diff --git a/.devcontainer/ci-env/devcontainer.json b/.devcontainer/ci-env/devcontainer.json new file mode 100644 index 00000000000000..23b0555e66a43e --- /dev/null +++ b/.devcontainer/ci-env/devcontainer.json @@ -0,0 +1,12 @@ +{ + "name": "CI build container", + "image": "ghcr.io/openwrt/buildbot/buildworker-v3.8.0:v9", + "features": { + }, + "remoteUser": "buildbot", + "customizations": { + "vscode": { + "extensions": ["ms-vscode.cpptools", "plorefice.devicetree"] + } + } +} diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index fed2b8de7c95a7..2ec7b7d7d8893a 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -19,6 +19,15 @@ body: ```. /etc/openwrt_release && echo $DISTRIB_REVISION``` validations: required: true + - type: input + id: release + attributes: + label: OpenWrt release + description: | + The OpenWrt release or commit hash where this bug occurs (use command below). + ```. /etc/openwrt_release && echo $DISTRIB_RELEASE``` + validations: + required: true - type: input id: target attributes: diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml new file mode 100644 index 00000000000000..55d01f85cbba2d --- /dev/null +++ b/.github/workflows/github-release.yml @@ -0,0 +1,24 @@ +name: Create GitHub release + +permissions: + contents: write + +on: + push: + tags: + - "v*" + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Release + uses: softprops/action-gh-release@v1 + with: + draft: true + prerelease: true diff --git a/.github/workflows/issue-labeller.yml b/.github/workflows/issue-labeller.yml new file mode 100644 index 00000000000000..c94b99b5ecb45b --- /dev/null +++ b/.github/workflows/issue-labeller.yml @@ -0,0 +1,11 @@ +name: Issue Labeller +on: + issues: + types: [ opened ] + +jobs: + label-component: + name: Validate and Tag Bug Report + permissions: + issues: write + uses: openwrt/actions-shared-workflows/.github/workflows/issue-labeller.yml@main diff --git a/.github/workflows/push-containers.yml b/.github/workflows/push-containers.yml index 5b5140961cd047..74f534d57a4a40 100644 --- a/.github/workflows/push-containers.yml +++ b/.github/workflows/push-containers.yml @@ -4,6 +4,7 @@ on: push: paths: - 'include/version.mk' + - 'include/cmake.mk' - 'tools/**' - '.github/workflows/push-containers.yml' - 'toolchain/**' @@ -14,7 +15,7 @@ permissions: contents: read concurrency: - group: ${{ github.workflow }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: diff --git a/Makefile b/Makefile index c325034bb9da4f..9bdb03a443ff85 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt dir world: -DISTRO_PKG_CONFIG:=$(shell $(TOPDIR)/scripts/command_all.sh pkg-config | grep '/usr' -m 1) +DISTRO_PKG_CONFIG:=$(shell $(TOPDIR)/scripts/command_all.sh pkg-config | grep -e '/usr' -e '/nix/store' -m 1) export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH)) export PATH:=$(if $(STAGING_DIR),$(abspath $(STAGING_DIR)/../host/bin),$(TOPDIR)/staging_dir/host/bin):$(PATH) diff --git a/config/Config-build.in b/config/Config-build.in index 5f9a1be8586267..ebfce8add448c8 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -26,6 +26,14 @@ menu "Global build settings" directory containing machine readable list of built profiles and resulting images. + config JSON_CYCLONEDX_SBOM + bool "Create CycloneDX SBOM JSON" + default BUILDBOT + help + Create a JSON files *.bom.cdx.json in the build + directory containing Software Bill Of Materials in CycloneDX + format. + config ALL_NONSHARED bool "Select all target specific packages by default" select ALL_KMODS diff --git a/config/Config-images.in b/config/Config-images.in index c37537b1a71cda..c2d7af7a80b105 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -218,11 +218,6 @@ menu "Target Images" depends on GRUB_IMAGES || GRUB_EFI_IMAGES default y - config GRUB_SERIAL - string "Serial port device" - depends on GRUB_IMAGES || GRUB_EFI_IMAGES - default "ttyS0" - config GRUB_BAUDRATE int "Serial port baud rate" depends on GRUB_IMAGES || GRUB_EFI_IMAGES @@ -231,7 +226,8 @@ menu "Target Images" config GRUB_FLOWCONTROL bool "Use RTE/CTS on serial console" - depends on GRUB_SERIAL != "" + depends on GRUB_IMAGES || GRUB_EFI_IMAGES + depends on TARGET_SERIAL != "" config GRUB_BOOTOPTS string "Extra kernel boot options" @@ -277,6 +273,11 @@ menu "Target Images" depends on GRUB_IMAGES || GRUB_EFI_IMAGES select PACKAGE_kmod-e1000 + config TARGET_SERIAL + string "Serial port device" + depends on TARGET_x86 || TARGET_armsr + default "ttyS0" + config TARGET_IMAGES_GZIP bool "GZip images" depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armsr || TARGET_malta diff --git a/config/Config-kernel.in b/config/Config-kernel.in index a1209d82f3a8d1..4c43190e40df5e 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -682,10 +682,23 @@ config KERNEL_PRINTK_TIME default y config KERNEL_SLUB_DEBUG - bool + bool "Enable SLUB debugging support" + help + This enables various debugging features: + - Accepts "slub_debug" kernel parameter + - Provides caches debugging options (e.g. tracing, validating) + - Adds /sys/kernel/slab/ attrs for reading amounts of *objects* + - Enables /proc/slabinfo support + - Prints info when running out of memory + + Enabling this can result in a significant increase of code size. config KERNEL_SLUB_DEBUG_ON - bool + depends on KERNEL_SLUB_DEBUG + bool "Boot kernel with basic caches debugging enabled" + help + This enables by default sanity_checks, red_zone, poison and store_user + debugging options for all caches. config KERNEL_SLABINFO select KERNEL_SLUB_DEBUG diff --git a/include/bpf.mk b/include/bpf.mk index ec3f04e1e9e169..a3357f0e297f08 100644 --- a/include/bpf.mk +++ b/include/bpf.mk @@ -33,7 +33,7 @@ BPF_TARGET:=bpf$(if $(CONFIG_BIG_ENDIAN),eb,el) BPF_HEADERS_DIR:=$(STAGING_DIR)/bpf-headers BPF_KERNEL_INCLUDE := \ - -nostdinc -isystem $(TOOLCHAIN_DIR)/include \ + -nostdinc -isystem $(TOOLCHAIN_INC_DIRS) \ -I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include \ -I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/asm/mach-generic \ -I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/generated \ diff --git a/include/cmake.mk b/include/cmake.mk index 9b169b069346f2..c82ba5f8099c29 100644 --- a/include/cmake.mk +++ b/include/cmake.mk @@ -22,7 +22,7 @@ HOST_CMAKE_BINARY_DIR = $(HOST_BUILD_DIR)$(if $(CMAKE_BINARY_SUBDIR),/$(CMAKE_BI MAKE_PATH = $(firstword $(CMAKE_BINARY_SUBDIR) .) ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) - cmake_tool=$(TOOLCHAIN_DIR)/bin/$(1) + cmake_tool=$(firstword $(TOOLCHAIN_BIN_DIRS))/$(1) else cmake_tool=$(shell command -v $(1)) endif @@ -49,7 +49,7 @@ CMAKE_AR:=$(call cmake_tool,$(TARGET_AR)) CMAKE_NM:=$(call cmake_tool,$(TARGET_NM)) CMAKE_RANLIB:=$(call cmake_tool,$(TARGET_RANLIB)) -CMAKE_FIND_ROOT_PATH:=$(STAGING_DIR)/usr;$(TOOLCHAIN_DIR)$(if $(CONFIG_EXTERNAL_TOOLCHAIN),;$(CONFIG_TOOLCHAIN_ROOT)) +CMAKE_FIND_ROOT_PATH:=$(STAGING_DIR)/usr;$(TOOLCHAIN_ROOT_DIR) CMAKE_HOST_FIND_ROOT_PATH:=$(STAGING_DIR)/host;$(STAGING_DIR_HOSTPKG);$(STAGING_DIR_HOST) CMAKE_SHARED_LDFLAGS:=-Wl,-Bsymbolic-functions CMAKE_HOST_INSTALL_PREFIX = $(HOST_BUILD_PREFIX) @@ -89,6 +89,7 @@ define Build/Configure/Default CXXFLAGS="$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \ cmake \ + --no-warn-unused-cli \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_VERSION=1 \ -DCMAKE_SYSTEM_PROCESSOR=$(ARCH) \ @@ -141,6 +142,7 @@ define Host/Configure/Default CXXFLAGS="$(HOST_CFLAGS)" \ LDFLAGS="$(HOST_LDFLAGS)" \ cmake \ + --no-warn-unused-cli \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_COMPILER_LAUNCHER="$(CMAKE_C_COMPILER_LAUNCHER)" \ -DCMAKE_C_COMPILER="$(CMAKE_HOST_C_COMPILER)" \ diff --git a/include/image-commands.mk b/include/image-commands.mk index 77a35f3eec0070..41a5e1198a95a0 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -133,6 +133,8 @@ define Build/append-md5sum-ascii-salted rm $@.salted endef +UBI_NAND_SIZE_LIMIT = $(IMAGE_SIZE) - ($(NAND_SIZE)*20/1024 + 4*$(BLOCKSIZE)) + define Build/append-ubi sh $(TOPDIR)/scripts/ubinize-image.sh \ $(if $(UBOOTENV_IN_UBI),--uboot-env) \ @@ -146,6 +148,8 @@ define Build/append-ubi $(UBINIZE_OPTS) cat $@.tmp >> $@ rm $@.tmp + $(if $(and $(IMAGE_SIZE),$(NAND_SIZE)),\ + $(call Build/check-size,$(UBI_NAND_SIZE_LIMIT))) endef define Build/ubinize-kernel @@ -215,7 +219,7 @@ endef define Build/check-size @imagesize="$$(stat -c%s $@)"; \ - limitsize="$$(($(subst k,* 1024,$(subst m, * 1024k,$(if $(1),$(1),$(IMAGE_SIZE))))))"; \ + limitsize="$$(($(call exp_units,$(if $(1),$(1),$(IMAGE_SIZE)))))"; \ [ $$limitsize -ge $$imagesize ] || { \ $(call ERROR_MESSAGE, WARNING: Image file $@ is too big: $$imagesize > $$limitsize); \ rm -f $@; \ @@ -226,6 +230,11 @@ define Build/copy-file cat "$(1)" > "$@" endef +define Build/dlink-sge-image + $(STAGING_DIR_HOST)/bin/dlink-sge-image $(1) $@ $@.enc + mv $@.enc $@ +endef + define Build/edimax-header $(STAGING_DIR_HOST)/bin/mkedimaximg -i $@ -o $@.new $(1) @mv $@.new $@ @@ -384,10 +393,17 @@ define Build/kernel-bin endef define Build/linksys-image - $(TOPDIR)/scripts/linksys-image.sh \ + let \ + size="$$(stat -c%s $@)" \ + pad="$(call exp_units,$(PAGESIZE))" \ + offset="256" \ + pad="(pad - ((size + offset) % pad)) % pad"; \ + dd if=/dev/zero bs=$$pad count=1 | tr '\000' '\377' >> $@ + printf ".LINKSYS.01000409%-15s%08X%-8s%-16s" \ "$(call param_get_default,type,$(1),$(DEVICE_NAME))" \ - $@ $@.new - mv $@.new $@ + "$$(cksum $@ | cut -d ' ' -f1)" \ + "0" "K0000000F0246434" >> $@ + dd if=/dev/zero bs=192 count=1 >> $@ endef define Build/lzma @@ -461,8 +477,8 @@ endef define Build/pad-offset let \ size="$$(stat -c%s $@)" \ - pad="$(subst k,* 1024,$(word 1, $(1)))" \ - offset="$(subst k,* 1024,$(word 2, $(1)))" \ + pad="$(call exp_units,$(word 1, $(1)))" \ + offset="$(call exp_units,$(word 2, $(1)))" \ pad="(pad - ((size + offset) % pad)) % pad" \ newsize='size + pad'; \ dd if=$@ of=$@.new bs=$$newsize count=1 conv=sync @@ -624,7 +640,7 @@ endef define Build/zyxel-ras-image let \ - newsize="$(subst k,* 1024,$(RAS_ROOTFS_SIZE))"; \ + newsize="$(call exp_units,$(RAS_ROOTFS_SIZE))"; \ $(STAGING_DIR_HOST)/bin/mkrasimage \ -b $(RAS_BOARD) \ -v $(RAS_VERSION) \ diff --git a/include/image.mk b/include/image.mk index 8f0cbead108091..096ccb5f1858c2 100644 --- a/include/image.mk +++ b/include/image.mk @@ -20,6 +20,8 @@ include $(INCLUDE_DIR)/rootfs.mk override MAKE:=$(_SINGLE)$(SUBMAKE) override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE) +exp_units = $(subst k, * 1024,$(subst m, * 1024k,$(subst g, * 1024m,$(1)))) + target_params = $(subst +,$(space),$*) param_get = $(patsubst $(1)=%,%,$(filter $(1)=%,$(2))) param_get_default = $(firstword $(call param_get,$(1),$(2)) $(3)) @@ -40,8 +42,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 +171,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))) @@ -277,6 +283,13 @@ endef define Image/Manifest $(call opkg,$(TARGET_DIR_ORIG)) list-installed > \ $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest +ifndef IB + $(if $(CONFIG_JSON_CYCLONEDX_SBOM), \ + $(SCRIPT_DIR)/package-metadata.pl imgcyclonedxsbom \ + $(TMP_DIR)/.packageinfo \ + $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest > \ + $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).bom.cdx.json) +endif endef define Image/gzip-ext4-padded-squashfs @@ -384,6 +397,7 @@ define Device/Init DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1)-$$(2) FACTORY_IMG_NAME := IMAGE_SIZE := + NAND_SIZE := KERNEL_PREFIX = $$(DEVICE_IMG_PREFIX) KERNEL_SUFFIX := -kernel.bin KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX) @@ -444,7 +458,7 @@ DEFAULT_DEVICE_VARS := \ DEVICE_DTS_DIR DEVICE_DTS_OVERLAY DEVICE_DTS_LOADADDR \ DEVICE_FDT_NUM DEVICE_IMG_PREFIX SOC BOARD_NAME UIMAGE_MAGIC UIMAGE_NAME \ UIMAGE_TIME SUPPORTED_DEVICES IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR \ - UBOOT_PATH IMAGE_SIZE \ + UBOOT_PATH IMAGE_SIZE NAND_SIZE \ FACTORY_IMG_NAME FACTORY_SIZE \ DEVICE_PACKAGES DEVICE_COMPAT_VERSION DEVICE_COMPAT_MESSAGE \ DEVICE_VENDOR DEVICE_MODEL DEVICE_VARIANT \ diff --git a/include/kernel-5.15 b/include/kernel-5.15 index 96feed23e078d4..809cec30657aac 100644 --- a/include/kernel-5.15 +++ b/include/kernel-5.15 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.15 = .132 -LINUX_KERNEL_HASH-5.15.132 = 4177b5c4d6e749bb8339ac4aa68eb0932ead9490b956a80d9a597089959618ac +LINUX_VERSION-5.15 = .141 +LINUX_KERNEL_HASH-5.15.141 = 936d6ac65c692a986b4bde34b7f3d7ad90f7f86f19e4ef320e008d40f07e2cfa diff --git a/include/kernel-6.1 b/include/kernel-6.1 index c916b86dcc3108..6038c652a9f948 100644 --- a/include/kernel-6.1 +++ b/include/kernel-6.1 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.1 = .55 -LINUX_KERNEL_HASH-6.1.55 = a87e241ec15d53452c4efe219713a3769d88cc436b5b98cf6efb262c4aff15c0 +LINUX_VERSION-6.1 = .65 +LINUX_KERNEL_HASH-6.1.65 = 407229936802a44b1e484c2e9ac3bbe53a65d825cc468ccdbd76281b491ab20a diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index 6a0251a9e2c966..d9842fd82aebaa 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -9,10 +9,6 @@ endif INITRAMFS_EXTRA_FILES ?= $(GENERIC_PLATFORM_DIR)/image/initramfs-base-files.txt -ifneq (,$(KERNEL_CC)) - KERNEL_MAKEOPTS += CC="$(KERNEL_CC)" -endif - export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include # defined in quilt.mk @@ -168,7 +164,7 @@ define Kernel/CompileImage/Initramfs $(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR) $(TARGET_DIR)/init) rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio* ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE),y) -ifneq ($(qstrip $(CONFIG_EXTERNAL_CPIO)),) +ifneq ($(call qstrip,$(CONFIG_EXTERNAL_CPIO)),) $(CP) $(CONFIG_EXTERNAL_CPIO) $(KERNEL_BUILD_DIR)/initrd.cpio else ( cd $(TARGET_DIR); find . | LC_ALL=C sort | $(STAGING_DIR_HOST)/bin/cpio --reproducible -o -H newc -R 0:0 > $(KERNEL_BUILD_DIR)/initrd.cpio ) diff --git a/include/kernel.mk b/include/kernel.mk index 3012eb899352e2..8236416132d63d 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -119,6 +119,10 @@ KERNEL_MAKE_FLAGS = \ cmd_syscalls= \ $(if $(__package_mk),KBUILD_EXTRA_SYMBOLS="$(wildcard $(PKG_SYMVERS_DIR)/*.symvers)") +ifneq (,$(KERNEL_CC)) + KERNEL_MAKE_FLAGS += CC="$(KERNEL_CC)" +endif + KERNEL_NOSTDINC_FLAGS = \ -nostdinc $(if $(DUMP),, -isystem $(shell $(TARGET_CC) -print-file-name=include)) diff --git a/include/package-dumpinfo.mk b/include/package-dumpinfo.mk index 597452e4b93074..6baf10225de888 100644 --- a/include/package-dumpinfo.mk +++ b/include/package-dumpinfo.mk @@ -36,6 +36,8 @@ $(if $(USERID),Require-User: $(USERID) )Source: $(PKG_SOURCE) $(if $(LICENSE),License: $(LICENSE) )$(if $(LICENSE_FILES),LicenseFiles: $(LICENSE_FILES) +)$(if $(PKG_CPE_ID),CPE-ID: $(PKG_CPE_ID) +)$(if $(ABI_VERSION),ABI-Version: $(ABI_VERSION) )Type: $(if $(Package/$(1)/targets),$(Package/$(1)/targets),$(if $(PKG_TARGETS),$(PKG_TARGETS),ipkg)) $(if $(KCONFIG),Kernel-Config: $(KCONFIG) )$(if $(BUILDONLY),Build-Only: $(BUILDONLY) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index e5f20fff22e282..49340ce3e441cc 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -238,4 +238,4 @@ prereq: $(STAGING_DIR_HOST)/bin/mkhash $(STAGING_DIR_HOST)/bin/xxd # Install ldconfig stub $(eval $(call TestHostCommand,ldconfig-stub,Failed to install stub, \ - $(LN) $(firstword $(wildcard /bin/true /usr/bin/true)) $(STAGING_DIR_HOST)/bin/ldconfig)) + $(LN) $(SCRIPT_DIR)/noop.sh $(STAGING_DIR_HOST)/bin/ldconfig)) diff --git a/include/quilt.mk b/include/quilt.mk index 18cafe60a280bb..a58390f6c5471d 100644 --- a/include/quilt.mk +++ b/include/quilt.mk @@ -34,8 +34,8 @@ endif ifneq ($(if $(DUMP),1,$(__quilt_inc)),1) __quilt_inc:=1 -PATCH_DIR?=./patches -FILES_DIR?=./files +PATCH_DIR?=$(CURDIR)/patches +FILES_DIR?=$(CURDIR)/files HOST_PATCH_DIR?=$(PATCH_DIR) HOST_FILES_DIR?=$(FILES_DIR) @@ -106,13 +106,14 @@ define Kernel/Patch/Default endef define Quilt/RefreshDir - mkdir -p $(2) - -rm -f $(2)/* 2>/dev/null >/dev/null - @( \ + -rm -rf $(2) 2>/dev/null >/dev/null + [ -f $(1)/.quilt_no_patch ] || mkdir -p $(2) + @[ -f $(1)/.quilt_no_patch ] || { \ for patch in $$$$($(if $(3),grep "^$(3)",cat) $(1)/patches/series | awk '{print $$$$1}'); do \ $(CP) -v "$(1)/patches/$$$$patch" $(2); \ done; \ - ) + } + @-rm -f $(1)/.quilt_no_patch 2>/dev/null >/dev/null; endef define Quilt/Refresh/Host @@ -156,7 +157,7 @@ define Quilt/Template } @[ -f "$(1)/patches/series" ] || { \ echo "The source directory contains no quilt patches."; \ - false; \ + touch $(1)/patches/series $(1)/.quilt_no_patch; \ } @[ -n "$$$$(ls $(1)/patches/series)" -o \ "$$$$(cat $(1)/patches/series | $(MKHASH) md5)" = "$$(sort $(1)/patches/series | $(MKHASH) md5)" ] || { \ @@ -165,10 +166,12 @@ define Quilt/Template } $(3)refresh: $(3)quilt-check - @cd "$(1)"; $(QUILT_CMD) pop -a -f >/dev/null 2>/dev/null - @cd "$(1)"; while $(QUILT_CMD) next 2>/dev/null >/dev/null && $(QUILT_CMD) push; do \ - QUILT_DIFF_OPTS="-p" $(QUILT_CMD) refresh -p ab --no-index --no-timestamps; \ - done; ! $(QUILT_CMD) next 2>/dev/null >/dev/null + @[ -f $(1)/.quilt_no_patch ] || { \ + cd "$(1)"; $(QUILT_CMD) pop -a -f >/dev/null 2>/dev/null; \ + while $(QUILT_CMD) next 2>/dev/null >/dev/null && $(QUILT_CMD) push; do \ + QUILT_DIFF_OPTS="-p" $(QUILT_CMD) refresh -p ab --no-index --no-timestamps; \ + done; ! $(QUILT_CMD) next 2>/dev/null >/dev/null; \ + } $(Quilt/Refresh/$(4)) $(3)update: $(3)quilt-check diff --git a/include/scan.mk b/include/scan.mk index 33a5832ff5f237..2e0ee0c9609935 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 2b8106410f5921..06867a70e426b6 100644 --- a/include/u-boot.mk +++ b/include/u-boot.mk @@ -1,3 +1,5 @@ +include $(INCLUDE_DIR)/prereq.mk + PKG_NAME ?= u-boot ifndef PKG_SOURCE_PROTO @@ -16,7 +18,32 @@ 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, \ + Please install the Python3 elftools module, \ + $(STAGING_DIR_HOST)/bin/python3 -c 'import elftools')) +endif + +ifdef UBOOT_USE_INTREE_DTC + $(eval $(call TestHostCommand,python3-dev, \ + Please install the python3-dev package, \ + python3.11-config --includes 2>&1 | grep 'python3', \ + python3.10-config --includes 2>&1 | grep 'python3', \ + python3.9-config --includes 2>&1 | grep 'python3', \ + python3.8-config --includes 2>&1 | grep 'python3', \ + python3.7-config --includes 2>&1 | grep 'python3', \ + python3-config --includes 2>&1 | grep -E 'python3\.([7-9]|[0-9][0-9])\.?')) + + $(eval $(call TestHostCommand,python3-setuptools, \ + Please install the Python3 setuptools module, \ + $(STAGING_DIR_HOST)/bin/python3 -c 'import setuptools')) + + $(eval $(call TestHostCommand,swig, \ + Please install the swig package, \ + swig -version)) +endif export GCC_HONOUR_COPTS=s @@ -88,7 +115,9 @@ define Build/Configure/U-Boot +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(UBOOT_CONFIGURE_VARS) oldconfig) endef -DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc) +ifndef UBOOT_USE_INTREE_DTC + DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc) +endif define Build/Compile/U-Boot +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ diff --git a/package/Makefile b/package/Makefile index 4b8df7f484de6e..8e72d4ec726dbc 100644 --- a/package/Makefile +++ b/package/Makefile @@ -106,6 +106,14 @@ ifdef CONFIG_SIGNED_PACKAGES $(STAGING_DIR_HOST)/bin/usign -S -m Packages -s $(BUILD_KEY); \ ); done endif +ifdef CONFIG_JSON_CYCLONEDX_SBOM + @echo Creating CycloneDX package SBOMs... + @for d in $(PACKAGE_SUBDIRS); do ( \ + [ -d $$d ] && \ + cd $$d || continue; \ + $(SCRIPT_DIR)/package-metadata.pl pkgcyclonedxsbom Packages.manifest > Packages.bom.cdx.json || true; \ + ); done +endif $(curdir)/flags-install:= -j1 diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 8732f82fb9815e..67fc5d29c1d764 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -108,6 +108,9 @@ define Build/Prepare mkdir -p $(PKG_BUILD_DIR) endef +define Build/Quilt +endef + define Build/Compile/Default endef @@ -196,7 +199,8 @@ define Package/base-files/install $(1)/usr/lib \ $(1)/usr/bin \ $(1)/sys \ - $(1)/www \ + $(1)/www + mkdir -p -m 750 \ $(1)/root $(LN) /proc/mounts $(1)/etc/mtab diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh index 827cb5dc2ead71..9b5e5accdca8ca 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/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index bbdecbbc47586d..d9628dbb7ad2b8 100644 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -40,6 +40,14 @@ append() { eval "export ${NO_EXPORT:+-n} -- \"$var=\${$var:+\${$var}\${value:+\$sep}}\$value\"" } +prepend() { + local var="$1" + local value="$2" + local sep="${3:- }" + + eval "export ${NO_EXPORT:+-n} -- \"$var=\${$value:+\${$value}\$sep}\$var\"" +} + list_contains() { local var="$1" local str="$2" diff --git a/package/base-files/files/lib/functions/leds.sh b/package/base-files/files/lib/functions/leds.sh index a7532faa2fd553..333d900df0cab2 100644 --- a/package/base-files/files/lib/functions/leds.sh +++ b/package/base-files/files/lib/functions/leds.sh @@ -11,6 +11,36 @@ get_dt_led_path() { echo "$ledpath" } +get_dt_led_color_func() { + local enum + local func + local idx + local label + + [ -e "$1/function" ] && func=$(cat "$1/function") + [ -e "$1/color" ] && idx=$((0x$(hexdump -n 4 -e '4/1 "%02x"' "$1/color"))) + [ -e "$1/function-enumerator" ] && \ + enum=$((0x$(hexdump -n 4 -e '4/1 "%02x"' "$1/function-enumerator"))) + + [ -z "$idx" ] && [ -z "$func" ] && return 2 + + if [ -n "$idx" ]; then + for color in "white" "red" "green" "blue" "amber" \ + "violet" "yellow" "ir" "multicolor" "rgb" \ + "purple" "orange" "pink" "cyan" "lime" + do + [ $idx -eq 0 ] && label="$color" && break + idx=$((idx-1)) + done + fi + + label="$label:$func" + [ -n "$enum" ] && label="$label-$enum" + echo "$label" + + return 0 +} + get_dt_led() { local label local ledpath=$(get_dt_led_path $1) @@ -18,6 +48,7 @@ get_dt_led() { [ -n "$ledpath" ] && \ label=$(cat "$ledpath/label" 2>/dev/null) || \ label=$(cat "$ledpath/chan-name" 2>/dev/null) || \ + label=$(get_dt_led_color_func "$ledpath") || \ label=$(basename "$ledpath") echo "$label" diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index a37e8cf82416d3..a75bd116525b7e 100644 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -106,20 +106,28 @@ ucidef_set_bridge_mac() { json_select .. } -ucidef_set_network_device_mac() { - json_select_object "network-device" +_ucidef_set_network_device_common() { + json_select_object "network_device" json_select_object "${1}" - json_add_string macaddr "${2}" + json_add_string "${2}" "${3}" json_select .. json_select .. } +ucidef_set_network_device_mac() { + _ucidef_set_network_device_common $1 macaddr $2 +} + ucidef_set_network_device_path() { - json_select_object "network_device" - json_select_object "$1" - json_add_string path "$2" - json_select .. - json_select .. + _ucidef_set_network_device_common $1 path $2 +} + +ucidef_set_network_device_gro() { + _ucidef_set_network_device_common $1 gro $2 +} + +ucidef_set_network_device_conduit() { + _ucidef_set_network_device_common $1 conduit $2 } _ucidef_add_switch_port() { diff --git a/package/boot/apex/Makefile b/package/boot/apex/Makefile new file mode 100644 index 00000000000000..66a1b7667eb055 --- /dev/null +++ b/package/boot/apex/Makefile @@ -0,0 +1,61 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2006-2023 OpenWrt.org + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=apex +# This version was created from the stalled and unreleased v1.6.10 +# with some patches on top. +PKG_VERSION:=1.6.10-openwrt +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/linusw/apex.git +PKG_SOURCE_VERSION:=483e18aa133d5e25866570c29b124530b2d1e0d3 +PKG_MIRROR_HASH:=42230bb436f5590447ca55e8befb8927e6ea74c1e6953c043bbbef986c411704 + +PKG_TARGETS:=bin +PKG_FLAGS:=nonshared +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/package.mk + +export GCC_HONOUR_COPTS=s + +define Package/apex + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_ixp4xx @!IN_SDK + DEFAULT:=y + TITLE:=Boot loader for NSLU2, FSG3, NAS100D and others +endef + +define build_apex + $(MAKE) -C $(PKG_BUILD_DIR) \ + ARCH=arm \ + $(1)_config + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + KBUILD_HAVE_NLS=no \ + ARCH=arm \ + clean all + $(INSTALL_BIN) $(PKG_BUILD_DIR)/apex.bin $(PKG_BUILD_DIR)/out/apex-$(2).bin +endef + +define Build/Compile + $(INSTALL_DIR) $(PKG_BUILD_DIR)/out + $(call build_apex,openwrt-nslu2-armeb,nslu2-armeb) + $(call build_apex,openwrt-nslu2-16mb-armeb,nslu2-16mb-armeb) + $(call build_apex,openwrt-fsg3-armeb,fsg3-armeb) + $(call build_apex,openwrt-nas100d-armeb,nas100d-armeb) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE)/apex + $(CP) $(PKG_BUILD_DIR)/out/*.bin $(STAGING_DIR_IMAGE)/apex +endef + +$(eval $(call BuildPackage,apex)) diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile index f77f3059112f2e..259a987e6bf94f 100644 --- a/package/boot/arm-trusted-firmware-mediatek/Makefile +++ b/package/boot/arm-trusted-firmware-mediatek/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=arm-trusted-firmware-mediatek -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=https://github.com/mtk-openwrt/arm-trusted-firmware.git -PKG_SOURCE_DATE:=2023-07-24 -PKG_SOURCE_VERSION:=00ac6db375b76e57e1f5e9e9bffa033e907c3581 -PKG_MIRROR_HASH:=74fc18395532c4292f530da8d00fa1873ada4e05e600c0077a7b7f85ace0d913 +PKG_SOURCE_DATE:=2023-10-13 +PKG_SOURCE_VERSION:=0ea67d76ae8be127c91caa3fcdf449b1fe533175 +PKG_MIRROR_HASH:=b102f6ffaa7cd2202161c44cab4d27f426d9d74c311ea9eb4d2f371ea2af4a2e PKG_MAINTAINER:=Daniel Golle @@ -94,6 +94,22 @@ define Trusted-Firmware-A/mt7622-sdmmc-2ddr DDR3_FLYBY:=1 endef +define Trusted-Firmware-A/mt7981-emmc-ddr4 + NAME:=MediaTek MT7981 (eMMC, DDR4) + BOOT_DEVICE:=emmc + BUILD_SUBTARGET:=filogic + PLAT:=mt7981 + DDR_TYPE:=ddr4 +endef + +define Trusted-Firmware-A/mt7981-spim-nand-ddr4 + NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR4) + BOOT_DEVICE:=spim-nand + BUILD_SUBTARGET:=filogic + PLAT:=mt7981 + DDR_TYPE:=ddr4 +endef + define Trusted-Firmware-A/mt7981-nor-ddr3 NAME:=MediaTek MT7981 (SPI-NOR, DDR3) BOOT_DEVICE:=nor @@ -175,6 +191,15 @@ define Trusted-Firmware-A/mt7986-spim-nand-ddr4 NAND_TYPE:=spim:2k+64 endef +define Trusted-Firmware-A/mt7986-spim-nand-4k-ddr4 + NAME:=MediaTek MT7986 (SPI-NAND via SPIM, DDR4) + BOOT_DEVICE:=spim-nand + BUILD_SUBTARGET:=filogic + PLAT:=mt7986 + DDR_TYPE:=ddr4 + NAND_TYPE:=spim:4k+256 +endef + define Trusted-Firmware-A/mt7986-nor-ddr3 NAME:=MediaTek MT7986 (SPI-NOR, DDR3) BOOT_DEVICE:=nor @@ -349,6 +374,8 @@ TFA_TARGETS:= \ mt7981-sdmmc-ddr3 \ mt7981-snand-ddr3 \ mt7981-spim-nand-ddr3 \ + mt7981-emmc-ddr4 \ + mt7981-spim-nand-ddr4 \ mt7986-emmc-ddr3 \ mt7986-nor-ddr3 \ mt7986-sdmmc-ddr3 \ @@ -359,6 +386,7 @@ TFA_TARGETS:= \ mt7986-sdmmc-ddr4 \ mt7986-snand-ddr4 \ mt7986-spim-nand-ddr4 \ + mt7986-spim-nand-4k-ddr4 \ mt7988-emmc-ddr3 \ mt7988-nor-ddr3 \ mt7988-sdmmc-ddr3 \ diff --git a/package/boot/arm-trusted-firmware-mediatek/patches/001-mt7988-enable-2p5g-phy.patch b/package/boot/arm-trusted-firmware-mediatek/patches/001-mt7988-enable-2p5g-phy.patch deleted file mode 100644 index d377bd8433c27c..00000000000000 --- a/package/boot/arm-trusted-firmware-mediatek/patches/001-mt7988-enable-2p5g-phy.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/plat/mediatek/mt7988/bl2/bl2_plat_init.c -+++ b/plat/mediatek/mt7988/bl2/bl2_plat_init.c -@@ -90,6 +90,8 @@ static void mtk_i2p5g_phy_init(void) - * clear bit 22 to use external MDIO. - */ - mmio_setbits_32(GBE_TOP_REG, I2P5G_MDIO); -+ /* Internal 2.5Gphy power on sequence */ -+ eth_2p5g_phy_mtcmos_ctrl(true); - } - - static void mt7988_i2c_init(void) diff --git a/package/boot/arm-trusted-firmware-mediatek/patches/002-mt7622-move-wdt-init-after-dram-init.patch b/package/boot/arm-trusted-firmware-mediatek/patches/002-mt7622-move-wdt-init-after-dram-init.patch deleted file mode 100644 index 4a4d252bebecb4..00000000000000 --- a/package/boot/arm-trusted-firmware-mediatek/patches/002-mt7622-move-wdt-init-after-dram-init.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 9e8cb08bc64530e7511b86a131cfad1ae0199586 Mon Sep 17 00:00:00 2001 -From: Daniel Golle -Date: Sun, 10 Sep 2023 23:35:47 +0100 -Subject: [PATCH] mt7622: move wdt init after dram init - -resolves hang on reboot ---- - plat/mediatek/mt7622/bl2/bl2_plat_init.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/plat/mediatek/mt7622/bl2/bl2_plat_init.c -+++ b/plat/mediatek/mt7622/bl2/bl2_plat_init.c -@@ -40,7 +40,6 @@ bool plat_is_my_cpu_primary(void) - const struct initcall bl2_initcalls[] = { - INITCALL(plat_mt_cpuxgpt_init), - INITCALL(generic_delay_timer_init), -- INITCALL(mtk_wdt_init), - INITCALL(mtk_print_cpu), - INITCALL(mtk_pin_init), - #ifndef IMAGE_BL2PL -@@ -49,6 +48,7 @@ const struct initcall bl2_initcalls[] = - INITCALL(mtk_pwrap_init), - INITCALL(mtk_pmic_init), - INITCALL(mtk_mem_init), -+ INITCALL(mtk_wdt_init), - - INITCALL(NULL) - }; diff --git a/package/boot/rkbin/Makefile b/package/boot/rkbin/Makefile new file mode 100644 index 00000000000000..affdd7b4e19206 --- /dev/null +++ b/package/boot/rkbin/Makefile @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2021-2023 ImmortalWrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=rkbin +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL=https://github.com/rockchip-linux/rkbin.git +PKG_SOURCE_DATE:=2023-07-26 +PKG_SOURCE_VERSION:=b4558da0860ca48bf1a571dd33ccba580b9abe23 +PKG_MIRROR_HASH:=5842fbcb7e217c336235573e431e427f2f745390d989f6765a6c258a5bdf1b6e + +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Tianling Shen + +include $(INCLUDE_DIR)/kernel.mk +include $(INCLUDE_DIR)/trusted-firmware-a.mk +include $(INCLUDE_DIR)/package.mk + +define Trusted-Firmware-A/Default + NAME:=Rockchip $(1) SoCs + BUILD_TARGET:=rockchip +endef + +define Trusted-Firmware-A/rk3568 + BUILD_SUBTARGET:=armv8 + ATF:=rk35/rk3568_bl31_v1.43.elf + TPL:=rk35/rk3568_ddr_1560MHz_v1.18.bin +endef + +TFA_TARGETS:= \ + rk3568 + +define Build/Compile +endef + +define Package/trusted-firmware-a/install + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + + $(CP) $(PKG_BUILD_DIR)/bin/$(ATF) $(STAGING_DIR_IMAGE)/ + $(CP) $(PKG_BUILD_DIR)/bin/$(TPL) $(STAGING_DIR_IMAGE)/ +endef + +$(eval $(call BuildPackage/Trusted-Firmware-A)) diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index aeeb9385d34165..7c0cdf9013f903 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -31,6 +31,7 @@ asus,zenwifi-cd6n|\ asus,zenwifi-cd6r|\ buffalo,bhr-4grv2|\ devolo,magic-2-wifi|\ +dlink,dap-1720-a1|\ dlink,dir-859-a1|\ dlink,dir-859-a3|\ dlink,dir-869-a1|\ @@ -105,7 +106,9 @@ dongwon,dw02-412h-128m|\ glinet,gl-ar300m-lite|\ glinet,gl-ar300m-nand|\ glinet,gl-ar300m-nor|\ -glinet,gl-ar300m16) +glinet,gl-ar300m16|\ +glinet,gl-s200-nor|\ +glinet,gl-s200-nor-nand) idx="$(find_mtd_index u-boot-env)" [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" diff --git a/package/boot/uboot-envtools/files/ipq806x b/package/boot/uboot-envtools/files/ipq806x index 01a86c7b19fcae..443a0e13d40deb 100644 --- a/package/boot/uboot-envtools/files/ipq806x +++ b/package/boot/uboot-envtools/files/ipq806x @@ -38,6 +38,10 @@ askey,rt4230w-rev6) edgecore,ecw5410) ubootenv_add_uci_config "/dev/mtd11" "0x0" "0x10000" "0x10000" ;; +extreme,ap3935) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" + ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000" + ;; linksys,ea7500-v1|\ linksys,ea8500) ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x20000" "0x20000" diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index 4b8fe6b80126e1..050e1173c33393 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -37,31 +37,30 @@ bananapi,bpi-r3) ;; esac ;; -glinet,gl-mt3000) - ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000" - ;; -glinet,gl-mt6000) - local envdev=$(find_mmc_part "u-boot-env") - ubootenv_add_uci_config "$envdev" "0x0" "0x80000" - ;; -mercusys,mr90x-v1) - local envdev=/dev/mtd$(find_mtd_index "u-boot-env") - ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1" +cmcc,rax3000m) + case "$(cmdline_get_var root)" in + /dev/mmc*) + local envdev=$(find_mmc_part "ubootenv" "mmcblk0") + ubootenv_add_uci_config "$envdev" "0x0" "0x40000" "0x40000" "1" + ubootenv_add_uci_config "$envdev" "0x40000" "0x40000" "0x40000" "1" + ;; + *) + . /lib/upgrade/nand.sh + local envubi=$(nand_find_ubi ubi) + local envdev=/dev/$(nand_find_volume $envubi ubootenv) + local envdev2=/dev/$(nand_find_volume $envubi ubootenv2) + ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x1f000" "1" + ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x1f000" "1" + ;; + esac ;; cetron,ct3003|\ -netgear,wax220) +netgear,wax220|\ +zbtlink,zbt-z8102ax) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" ;; -ubnt,unifi-6-plus) - ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x10000" - ;; -xiaomi,mi-router-wr30u-112m-nmbm|\ -xiaomi,mi-router-wr30u-stock|\ -xiaomi,redmi-router-ax6000-stock) - ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000" - ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000" - ;; h3c,magic-nx30-pro|\ +jcg,q30-pro|\ qihoo,360t7|\ tplink,tl-xdr4288|\ tplink,tl-xdr6086|\ @@ -75,10 +74,39 @@ xiaomi,redmi-router-ax6000-ubootmod) ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x20000" "1" ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x20000" "1" ;; +glinet,gl-mt2500|\ +glinet,gl-mt6000) + local envdev=$(find_mmc_part "u-boot-env") + ubootenv_add_uci_config "$envdev" "0x0" "0x80000" + ;; +glinet,gl-mt3000) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000" + ;; +mercusys,mr90x-v1) + local envdev=/dev/mtd$(find_mtd_index "u-boot-env") + ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1" + ;; +ubnt,unifi-6-plus) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x10000" + ;; +xiaomi,mi-router-wr30u-112m-nmbm|\ +xiaomi,mi-router-wr30u-stock|\ +xiaomi,redmi-router-ax6000-stock) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000" + ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000" + ;; zyxel,ex5601-t0) local envdev=/dev/mtd$(find_mtd_index "u-boot-env") ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x40000" "2" ;; +zyxel,ex5601-t0-ubootmod) + . /lib/upgrade/nand.sh + local envubi=$(nand_find_ubi ubi) + local envdev=/dev/$(nand_find_volume $envubi ubootenv) + local envdev2=/dev/$(nand_find_volume $envubi ubootenv2) + ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x20000" "1" + ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x20000" "1" + ;; zyxel,ex5700-telenor) ubootenv_add_uci_config "/dev/ubootenv" "0x0" "0x4000" "0x4000" "1" ;; diff --git a/package/boot/uboot-envtools/files/mvebu b/package/boot/uboot-envtools/files/mvebu index 63b5132608a694..c4ce76cf24087b 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-envtools/files/qualcommax_ipq807x b/package/boot/uboot-envtools/files/qualcommax_ipq807x index 106ba47c08e499..761d5dfcc9fe51 100644 --- a/package/boot/uboot-envtools/files/qualcommax_ipq807x +++ b/package/boot/uboot-envtools/files/qualcommax_ipq807x @@ -11,7 +11,8 @@ case "$board" in dynalink,dl-wrx36|\ netgear,rax120v2|\ netgear,wax218|\ -netgear,wax620) +netgear,wax620|\ +netgear,wax630) idx="$(find_mtd_index 0:appsblenv)" [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" "2" diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index a04c0616e57a85..60ac40ff3636da 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -20,6 +20,7 @@ alfa-network,tube-e4g|\ engenius,epg600|\ engenius,esr600h|\ linksys,re7000|\ +meig,slt866|\ sitecom,wlr-4100-v1-002|\ zyxel,keenetic-lite-iii-a) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000" @@ -127,6 +128,7 @@ xiaomi,redmi-router-ac2100) zyxel,lte3301-plus) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x80000" ;; +zyxel,lte5398-m904|\ zyxel,nr7101) idx="$(find_mtd_index Config)" [ -n "$idx" ] && \ diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index 1a97570031c431..a9e6d35f00f0d5 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -5,6 +5,8 @@ PKG_VERSION:=2023.07.02 PKG_HASH:=6b6a48581c14abb0f95bd87c1af4d740922406d7b801002a9f94727fdde021d5 PKG_BUILD_DEPENDS:=!(TARGET_ramips||TARGET_mediatek_mt7623):arm-trusted-firmware-tools/host +UBOOT_USE_INTREE_DTC:=1 + include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk @@ -200,6 +202,30 @@ define U-Boot/mt7629_rfb UBOOT_CONFIG:=mt7629_rfb endef +define U-Boot/mt7981_cmcc_rax3000m-emmc + NAME:=CMCC RAX3000M + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=cmcc_rax3000m + UBOOT_CONFIG:=mt7981_cmcc_rax3000m-emmc + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=emmc + BL2_SOC:=mt7981 + BL2_DDRTYPE:=ddr4 + DEPENDS:=+trusted-firmware-a-mt7981-emmc-ddr4 +endef + +define U-Boot/mt7981_cmcc_rax3000m-nand + NAME:=CMCC RAX3000M + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=cmcc_rax3000m + UBOOT_CONFIG:=mt7981_cmcc_rax3000m-nand + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=spim-nand + BL2_SOC:=mt7981 + BL2_DDRTYPE:=ddr4 + DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr4 +endef + define U-Boot/mt7981_h3c_magic-nx30-pro NAME:=H3C Magic NX30 Pro BUILD_SUBTARGET:=filogic @@ -212,6 +238,18 @@ define U-Boot/mt7981_h3c_magic-nx30-pro DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3 endef +define U-Boot/mt7981_jcg_q30-pro + NAME:=JCG Q30 PRO + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=jcg_q30-pro + UBOOT_CONFIG:=mt7981_jcg_q30-pro + 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 @@ -417,6 +455,18 @@ define U-Boot/mt7986_xiaomi_redmi-router-ax6000 DEPENDS:=+trusted-firmware-a-mt7986-spim-nand-ddr4 endef +define U-Boot/mt7986_zyxel_ex5601-t0 + NAME:=Zyxel EX5601-T0 + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=zyxel_ex5601-t0-ubootmod + UBOOT_CONFIG:=mt7986_zyxel_ex5601-t0 + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=spim-nand-4k + BL2_SOC:=mt7986 + BL2_DDRTYPE:=ddr4 + DEPENDS:=+trusted-firmware-a-mt7986-spim-nand-4k-ddr4 +endef + define U-Boot/mt7988_rfb-spim-nand NAME:=MT7988 Reference Board BUILD_SUBTARGET:=filogic @@ -496,7 +546,10 @@ UBOOT_TARGETS := \ mt7628_rfb \ ravpower_rp-wd009 \ mt7629_rfb \ + mt7981_cmcc_rax3000m-emmc \ + mt7981_cmcc_rax3000m-nand \ mt7981_h3c_magic-nx30-pro \ + mt7981_jcg_q30-pro \ mt7981_rfb-spim-nand \ mt7981_rfb-emmc \ mt7981_rfb-nor \ @@ -513,6 +566,7 @@ UBOOT_TARGETS := \ mt7986_tplink_tl-xdr6086 \ mt7986_tplink_tl-xdr6088 \ mt7986_xiaomi_redmi-router-ax6000 \ + mt7986_zyxel_ex5601-t0 \ mt7986_rfb \ mt7988_rfb-spim-nand \ mt7988_rfb-snand \ diff --git a/package/boot/uboot-mediatek/patches/131-spi-mtk_spim-prevent-global-pll-clock-override.patch b/package/boot/uboot-mediatek/patches/131-spi-mtk_spim-prevent-global-pll-clock-override.patch new file mode 100644 index 00000000000000..c4e0fff921f453 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/131-spi-mtk_spim-prevent-global-pll-clock-override.patch @@ -0,0 +1,47 @@ +From 41f225dae30ea6ddcff10f120a9e732f994d3a07 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Nicol=C3=B2=20Veronese?= +Date: Tue, 3 Oct 2023 23:46:52 +0200 +Subject: [PATCH] spi: mtk_spim: prevent global pll clock override +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +With commit 793e6230118032a099ec42a1ea67f434721edcc0 + a new system to calculate the SPI clocks has been added. + +Unfortunately, the do_div macro overrides the global + priv->pll_clk_rate field. This will cause to have a reduced + clock rate on each subsequent SPI call. + +Signed-off-by: Valerio 'ftp21' Mancini +Signed-off-by: Nicolò Veronese +--- + drivers/spi/mtk_spim.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/drivers/spi/mtk_spim.c ++++ b/drivers/spi/mtk_spim.c +@@ -409,7 +409,7 @@ static int mtk_spim_transfer_wait(struct + { + struct udevice *bus = dev_get_parent(slave->dev); + struct mtk_spim_priv *priv = dev_get_priv(bus); +- u32 sck_l, sck_h, clk_count, reg; ++ u32 pll_clk, sck_l, sck_h, clk_count, reg; + ulong us = 1; + int ret = 0; + +@@ -418,11 +418,12 @@ static int mtk_spim_transfer_wait(struct + else + clk_count = op->data.nbytes; + ++ pll_clk = priv->pll_clk_rate; + sck_l = readl(priv->base + SPI_CFG2_REG) >> SPI_CFG2_SCK_LOW_OFFSET; + sck_h = readl(priv->base + SPI_CFG2_REG) & SPI_CFG2_SCK_HIGH_MASK; +- do_div(priv->pll_clk_rate, sck_l + sck_h + 2); ++ do_div(pll_clk, sck_l + sck_h + 2); + +- us = CLK_TO_US(priv->pll_clk_rate, clk_count * 8); ++ us = CLK_TO_US(pll_clk, clk_count * 8); + us += 1000 * 1000; /* 1s tolerance */ + + if (us > UINT_MAX) diff --git a/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch b/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch index 574259fb395764..ae7623086e4475 100644 --- a/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch +++ b/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch @@ -70,7 +70,7 @@ { --- a/boot/image-fit.c +++ b/boot/image-fit.c -@@ -2051,6 +2051,49 @@ static const char *fit_get_image_type_pr +@@ -2051,6 +2051,47 @@ static const char *fit_get_image_type_pr return "unknown"; } @@ -93,11 +93,8 @@ + max_size = hdrsize; + + images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH); -+ if (images_noffset < 0) { -+ printf("Can't find images parent node '%s' (%s)\n", -+ FIT_IMAGES_PATH, fdt_strerror(images_noffset)); -+ return 0; -+ } ++ if (images_noffset < 0) ++ goto out; + + for (ndepth = 0, + noffset = fdt_next_node(fit, images_noffset, &ndepth); @@ -106,7 +103,7 @@ + if (ndepth == 1) { + ret = fit_image_get_data_and_size(fit, noffset, &data, &data_size); + if (ret) -+ return 0; ++ goto out; + + img_total = data_size + (data - fit); + @@ -114,6 +111,7 @@ + } + } + ++out: + return max_size; +} + diff --git a/package/boot/uboot-mediatek/patches/260-add-missing-type-u64.patch b/package/boot/uboot-mediatek/patches/260-add-missing-type-u64.patch deleted file mode 100644 index a6204c7b69e105..00000000000000 --- a/package/boot/uboot-mediatek/patches/260-add-missing-type-u64.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/include/linux/types.h -+++ b/include/linux/types.h -@@ -1,6 +1,7 @@ - #ifndef _LINUX_TYPES_H - #define _LINUX_TYPES_H - -+typedef unsigned long long __u64; - #include - #include - #include diff --git a/package/boot/uboot-mediatek/patches/300-force-pylibfdt-build.patch b/package/boot/uboot-mediatek/patches/300-force-pylibfdt-build.patch deleted file mode 100644 index 89cdf60f95073b..00000000000000 --- a/package/boot/uboot-mediatek/patches/300-force-pylibfdt-build.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -2006,26 +2006,7 @@ endif - # Check dtc and pylibfdt, if DTC is provided, else build them - PHONY += scripts_dtc - scripts_dtc: scripts_basic -- $(Q)if test "$(DTC)" = "$(DTC_INTREE)"; then \ -- $(MAKE) $(build)=scripts/dtc; \ -- else \ -- if ! $(DTC) -v >/dev/null; then \ -- echo '*** Failed to check dtc version: $(DTC)'; \ -- false; \ -- else \ -- if test "$(call dtc-version)" -lt $(DTC_MIN_VERSION); then \ -- echo '*** Your dtc is too old, please upgrade to dtc $(DTC_MIN_VERSION) or newer'; \ -- false; \ -- else \ -- if [ -n "$(CONFIG_PYLIBFDT)" ]; then \ -- if ! echo "import libfdt" | $(PYTHON3) 2>/dev/null; then \ -- echo '*** pylibfdt does not seem to be available with $(PYTHON3)'; \ -- false; \ -- fi; \ -- fi; \ -- fi; \ -- fi; \ -- fi -+ $(MAKE) $(build)=scripts/dtc - - # --------------------------------------------------------------------------- - quiet_cmd_cpp_lds = LDS $@ 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 146a93f4f3763b..1567ba537c052a 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/431-add-xiaomi_redmi-ax6000.patch b/package/boot/uboot-mediatek/patches/431-add-xiaomi_redmi-ax6000.patch index 070456b2ee8862..88b2c63632d4c1 100644 --- a/package/boot/uboot-mediatek/patches/431-add-xiaomi_redmi-ax6000.patch +++ b/package/boot/uboot-mediatek/patches/431-add-xiaomi_redmi-ax6000.patch @@ -239,12 +239,12 @@ +ð { + status = "okay"; + mediatek,gmac-id = <0>; -+ phy-mode = "sgmii"; ++ phy-mode = "2500base-x"; + mediatek,switch = "mt7531"; + reset-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + + fixed-link { -+ speed = <1000>; ++ speed = <2500>; + full-duplex; + }; +}; diff --git a/package/boot/uboot-mediatek/patches/436-add-glinet-mt6000.patch b/package/boot/uboot-mediatek/patches/436-add-glinet-mt6000.patch index ad138acfd921d4..e0a059eb7bd398 100644 --- a/package/boot/uboot-mediatek/patches/436-add-glinet-mt6000.patch +++ b/package/boot/uboot-mediatek/patches/436-add-glinet-mt6000.patch @@ -259,7 +259,7 @@ +bootmenu_0=Startup system (Default).=run boot_system +bootmenu_1=Load Firmware via TFTP then write to eMMC.=run boot_tftp_firmware ; run bootmenu_confirm_return +bootmenu_2=Load BL31+U-Boot FIP via TFTP then write to eMMC.=run boot_tftp_write_fip ; run bootmenu_confirm_return -+bootmenu_3=mLoad BL2 preloader via TFTP then write to eMMC.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return ++bootmenu_3=Load BL2 preloader via TFTP then write to eMMC.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return +bootmenu_4=Reboot.=reset +bootmenu_5=Reset all settings to factory defaults.=run reset_factory ; reset +filesize_to_blk=setexpr cnt $filesize + 0x1ff && setexpr cnt $cnt / 0x200 diff --git a/package/boot/uboot-mediatek/patches/437-add-cmcc_rax3000m.patch b/package/boot/uboot-mediatek/patches/437-add-cmcc_rax3000m.patch new file mode 100644 index 00000000000000..26e0e30a996628 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/437-add-cmcc_rax3000m.patch @@ -0,0 +1,697 @@ +--- /dev/null ++++ b/configs/mt7981_cmcc_rax3000m-emmc_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-cmcc-rax3000m-emmc" ++CONFIG_DEFAULT_ENV_FILE="cmcc_rax3000m-emmc_env" ++CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-cmcc-rax3000m-emmc.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_MMC=y ++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_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_USB=y ++CONFIG_CMD_UUID=y ++CONFIG_DISPLAY_CPUINFO=y ++CONFIG_DM_MMC=y ++CONFIG_DM_REGULATOR=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_DM_REGULATOR_GPIO=y ++CONFIG_DM_USB=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_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_MMC=y ++CONFIG_MMC_DEFAULT_DEV=1 ++CONFIG_MMC_HS200_SUPPORT=y ++CONFIG_MMC_MTK=y ++CONFIG_MMC_SUPPORTS_TUNING=y ++CONFIG_SUPPORT_EMMC_BOOT=y ++CONFIG_SPI=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_USB=y ++CONFIG_USB_HOST=y ++CONFIG_USB_XHCI_HCD=y ++CONFIG_USB_XHCI_MTK=y ++CONFIG_USB_STORAGE=y ++CONFIG_OF_EMBED=y ++CONFIG_ENV_OVERWRITE=y ++CONFIG_ENV_IS_IN_MMC=y ++CONFIG_ENV_OFFSET=0x400000 ++CONFIG_ENV_OFFSET_REDUND=0x440000 ++CONFIG_ENV_SIZE=0x40000 ++CONFIG_ENV_SIZE_REDUND=0x40000 ++CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y ++CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_CLK=y ++CONFIG_SUPPORT_EMMC_BOOT=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_CMD_SF=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/configs/mt7981_cmcc_rax3000m-nand_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-cmcc-rax3000m-nand" ++CONFIG_DEFAULT_ENV_FILE="cmcc_rax3000m-nand_env" ++CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-cmcc-rax3000m-nand.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-cmcc-rax3000m.dtsi +@@ -0,0 +1,85 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++/* ++ * Copyright (c) 2022 MediaTek Inc. ++ * Author: Sam Shih ++ */ ++ ++/dts-v1/; ++#include "mt7981.dtsi" ++#include ++#include ++ ++/ { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ model = "CMCC RAX3000M"; ++ compatible = "mediatek,mt7981", "mediatek,mt7981-rfb"; ++ ++ chosen { ++ stdout-path = &uart0; ++ tick-timer = &timer0; ++ }; ++ ++ memory@40000000 { ++ device_type = "memory"; ++ reg = <0x40000000 0x20000000>; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ button-reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&gpio 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ button-mesh { ++ label = "mesh"; ++ linux,code = ; ++ linux,input-type = ; ++ gpios = <&gpio 0 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-0 { ++ label = "green:status"; ++ gpios = <&gpio 9 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-1 { ++ label = "blue:status"; ++ gpios = <&gpio 12 GPIO_ACTIVE_LOW>; ++ }; ++ ++ led-2 { ++ label = "red:status"; ++ gpios = <&gpio 35 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++ð { ++ 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; ++ }; ++}; ++ ++&uart0 { ++ mediatek,force-highspeed; ++ status = "okay"; ++}; ++ ++&watchdog { ++ status = "disabled"; ++}; +--- /dev/null ++++ b/arch/arm/dts/mt7981-cmcc-rax3000m-emmc.dts +@@ -0,0 +1,53 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++ ++/dts-v1/; ++#include "mt7981-cmcc-rax3000m.dtsi" ++ ++/ { ++ reg_3p3v: regulator-3p3v { ++ compatible = "regulator-fixed"; ++ regulator-name = "fixed-3.3V"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-boot-on; ++ regulator-always-on; ++ }; ++}; ++ ++&mmc0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_default>; ++ max-frequency = <26000000>; ++ bus-width = <8>; ++ cap-mmc-hw-reset; ++ vmmc-supply = <®_3p3v>; ++ non-removable; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ mmc0_pins_default: mmc0default { ++ mux { ++ function = "flash"; ++ groups = "emmc_45"; ++ }; ++ conf-cmd-dat { ++ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO", ++ "SPI0_CS", "SPI0_HOLD", "SPI0_WP", ++ "SPI1_CLK", "SPI1_MOSI", "SPI1_MISO"; ++ input-enable; ++ drive-strength = ; ++ bias-pull-up = ; ++ }; ++ conf-clk { ++ pins = "SPI1_CS"; ++ drive-strength = ; ++ bias-pull-down = ; ++ }; ++ conf-rst { ++ pins = "PWM0"; ++ drive-strength = ; ++ bias-pull-up = ; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm/dts/mt7981-cmcc-rax3000m-nand.dts +@@ -0,0 +1,77 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++ ++/dts-v1/; ++#include "mt7981-cmcc-rax3000m.dtsi" ++ ++&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 = ; ++ }; ++ }; ++}; ++ ++&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 0x7200000>; ++ }; ++ }; ++ }; ++}; +--- /dev/null ++++ b/cmcc_rax3000m-emmc_env +@@ -0,0 +1,55 @@ ++ipaddr=192.168.1.1 ++serverip=192.168.1.254 ++loadaddr=0x46000000 ++console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0 ++bootargs=root=/dev/mmcblk0p65 ++bootcmd=if pstore check ; then run boot_recovery ; else run boot_emmc ; fi ++bootconf=config-1#mt7981b-cmcc-rax3000m-emmc ++bootdelay=0 ++bootfile=openwrt-mediatek-filogic-cmcc_rax3000m-initramfs-recovery.itb ++bootfile_bl2=openwrt-mediatek-filogic-cmcc_rax3000m-emmc-preloader.bin ++bootfile_fip=openwrt-mediatek-filogic-cmcc_rax3000m-emmc-bl31-uboot.fip ++bootfile_upg=openwrt-mediatek-filogic-cmcc_rax3000m-squashfs-sysupgrade.itb ++bootled_pwr=red:status ++bootled_rec=blue:status ++bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60 ++bootmenu_default=0 ++bootmenu_delay=0 ++bootmenu_title= ( ( ( OpenWrt ) ) ) [eMMC] ++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 eMMC.=run boot_production ; run bootmenu_confirm_return ++bootmenu_3=Boot recovery system from eMMC.=run boot_recovery ; run bootmenu_confirm_return ++bootmenu_4=Load production system via TFTP then write to eMMC.=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 eMMC.=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 eMMC.=run boot_tftp_write_fip ; run bootmenu_confirm_return ++bootmenu_7=Load BL2 preloader via TFTP then write to eMMC.=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 emmc_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off ++boot_recovery=led $bootled_rec on ; run emmc_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off ++boot_emmc=run boot_production ; run boot_recovery ++boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done ++boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run emmc_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run emmc_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run emmc_write_fip ++boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run emmc_write_bl2 ++boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf ++mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $loadaddr 0x$part_addr 0x$image_size ++mmc_read_vol=mmc read $loadaddr $part_addr 0x100 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200 ++part_default=production ++part_recovery=recovery ++reset_factory=eraseenv && reset ++emmc_read_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_read_vol ++emmc_read_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_read_vol ++emmc_write_bl2=mmc partconf 0 1 1 1 && mmc erase 0x0 0x400 && mmc write $fileaddr 0x0 0x400 ; mmc partconf 0 1 1 0 ++emmc_write_fip=mmc erase 0x3400 0x2000 && mmc write $fileaddr 0x3400 0x2000 && mmc erase 0x2000 0x800 ++emmc_write_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_write_vol ++emmc_write_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_write_vol ++_init_env=setenv _init_env ; setenv _create_env ; saveenv ; saveenv ++_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first ++_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title ++_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver" +--- /dev/null ++++ b/cmcc_rax3000m-nand_env +@@ -0,0 +1,56 @@ ++ipaddr=192.168.1.1 ++serverip=192.168.1.254 ++loadaddr=0x46000000 ++console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0 ++bootconf=config-1#mt7981b-cmcc-rax3000m-nand ++bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi ++bootdelay=0 ++bootfile=openwrt-mediatek-filogic-cmcc_rax3000m-initramfs-recovery.itb ++bootfile_bl2=openwrt-mediatek-filogic-cmcc_rax3000m-nand-preloader.bin ++bootfile_fip=openwrt-mediatek-filogic-cmcc_rax3000m-nand-bl31-uboot.fip ++bootfile_upg=openwrt-mediatek-filogic-cmcc_rax3000m-squashfs-sysupgrade.itb ++bootled_pwr=red:status ++bootled_rec=blue:status ++bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60 ++bootmenu_default=0 ++bootmenu_delay=0 ++bootmenu_title= ( ( ( OpenWrt ) ) ) [SPI-NAND] ++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 ++_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv ++_firstboot=setenv _firstboot ; 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/boot/uboot-mediatek/patches/438-add-jcg_q30-pro.patch b/package/boot/uboot-mediatek/patches/438-add-jcg_q30-pro.patch new file mode 100644 index 00000000000000..639cae174e752d --- /dev/null +++ b/package/boot/uboot-mediatek/patches/438-add-jcg_q30-pro.patch @@ -0,0 +1,420 @@ +--- /dev/null ++++ b/configs/mt7981_jcg_q30-pro_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-pro" ++CONFIG_DEFAULT_ENV_FILE="jcg_q30-pro_env" ++CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981_jcg_q30-pro.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-pro.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 PRO"; ++ 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-pro_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=openwrt-mediatek-filogic-jcg_q30-pro-initramfs-recovery.itb ++bootfile_bl2=openwrt-mediatek-filogic-jcg_q30-pro-preloader.bin ++bootfile_fip=openwrt-mediatek-filogic-jcg_q30-pro-bl31-uboot.fip ++bootfile_upg=openwrt-mediatek-filogic-jcg_q30-pro-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/boot/uboot-mediatek/patches/439-add-zyxel_ex5601-t0.patch b/package/boot/uboot-mediatek/patches/439-add-zyxel_ex5601-t0.patch new file mode 100644 index 00000000000000..7f0564fd4974df --- /dev/null +++ b/package/boot/uboot-mediatek/patches/439-add-zyxel_ex5601-t0.patch @@ -0,0 +1,431 @@ +--- /dev/null ++++ b/configs/mt7986_zyxel_ex5601-t0_defconfig +@@ -0,0 +1,186 @@ ++CONFIG_ARM=y ++CONFIG_POSITION_INDEPENDENT=y ++CONFIG_ARCH_MEDIATEK=y ++CONFIG_TARGET_MT7986=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="mt7986a-zyxel_ex5601-t0" ++CONFIG_DEFAULT_ENV_FILE="zyxel_ex5601-t0_env" ++CONFIG_DEFAULT_FDT_FILE="mediatek/mt7986a-zyxel_ex5601-t0.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="EX5601> " ++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_MTD=y ++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_USB=y ++# CONFIG_CMD_FLASH is not set ++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_USB=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_DM_PCI=y ++CONFIG_PCIE_MEDIATEK=y ++# CONFIG_MMC is not set ++# CONFIG_DM_MMC is not set ++CONFIG_MTD=y ++CONFIG_MTD_UBI_FASTMAP=y ++# CONFIG_DM_PCI is not set ++# CONFIG_PCIE_MEDIATEK is not set ++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_I2C is not set ++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_USB=y ++CONFIG_USB_HOST=y ++CONFIG_USB_XHCI_HCD=y ++CONFIG_USB_XHCI_MTK=y ++CONFIG_USB_STORAGE=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_MT7986=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_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/mt7986a-zyxel_ex5601-t0.dts +@@ -0,0 +1,181 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Author: Valerio 'ftp21' Mancini ++ * Author: Nicolò Veronese ++ */ ++ ++/dts-v1/; ++#include ++#include "mt7986.dtsi" ++#include ++ ++/ { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ model = "Zyxel EX5601-T0 ubootmod"; ++ compatible = "mediatek,mt7986", "mediatek,mt7986-sd-rfb"; ++ ++ chosen { ++ stdout-path = &uart0; ++ tick-timer = &timer0; ++ }; ++ ++ memory@40000000 { ++ device_type = "memory"; ++ reg = <0x40000000 0x20000000>; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ factory { ++ label = "reset"; ++ gpios = <&gpio 21 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ ++ wps { ++ label = "wps"; ++ gpios = <&gpio 56 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led_status_green: pwr { ++ label = "green:status"; ++ gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; ++ default-state = "off"; ++ }; ++ ++ led_sfp_green: sfp { ++ label = "green:sfp"; ++ gpios = <&gpio 24 GPIO_ACTIVE_HIGH>; ++ default-state = "off"; ++ }; ++ }; ++}; ++ ++&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 5 GPIO_ACTIVE_HIGH>; ++ ++ fixed-link { ++ speed = <2500>; ++ full-duplex; ++ }; ++}; ++ ++&pinctrl { ++ spic_pins: spi1-pins-func-1 { ++ mux { ++ function = "spi"; ++ groups = "spi1_2"; ++ }; ++ }; ++ ++ uart1_pins: spi1-pins-func-3 { ++ mux { ++ function = "uart"; ++ groups = "uart1_2"; ++ }; ++ }; ++ ++ spi_flash_pins: spi0-pins-func-1 { ++ mux { ++ function = "flash"; ++ groups = "spi0", "spi0_wp_hold"; ++ }; ++ ++ conf-pu { ++ pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP"; ++ drive-strength = ; ++ bias-pull-up = ; ++ }; ++ ++ conf-pd { ++ pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; ++ drive-strength = ; ++ bias-pull-down = ; ++ }; ++ }; ++}; ++ ++&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 = <1>; ++ sample_sel = <0>; ++ ++ spi_nand@0 { ++ compatible = "spi-nand"; ++ reg = <0>; ++ spi-max-frequency = <20000000>; ++ spi-tx-buswidth = <4>; ++ spi-rx-buswidth = <4>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "bl2"; ++ reg = <0x0 0x100000>; ++ }; ++ ++ partition@100000 { ++ label = "u-boot-env"; ++ reg = <0x0100000 0x0080000>; ++ }; ++ ++ partition@180000 { ++ label = "Factory"; ++ reg = <0x180000 0x0200000>; ++ }; ++ ++ partition@380000 { ++ label = "fip"; ++ reg = <0x380000 0x0200000>; ++ }; ++ ++ partition@540000 { ++ label = "zloader"; ++ reg = <0x540000 0x0040000>; ++ read-only; ++ }; ++ partition@580000 { ++ label = "ubi"; ++ reg = <0x580000 0x1da80000>; ++ }; ++ }; ++ }; ++}; ++ ++&watchdog { ++ status = "disabled"; ++}; ++ +--- /dev/null ++++ b/zyxel_ex5601-t0_env +@@ -0,0 +1,55 @@ ++ethaddr_factory=mtd read Factory 0x40080000 0x0 0x20000 && env readmem -b ethaddr 0x4008002A 0x6 ; setenv ethaddr_factory ++ipaddr=192.168.1.1 ++serverip=192.168.1.254 ++loadaddr=0x46000000 ++console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0 ++bootargs=console=ttyS0,115200n8 console_msg_format=syslog ++bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi ++bootconf=config-1 ++bootdelay=0 ++bootfile=openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-initramfs-recovery.itb ++bootfile_bl2=openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-preloader.bin ++bootfile_fip=openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-bl31-uboot.fip ++bootfile_upg=openwrt-mediatek-filogic-zyxel_ex5601-t0-ubootmod-squashfs-sysupgrade.itb ++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 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=run ubi_read_production && bootm $loadaddr#$bootconf ++boot_recovery=run ubi_read_recovery && bootm $loadaddr#$bootconf ++boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever ++boot_tftp_forever=while true ; do run boot_tftp_recovery ; sleep 1 ; done ++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_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=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_fit=fit ++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 ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic 1 ++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 $part_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 && ubi write $loadaddr fit $filesize ++ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize ++_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv ++_firstboot=setenv _firstboot ; run ethaddr_factory ; run _switch_to_menu ; run _init_env ; run boot_first ++_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title ++_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver" diff --git a/package/boot/uboot-mvebu/patches/0004-arm-mvebu-clearfog-read-number-of-ddr-channels-from-.patch b/package/boot/uboot-mvebu/patches/0004-arm-mvebu-clearfog-read-number-of-ddr-channels-from-.patch new file mode 100644 index 00000000000000..f4db7026399f80 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0004-arm-mvebu-clearfog-read-number-of-ddr-channels-from-.patch @@ -0,0 +1,85 @@ +From 1dbc6d3739869af38e6157cd8b9bc4314ca3c9fe Mon Sep 17 00:00:00 2001 +From: Josua Mayer +Date: Mon, 18 Jul 2022 20:04:54 +0300 +Subject: [PATCH 1/2] arm: mvebu: clearfog: read number of ddr channels from + tlv data + +Extend the existing tlv vendor extension used for ram size by one byte to +also store the number of ddr channels. +The length of the tlv entry can indicate whether the new information is +present. If not default to single channel. + +Signed-off-by: Josua Mayer +--- + board/solidrun/clearfog/clearfog.c | 14 +++++++++++++- + board/solidrun/common/tlv_data.c | 7 ++++++- + board/solidrun/common/tlv_data.h | 1 + + 3 files changed, 20 insertions(+), 2 deletions(-) + +diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c +index 6edb4221551..4f4532b537e 100644 +--- a/board/solidrun/clearfog/clearfog.c ++++ b/board/solidrun/clearfog/clearfog.c +@@ -36,7 +36,7 @@ DECLARE_GLOBAL_DATA_PTR; + #define BOARD_GPP_POL_LOW 0x0 + #define BOARD_GPP_POL_MID 0x0 + +-static struct tlv_data cf_tlv_data; ++static struct tlv_data cf_tlv_data = { 0 }; + + static void cf_read_tlv_data(void) + { +@@ -168,6 +168,18 @@ struct mv_ddr_topology_map *mv_ddr_topology_map_get(void) + break; + } + ++ switch (cf_tlv_data.ram_channels) { ++ default: ++ case 1: ++ for (uint8_t i = 0; i < 5; i++) ++ ifp->as_bus_params[i].cs_bitmask = 0x1; ++ break; ++ case 2: ++ for (uint8_t i = 0; i < 5; i++) ++ ifp->as_bus_params[i].cs_bitmask = 0x3; ++ break; ++ } ++ + /* Return the board topology as defined in the board code */ + return &board_topology_map; + } +diff --git a/board/solidrun/common/tlv_data.c b/board/solidrun/common/tlv_data.c +index 11d6e4a1380..cf5824886c3 100644 +--- a/board/solidrun/common/tlv_data.c ++++ b/board/solidrun/common/tlv_data.c +@@ -45,9 +45,14 @@ static void parse_tlv_vendor_ext(struct tlvinfo_tlv *tlv_entry, + + if (val[4] != SR_TLV_CODE_RAM_SIZE) + return; +- if (tlv_entry->length != 6) ++ if (tlv_entry->length < 6) + return; + td->ram_size = val[5]; ++ ++ /* extension with additional data field for number of ddr channels */ ++ if (tlv_entry->length >= 7) { ++ td->ram_channels = val[6]; ++ } + } + + static void parse_tlv_data(u8 *eeprom, struct tlvinfo_header *hdr, +diff --git a/board/solidrun/common/tlv_data.h b/board/solidrun/common/tlv_data.h +index a1432e4b8e1..be3f782ac4a 100644 +--- a/board/solidrun/common/tlv_data.h ++++ b/board/solidrun/common/tlv_data.h +@@ -10,6 +10,7 @@ struct tlv_data { + /* Store product name of both SOM and carrier */ + char tlv_product_name[2][32]; + unsigned int ram_size; ++ uint8_t ram_channels; + }; + + void read_tlv_data(struct tlv_data *td); +-- +2.35.3 + diff --git a/package/boot/uboot-mvebu/patches/0005-arm-mvebu-clearfog-support-512MB-memory-size-from-tl.patch b/package/boot/uboot-mvebu/patches/0005-arm-mvebu-clearfog-support-512MB-memory-size-from-tl.patch new file mode 100644 index 00000000000000..05fb8fdbf1b475 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0005-arm-mvebu-clearfog-support-512MB-memory-size-from-tl.patch @@ -0,0 +1,31 @@ +From b1b4941c2e3e16a21dc15604220725cf7f2de7c5 Mon Sep 17 00:00:00 2001 +From: Josua Mayer +Date: Wed, 20 Jul 2022 19:10:56 +0300 +Subject: [PATCH 2/2] arm: mvebu: clearfog: support 512MB memory size from tlv + eeprom + +Handle 2GBit memory size value "2" from tlv eeprom on ddr +initialisation, to support SoMs with 512MB ddr memory. + +Signed-off-by: Josua Mayer +--- + board/solidrun/clearfog/clearfog.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c +index 4f4532b537e..6fa2fe5fe3e 100644 +--- a/board/solidrun/clearfog/clearfog.c ++++ b/board/solidrun/clearfog/clearfog.c +@@ -159,6 +159,9 @@ struct mv_ddr_topology_map *mv_ddr_topology_map_get(void) + cf_read_tlv_data(); + + switch (cf_tlv_data.ram_size) { ++ case 2: ++ ifp->memory_size = MV_DDR_DIE_CAP_2GBIT; ++ break; + case 4: + default: + ifp->memory_size = MV_DDR_DIE_CAP_4GBIT; +-- +2.35.3 + diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile index cdaad7ce469485..1dad3c1e1cff9b 100644 --- a/package/boot/uboot-rockchip/Makefile +++ b/package/boot/uboot-rockchip/Makefile @@ -5,13 +5,15 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2021.07 -PKG_RELEASE:=5 - -PKG_HASH:=312b7eeae44581d1362c3a3f02c28d806647756c82ba8c72241c7cdbe68ba77e +PKG_VERSION:=2023.07.02 +PKG_RELEASE:=1 +PKG_HASH:=6b6a48581c14abb0f95bd87c1af4d740922406d7b801002a9f94727fdde021d5 PKG_MAINTAINER:=Tobias Maedel +UBOOT_USE_BINMAN:=1 +UBOOT_USE_INTREE_DTC:=1 + include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk @@ -28,7 +30,6 @@ define U-Boot/rk3328/Default BUILD_SUBTARGET:=armv8 DEPENDS:=+PACKAGE_u-boot-$(1):trusted-firmware-a-rk3328 ATF:=rk3328_bl31.elf - OF_PLATDATA:=$(1) endef define U-Boot/nanopi-r2c-rk3328 @@ -116,6 +117,30 @@ define U-Boot/rockpro64-rk3399 pine64_rockpro64 endef + +# RK3568 boards + +define U-Boot/rk3568/Default + BUILD_SUBTARGET:=armv8 + DEPENDS:=+PACKAGE_u-boot-$(1):trusted-firmware-a-rk3568 + ATF:=rk3568_bl31_v1.43.elf + TPL:=rk3568_ddr_1560MHz_v1.18.bin +endef + +define U-Boot/nanopi-r5c-rk3568 + $(U-Boot/rk3568/Default) + NAME:=NanoPi R5C + BUILD_DEVICES:= \ + friendlyarm_nanopi-r5c +endef + +define U-Boot/nanopi-r5s-rk3568 + $(U-Boot/rk3568/Default) + NAME:=NanoPi R5S + BUILD_DEVICES:= \ + friendlyarm_nanopi-r5s +endef + UBOOT_TARGETS := \ nanopc-t4-rk3399 \ nanopi-r4s-rk3399 \ @@ -127,27 +152,21 @@ UBOOT_TARGETS := \ orangepi-r1-plus-lts-rk3328 \ roc-cc-rk3328 \ rock64-rk3328 \ - rock-pi-e-rk3328 + rock-pi-e-rk3328 \ + nanopi-r5c-rk3568 \ + nanopi-r5s-rk3568 UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes -UBOOT_MAKE_FLAGS += \ - BL31=$(STAGING_DIR_IMAGE)/$(ATF) - -define Build/Configure - $(call Build/Configure/U-Boot) +UBOOT_CUSTOMIZE_CONFIG := \ + --disable SPL_FIT_SIGNATURE \ + --disable TOOLS_MKEFICAPSULE \ + --set-str MKIMAGE_DTC_PATH $(PKG_BUILD_DIR)/scripts/dtc/dtc -ifneq ($(OF_PLATDATA),) - mkdir -p $(PKG_BUILD_DIR)/tpl/dts - mkdir -p $(PKG_BUILD_DIR)/include/generated - - $(CP) $(PKG_BUILD_DIR)/of-platdata/$(OF_PLATDATA)/dt-plat.c $(PKG_BUILD_DIR)/tpl/dts/dt-plat.c - $(CP) $(PKG_BUILD_DIR)/of-platdata/$(OF_PLATDATA)/dt-structs-gen.h $(PKG_BUILD_DIR)/include/generated/dt-structs-gen.h - $(CP) $(PKG_BUILD_DIR)/of-platdata/$(OF_PLATDATA)/dt-decl.h $(PKG_BUILD_DIR)/include/generated/dt-decl.h -endif - - $(SED) 's#CONFIG_MKIMAGE_DTC_PATH=.*#CONFIG_MKIMAGE_DTC_PATH="$(PKG_BUILD_DIR)/scripts/dtc/dtc"#g' $(PKG_BUILD_DIR)/.config -endef +UBOOT_MAKE_FLAGS += \ + PATH=$(STAGING_DIR_HOST)/bin:$(PATH) \ + BL31=$(STAGING_DIR_IMAGE)/$(ATF) \ + $(if $(TPL),ROCKCHIP_TPL=$(STAGING_DIR_IMAGE)/$(TPL)) define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) diff --git a/package/boot/uboot-rockchip/patches/001-scripts-remove-dependency-on-swig.patch b/package/boot/uboot-rockchip/patches/001-scripts-remove-dependency-on-swig.patch deleted file mode 100644 index 050558938548ea..00000000000000 --- a/package/boot/uboot-rockchip/patches/001-scripts-remove-dependency-on-swig.patch +++ /dev/null @@ -1,24 +0,0 @@ -From b137ca16b54c67d76714ea5a0138741959b0dc29 Mon Sep 17 00:00:00 2001 -From: David Bauer -Date: Mon, 13 Jul 2020 23:37:37 +0200 -Subject: [PATCH] scripts: remove dependency on swig - -Don't build the libfdt tool, as it has a dependency on swig (which -OpenWrt does not ship). - -This requires more hacks, as of-platdata generation does not work -without it. - -Signed-off-by: David Bauer ---- - scripts/dtc/Makefile | 2 -- - 1 file changed, 2 deletions(-) - ---- a/scripts/dtc/Makefile -+++ b/scripts/dtc/Makefile -@@ -18,5 +18,3 @@ HOSTCFLAGS_dtc-parser.tab.o := -I$(src) - # dependencies on generated files need to be listed explicitly - $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h - --# Added for U-Boot --subdir-$(CONFIG_PYLIBFDT) += pylibfdt diff --git a/package/boot/uboot-rockchip/patches/002-spl-remove-dtoc-of-pdata-generation.patch b/package/boot/uboot-rockchip/patches/002-spl-remove-dtoc-of-pdata-generation.patch deleted file mode 100644 index 14bcbfb630ed03..00000000000000 --- a/package/boot/uboot-rockchip/patches/002-spl-remove-dtoc-of-pdata-generation.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 55273cf6079ddd3b006da69f0113c2c66c03f17e Mon Sep 17 00:00:00 2001 -From: David Bauer -Date: Tue, 14 Jul 2020 22:44:22 +0200 -Subject: [PATCH] spl: remove dtoc of-pdata generation - -Remove the dtoc of-pdata generation. This generation is dependant on -libpython-dev. As OpenWrt does not ship with this dependency, use -pre-generated pdata files and remove the generation from the -build-process. - -This only affects RK3328 boards. - -Signed-off-by: David Bauer ---- - scripts/Makefile.spl | 6 ------ - 1 file changed, 6 deletions(-) - ---- a/scripts/Makefile.spl -+++ b/scripts/Makefile.spl -@@ -354,8 +354,6 @@ $(platdata-hdr) $(u-boot-spl-platdata_c) - @# of OF_PLATDATA_INST and this might change between builds. Leaving old - @# ones around is confusing and it is possible that switching the - @# setting again will use the old one instead of regenerating it. -- @rm -f $(u-boot-spl-all-platdata_c) $(u-boot-spl-all-platdata) -- $(call if_changed,dtoc) - - ifdef CONFIG_SAMSUNG - ifdef CONFIG_VAR_SIZE_SPL diff --git a/package/boot/uboot-rockchip/patches/103-rockchip-rk3328-Add-support-for-Orange-Pi-R1-Plus.patch b/package/boot/uboot-rockchip/patches/100-rockchip-rk3328-Add-support-for-Orange-Pi-R1-Plus.patch similarity index 91% rename from package/boot/uboot-rockchip/patches/103-rockchip-rk3328-Add-support-for-Orange-Pi-R1-Plus.patch rename to package/boot/uboot-rockchip/patches/100-rockchip-rk3328-Add-support-for-Orange-Pi-R1-Plus.patch index ff17559c2fe6b0..487e6afda81ca6 100644 --- a/package/boot/uboot-rockchip/patches/103-rockchip-rk3328-Add-support-for-Orange-Pi-R1-Plus.patch +++ b/package/boot/uboot-rockchip/patches/100-rockchip-rk3328-Add-support-for-Orange-Pi-R1-Plus.patch @@ -1,4 +1,4 @@ -From ff312af37d5f263f181468639aab83f645d331f1 Mon Sep 17 00:00:00 2001 +From 89afb631d965292aaf433806d8224b53d9e74036 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 20 May 2023 18:50:38 +0800 Subject: [PATCH] rockchip: rk3328: Add support for Orange Pi R1 Plus @@ -27,7 +27,7 @@ Signed-off-by: Tianling Shen --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile -@@ -110,6 +110,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3328) += \ +@@ -125,6 +125,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3328) += \ rk3328-evb.dtb \ rk3328-nanopi-r2c.dtb \ rk3328-nanopi-r2s.dtb \ @@ -53,24 +53,24 @@ Signed-off-by: Tianling Shen +}; + +&gpio0 { -+ u-boot,dm-spl; ++ bootph-pre-ram; +}; + +&pinctrl { -+ u-boot,dm-spl; ++ bootph-pre-ram; +}; + -+&sdmmc0m1_gpio { -+ u-boot,dm-spl; ++&sdmmc0m1_pin { ++ bootph-pre-ram; +}; + +&pcfg_pull_up_4ma { -+ u-boot,dm-spl; ++ bootph-pre-ram; +}; + +/* Need this and all the pinctrl/gpio stuff above to set pinmux */ +&vcc_sd { -+ u-boot,dm-spl; ++ bootph-pre-ram; +}; + +&gmac2io { @@ -81,12 +81,12 @@ Signed-off-by: Tianling Shen + +&spi0 { + spi_flash: spiflash@0 { -+ u-boot,dm-pre-reloc; ++ bootph-all; + }; +}; --- /dev/null +++ b/arch/arm/dts/rk3328-orangepi-r1-plus.dts -@@ -0,0 +1,359 @@ +@@ -0,0 +1,373 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Based on rk3328-nanopi-r2s.dts, which is: @@ -104,6 +104,7 @@ Signed-off-by: Tianling Shen + compatible = "xunlong,orangepi-r1-plus", "rockchip,rk3328"; + + aliases { ++ ethernet1 = &rtl8153; + mmc0 = &sdmmc; + }; + @@ -146,7 +147,7 @@ Signed-off-by: Tianling Shen + vcc_sd: sdmmc-regulator { + compatible = "regulator-fixed"; + gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>; -+ pinctrl-0 = <&sdmmc0m1_gpio>; ++ pinctrl-0 = <&sdmmc0m1_pin>; + pinctrl-names = "default"; + regulator-name = "vcc_sd"; + regulator-boot-on; @@ -439,6 +440,19 @@ Signed-off-by: Tianling Shen + status = "okay"; +}; + ++&usbdrd3 { ++ dr_mode = "host"; ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ /* Second port is for USB 3.0 */ ++ rtl8153: device@2 { ++ compatible = "usbbda,8153"; ++ reg = <2>; ++ }; ++}; ++ +&usb_host0_ehci { + status = "okay"; +}; @@ -463,39 +477,52 @@ Signed-off-by: Tianling Shen M: Chen-Yu Tsai --- /dev/null +++ b/configs/orangepi-r1-plus-rk3328_defconfig -@@ -0,0 +1,98 @@ +@@ -0,0 +1,114 @@ +CONFIG_ARM=y ++CONFIG_SKIP_LOWLEVEL_INIT=y ++CONFIG_COUNTER_FREQUENCY=24000000 +CONFIG_ARCH_ROCKCHIP=y -+CONFIG_SYS_TEXT_BASE=0x00200000 -+CONFIG_SPL_GPIO_SUPPORT=y ++CONFIG_TEXT_BASE=0x00200000 ++CONFIG_SPL_GPIO=y ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y ++CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000 +CONFIG_ENV_OFFSET=0x3F8000 ++CONFIG_DEFAULT_DEVICE_TREE="rk3328-orangepi-r1-plus" ++CONFIG_DM_RESET=y +CONFIG_ROCKCHIP_RK3328=y +CONFIG_TPL_ROCKCHIP_COMMON_BOARD=y +CONFIG_TPL_LIBCOMMON_SUPPORT=y +CONFIG_TPL_LIBGENERIC_SUPPORT=y -+CONFIG_SPL_DRIVERS_MISC_SUPPORT=y ++CONFIG_SPL_DRIVERS_MISC=y +CONFIG_SPL_STACK_R_ADDR=0x600000 -+CONFIG_NR_DRAM_BANKS=1 ++CONFIG_SPL_STACK=0x400000 ++CONFIG_TPL_SYS_MALLOC_F_LEN=0x800 +CONFIG_DEBUG_UART_BASE=0xFF130000 +CONFIG_DEBUG_UART_CLOCK=24000000 -+CONFIG_SYSINFO=y ++CONFIG_SYS_LOAD_ADDR=0x800800 +CONFIG_DEBUG_UART=y -+CONFIG_TPL_SYS_MALLOC_F_LEN=0x800 +# CONFIG_ANDROID_BOOT_IMAGE is not set +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y +CONFIG_SPL_LOAD_FIT=y +CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-orangepi-r1-plus.dtb" -+CONFIG_MISC_INIT_R=y +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_DISPLAY_BOARDINFO_LATE=y ++CONFIG_MISC_INIT_R=y ++CONFIG_SPL_MAX_SIZE=0x40000 ++CONFIG_SPL_PAD_TO=0x7f8000 ++CONFIG_SPL_HAS_BSS_LINKER_SECTION=y ++CONFIG_SPL_BSS_START_ADDR=0x2000000 ++CONFIG_SPL_BSS_MAX_SIZE=0x2000 +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set -+CONFIG_TPL_SYS_MALLOC_SIMPLE=y ++# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set +CONFIG_SPL_STACK_R=y -+CONFIG_SPL_I2C_SUPPORT=y -+CONFIG_SPL_POWER_SUPPORT=y ++CONFIG_SPL_I2C=y ++CONFIG_SPL_POWER=y +CONFIG_SPL_ATF=y +CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y ++CONFIG_TPL_SYS_MALLOC_SIMPLE=y +CONFIG_CMD_BOOTZ=y +CONFIG_CMD_GPT=y +CONFIG_CMD_MMC=y @@ -504,11 +531,11 @@ Signed-off-by: Tianling Shen +CONFIG_CMD_TIME=y +CONFIG_SPL_OF_CONTROL=y +CONFIG_TPL_OF_CONTROL=y -+CONFIG_DEFAULT_DEVICE_TREE="rk3328-orangepi-r1-plus" +CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" +CONFIG_TPL_OF_PLATDATA=y +CONFIG_ENV_IS_IN_MMC=y +CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_SYS_MMC_ENV_DEV=1 +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_TPL_DM=y +CONFIG_REGMAP=y @@ -526,13 +553,14 @@ Signed-off-by: Tianling Shen +CONFIG_MMC_DW=y +CONFIG_MMC_DW_ROCKCHIP=y +CONFIG_SF_DEFAULT_SPEED=20000000 -+CONFIG_DM_ETH=y ++CONFIG_SPI_FLASH_GIGADEVICE=y +CONFIG_ETH_DESIGNWARE=y +CONFIG_GMAC_ROCKCHIP=y +CONFIG_PINCTRL=y +CONFIG_SPL_PINCTRL=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_RK8XX=y ++CONFIG_SPL_PMIC_RK8XX=y +CONFIG_SPL_DM_REGULATOR=y +CONFIG_REGULATOR_PWM=y +CONFIG_DM_REGULATOR_FIXED=y @@ -542,9 +570,11 @@ Signed-off-by: Tianling Shen +CONFIG_RAM=y +CONFIG_SPL_RAM=y +CONFIG_TPL_RAM=y -+CONFIG_DM_RESET=y +CONFIG_BAUDRATE=1500000 +CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_SYS_NS16550_MEM32=y ++CONFIG_ROCKCHIP_SPI=y ++CONFIG_SYSINFO=y +CONFIG_SYSRESET=y +# CONFIG_TPL_SYSRESET is not set +CONFIG_USB=y diff --git a/package/boot/uboot-rockchip/patches/101-rock64pro-disable-CONFIG_USE_PREBOOT.patch b/package/boot/uboot-rockchip/patches/101-rock64pro-disable-CONFIG_USE_PREBOOT.patch deleted file mode 100644 index 174c9ea29c630d..00000000000000 --- a/package/boot/uboot-rockchip/patches/101-rock64pro-disable-CONFIG_USE_PREBOOT.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 2114d68b3c755ec8043ae9e43ac8e9753e0cec84 Mon Sep 17 00:00:00 2001 -From: Marty Jones -Date: Sun, 17 Jan 2021 15:26:09 -0500 -Subject: [PATCH] rockpro64: disable CONFIG_USE_PREBOOT - -On commit https://github.com/u-boot/u-boot/commit/f81f9f0ebac596bae7f27db095f4f0272b606cc3 -CONFIG_USE_PREBOOT was enabled on the RockPro64. - -When the board is booting, U-Boot hangs as soon as it disables the USB -controller. This is a workaround until a final solution is deployed -upstream. - -Signed-off-by: Marty Jones ---- - configs/rockpro64-rk3399_defconfig | 1 - - 1 file changed, 1 deletion(-) - ---- a/configs/rockpro64-rk3399_defconfig -+++ b/configs/rockpro64-rk3399_defconfig -@@ -12,7 +12,6 @@ CONFIG_DEBUG_UART_CLOCK=24000000 - CONFIG_SPL_SPI_FLASH_SUPPORT=y - CONFIG_SPL_SPI_SUPPORT=y - CONFIG_DEBUG_UART=y --CONFIG_USE_PREBOOT=y - CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rockpro64.dtb" - CONFIG_DISPLAY_BOARDINFO_LATE=y - CONFIG_MISC_INIT_R=y diff --git a/package/boot/uboot-rockchip/patches/104-rockchip-rk3328-Add-support-for-Orange-Pi-R1-Plus-LT.patch b/package/boot/uboot-rockchip/patches/101-rockchip-rk3328-Add-support-for-Orange-Pi-R1-Plus-LT.patch similarity index 86% rename from package/boot/uboot-rockchip/patches/104-rockchip-rk3328-Add-support-for-Orange-Pi-R1-Plus-LT.patch rename to package/boot/uboot-rockchip/patches/101-rockchip-rk3328-Add-support-for-Orange-Pi-R1-Plus-LT.patch index 05d569e7203bd0..56d36c74dc2a7a 100644 --- a/package/boot/uboot-rockchip/patches/104-rockchip-rk3328-Add-support-for-Orange-Pi-R1-Plus-LT.patch +++ b/package/boot/uboot-rockchip/patches/101-rockchip-rk3328-Add-support-for-Orange-Pi-R1-Plus-LT.patch @@ -1,4 +1,4 @@ -From 7a9326a96098bc63d2b60538f657c3a533415276 Mon Sep 17 00:00:00 2001 +From 408fd4570c0f1e6b1fe3722998394651144f2a29 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 20 May 2023 18:52:14 +0800 Subject: [PATCH] rockchip: rk3328: Add support for Orange Pi R1 Plus LTS @@ -10,7 +10,6 @@ changed from DDR4 to LPDDR3. The device tree is taken from kernel v6.4-rc1. Signed-off-by: Tianling Shen - --- arch/arm/dts/Makefile | 1 + .../rk3328-orangepi-r1-plus-lts-u-boot.dtsi | 46 +++++++ @@ -24,7 +23,7 @@ Signed-off-by: Tianling Shen --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile -@@ -111,6 +111,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3328) += \ +@@ -126,6 +126,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3328) += \ rk3328-nanopi-r2c.dtb \ rk3328-nanopi-r2s.dtb \ rk3328-orangepi-r1-plus.dtb \ @@ -50,24 +49,24 @@ Signed-off-by: Tianling Shen +}; + +&gpio0 { -+ u-boot,dm-spl; ++ bootph-pre-ram; +}; + +&pinctrl { -+ u-boot,dm-spl; ++ bootph-pre-ram; +}; + -+&sdmmc0m1_gpio { -+ u-boot,dm-spl; ++&sdmmc0m1_pin { ++ bootph-pre-ram; +}; + +&pcfg_pull_up_4ma { -+ u-boot,dm-spl; ++ bootph-pre-ram; +}; + +/* Need this and all the pinctrl/gpio stuff above to set pinmux */ +&vcc_sd { -+ u-boot,dm-spl; ++ bootph-pre-ram; +}; + +&gmac2io { @@ -78,7 +77,7 @@ Signed-off-by: Tianling Shen + +&spi0 { + spi_flash: spiflash@0 { -+ u-boot,dm-pre-reloc; ++ bootph-all; + }; +}; --- /dev/null @@ -141,39 +140,52 @@ Signed-off-by: Tianling Shen M: Chen-Yu Tsai --- /dev/null +++ b/configs/orangepi-r1-plus-lts-rk3328_defconfig -@@ -0,0 +1,98 @@ +@@ -0,0 +1,114 @@ +CONFIG_ARM=y ++CONFIG_SKIP_LOWLEVEL_INIT=y ++CONFIG_COUNTER_FREQUENCY=24000000 +CONFIG_ARCH_ROCKCHIP=y -+CONFIG_SYS_TEXT_BASE=0x00200000 -+CONFIG_SPL_GPIO_SUPPORT=y ++CONFIG_TEXT_BASE=0x00200000 ++CONFIG_SPL_GPIO=y ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y ++CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000 +CONFIG_ENV_OFFSET=0x3F8000 ++CONFIG_DEFAULT_DEVICE_TREE="rk3328-orangepi-r1-plus-lts" ++CONFIG_DM_RESET=y +CONFIG_ROCKCHIP_RK3328=y +CONFIG_TPL_ROCKCHIP_COMMON_BOARD=y +CONFIG_TPL_LIBCOMMON_SUPPORT=y +CONFIG_TPL_LIBGENERIC_SUPPORT=y -+CONFIG_SPL_DRIVERS_MISC_SUPPORT=y ++CONFIG_SPL_DRIVERS_MISC=y +CONFIG_SPL_STACK_R_ADDR=0x600000 -+CONFIG_NR_DRAM_BANKS=1 ++CONFIG_SPL_STACK=0x400000 ++CONFIG_TPL_SYS_MALLOC_F_LEN=0x800 +CONFIG_DEBUG_UART_BASE=0xFF130000 +CONFIG_DEBUG_UART_CLOCK=24000000 -+CONFIG_SYSINFO=y ++CONFIG_SYS_LOAD_ADDR=0x800800 +CONFIG_DEBUG_UART=y -+CONFIG_TPL_SYS_MALLOC_F_LEN=0x800 +# CONFIG_ANDROID_BOOT_IMAGE is not set +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y +CONFIG_SPL_LOAD_FIT=y +CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-orangepi-r1-plus-lts.dtb" -+CONFIG_MISC_INIT_R=y +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_DISPLAY_BOARDINFO_LATE=y ++CONFIG_MISC_INIT_R=y ++CONFIG_SPL_MAX_SIZE=0x40000 ++CONFIG_SPL_PAD_TO=0x7f8000 ++CONFIG_SPL_HAS_BSS_LINKER_SECTION=y ++CONFIG_SPL_BSS_START_ADDR=0x2000000 ++CONFIG_SPL_BSS_MAX_SIZE=0x2000 +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set -+CONFIG_TPL_SYS_MALLOC_SIMPLE=y ++# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set +CONFIG_SPL_STACK_R=y -+CONFIG_SPL_I2C_SUPPORT=y -+CONFIG_SPL_POWER_SUPPORT=y ++CONFIG_SPL_I2C=y ++CONFIG_SPL_POWER=y +CONFIG_SPL_ATF=y +CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y ++CONFIG_TPL_SYS_MALLOC_SIMPLE=y +CONFIG_CMD_BOOTZ=y +CONFIG_CMD_GPT=y +CONFIG_CMD_MMC=y @@ -182,11 +194,11 @@ Signed-off-by: Tianling Shen +CONFIG_CMD_TIME=y +CONFIG_SPL_OF_CONTROL=y +CONFIG_TPL_OF_CONTROL=y -+CONFIG_DEFAULT_DEVICE_TREE="rk3328-orangepi-r1-plus-lts" +CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" +CONFIG_TPL_OF_PLATDATA=y +CONFIG_ENV_IS_IN_MMC=y +CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_SYS_MMC_ENV_DEV=1 +CONFIG_NET_RANDOM_ETHADDR=y +CONFIG_TPL_DM=y +CONFIG_REGMAP=y @@ -204,13 +216,14 @@ Signed-off-by: Tianling Shen +CONFIG_MMC_DW=y +CONFIG_MMC_DW_ROCKCHIP=y +CONFIG_SF_DEFAULT_SPEED=20000000 -+CONFIG_DM_ETH=y ++CONFIG_SPI_FLASH_GIGADEVICE=y +CONFIG_ETH_DESIGNWARE=y +CONFIG_GMAC_ROCKCHIP=y +CONFIG_PINCTRL=y +CONFIG_SPL_PINCTRL=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_RK8XX=y ++CONFIG_SPL_PMIC_RK8XX=y +CONFIG_SPL_DM_REGULATOR=y +CONFIG_REGULATOR_PWM=y +CONFIG_DM_REGULATOR_FIXED=y @@ -220,9 +233,11 @@ Signed-off-by: Tianling Shen +CONFIG_RAM=y +CONFIG_SPL_RAM=y +CONFIG_TPL_RAM=y -+CONFIG_DM_RESET=y +CONFIG_BAUDRATE=1500000 +CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_SYS_NS16550_MEM32=y ++CONFIG_ROCKCHIP_SPI=y ++CONFIG_SYSINFO=y +CONFIG_SYSRESET=y +# CONFIG_TPL_SYSRESET is not set +CONFIG_USB=y diff --git a/package/boot/uboot-rockchip/patches/102-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R2C.patch b/package/boot/uboot-rockchip/patches/102-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R2C.patch deleted file mode 100644 index bc450b0dd412e2..00000000000000 --- a/package/boot/uboot-rockchip/patches/102-rockchip-rk3328-Add-support-for-FriendlyARM-NanoPi-R2C.patch +++ /dev/null @@ -1,199 +0,0 @@ -From 7000a609473ffe14d32c656cdd0ff3ca0d3ecbd7 Mon Sep 17 00:00:00 2001 -From: Tianling Shen -Date: Tue, 11 Apr 2023 18:14:49 +0800 -Subject: [PATCH] rockchip: rk3328: Add support for FriendlyARM NanoPi R2C - -The NanoPi R2C is a minor variant of NanoPi R2S with the on-board NIC -chip changed from rtl8211e to yt8521s, and otherwise identical to R2S. - -The device tree is taken from the kernel linux-next branch: -https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=004589ff9df5b75672a78b6c3c4cba93202b14c9 - -Signed-off-by: Tianling Shen -Reviewed-by: Kever Yang ---- - arch/arm/dts/Makefile | 1 + - arch/arm/dts/rk3328-nanopi-r2c-u-boot.dtsi | 3 + - arch/arm/dts/rk3328-nanopi-r2c.dts | 40 ++++++++ - board/rockchip/evb_rk3328/MAINTAINERS | 6 ++ - configs/nanopi-r2c-rk3328_defconfig | 112 +++++++++++++++++++++ - 5 files changed, 162 insertions(+) - create mode 100644 arch/arm/dts/rk3328-nanopi-r2c-u-boot.dtsi - create mode 100644 arch/arm/dts/rk3328-nanopi-r2c.dts - create mode 100644 configs/nanopi-r2c-rk3328_defconfig - ---- a/arch/arm/dts/Makefile -+++ b/arch/arm/dts/Makefile -@@ -108,6 +108,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3308) += \ - - dtb-$(CONFIG_ROCKCHIP_RK3328) += \ - rk3328-evb.dtb \ -+ rk3328-nanopi-r2c.dtb \ - rk3328-nanopi-r2s.dtb \ - rk3328-roc-cc.dtb \ - rk3328-rock64.dtb \ ---- /dev/null -+++ b/arch/arm/dts/rk3328-nanopi-r2c-u-boot.dtsi -@@ -0,0 +1,3 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later -+ -+#include "rk3328-nanopi-r2s-u-boot.dtsi" ---- /dev/null -+++ b/arch/arm/dts/rk3328-nanopi-r2c.dts -@@ -0,0 +1,40 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT -+/* -+ * Copyright (c) 2021 FriendlyElec Computer Tech. Co., Ltd. -+ * (http://www.friendlyarm.com) -+ * -+ * Copyright (c) 2021-2023 Tianling Shen -+ */ -+ -+/dts-v1/; -+#include "rk3328-nanopi-r2s.dts" -+ -+/ { -+ model = "FriendlyElec NanoPi R2C"; -+ compatible = "friendlyarm,nanopi-r2c", "rockchip,rk3328"; -+}; -+ -+&gmac2io { -+ phy-handle = <&yt8521s>; -+ tx_delay = <0x22>; -+ rx_delay = <0x12>; -+ -+ mdio { -+ /delete-node/ ethernet-phy@1; -+ -+ yt8521s: ethernet-phy@3 { -+ compatible = "ethernet-phy-ieee802.3-c22"; -+ reg = <3>; -+ -+ motorcomm,clk-out-frequency-hz = <125000000>; -+ motorcomm,keep-pll-enabled; -+ motorcomm,auto-sleep-disabled; -+ -+ pinctrl-0 = <ð_phy_reset_pin>; -+ pinctrl-names = "default"; -+ reset-assert-us = <10000>; -+ reset-deassert-us = <50000>; -+ reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+}; ---- a/board/rockchip/evb_rk3328/MAINTAINERS -+++ b/board/rockchip/evb_rk3328/MAINTAINERS -@@ -5,6 +5,12 @@ F: board/rockchip/evb_rk3328 - F: include/configs/evb_rk3328.h - F: configs/evb-rk3328_defconfig - -+NANOPI-R2C-RK3328 -+M: Tianling Shen -+S: Maintained -+F: configs/nanopi-r2c-rk3328_defconfig -+F: arch/arm/dts/rk3328-nanopi-r2c-u-boot.dtsi -+ - NANOPI-R2S-RK3328 - M: David Bauer - S: Maintained ---- /dev/null -+++ b/configs/nanopi-r2c-rk3328_defconfig -@@ -0,0 +1,98 @@ -+CONFIG_ARM=y -+CONFIG_ARCH_ROCKCHIP=y -+CONFIG_SYS_TEXT_BASE=0x00200000 -+CONFIG_SPL_GPIO_SUPPORT=y -+CONFIG_NR_DRAM_BANKS=1 -+CONFIG_ENV_OFFSET=0x3F8000 -+CONFIG_DEFAULT_DEVICE_TREE="rk3328-nanopi-r2c" -+CONFIG_ROCKCHIP_RK3328=y -+CONFIG_TPL_ROCKCHIP_COMMON_BOARD=y -+CONFIG_TPL_LIBCOMMON_SUPPORT=y -+CONFIG_TPL_LIBGENERIC_SUPPORT=y -+CONFIG_SPL_DRIVERS_MISC_SUPPORT=y -+CONFIG_SPL_STACK_R_ADDR=0x600000 -+CONFIG_DEBUG_UART_BASE=0xFF130000 -+CONFIG_DEBUG_UART_CLOCK=24000000 -+CONFIG_DEBUG_UART=y -+CONFIG_TPL_SYS_MALLOC_F_LEN=0x800 -+# CONFIG_ANDROID_BOOT_IMAGE is not set -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_SPL_LOAD_FIT=y -+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-nanopi-r2c.dtb" -+# CONFIG_DISPLAY_CPUINFO is not set -+CONFIG_DISPLAY_BOARDINFO_LATE=y -+CONFIG_MISC_INIT_R=y -+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set -+CONFIG_TPL_SYS_MALLOC_SIMPLE=y -+CONFIG_SPL_STACK_R=y -+CONFIG_SPL_I2C_SUPPORT=y -+CONFIG_SPL_POWER_SUPPORT=y -+CONFIG_SPL_ATF=y -+CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y -+CONFIG_CMD_BOOTZ=y -+CONFIG_CMD_GPT=y -+CONFIG_CMD_MMC=y -+CONFIG_CMD_USB=y -+# CONFIG_CMD_SETEXPR is not set -+CONFIG_CMD_TIME=y -+CONFIG_SPL_OF_CONTROL=y -+CONFIG_TPL_OF_CONTROL=y -+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" -+CONFIG_TPL_OF_PLATDATA=y -+CONFIG_ENV_IS_IN_MMC=y -+CONFIG_SYS_RELOC_GD_ENV_ADDR=y -+CONFIG_NET_RANDOM_ETHADDR=y -+CONFIG_TPL_DM=y -+CONFIG_REGMAP=y -+CONFIG_SPL_REGMAP=y -+CONFIG_TPL_REGMAP=y -+CONFIG_SYSCON=y -+CONFIG_SPL_SYSCON=y -+CONFIG_TPL_SYSCON=y -+CONFIG_CLK=y -+CONFIG_SPL_CLK=y -+CONFIG_FASTBOOT_BUF_ADDR=0x800800 -+CONFIG_FASTBOOT_CMD_OEM_FORMAT=y -+CONFIG_ROCKCHIP_GPIO=y -+CONFIG_SYS_I2C_ROCKCHIP=y -+CONFIG_MMC_DW=y -+CONFIG_MMC_DW_ROCKCHIP=y -+CONFIG_SF_DEFAULT_SPEED=20000000 -+CONFIG_DM_ETH=y -+CONFIG_ETH_DESIGNWARE=y -+CONFIG_GMAC_ROCKCHIP=y -+CONFIG_PINCTRL=y -+CONFIG_SPL_PINCTRL=y -+CONFIG_DM_PMIC=y -+CONFIG_PMIC_RK8XX=y -+CONFIG_SPL_DM_REGULATOR=y -+CONFIG_REGULATOR_PWM=y -+CONFIG_DM_REGULATOR_FIXED=y -+CONFIG_SPL_DM_REGULATOR_FIXED=y -+CONFIG_REGULATOR_RK8XX=y -+CONFIG_PWM_ROCKCHIP=y -+CONFIG_RAM=y -+CONFIG_SPL_RAM=y -+CONFIG_TPL_RAM=y -+CONFIG_DM_RESET=y -+CONFIG_BAUDRATE=1500000 -+CONFIG_DEBUG_UART_SHIFT=2 -+CONFIG_SYSINFO=y -+CONFIG_SYSRESET=y -+# CONFIG_TPL_SYSRESET is not set -+CONFIG_USB=y -+CONFIG_USB_XHCI_HCD=y -+CONFIG_USB_XHCI_DWC3=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_USB_EHCI_GENERIC=y -+CONFIG_USB_OHCI_HCD=y -+CONFIG_USB_OHCI_GENERIC=y -+CONFIG_USB_DWC2=y -+CONFIG_USB_DWC3=y -+# CONFIG_USB_DWC3_GADGET is not set -+CONFIG_USB_GADGET=y -+CONFIG_USB_GADGET_DWC2_OTG=y -+CONFIG_SPL_TINY_MEMSET=y -+CONFIG_TPL_TINY_MEMSET=y -+CONFIG_ERRNO_STR=y diff --git a/package/boot/uboot-rockchip/patches/103-rockchip-rk3568-Add-support-for-FriendlyARM-NanoPi-R.patch b/package/boot/uboot-rockchip/patches/103-rockchip-rk3568-Add-support-for-FriendlyARM-NanoPi-R.patch new file mode 100644 index 00000000000000..09cafb3227d28f --- /dev/null +++ b/package/boot/uboot-rockchip/patches/103-rockchip-rk3568-Add-support-for-FriendlyARM-NanoPi-R.patch @@ -0,0 +1,917 @@ +From c84214aab0e4c5b2f619dd89655f27b3ae40e82b Mon Sep 17 00:00:00 2001 +From: Tianling Shen +Date: Tue, 30 May 2023 15:00:33 +0800 +Subject: [PATCH] rockchip: rk3568: Add support for FriendlyARM NanoPi R5S + +FriendlyARM NanoPi R5S is an open-sourced mini IoT gateway device. + +Board Specifications +- Rockchip RK3568 +- 2 or 4GB LPDDR4X +- 8GB or 16GB eMMC, SD card slot +- GbE LAN (Native) +- 2x 2.5G LAN (PCIe) +- M.2 Connector +- HDMI 2.0, MIPI DSI/CSI +- 2xUSB 3.0 Host +- USB Type C PD, 5V/9V/12V +- GPIO: 12-pin 0.5mm FPC connector + +The device tree is taken from kernel v6.4-rc1. + +Reviewed-by: Kever Yang +Signed-off-by: Tianling Shen +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/rk3568-nanopi-r5s-u-boot.dtsi | 31 ++ + arch/arm/dts/rk3568-nanopi-r5s.dts | 136 +++++ + arch/arm/dts/rk3568-nanopi-r5s.dtsi | 590 +++++++++++++++++++++ + board/rockchip/evb_rk3568/MAINTAINERS | 8 + + configs/nanopi-r5s-rk3568_defconfig | 85 +++ + 6 files changed, 851 insertions(+) + create mode 100644 arch/arm/dts/rk3568-nanopi-r5s-u-boot.dtsi + create mode 100644 arch/arm/dts/rk3568-nanopi-r5s.dts + create mode 100644 arch/arm/dts/rk3568-nanopi-r5s.dtsi + create mode 100644 configs/nanopi-r5s-rk3568_defconfig + +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -171,6 +171,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3568) += \ + rk3566-anbernic-rgxx3.dtb \ + rk3566-radxa-cm3-io.dtb \ + rk3568-evb.dtb \ ++ rk3568-nanopi-r5s.dtb \ + rk3568-rock-3a.dtb + + dtb-$(CONFIG_ROCKCHIP_RK3588) += \ +--- /dev/null ++++ b/arch/arm/dts/rk3568-nanopi-r5s-u-boot.dtsi +@@ -0,0 +1,31 @@ ++// 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 Tianling Shen ++ */ ++ ++#include "rk356x-u-boot.dtsi" ++ ++/ { ++ chosen { ++ stdout-path = &uart2; ++ u-boot,spl-boot-order = "same-as-spl", &sdmmc0, &sdhci; ++ }; ++}; ++ ++&sdhci { ++ cap-mmc-highspeed; ++ mmc-ddr-1_8v; ++ mmc-hs200-1_8v; ++ mmc-hs400-1_8v; ++ mmc-hs400-enhanced-strobe; ++ pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>; ++}; ++ ++&uart2 { ++ clock-frequency = <24000000>; ++ bootph-all; ++ status = "okay"; ++}; +--- /dev/null ++++ b/arch/arm/dts/rk3568-nanopi-r5s.dts +@@ -0,0 +1,136 @@ ++// 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 Tianling Shen ++ */ ++ ++/dts-v1/; ++#include "rk3568-nanopi-r5s.dtsi" ++ ++/ { ++ model = "FriendlyElec NanoPi R5S"; ++ compatible = "friendlyarm,nanopi-r5s", "rockchip,rk3568"; ++ ++ aliases { ++ ethernet0 = &gmac0; ++ }; ++ ++ gpio-leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&lan1_led_pin>, <&lan2_led_pin>, <&power_led_pin>, <&wan_led_pin>; ++ ++ led-lan1 { ++ color = ; ++ function = LED_FUNCTION_LAN; ++ function-enumerator = <1>; ++ gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led-lan2 { ++ color = ; ++ function = LED_FUNCTION_LAN; ++ function-enumerator = <2>; ++ gpios = <&gpio3 RK_PD7 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ power_led: led-power { ++ color = ; ++ function = LED_FUNCTION_POWER; ++ linux,default-trigger = "heartbeat"; ++ gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led-wan { ++ color = ; ++ function = LED_FUNCTION_WAN; ++ gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++}; ++ ++&gmac0 { ++ assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>; ++ assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>; ++ assigned-clock-rates = <0>, <125000000>; ++ clock_in_out = "output"; ++ phy-handle = <&rgmii_phy0>; ++ phy-mode = "rgmii"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&gmac0_miim ++ &gmac0_tx_bus2 ++ &gmac0_rx_bus2 ++ &gmac0_rgmii_clk ++ &gmac0_rgmii_bus>; ++ snps,reset-gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_LOW>; ++ snps,reset-active-low; ++ /* Reset time is 15ms, 50ms for rtl8211f */ ++ snps,reset-delays-us = <0 15000 50000>; ++ tx_delay = <0x3c>; ++ rx_delay = <0x2f>; ++ status = "okay"; ++}; ++ ++&mdio0 { ++ rgmii_phy0: ethernet-phy@1 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <1>; ++ pinctrl-0 = <ð_phy0_reset_pin>; ++ pinctrl-names = "default"; ++ }; ++}; ++ ++&pcie2x1 { ++ num-lanes = <1>; ++ reset-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++}; ++ ++&pcie30phy { ++ data-lanes = <1 2>; ++ status = "okay"; ++}; ++ ++&pcie3x1 { ++ num-lanes = <1>; ++ reset-gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; ++ vpcie3v3-supply = <&vcc3v3_pcie>; ++ status = "okay"; ++}; ++ ++&pcie3x2 { ++ num-lanes = <1>; ++ num-ib-windows = <8>; ++ num-ob-windows = <8>; ++ reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>; ++ vpcie3v3-supply = <&vcc3v3_pcie>; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ gmac0 { ++ eth_phy0_reset_pin: eth-phy0-reset-pin { ++ rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ gpio-leds { ++ lan1_led_pin: lan1-led-pin { ++ rockchip,pins = <3 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ lan2_led_pin: lan2-led-pin { ++ rockchip,pins = <3 RK_PD7 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ power_led_pin: power-led-pin { ++ rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ wan_led_pin: wan-led-pin { ++ rockchip,pins = <2 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++}; +--- /dev/null ++++ b/arch/arm/dts/rk3568-nanopi-r5s.dtsi +@@ -0,0 +1,590 @@ ++// 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 Tianling Shen ++ */ ++ ++/dts-v1/; ++#include ++#include ++#include ++#include ++#include ++#include "rk3568.dtsi" ++ ++/ { ++ aliases { ++ mmc0 = &sdmmc0; ++ mmc1 = &sdhci; ++ }; ++ ++ chosen: chosen { ++ stdout-path = "serial2:1500000n8"; ++ }; ++ ++ hdmi-con { ++ compatible = "hdmi-connector"; ++ type = "a"; ++ ++ port { ++ hdmi_con_in: endpoint { ++ remote-endpoint = <&hdmi_out_con>; ++ }; ++ }; ++ }; ++ ++ vdd_usbc: vdd-usbc-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vdd_usbc"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ }; ++ ++ vcc3v3_sys: vcc3v3-sys-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_sys"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&vdd_usbc>; ++ }; ++ ++ 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 = <&vdd_usbc>; ++ }; ++ ++ vcc3v3_pcie: vcc3v3-pcie-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_pcie"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ enable-active-high; ++ gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; ++ startup-delay-us = <200000>; ++ vin-supply = <&vcc5v0_sys>; ++ }; ++ ++ 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 = <&vdd_usbc>; ++ }; ++ ++ vcc5v0_usb_host: vcc5v0-usb-host-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v0_usb_host_en>; ++ regulator-name = "vcc5v0_usb_host"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&vcc5v0_usb>; ++ }; ++ ++ vcc5v0_usb_otg: vcc5v0-usb-otg-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v0_usb_otg_en>; ++ regulator-name = "vcc5v0_usb_otg"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&vcc5v0_usb>; ++ }; ++ ++ pcie30_avdd0v9: pcie30-avdd0v9-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "pcie30_avdd0v9"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ vin-supply = <&vcc3v3_sys>; ++ }; ++ ++ pcie30_avdd1v8: pcie30-avdd1v8-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "pcie30_avdd1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vin-supply = <&vcc3v3_sys>; ++ }; ++}; ++ ++&combphy0 { ++ status = "okay"; ++}; ++ ++&combphy1 { ++ status = "okay"; ++}; ++ ++&combphy2 { ++ status = "okay"; ++}; ++ ++&cpu0 { ++ cpu-supply = <&vdd_cpu>; ++}; ++ ++&cpu1 { ++ cpu-supply = <&vdd_cpu>; ++}; ++ ++&cpu2 { ++ cpu-supply = <&vdd_cpu>; ++}; ++ ++&cpu3 { ++ cpu-supply = <&vdd_cpu>; ++}; ++ ++&gpu { ++ mali-supply = <&vdd_gpu>; ++ status = "okay"; ++}; ++ ++&hdmi { ++ avdd-0v9-supply = <&vdda0v9_image>; ++ avdd-1v8-supply = <&vcca1v8_image>; ++ status = "okay"; ++}; ++ ++&hdmi_in { ++ hdmi_in_vp0: endpoint { ++ remote-endpoint = <&vp0_out_hdmi>; ++ }; ++}; ++ ++&hdmi_out { ++ hdmi_out_con: endpoint { ++ remote-endpoint = <&hdmi_con_in>; ++ }; ++}; ++ ++&hdmi_sound { ++ status = "okay"; ++}; ++ ++&i2c0 { ++ status = "okay"; ++ ++ vdd_cpu: regulator@1c { ++ compatible = "tcs,tcs4525"; ++ reg = <0x1c>; ++ fcs,suspend-voltage-selector = <1>; ++ regulator-name = "vdd_cpu"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <800000>; ++ regulator-max-microvolt = <1150000>; ++ regulator-ramp-delay = <2300>; ++ vin-supply = <&vcc5v0_sys>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ rk809: pmic@20 { ++ compatible = "rockchip,rk809"; ++ reg = <0x20>; ++ interrupt-parent = <&gpio0>; ++ interrupts = ; ++ #clock-cells = <1>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pmic_int>; ++ rockchip,system-power-controller; ++ vcc1-supply = <&vcc3v3_sys>; ++ vcc2-supply = <&vcc3v3_sys>; ++ vcc3-supply = <&vcc3v3_sys>; ++ vcc4-supply = <&vcc3v3_sys>; ++ vcc5-supply = <&vcc3v3_sys>; ++ vcc6-supply = <&vcc3v3_sys>; ++ vcc7-supply = <&vcc3v3_sys>; ++ vcc8-supply = <&vcc3v3_sys>; ++ vcc9-supply = <&vcc3v3_sys>; ++ wakeup-source; ++ ++ regulators { ++ vdd_logic: DCDC_REG1 { ++ regulator-name = "vdd_logic"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-init-microvolt = <900000>; ++ regulator-initial-mode = <0x2>; ++ regulator-min-microvolt = <500000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_gpu: DCDC_REG2 { ++ regulator-name = "vdd_gpu"; ++ regulator-always-on; ++ regulator-init-microvolt = <900000>; ++ regulator-initial-mode = <0x2>; ++ regulator-min-microvolt = <500000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_ddr: DCDC_REG3 { ++ regulator-name = "vcc_ddr"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-initial-mode = <0x2>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vdd_npu: DCDC_REG4 { ++ regulator-name = "vdd_npu"; ++ regulator-init-microvolt = <900000>; ++ regulator-initial-mode = <0x2>; ++ regulator-min-microvolt = <500000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_1v8: DCDC_REG5 { ++ regulator-name = "vcc_1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdda0v9_image: LDO_REG1 { ++ regulator-name = "vdda0v9_image"; ++ regulator-min-microvolt = <950000>; ++ regulator-max-microvolt = <950000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdda_0v9: LDO_REG2 { ++ regulator-name = "vdda_0v9"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdda0v9_pmu: LDO_REG3 { ++ regulator-name = "vdda0v9_pmu"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <900000>; ++ }; ++ }; ++ ++ vccio_acodec: LDO_REG4 { ++ regulator-name = "vccio_acodec"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vccio_sd: LDO_REG5 { ++ regulator-name = "vccio_sd"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc3v3_pmu: LDO_REG6 { ++ regulator-name = "vcc3v3_pmu"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3300000>; ++ }; ++ }; ++ ++ vcca_1v8: LDO_REG7 { ++ regulator-name = "vcca_1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcca1v8_pmu: LDO_REG8 { ++ regulator-name = "vcca1v8_pmu"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ vcca1v8_image: LDO_REG9 { ++ regulator-name = "vcca1v8_image"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_3v3: SWITCH_REG1 { ++ regulator-name = "vcc_3v3"; ++ regulator-always-on; ++ regulator-boot-on; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc3v3_sd: SWITCH_REG2 { ++ regulator-name = "vcc3v3_sd"; ++ regulator-always-on; ++ regulator-boot-on; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ }; ++ ++ }; ++}; ++ ++&i2c5 { ++ status = "okay"; ++ ++ hym8563: rtc@51 { ++ compatible = "haoyu,hym8563"; ++ reg = <0x51>; ++ interrupt-parent = <&gpio0>; ++ interrupts = ; ++ #clock-cells = <0>; ++ clock-output-names = "rtcic_32kout"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hym8563_int>; ++ wakeup-source; ++ }; ++}; ++ ++&i2s0_8ch { ++ status = "okay"; ++}; ++ ++&pcie30phy { ++ data-lanes = <1 2>; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ hym8563 { ++ hym8563_int: hym8563-int { ++ rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ pmic { ++ pmic_int: pmic-int { ++ rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ usb { ++ vcc5v0_usb_host_en: vcc5v0-usb-host-en { ++ rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ vcc5v0_usb_otg_en: vcc5v0-usb-otg-en { ++ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++}; ++ ++&pmu_io_domains { ++ pmuio1-supply = <&vcc3v3_pmu>; ++ pmuio2-supply = <&vcc3v3_pmu>; ++ vccio1-supply = <&vccio_acodec>; ++ vccio3-supply = <&vccio_sd>; ++ vccio4-supply = <&vcc_1v8>; ++ vccio5-supply = <&vcc_3v3>; ++ vccio6-supply = <&vcc_1v8>; ++ vccio7-supply = <&vcc_3v3>; ++ status = "okay"; ++}; ++ ++&saradc { ++ vref-supply = <&vcca_1v8>; ++ status = "okay"; ++}; ++ ++&sdhci { ++ bus-width = <8>; ++ max-frequency = <200000000>; ++ non-removable; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd>; ++ status = "okay"; ++}; ++ ++&sdmmc0 { ++ max-frequency = <150000000>; ++ no-sdio; ++ no-mmc; ++ bus-width = <4>; ++ cap-mmc-highspeed; ++ cap-sd-highspeed; ++ disable-wp; ++ vmmc-supply = <&vcc3v3_sd>; ++ vqmmc-supply = <&vccio_sd>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; ++ status = "okay"; ++}; ++ ++&tsadc { ++ rockchip,hw-tshut-mode = <1>; ++ rockchip,hw-tshut-polarity = <0>; ++ status = "okay"; ++}; ++ ++&uart2 { ++ status = "okay"; ++}; ++ ++&usb_host0_ehci { ++ status = "okay"; ++}; ++ ++&usb_host0_ohci { ++ status = "okay"; ++}; ++ ++&usb_host0_xhci { ++ extcon = <&usb2phy0>; ++ dr_mode = "host"; ++ status = "okay"; ++}; ++ ++&usb_host1_ehci { ++ status = "okay"; ++}; ++ ++&usb_host1_ohci { ++ status = "okay"; ++}; ++ ++&usb_host1_xhci { ++ status = "okay"; ++}; ++ ++&usb2phy0 { ++ status = "okay"; ++}; ++ ++&usb2phy0_host { ++ phy-supply = <&vcc5v0_usb_host>; ++ status = "okay"; ++}; ++ ++&usb2phy0_otg { ++ status = "okay"; ++}; ++ ++&usb2phy1 { ++ status = "okay"; ++}; ++ ++&usb2phy1_host { ++ phy-supply = <&vcc5v0_usb_otg>; ++ status = "okay"; ++}; ++ ++&usb2phy1_otg { ++ status = "okay"; ++}; ++ ++&vop { ++ assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>; ++ assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>; ++ status = "okay"; ++}; ++ ++&vop_mmu { ++ status = "okay"; ++}; ++ ++&vp0 { ++ vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { ++ reg = ; ++ remote-endpoint = <&hdmi_in_vp0>; ++ }; ++}; +--- a/board/rockchip/evb_rk3568/MAINTAINERS ++++ b/board/rockchip/evb_rk3568/MAINTAINERS +@@ -7,6 +7,14 @@ F: configs/evb-rk3568_defconfig + F: arch/arm/dts/rk3568-evb-boot.dtsi + F: arch/arm/dts/rk3568-evb.dts + ++NANOPI-R5S ++M: Tianling Shen ++S: Maintained ++F: configs/nanopi-r5s-rk3568_defconfig ++F: arch/arm/dts/rk3568-nanopi-r5s.dts ++F: arch/arm/dts/rk3568-nanopi-r5s.dtsi ++F: arch/arm/dts/rk3568-nanopi-r5s-u-boot.dtsi ++ + RADXA-CM3 + M: Jagan Teki + S: Maintained +--- /dev/null ++++ b/configs/nanopi-r5s-rk3568_defconfig +@@ -0,0 +1,85 @@ ++CONFIG_ARM=y ++CONFIG_SKIP_LOWLEVEL_INIT=y ++CONFIG_COUNTER_FREQUENCY=24000000 ++CONFIG_ARCH_ROCKCHIP=y ++CONFIG_TEXT_BASE=0x00a00000 ++CONFIG_SPL_LIBCOMMON_SUPPORT=y ++CONFIG_SPL_LIBGENERIC_SUPPORT=y ++CONFIG_NR_DRAM_BANKS=2 ++CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y ++CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000 ++CONFIG_DEFAULT_DEVICE_TREE="rk3568-nanopi-r5s" ++CONFIG_ROCKCHIP_RK3568=y ++CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y ++CONFIG_SPL_SERIAL=y ++CONFIG_SPL_STACK_R_ADDR=0x600000 ++CONFIG_TARGET_EVB_RK3568=y ++CONFIG_SPL_STACK=0x400000 ++CONFIG_DEBUG_UART_BASE=0xFE660000 ++CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_SYS_LOAD_ADDR=0xc00800 ++CONFIG_DEBUG_UART=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_SPL_LOAD_FIT=y ++CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-nanopi-r5s.dtb" ++# CONFIG_DISPLAY_CPUINFO is not set ++CONFIG_DISPLAY_BOARDINFO_LATE=y ++CONFIG_SPL_MAX_SIZE=0x40000 ++CONFIG_SPL_PAD_TO=0x7f8000 ++CONFIG_SPL_HAS_BSS_LINKER_SECTION=y ++CONFIG_SPL_BSS_START_ADDR=0x4000000 ++CONFIG_SPL_BSS_MAX_SIZE=0x4000 ++# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set ++# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set ++CONFIG_SPL_STACK_R=y ++CONFIG_SPL_ATF=y ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_I2C=y ++CONFIG_CMD_MMC=y ++CONFIG_CMD_USB=y ++CONFIG_CMD_PMIC=y ++CONFIG_CMD_REGULATOR=y ++# CONFIG_SPL_DOS_PARTITION is not set ++CONFIG_SPL_OF_CONTROL=y ++CONFIG_OF_LIVE=y ++CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" ++CONFIG_SPL_DM_WARN=y ++CONFIG_SPL_REGMAP=y ++CONFIG_SPL_SYSCON=y ++CONFIG_SPL_CLK=y ++CONFIG_ROCKCHIP_GPIO=y ++CONFIG_SYS_I2C_ROCKCHIP=y ++CONFIG_MISC=y ++CONFIG_SUPPORT_EMMC_RPMB=y ++CONFIG_MMC_DW=y ++CONFIG_MMC_DW_ROCKCHIP=y ++CONFIG_MMC_SDHCI=y ++CONFIG_MMC_SDHCI_SDMA=y ++CONFIG_MMC_SDHCI_ROCKCHIP=y ++CONFIG_ETH_DESIGNWARE=y ++CONFIG_GMAC_ROCKCHIP=y ++CONFIG_PHY_ROCKCHIP_INNO_USB2=y ++CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y ++CONFIG_POWER_DOMAIN=y ++CONFIG_DM_PMIC=y ++CONFIG_PMIC_RK8XX=y ++CONFIG_SPL_DM_REGULATOR_FIXED=y ++CONFIG_REGULATOR_RK8XX=y ++CONFIG_PWM_ROCKCHIP=y ++CONFIG_SPL_RAM=y ++CONFIG_BAUDRATE=1500000 ++CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_SYS_NS16550_MEM32=y ++CONFIG_SYSRESET=y ++CONFIG_SYSRESET_PSCI=y ++CONFIG_USB=y ++CONFIG_USB_XHCI_HCD=y ++CONFIG_USB_XHCI_DWC3=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_EHCI_GENERIC=y ++CONFIG_USB_OHCI_HCD=y ++CONFIG_USB_OHCI_GENERIC=y ++CONFIG_USB_DWC3=y ++CONFIG_ERRNO_STR=y diff --git a/package/boot/uboot-rockchip/patches/104-rockchip-rk3568-Add-support-for-FriendlyARM-NanoPi-R.patch b/package/boot/uboot-rockchip/patches/104-rockchip-rk3568-Add-support-for-FriendlyARM-NanoPi-R.patch new file mode 100644 index 00000000000000..d1a5197e7d7d6f --- /dev/null +++ b/package/boot/uboot-rockchip/patches/104-rockchip-rk3568-Add-support-for-FriendlyARM-NanoPi-R.patch @@ -0,0 +1,269 @@ +From 41538742491c46100f570680c02fbdd0d2b6b880 Mon Sep 17 00:00:00 2001 +From: Tianling Shen +Date: Tue, 30 May 2023 15:00:33 +0800 +Subject: [PATCH] rockchip: rk3568: Add support for FriendlyARM NanoPi R5C + +FriendlyARM NanoPi R5C is an open-sourced mini IoT gateway device. + +Specification: +- Rockchip RK3568 +- 1/4GB LPDDR4X RAM +- 8/32GB eMMC +- SD card slot +- M.2 Connector +- 2x USB 3.0 Port +- 2x 2500 Base-T (PCIe, r8125) +- HDMI 2.0 +- MIPI DSI/CSI +- USB Type C 5V + +The device tree is taken from kernel v6.4-rc1. + +Reviewed-by: Kever Yang +Signed-off-by: Tianling Shen +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/rk3568-nanopi-r5c-u-boot.dtsi | 3 + + arch/arm/dts/rk3568-nanopi-r5c.dts | 112 +++++++++++++++++++++ + board/rockchip/evb_rk3568/MAINTAINERS | 7 ++ + configs/nanopi-r5c-rk3568_defconfig | 85 ++++++++++++++++ + 5 files changed, 208 insertions(+) + create mode 100644 arch/arm/dts/rk3568-nanopi-r5c-u-boot.dtsi + create mode 100644 arch/arm/dts/rk3568-nanopi-r5c.dts + create mode 100644 configs/nanopi-r5c-rk3568_defconfig + +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -171,6 +171,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3568) += \ + rk3566-anbernic-rgxx3.dtb \ + rk3566-radxa-cm3-io.dtb \ + rk3568-evb.dtb \ ++ rk3568-nanopi-r5c.dtb \ + rk3568-nanopi-r5s.dtb \ + rk3568-rock-3a.dtb + +--- /dev/null ++++ b/arch/arm/dts/rk3568-nanopi-r5c-u-boot.dtsi +@@ -0,0 +1,3 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++ ++#include "rk3568-nanopi-r5s-u-boot.dtsi" +--- /dev/null ++++ b/arch/arm/dts/rk3568-nanopi-r5c.dts +@@ -0,0 +1,112 @@ ++// 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 Tianling Shen ++ */ ++ ++/dts-v1/; ++#include "rk3568-nanopi-r5s.dtsi" ++ ++/ { ++ model = "FriendlyElec NanoPi R5C"; ++ compatible = "friendlyarm,nanopi-r5c", "rockchip,rk3568"; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&reset_button_pin>; ++ ++ button-reset { ++ debounce-interval = <50>; ++ gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_LOW>; ++ label = "reset"; ++ linux,code = ; ++ }; ++ }; ++ ++ gpio-leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&lan_led_pin>, <&power_led_pin>, <&wan_led_pin>, <&wlan_led_pin>; ++ ++ led-lan { ++ color = ; ++ function = LED_FUNCTION_LAN; ++ gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ power_led: led-power { ++ color = ; ++ function = LED_FUNCTION_POWER; ++ linux,default-trigger = "heartbeat"; ++ gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led-wan { ++ color = ; ++ function = LED_FUNCTION_WAN; ++ gpios = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led-wlan { ++ color = ; ++ function = LED_FUNCTION_WLAN; ++ gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++}; ++ ++&pcie2x1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pcie20_reset_pin>; ++ reset-gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++}; ++ ++&pcie3x1 { ++ num-lanes = <1>; ++ reset-gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; ++ vpcie3v3-supply = <&vcc3v3_pcie>; ++ status = "okay"; ++}; ++ ++&pcie3x2 { ++ num-lanes = <1>; ++ reset-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>; ++ vpcie3v3-supply = <&vcc3v3_pcie>; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ gpio-leds { ++ lan_led_pin: lan-led-pin { ++ rockchip,pins = <3 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ power_led_pin: power-led-pin { ++ rockchip,pins = <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ wan_led_pin: wan-led-pin { ++ rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ wlan_led_pin: wlan-led-pin { ++ rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ pcie { ++ pcie20_reset_pin: pcie20-reset-pin { ++ rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ rockchip-key { ++ reset_button_pin: reset-button-pin { ++ rockchip,pins = <4 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++}; +--- a/board/rockchip/evb_rk3568/MAINTAINERS ++++ b/board/rockchip/evb_rk3568/MAINTAINERS +@@ -7,6 +7,13 @@ F: configs/evb-rk3568_defconfig + F: arch/arm/dts/rk3568-evb-boot.dtsi + F: arch/arm/dts/rk3568-evb.dts + ++NANOPI-R5C ++M: Tianling Shen ++S: Maintained ++F: configs/nanopi-r5c-rk3568_defconfig ++F: arch/arm/dts/rk3568-nanopi-r5c.dts ++F: arch/arm/dts/rk3568-nanopi-r5c-u-boot.dtsi ++ + NANOPI-R5S + M: Tianling Shen + S: Maintained +--- /dev/null ++++ b/configs/nanopi-r5c-rk3568_defconfig +@@ -0,0 +1,85 @@ ++CONFIG_ARM=y ++CONFIG_SKIP_LOWLEVEL_INIT=y ++CONFIG_COUNTER_FREQUENCY=24000000 ++CONFIG_ARCH_ROCKCHIP=y ++CONFIG_TEXT_BASE=0x00a00000 ++CONFIG_SPL_LIBCOMMON_SUPPORT=y ++CONFIG_SPL_LIBGENERIC_SUPPORT=y ++CONFIG_NR_DRAM_BANKS=2 ++CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y ++CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000 ++CONFIG_DEFAULT_DEVICE_TREE="rk3568-nanopi-r5c" ++CONFIG_ROCKCHIP_RK3568=y ++CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y ++CONFIG_SPL_SERIAL=y ++CONFIG_SPL_STACK_R_ADDR=0x600000 ++CONFIG_TARGET_EVB_RK3568=y ++CONFIG_SPL_STACK=0x400000 ++CONFIG_DEBUG_UART_BASE=0xFE660000 ++CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_SYS_LOAD_ADDR=0xc00800 ++CONFIG_DEBUG_UART=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_SPL_LOAD_FIT=y ++CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-nanopi-r5c.dtb" ++# CONFIG_DISPLAY_CPUINFO is not set ++CONFIG_DISPLAY_BOARDINFO_LATE=y ++CONFIG_SPL_MAX_SIZE=0x40000 ++CONFIG_SPL_PAD_TO=0x7f8000 ++CONFIG_SPL_HAS_BSS_LINKER_SECTION=y ++CONFIG_SPL_BSS_START_ADDR=0x4000000 ++CONFIG_SPL_BSS_MAX_SIZE=0x4000 ++# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set ++# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set ++CONFIG_SPL_STACK_R=y ++CONFIG_SPL_ATF=y ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_I2C=y ++CONFIG_CMD_MMC=y ++CONFIG_CMD_USB=y ++CONFIG_CMD_PMIC=y ++CONFIG_CMD_REGULATOR=y ++# CONFIG_SPL_DOS_PARTITION is not set ++CONFIG_SPL_OF_CONTROL=y ++CONFIG_OF_LIVE=y ++CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" ++CONFIG_SPL_DM_WARN=y ++CONFIG_SPL_REGMAP=y ++CONFIG_SPL_SYSCON=y ++CONFIG_SPL_CLK=y ++CONFIG_ROCKCHIP_GPIO=y ++CONFIG_SYS_I2C_ROCKCHIP=y ++CONFIG_MISC=y ++CONFIG_SUPPORT_EMMC_RPMB=y ++CONFIG_MMC_DW=y ++CONFIG_MMC_DW_ROCKCHIP=y ++CONFIG_MMC_SDHCI=y ++CONFIG_MMC_SDHCI_SDMA=y ++CONFIG_MMC_SDHCI_ROCKCHIP=y ++CONFIG_ETH_DESIGNWARE=y ++CONFIG_GMAC_ROCKCHIP=y ++CONFIG_PHY_ROCKCHIP_INNO_USB2=y ++CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y ++CONFIG_POWER_DOMAIN=y ++CONFIG_DM_PMIC=y ++CONFIG_PMIC_RK8XX=y ++CONFIG_SPL_DM_REGULATOR_FIXED=y ++CONFIG_REGULATOR_RK8XX=y ++CONFIG_PWM_ROCKCHIP=y ++CONFIG_SPL_RAM=y ++CONFIG_BAUDRATE=1500000 ++CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_SYS_NS16550_MEM32=y ++CONFIG_SYSRESET=y ++CONFIG_SYSRESET_PSCI=y ++CONFIG_USB=y ++CONFIG_USB_XHCI_HCD=y ++CONFIG_USB_XHCI_DWC3=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_EHCI_GENERIC=y ++CONFIG_USB_OHCI_HCD=y ++CONFIG_USB_OHCI_GENERIC=y ++CONFIG_USB_DWC3=y ++CONFIG_ERRNO_STR=y diff --git a/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-decl.h b/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-decl.h deleted file mode 100644 index 0919e4ed5374f3..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-decl.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares externs for all device/uclass instances. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include - -/* driver declarations - these allow DM_DRIVER_GET() to be used */ -extern U_BOOT_DRIVER(rockchip_rk3328_cru); -extern U_BOOT_DRIVER(rockchip_rk3328_dmc); -extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); -extern U_BOOT_DRIVER(ns16550_serial); -extern U_BOOT_DRIVER(rockchip_rk3328_grf); - -/* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */ -extern UCLASS_DRIVER(clk); -extern UCLASS_DRIVER(mmc); -extern UCLASS_DRIVER(ram); -extern UCLASS_DRIVER(serial); -extern UCLASS_DRIVER(syscon); diff --git a/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-plat.c b/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-plat.c deleted file mode 100644 index e5b330c9d9756b..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-plat.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares the U_BOOT_DRIVER() records and platform data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -/* Allow use of U_BOOT_DRVINFO() in this file */ -#define DT_PLAT_C - -#include -#include -#include - -/* - * driver_info declarations, ordered by 'struct driver_info' linker_list idx: - * - * idx driver_info driver - * --- -------------------- -------------------- - * 0: clock_controller_at_ff440000 rockchip_rk3328_cru - * 1: dmc rockchip_rk3328_dmc - * 2: mmc_at_ff500000 rockchip_rk3288_dw_mshc - * 3: serial_at_ff130000 ns16550_serial - * 4: syscon_at_ff100000 rockchip_rk3328_grf - * --- -------------------- -------------------- - */ - -/* - * Node /clock-controller@ff440000 index 0 - * driver rockchip_rk3328_cru parent None - */ -static struct dtd_rockchip_rk3328_cru dtv_clock_controller_at_ff440000 = { - .reg = {0xff440000, 0x1000}, - .rockchip_grf = 0x3a, -}; -U_BOOT_DRVINFO(clock_controller_at_ff440000) = { - .name = "rockchip_rk3328_cru", - .plat = &dtv_clock_controller_at_ff440000, - .plat_size = sizeof(dtv_clock_controller_at_ff440000), - .parent_idx = -1, -}; - -/* - * Node /dmc index 1 - * driver rockchip_rk3328_dmc parent None - */ -static struct dtd_rockchip_rk3328_dmc dtv_dmc = { - .reg = {0xff400000, 0x1000, 0xff780000, 0x3000, 0xff100000, 0x1000, 0xff440000, 0x1000, - 0xff720000, 0x1000, 0xff798000, 0x1000}, - .rockchip_sdram_params = {0x1, 0xa, 0x2, 0x1, 0x0, 0x0, 0x11, 0x0, - 0x11, 0x0, 0x0, 0x94291288, 0x0, 0x27, 0x462, 0x15, - 0x242, 0xff, 0x14d, 0x0, 0x1, 0x0, 0x0, 0x0, - 0x43049010, 0x64, 0x28003b, 0xd0, 0x20053, 0xd4, 0x220000, 0xd8, - 0x100, 0xdc, 0x40000, 0xe0, 0x0, 0xe4, 0x110000, 0xe8, - 0x420, 0xec, 0x400, 0xf4, 0xf011f, 0x100, 0x9060b06, 0x104, - 0x20209, 0x108, 0x505040a, 0x10c, 0x40400c, 0x110, 0x5030206, 0x114, - 0x3030202, 0x120, 0x3030b03, 0x124, 0x20208, 0x180, 0x1000040, 0x184, - 0x0, 0x190, 0x7030003, 0x198, 0x5001100, 0x1a0, 0xc0400003, 0x240, - 0x6000604, 0x244, 0x201, 0x250, 0xf00, 0x490, 0x1, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0x4, 0xc, 0x28, 0xa, 0x2c, - 0x0, 0x30, 0x9, 0xffffffff, 0xffffffff, 0x77, 0x88, 0x79, - 0x79, 0x87, 0x97, 0x87, 0x78, 0x77, 0x78, 0x87, - 0x88, 0x87, 0x87, 0x77, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x79, 0x9, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, - 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x79, 0x9, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x79, 0x9, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, - 0x9, 0x77, 0x78, 0x77, 0x77, 0x77, 0x77, 0x77, - 0x77, 0x77, 0x79, 0x9}, -}; -U_BOOT_DRVINFO(dmc) = { - .name = "rockchip_rk3328_dmc", - .plat = &dtv_dmc, - .plat_size = sizeof(dtv_dmc), - .parent_idx = -1, -}; - -/* - * Node /mmc@ff500000 index 2 - * driver rockchip_rk3288_dw_mshc parent None - */ -static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff500000 = { - .bus_width = 0x4, - .cap_sd_highspeed = true, - .clocks = { - {0, {317}}, - {0, {33}}, - {0, {74}}, - {0, {78}},}, - .disable_wp = true, - .fifo_depth = 0x100, - .interrupts = {0x0, 0xc, 0x4}, - .max_frequency = 0x8f0d180, - .pinctrl_0 = {0x47, 0x48, 0x49, 0x4a}, - .pinctrl_names = "default", - .reg = {0xff500000, 0x4000}, - .sd_uhs_sdr104 = true, - .sd_uhs_sdr12 = true, - .sd_uhs_sdr25 = true, - .sd_uhs_sdr50 = true, - .u_boot_spl_fifo_mode = true, - .vmmc_supply = 0x4b, - .vqmmc_supply = 0x1e, -}; -U_BOOT_DRVINFO(mmc_at_ff500000) = { - .name = "rockchip_rk3288_dw_mshc", - .plat = &dtv_mmc_at_ff500000, - .plat_size = sizeof(dtv_mmc_at_ff500000), - .parent_idx = -1, -}; - -/* - * Node /serial@ff130000 index 3 - * driver ns16550_serial parent None - */ -static struct dtd_ns16550_serial dtv_serial_at_ff130000 = { - .clock_frequency = 0x16e3600, - .clocks = { - {0, {40}}, - {0, {212}},}, - .dma_names = {"tx", "rx"}, - .dmas = {0x10, 0x6, 0x10, 0x7}, - .interrupts = {0x0, 0x39, 0x4}, - .pinctrl_0 = 0x26, - .pinctrl_names = "default", - .reg = {0xff130000, 0x100}, - .reg_io_width = 0x4, - .reg_shift = 0x2, -}; -U_BOOT_DRVINFO(serial_at_ff130000) = { - .name = "ns16550_serial", - .plat = &dtv_serial_at_ff130000, - .plat_size = sizeof(dtv_serial_at_ff130000), - .parent_idx = -1, -}; - -/* - * Node /syscon@ff100000 index 4 - * driver rockchip_rk3328_grf parent None - */ -static struct dtd_rockchip_rk3328_grf dtv_syscon_at_ff100000 = { - .reg = {0xff100000, 0x1000}, -}; -U_BOOT_DRVINFO(syscon_at_ff100000) = { - .name = "rockchip_rk3328_grf", - .plat = &dtv_syscon_at_ff100000, - .plat_size = sizeof(dtv_syscon_at_ff100000), - .parent_idx = -1, -}; - diff --git a/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-structs-gen.h b/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-structs-gen.h deleted file mode 100644 index b1ff08a9278d2f..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-structs-gen.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * DO NOT MODIFY - * - * Defines the structs used to hold devicetree data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include -struct dtd_ns16550_serial { - fdt32_t clock_frequency; - struct phandle_1_arg clocks[2]; - const char * dma_names[2]; - fdt32_t dmas[4]; - fdt32_t interrupts[3]; - fdt32_t pinctrl_0; - const char * pinctrl_names; - fdt64_t reg[2]; - fdt32_t reg_io_width; - fdt32_t reg_shift; -}; -struct dtd_rockchip_rk3288_dw_mshc { - fdt32_t bus_width; - bool cap_sd_highspeed; - struct phandle_1_arg clocks[4]; - bool disable_wp; - fdt32_t fifo_depth; - fdt32_t interrupts[3]; - fdt32_t max_frequency; - fdt32_t pinctrl_0[4]; - const char * pinctrl_names; - fdt64_t reg[2]; - bool sd_uhs_sdr104; - bool sd_uhs_sdr12; - bool sd_uhs_sdr25; - bool sd_uhs_sdr50; - bool u_boot_spl_fifo_mode; - fdt32_t vmmc_supply; - fdt32_t vqmmc_supply; -}; -struct dtd_rockchip_rk3328_cru { - fdt64_t reg[2]; - fdt32_t rockchip_grf; -}; -struct dtd_rockchip_rk3328_dmc { - fdt64_t reg[12]; - fdt32_t rockchip_sdram_params[196]; -}; -struct dtd_rockchip_rk3328_grf { - fdt64_t reg[2]; -}; diff --git a/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-decl.h b/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-decl.h deleted file mode 100644 index 0919e4ed5374f3..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-decl.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares externs for all device/uclass instances. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include - -/* driver declarations - these allow DM_DRIVER_GET() to be used */ -extern U_BOOT_DRIVER(rockchip_rk3328_cru); -extern U_BOOT_DRIVER(rockchip_rk3328_dmc); -extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); -extern U_BOOT_DRIVER(ns16550_serial); -extern U_BOOT_DRIVER(rockchip_rk3328_grf); - -/* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */ -extern UCLASS_DRIVER(clk); -extern UCLASS_DRIVER(mmc); -extern UCLASS_DRIVER(ram); -extern UCLASS_DRIVER(serial); -extern UCLASS_DRIVER(syscon); diff --git a/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-plat.c b/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-plat.c deleted file mode 100644 index e5b330c9d9756b..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-plat.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares the U_BOOT_DRIVER() records and platform data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -/* Allow use of U_BOOT_DRVINFO() in this file */ -#define DT_PLAT_C - -#include -#include -#include - -/* - * driver_info declarations, ordered by 'struct driver_info' linker_list idx: - * - * idx driver_info driver - * --- -------------------- -------------------- - * 0: clock_controller_at_ff440000 rockchip_rk3328_cru - * 1: dmc rockchip_rk3328_dmc - * 2: mmc_at_ff500000 rockchip_rk3288_dw_mshc - * 3: serial_at_ff130000 ns16550_serial - * 4: syscon_at_ff100000 rockchip_rk3328_grf - * --- -------------------- -------------------- - */ - -/* - * Node /clock-controller@ff440000 index 0 - * driver rockchip_rk3328_cru parent None - */ -static struct dtd_rockchip_rk3328_cru dtv_clock_controller_at_ff440000 = { - .reg = {0xff440000, 0x1000}, - .rockchip_grf = 0x3a, -}; -U_BOOT_DRVINFO(clock_controller_at_ff440000) = { - .name = "rockchip_rk3328_cru", - .plat = &dtv_clock_controller_at_ff440000, - .plat_size = sizeof(dtv_clock_controller_at_ff440000), - .parent_idx = -1, -}; - -/* - * Node /dmc index 1 - * driver rockchip_rk3328_dmc parent None - */ -static struct dtd_rockchip_rk3328_dmc dtv_dmc = { - .reg = {0xff400000, 0x1000, 0xff780000, 0x3000, 0xff100000, 0x1000, 0xff440000, 0x1000, - 0xff720000, 0x1000, 0xff798000, 0x1000}, - .rockchip_sdram_params = {0x1, 0xa, 0x2, 0x1, 0x0, 0x0, 0x11, 0x0, - 0x11, 0x0, 0x0, 0x94291288, 0x0, 0x27, 0x462, 0x15, - 0x242, 0xff, 0x14d, 0x0, 0x1, 0x0, 0x0, 0x0, - 0x43049010, 0x64, 0x28003b, 0xd0, 0x20053, 0xd4, 0x220000, 0xd8, - 0x100, 0xdc, 0x40000, 0xe0, 0x0, 0xe4, 0x110000, 0xe8, - 0x420, 0xec, 0x400, 0xf4, 0xf011f, 0x100, 0x9060b06, 0x104, - 0x20209, 0x108, 0x505040a, 0x10c, 0x40400c, 0x110, 0x5030206, 0x114, - 0x3030202, 0x120, 0x3030b03, 0x124, 0x20208, 0x180, 0x1000040, 0x184, - 0x0, 0x190, 0x7030003, 0x198, 0x5001100, 0x1a0, 0xc0400003, 0x240, - 0x6000604, 0x244, 0x201, 0x250, 0xf00, 0x490, 0x1, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0x4, 0xc, 0x28, 0xa, 0x2c, - 0x0, 0x30, 0x9, 0xffffffff, 0xffffffff, 0x77, 0x88, 0x79, - 0x79, 0x87, 0x97, 0x87, 0x78, 0x77, 0x78, 0x87, - 0x88, 0x87, 0x87, 0x77, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x79, 0x9, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, - 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x79, 0x9, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x79, 0x9, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, - 0x9, 0x77, 0x78, 0x77, 0x77, 0x77, 0x77, 0x77, - 0x77, 0x77, 0x79, 0x9}, -}; -U_BOOT_DRVINFO(dmc) = { - .name = "rockchip_rk3328_dmc", - .plat = &dtv_dmc, - .plat_size = sizeof(dtv_dmc), - .parent_idx = -1, -}; - -/* - * Node /mmc@ff500000 index 2 - * driver rockchip_rk3288_dw_mshc parent None - */ -static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff500000 = { - .bus_width = 0x4, - .cap_sd_highspeed = true, - .clocks = { - {0, {317}}, - {0, {33}}, - {0, {74}}, - {0, {78}},}, - .disable_wp = true, - .fifo_depth = 0x100, - .interrupts = {0x0, 0xc, 0x4}, - .max_frequency = 0x8f0d180, - .pinctrl_0 = {0x47, 0x48, 0x49, 0x4a}, - .pinctrl_names = "default", - .reg = {0xff500000, 0x4000}, - .sd_uhs_sdr104 = true, - .sd_uhs_sdr12 = true, - .sd_uhs_sdr25 = true, - .sd_uhs_sdr50 = true, - .u_boot_spl_fifo_mode = true, - .vmmc_supply = 0x4b, - .vqmmc_supply = 0x1e, -}; -U_BOOT_DRVINFO(mmc_at_ff500000) = { - .name = "rockchip_rk3288_dw_mshc", - .plat = &dtv_mmc_at_ff500000, - .plat_size = sizeof(dtv_mmc_at_ff500000), - .parent_idx = -1, -}; - -/* - * Node /serial@ff130000 index 3 - * driver ns16550_serial parent None - */ -static struct dtd_ns16550_serial dtv_serial_at_ff130000 = { - .clock_frequency = 0x16e3600, - .clocks = { - {0, {40}}, - {0, {212}},}, - .dma_names = {"tx", "rx"}, - .dmas = {0x10, 0x6, 0x10, 0x7}, - .interrupts = {0x0, 0x39, 0x4}, - .pinctrl_0 = 0x26, - .pinctrl_names = "default", - .reg = {0xff130000, 0x100}, - .reg_io_width = 0x4, - .reg_shift = 0x2, -}; -U_BOOT_DRVINFO(serial_at_ff130000) = { - .name = "ns16550_serial", - .plat = &dtv_serial_at_ff130000, - .plat_size = sizeof(dtv_serial_at_ff130000), - .parent_idx = -1, -}; - -/* - * Node /syscon@ff100000 index 4 - * driver rockchip_rk3328_grf parent None - */ -static struct dtd_rockchip_rk3328_grf dtv_syscon_at_ff100000 = { - .reg = {0xff100000, 0x1000}, -}; -U_BOOT_DRVINFO(syscon_at_ff100000) = { - .name = "rockchip_rk3328_grf", - .plat = &dtv_syscon_at_ff100000, - .plat_size = sizeof(dtv_syscon_at_ff100000), - .parent_idx = -1, -}; - diff --git a/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-structs-gen.h b/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-structs-gen.h deleted file mode 100644 index b1ff08a9278d2f..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2s-rk3328/dt-structs-gen.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * DO NOT MODIFY - * - * Defines the structs used to hold devicetree data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include -struct dtd_ns16550_serial { - fdt32_t clock_frequency; - struct phandle_1_arg clocks[2]; - const char * dma_names[2]; - fdt32_t dmas[4]; - fdt32_t interrupts[3]; - fdt32_t pinctrl_0; - const char * pinctrl_names; - fdt64_t reg[2]; - fdt32_t reg_io_width; - fdt32_t reg_shift; -}; -struct dtd_rockchip_rk3288_dw_mshc { - fdt32_t bus_width; - bool cap_sd_highspeed; - struct phandle_1_arg clocks[4]; - bool disable_wp; - fdt32_t fifo_depth; - fdt32_t interrupts[3]; - fdt32_t max_frequency; - fdt32_t pinctrl_0[4]; - const char * pinctrl_names; - fdt64_t reg[2]; - bool sd_uhs_sdr104; - bool sd_uhs_sdr12; - bool sd_uhs_sdr25; - bool sd_uhs_sdr50; - bool u_boot_spl_fifo_mode; - fdt32_t vmmc_supply; - fdt32_t vqmmc_supply; -}; -struct dtd_rockchip_rk3328_cru { - fdt64_t reg[2]; - fdt32_t rockchip_grf; -}; -struct dtd_rockchip_rk3328_dmc { - fdt64_t reg[12]; - fdt32_t rockchip_sdram_params[196]; -}; -struct dtd_rockchip_rk3328_grf { - fdt64_t reg[2]; -}; diff --git a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-lts-rk3328/dt-decl.h b/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-lts-rk3328/dt-decl.h deleted file mode 100644 index 75795aa6cc7af2..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-lts-rk3328/dt-decl.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares externs for all device/uclass instances. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include - -/* driver declarations - these allow DM_DRIVER_GET() to be used */ -extern U_BOOT_DRIVER(rockchip_rk3328_cru); -extern U_BOOT_DRIVER(rockchip_rk3328_dmc); -extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); -extern U_BOOT_DRIVER(ns16550_serial); -extern U_BOOT_DRIVER(rockchip_rk3328_spi); -extern U_BOOT_DRIVER(rockchip_rk3328_grf); - -/* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */ -extern UCLASS_DRIVER(clk); -extern UCLASS_DRIVER(mmc); -extern UCLASS_DRIVER(ram); -extern UCLASS_DRIVER(serial); -extern UCLASS_DRIVER(syscon); diff --git a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-lts-rk3328/dt-plat.c b/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-lts-rk3328/dt-plat.c deleted file mode 100644 index 12081b19e021a0..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-lts-rk3328/dt-plat.c +++ /dev/null @@ -1,170 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares the U_BOOT_DRIVER() records and platform data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -/* Allow use of U_BOOT_DRVINFO() in this file */ -#define DT_PLAT_C - -#include -#include -#include - -/* - * driver_info declarations, ordered by 'struct driver_info' linker_list idx: - * - * idx driver_info driver - * --- -------------------- -------------------- - * 0: clock_controller_at_ff440000 rockchip_rk3328_cru - * 1: dmc rockchip_rk3328_dmc - * 2: mmc_at_ff500000 rockchip_rk3288_dw_mshc - * 3: serial_at_ff130000 ns16550_serial - * 4: spi_at_ff190000 rockchip_rk3328_spi - * 5: syscon_at_ff100000 rockchip_rk3328_grf - * --- -------------------- -------------------- - */ - -/* - * Node /clock-controller@ff440000 index 0 - * driver rockchip_rk3328_cru parent None - */ -static struct dtd_rockchip_rk3328_cru dtv_clock_controller_at_ff440000 = { - .reg = {0xff440000, 0x1000}, - .rockchip_grf = 0x38, -}; -U_BOOT_DRVINFO(clock_controller_at_ff440000) = { - .name = "rockchip_rk3328_cru", - .plat = &dtv_clock_controller_at_ff440000, - .plat_size = sizeof(dtv_clock_controller_at_ff440000), - .parent_idx = -1, -}; - -/* - * Node /dmc index 1 - * driver rockchip_rk3328_dmc parent None - */ -static struct dtd_rockchip_rk3328_dmc dtv_dmc = { - .reg = {0xff400000, 0x1000, 0xff780000, 0x3000, 0xff100000, 0x1000, 0xff440000, 0x1000, - 0xff720000, 0x1000, 0xff798000, 0x1000}, - .rockchip_sdram_params = {0x1, 0xc, 0x3, 0x1, 0x0, 0x0, 0x10, 0x10, - 0x10, 0x10, 0x0, 0x8c48a18a, 0x0, 0x21, 0x482, 0x15, - 0x21a, 0xff, 0x14d, 0x6, 0x1, 0x0, 0x0, 0x0, - 0x43041008, 0x64, 0x140023, 0xd0, 0x220002, 0xd4, 0x10000, 0xd8, - 0x703, 0xdc, 0x830004, 0xe0, 0x10000, 0xe4, 0x70003, 0xf4, - 0xf011f, 0x100, 0x6090b07, 0x104, 0x2020b, 0x108, 0x2030506, 0x10c, - 0x505000, 0x110, 0x3020204, 0x114, 0x1010303, 0x118, 0x2020003, 0x120, - 0x303, 0x138, 0x25, 0x180, 0x3c000f, 0x184, 0x900000, 0x190, - 0x7020000, 0x198, 0x5001100, 0x1a0, 0xc0400003, 0x240, 0x900090c, 0x244, - 0x101, 0x250, 0xf00, 0x490, 0x1, 0xffffffff, 0xffffffff, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0x4, 0xb, 0x28, 0x6, 0x2c, - 0x0, 0x30, 0x3, 0xffffffff, 0xffffffff, 0x77, 0x88, 0x79, - 0x79, 0x87, 0x97, 0x87, 0x78, 0x77, 0x78, 0x87, - 0x88, 0x87, 0x87, 0x77, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x79, 0x9, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, - 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x79, 0x9, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x79, 0x9, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, - 0x9, 0x77, 0x78, 0x77, 0x77, 0x77, 0x77, 0x77, - 0x77, 0x77, 0x79, 0x9}, -}; -U_BOOT_DRVINFO(dmc) = { - .name = "rockchip_rk3328_dmc", - .plat = &dtv_dmc, - .plat_size = sizeof(dtv_dmc), - .parent_idx = -1, -}; - -/* - * Node /mmc@ff500000 index 2 - * driver rockchip_rk3288_dw_mshc parent None - */ -static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff500000 = { - .bus_width = 0x4, - .cap_sd_highspeed = true, - .clocks = { - {0, {317}}, - {0, {33}}, - {0, {74}}, - {0, {78}},}, - .disable_wp = true, - .fifo_depth = 0x100, - .interrupts = {0x0, 0xc, 0x4}, - .max_frequency = 0x8f0d180, - .pinctrl_0 = {0x45, 0x46, 0x47, 0x48}, - .pinctrl_names = "default", - .reg = {0xff500000, 0x4000}, - .u_boot_spl_fifo_mode = true, - .vmmc_supply = 0x49, -}; -U_BOOT_DRVINFO(mmc_at_ff500000) = { - .name = "rockchip_rk3288_dw_mshc", - .plat = &dtv_mmc_at_ff500000, - .plat_size = sizeof(dtv_mmc_at_ff500000), - .parent_idx = -1, -}; - -/* - * Node /serial@ff130000 index 3 - * driver ns16550_serial parent None - */ -static struct dtd_ns16550_serial dtv_serial_at_ff130000 = { - .clock_frequency = 0x16e3600, - .clocks = { - {0, {40}}, - {0, {212}},}, - .dma_names = {"tx", "rx"}, - .dmas = {0x10, 0x6, 0x10, 0x7}, - .interrupts = {0x0, 0x39, 0x4}, - .pinctrl_0 = 0x24, - .pinctrl_names = "default", - .reg = {0xff130000, 0x100}, - .reg_io_width = 0x4, - .reg_shift = 0x2, -}; -U_BOOT_DRVINFO(serial_at_ff130000) = { - .name = "ns16550_serial", - .plat = &dtv_serial_at_ff130000, - .plat_size = sizeof(dtv_serial_at_ff130000), - .parent_idx = -1, -}; - -/* Node /spi@ff190000 index 4 */ -static struct dtd_rockchip_rk3328_spi dtv_spi_at_ff190000 = { - .clocks = { - {0, {32}}, - {0, {209}},}, - .dma_names = {"tx", "rx"}, - .dmas = {0x10, 0x8, 0x10, 0x9}, - .interrupts = {0x0, 0x31, 0x4}, - .pinctrl_0 = {0x2c, 0x2d, 0x2e, 0x2f}, - .pinctrl_names = "default", - .reg = {0xff190000, 0x1000}, -}; -U_BOOT_DRVINFO(spi_at_ff190000) = { - .name = "rockchip_rk3328_spi", - .plat = &dtv_spi_at_ff190000, - .plat_size = sizeof(dtv_spi_at_ff190000), - .parent_idx = -1, -}; - -/* - * Node /syscon@ff100000 index 5 - * driver rockchip_rk3328_grf parent None - */ -static struct dtd_rockchip_rk3328_grf dtv_syscon_at_ff100000 = { - .reg = {0xff100000, 0x1000}, -}; -U_BOOT_DRVINFO(syscon_at_ff100000) = { - .name = "rockchip_rk3328_grf", - .plat = &dtv_syscon_at_ff100000, - .plat_size = sizeof(dtv_syscon_at_ff100000), - .parent_idx = -1, -}; - diff --git a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-lts-rk3328/dt-structs-gen.h b/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-lts-rk3328/dt-structs-gen.h deleted file mode 100644 index d09583153103cf..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-lts-rk3328/dt-structs-gen.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * DO NOT MODIFY - * - * Defines the structs used to hold devicetree data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include -struct dtd_ns16550_serial { - fdt32_t clock_frequency; - struct phandle_1_arg clocks[2]; - const char * dma_names[2]; - fdt32_t dmas[4]; - fdt32_t interrupts[3]; - fdt32_t pinctrl_0; - const char * pinctrl_names; - fdt64_t reg[2]; - fdt32_t reg_io_width; - fdt32_t reg_shift; -}; -struct dtd_rockchip_rk3288_dw_mshc { - fdt32_t bus_width; - bool cap_sd_highspeed; - struct phandle_1_arg clocks[4]; - bool disable_wp; - fdt32_t fifo_depth; - fdt32_t interrupts[3]; - fdt32_t max_frequency; - fdt32_t pinctrl_0[4]; - const char * pinctrl_names; - fdt64_t reg[2]; - bool u_boot_spl_fifo_mode; - fdt32_t vmmc_supply; -}; -struct dtd_rockchip_rk3328_cru { - fdt64_t reg[2]; - fdt32_t rockchip_grf; -}; -struct dtd_rockchip_rk3328_dmc { - fdt64_t reg[12]; - fdt32_t rockchip_sdram_params[196]; -}; -struct dtd_rockchip_rk3328_grf { - fdt64_t reg[2]; -}; -struct dtd_rockchip_rk3328_spi { - struct phandle_1_arg clocks[2]; - const char * dma_names[2]; - fdt32_t dmas[4]; - fdt32_t interrupts[3]; - fdt32_t pinctrl_0[4]; - const char * pinctrl_names; - fdt64_t reg[2]; -}; diff --git a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-rk3328/dt-decl.h b/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-rk3328/dt-decl.h deleted file mode 100644 index 75795aa6cc7af2..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-rk3328/dt-decl.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares externs for all device/uclass instances. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include - -/* driver declarations - these allow DM_DRIVER_GET() to be used */ -extern U_BOOT_DRIVER(rockchip_rk3328_cru); -extern U_BOOT_DRIVER(rockchip_rk3328_dmc); -extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); -extern U_BOOT_DRIVER(ns16550_serial); -extern U_BOOT_DRIVER(rockchip_rk3328_spi); -extern U_BOOT_DRIVER(rockchip_rk3328_grf); - -/* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */ -extern UCLASS_DRIVER(clk); -extern UCLASS_DRIVER(mmc); -extern UCLASS_DRIVER(ram); -extern UCLASS_DRIVER(serial); -extern UCLASS_DRIVER(syscon); diff --git a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-rk3328/dt-plat.c b/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-rk3328/dt-plat.c deleted file mode 100644 index 90656fc306d85a..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-rk3328/dt-plat.c +++ /dev/null @@ -1,170 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares the U_BOOT_DRIVER() records and platform data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -/* Allow use of U_BOOT_DRVINFO() in this file */ -#define DT_PLAT_C - -#include -#include -#include - -/* - * driver_info declarations, ordered by 'struct driver_info' linker_list idx: - * - * idx driver_info driver - * --- -------------------- -------------------- - * 0: clock_controller_at_ff440000 rockchip_rk3328_cru - * 1: dmc rockchip_rk3328_dmc - * 2: mmc_at_ff500000 rockchip_rk3288_dw_mshc - * 3: serial_at_ff130000 ns16550_serial - * 4: spi_at_ff190000 rockchip_rk3328_spi - * 5: syscon_at_ff100000 rockchip_rk3328_grf - * --- -------------------- -------------------- - */ - -/* - * Node /clock-controller@ff440000 index 0 - * driver rockchip_rk3328_cru parent None - */ -static struct dtd_rockchip_rk3328_cru dtv_clock_controller_at_ff440000 = { - .reg = {0xff440000, 0x1000}, - .rockchip_grf = 0x38, -}; -U_BOOT_DRVINFO(clock_controller_at_ff440000) = { - .name = "rockchip_rk3328_cru", - .plat = &dtv_clock_controller_at_ff440000, - .plat_size = sizeof(dtv_clock_controller_at_ff440000), - .parent_idx = -1, -}; - -/* - * Node /dmc index 1 - * driver rockchip_rk3328_dmc parent None - */ -static struct dtd_rockchip_rk3328_dmc dtv_dmc = { - .reg = {0xff400000, 0x1000, 0xff780000, 0x3000, 0xff100000, 0x1000, 0xff440000, 0x1000, - 0xff720000, 0x1000, 0xff798000, 0x1000}, - .rockchip_sdram_params = {0x1, 0xa, 0x2, 0x1, 0x0, 0x0, 0x11, 0x0, - 0x11, 0x0, 0x0, 0x94291288, 0x0, 0x27, 0x462, 0x15, - 0x242, 0xff, 0x14d, 0x0, 0x1, 0x0, 0x0, 0x0, - 0x43049010, 0x64, 0x28003b, 0xd0, 0x20053, 0xd4, 0x220000, 0xd8, - 0x100, 0xdc, 0x40000, 0xe0, 0x0, 0xe4, 0x110000, 0xe8, - 0x420, 0xec, 0x400, 0xf4, 0xf011f, 0x100, 0x9060b06, 0x104, - 0x20209, 0x108, 0x505040a, 0x10c, 0x40400c, 0x110, 0x5030206, 0x114, - 0x3030202, 0x120, 0x3030b03, 0x124, 0x20208, 0x180, 0x1000040, 0x184, - 0x0, 0x190, 0x7030003, 0x198, 0x5001100, 0x1a0, 0xc0400003, 0x240, - 0x6000604, 0x244, 0x201, 0x250, 0xf00, 0x490, 0x1, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0x4, 0xc, 0x28, 0xa, 0x2c, - 0x0, 0x30, 0x9, 0xffffffff, 0xffffffff, 0x77, 0x88, 0x79, - 0x79, 0x87, 0x97, 0x87, 0x78, 0x77, 0x78, 0x87, - 0x88, 0x87, 0x87, 0x77, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x79, 0x9, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, - 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x79, 0x9, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x79, 0x9, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, - 0x9, 0x77, 0x78, 0x77, 0x77, 0x77, 0x77, 0x77, - 0x77, 0x77, 0x79, 0x9}, -}; -U_BOOT_DRVINFO(dmc) = { - .name = "rockchip_rk3328_dmc", - .plat = &dtv_dmc, - .plat_size = sizeof(dtv_dmc), - .parent_idx = -1, -}; - -/* - * Node /mmc@ff500000 index 2 - * driver rockchip_rk3288_dw_mshc parent None - */ -static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff500000 = { - .bus_width = 0x4, - .cap_sd_highspeed = true, - .clocks = { - {0, {317}}, - {0, {33}}, - {0, {74}}, - {0, {78}},}, - .disable_wp = true, - .fifo_depth = 0x100, - .interrupts = {0x0, 0xc, 0x4}, - .max_frequency = 0x8f0d180, - .pinctrl_0 = {0x45, 0x46, 0x47, 0x48}, - .pinctrl_names = "default", - .reg = {0xff500000, 0x4000}, - .u_boot_spl_fifo_mode = true, - .vmmc_supply = 0x49, -}; -U_BOOT_DRVINFO(mmc_at_ff500000) = { - .name = "rockchip_rk3288_dw_mshc", - .plat = &dtv_mmc_at_ff500000, - .plat_size = sizeof(dtv_mmc_at_ff500000), - .parent_idx = -1, -}; - -/* - * Node /serial@ff130000 index 3 - * driver ns16550_serial parent None - */ -static struct dtd_ns16550_serial dtv_serial_at_ff130000 = { - .clock_frequency = 0x16e3600, - .clocks = { - {0, {40}}, - {0, {212}},}, - .dma_names = {"tx", "rx"}, - .dmas = {0x10, 0x6, 0x10, 0x7}, - .interrupts = {0x0, 0x39, 0x4}, - .pinctrl_0 = 0x24, - .pinctrl_names = "default", - .reg = {0xff130000, 0x100}, - .reg_io_width = 0x4, - .reg_shift = 0x2, -}; -U_BOOT_DRVINFO(serial_at_ff130000) = { - .name = "ns16550_serial", - .plat = &dtv_serial_at_ff130000, - .plat_size = sizeof(dtv_serial_at_ff130000), - .parent_idx = -1, -}; - -/* Node /spi@ff190000 index 4 */ -static struct dtd_rockchip_rk3328_spi dtv_spi_at_ff190000 = { - .clocks = { - {0, {32}}, - {0, {209}},}, - .dma_names = {"tx", "rx"}, - .dmas = {0x10, 0x8, 0x10, 0x9}, - .interrupts = {0x0, 0x31, 0x4}, - .pinctrl_0 = {0x2c, 0x2d, 0x2e, 0x2f}, - .pinctrl_names = "default", - .reg = {0xff190000, 0x1000}, -}; -U_BOOT_DRVINFO(spi_at_ff190000) = { - .name = "rockchip_rk3328_spi", - .plat = &dtv_spi_at_ff190000, - .plat_size = sizeof(dtv_spi_at_ff190000), - .parent_idx = -1, -}; - -/* - * Node /syscon@ff100000 index 5 - * driver rockchip_rk3328_grf parent None - */ -static struct dtd_rockchip_rk3328_grf dtv_syscon_at_ff100000 = { - .reg = {0xff100000, 0x1000}, -}; -U_BOOT_DRVINFO(syscon_at_ff100000) = { - .name = "rockchip_rk3328_grf", - .plat = &dtv_syscon_at_ff100000, - .plat_size = sizeof(dtv_syscon_at_ff100000), - .parent_idx = -1, -}; - diff --git a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-rk3328/dt-structs-gen.h b/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-rk3328/dt-structs-gen.h deleted file mode 100644 index d09583153103cf..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-rk3328/dt-structs-gen.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * DO NOT MODIFY - * - * Defines the structs used to hold devicetree data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include -struct dtd_ns16550_serial { - fdt32_t clock_frequency; - struct phandle_1_arg clocks[2]; - const char * dma_names[2]; - fdt32_t dmas[4]; - fdt32_t interrupts[3]; - fdt32_t pinctrl_0; - const char * pinctrl_names; - fdt64_t reg[2]; - fdt32_t reg_io_width; - fdt32_t reg_shift; -}; -struct dtd_rockchip_rk3288_dw_mshc { - fdt32_t bus_width; - bool cap_sd_highspeed; - struct phandle_1_arg clocks[4]; - bool disable_wp; - fdt32_t fifo_depth; - fdt32_t interrupts[3]; - fdt32_t max_frequency; - fdt32_t pinctrl_0[4]; - const char * pinctrl_names; - fdt64_t reg[2]; - bool u_boot_spl_fifo_mode; - fdt32_t vmmc_supply; -}; -struct dtd_rockchip_rk3328_cru { - fdt64_t reg[2]; - fdt32_t rockchip_grf; -}; -struct dtd_rockchip_rk3328_dmc { - fdt64_t reg[12]; - fdt32_t rockchip_sdram_params[196]; -}; -struct dtd_rockchip_rk3328_grf { - fdt64_t reg[2]; -}; -struct dtd_rockchip_rk3328_spi { - struct phandle_1_arg clocks[2]; - const char * dma_names[2]; - fdt32_t dmas[4]; - fdt32_t interrupts[3]; - fdt32_t pinctrl_0[4]; - const char * pinctrl_names; - fdt64_t reg[2]; -}; diff --git a/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-decl.h b/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-decl.h deleted file mode 100644 index 72675609cd21d6..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-decl.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares externs for all device/uclass instances. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include - -/* driver declarations - these allow DM_DRIVER_GET() to be used */ -extern U_BOOT_DRIVER(rockchip_rk3328_cru); -extern U_BOOT_DRIVER(rockchip_rk3328_dmc); -extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); -extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); -extern U_BOOT_DRIVER(ns16550_serial); -extern U_BOOT_DRIVER(rockchip_rk3328_grf); - -/* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */ -extern UCLASS_DRIVER(clk); -extern UCLASS_DRIVER(mmc); -extern UCLASS_DRIVER(ram); -extern UCLASS_DRIVER(serial); -extern UCLASS_DRIVER(syscon); diff --git a/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-plat.c b/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-plat.c deleted file mode 100644 index aa03298e584696..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-plat.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares the U_BOOT_DRIVER() records and platform data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -/* Allow use of U_BOOT_DRVINFO() in this file */ -#define DT_PLAT_C - -#include -#include -#include - -/* - * driver_info declarations, ordered by 'struct driver_info' linker_list idx: - * - * idx driver_info driver - * --- -------------------- -------------------- - * 0: clock_controller_at_ff440000 rockchip_rk3328_cru - * 1: dmc rockchip_rk3328_dmc - * 2: mmc_at_ff500000 rockchip_rk3288_dw_mshc - * 3: mmc_at_ff520000 rockchip_rk3288_dw_mshc - * 4: serial_at_ff130000 ns16550_serial - * 5: syscon_at_ff100000 rockchip_rk3328_grf - * --- -------------------- -------------------- - */ - -/* - * Node /clock-controller@ff440000 index 0 - * driver rockchip_rk3328_cru parent None - */ -static struct dtd_rockchip_rk3328_cru dtv_clock_controller_at_ff440000 = { - .reg = {0xff440000, 0x1000}, - .rockchip_grf = 0x3a, -}; -U_BOOT_DRVINFO(clock_controller_at_ff440000) = { - .name = "rockchip_rk3328_cru", - .plat = &dtv_clock_controller_at_ff440000, - .plat_size = sizeof(dtv_clock_controller_at_ff440000), - .parent_idx = -1, -}; - -/* - * Node /dmc index 1 - * driver rockchip_rk3328_dmc parent None - */ -static struct dtd_rockchip_rk3328_dmc dtv_dmc = { - .reg = {0xff400000, 0x1000, 0xff780000, 0x3000, 0xff100000, 0x1000, 0xff440000, 0x1000, - 0xff720000, 0x1000, 0xff798000, 0x1000}, - .rockchip_sdram_params = {0x1, 0xa, 0x2, 0x1, 0x0, 0x0, 0x11, 0x0, - 0x11, 0x0, 0x0, 0x94291288, 0x0, 0x27, 0x462, 0x15, - 0x242, 0xff, 0x14d, 0x0, 0x1, 0x0, 0x0, 0x0, - 0x43049010, 0x64, 0x28003b, 0xd0, 0x20053, 0xd4, 0x220000, 0xd8, - 0x100, 0xdc, 0x40000, 0xe0, 0x0, 0xe4, 0x110000, 0xe8, - 0x420, 0xec, 0x400, 0xf4, 0xf011f, 0x100, 0x9060b06, 0x104, - 0x20209, 0x108, 0x505040a, 0x10c, 0x40400c, 0x110, 0x5030206, 0x114, - 0x3030202, 0x120, 0x3030b03, 0x124, 0x20208, 0x180, 0x1000040, 0x184, - 0x0, 0x190, 0x7030003, 0x198, 0x5001100, 0x1a0, 0xc0400003, 0x240, - 0x6000604, 0x244, 0x201, 0x250, 0xf00, 0x490, 0x1, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0x4, 0xc, 0x28, 0xa, 0x2c, - 0x0, 0x30, 0x9, 0xffffffff, 0xffffffff, 0x77, 0x88, 0x79, - 0x79, 0x87, 0x97, 0x87, 0x78, 0x77, 0x78, 0x87, - 0x88, 0x87, 0x87, 0x77, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x79, 0x9, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, - 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x79, 0x9, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x79, 0x9, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, - 0x9, 0x77, 0x78, 0x77, 0x77, 0x77, 0x77, 0x77, - 0x77, 0x77, 0x79, 0x9}, -}; -U_BOOT_DRVINFO(dmc) = { - .name = "rockchip_rk3328_dmc", - .plat = &dtv_dmc, - .plat_size = sizeof(dtv_dmc), - .parent_idx = -1, -}; - -/* - * Node /mmc@ff500000 index 2 - * driver rockchip_rk3288_dw_mshc parent None - */ -static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff500000 = { - .bus_width = 0x4, - .cap_mmc_highspeed = true, - .cap_sd_highspeed = true, - .clocks = { - {0, {317}}, - {0, {33}}, - {0, {74}}, - {0, {78}},}, - .disable_wp = true, - .fifo_depth = 0x100, - .interrupts = {0x0, 0xc, 0x4}, - .max_frequency = 0x8f0d180, - .pinctrl_0 = {0x47, 0x48, 0x49, 0x4a}, - .pinctrl_names = "default", - .reg = {0xff500000, 0x4000}, - .sd_uhs_sdr104 = true, - .sd_uhs_sdr12 = true, - .sd_uhs_sdr25 = true, - .sd_uhs_sdr50 = true, - .u_boot_spl_fifo_mode = true, - .vmmc_supply = 0x4b, - .vqmmc_supply = 0x1e, -}; -U_BOOT_DRVINFO(mmc_at_ff500000) = { - .name = "rockchip_rk3288_dw_mshc", - .plat = &dtv_mmc_at_ff500000, - .plat_size = sizeof(dtv_mmc_at_ff500000), - .parent_idx = -1, -}; - -/* - * Node /mmc@ff520000 index 3 - * driver rockchip_rk3288_dw_mshc parent None - */ -static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff520000 = { - .bus_width = 0x8, - .cap_mmc_highspeed = true, - .clocks = { - {0, {319}}, - {0, {35}}, - {0, {76}}, - {0, {80}},}, - .fifo_depth = 0x100, - .interrupts = {0x0, 0xe, 0x4}, - .max_frequency = 0x8f0d180, - .mmc_ddr_1_8v = true, - .mmc_hs200_1_8v = true, - .non_removable = true, - .pinctrl_0 = {0x4c, 0x4d, 0x4e, 0x0}, - .pinctrl_names = "default", - .reg = {0xff520000, 0x4000}, - .u_boot_spl_fifo_mode = true, - .vmmc_supply = 0x1c, - .vqmmc_supply = 0x1d, -}; -U_BOOT_DRVINFO(mmc_at_ff520000) = { - .name = "rockchip_rk3288_dw_mshc", - .plat = &dtv_mmc_at_ff520000, - .plat_size = sizeof(dtv_mmc_at_ff520000), - .parent_idx = -1, -}; - -/* - * Node /serial@ff130000 index 4 - * driver ns16550_serial parent None - */ -static struct dtd_ns16550_serial dtv_serial_at_ff130000 = { - .clock_frequency = 0x16e3600, - .clocks = { - {0, {40}}, - {0, {212}},}, - .dma_names = {"tx", "rx"}, - .dmas = {0x10, 0x6, 0x10, 0x7}, - .interrupts = {0x0, 0x39, 0x4}, - .pinctrl_0 = 0x26, - .pinctrl_names = "default", - .reg = {0xff130000, 0x100}, - .reg_io_width = 0x4, - .reg_shift = 0x2, -}; -U_BOOT_DRVINFO(serial_at_ff130000) = { - .name = "ns16550_serial", - .plat = &dtv_serial_at_ff130000, - .plat_size = sizeof(dtv_serial_at_ff130000), - .parent_idx = -1, -}; - -/* - * Node /syscon@ff100000 index 5 - * driver rockchip_rk3328_grf parent None - */ -static struct dtd_rockchip_rk3328_grf dtv_syscon_at_ff100000 = { - .reg = {0xff100000, 0x1000}, -}; -U_BOOT_DRVINFO(syscon_at_ff100000) = { - .name = "rockchip_rk3328_grf", - .plat = &dtv_syscon_at_ff100000, - .plat_size = sizeof(dtv_syscon_at_ff100000), - .parent_idx = -1, -}; - diff --git a/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-structs-gen.h b/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-structs-gen.h deleted file mode 100644 index 5b729fc57f5343..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/roc-cc-rk3328/dt-structs-gen.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * DO NOT MODIFY - * - * Defines the structs used to hold devicetree data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include -struct dtd_ns16550_serial { - fdt32_t clock_frequency; - struct phandle_1_arg clocks[2]; - const char * dma_names[2]; - fdt32_t dmas[4]; - fdt32_t interrupts[3]; - fdt32_t pinctrl_0; - const char * pinctrl_names; - fdt64_t reg[2]; - fdt32_t reg_io_width; - fdt32_t reg_shift; -}; -struct dtd_rockchip_rk3288_dw_mshc { - fdt32_t bus_width; - bool cap_mmc_highspeed; - bool cap_sd_highspeed; - struct phandle_1_arg clocks[4]; - bool disable_wp; - fdt32_t fifo_depth; - fdt32_t interrupts[3]; - fdt32_t max_frequency; - bool mmc_ddr_1_8v; - bool mmc_hs200_1_8v; - bool non_removable; - fdt32_t pinctrl_0[4]; - const char * pinctrl_names; - fdt64_t reg[2]; - bool sd_uhs_sdr104; - bool sd_uhs_sdr12; - bool sd_uhs_sdr25; - bool sd_uhs_sdr50; - bool u_boot_spl_fifo_mode; - fdt32_t vmmc_supply; - fdt32_t vqmmc_supply; -}; -struct dtd_rockchip_rk3328_cru { - fdt64_t reg[2]; - fdt32_t rockchip_grf; -}; -struct dtd_rockchip_rk3328_dmc { - fdt64_t reg[12]; - fdt32_t rockchip_sdram_params[196]; -}; -struct dtd_rockchip_rk3328_grf { - fdt64_t reg[2]; -}; diff --git a/package/boot/uboot-rockchip/src/of-platdata/rock-pi-e-rk3328/dt-decl.h b/package/boot/uboot-rockchip/src/of-platdata/rock-pi-e-rk3328/dt-decl.h deleted file mode 100644 index 72675609cd21d6..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/rock-pi-e-rk3328/dt-decl.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares externs for all device/uclass instances. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include - -/* driver declarations - these allow DM_DRIVER_GET() to be used */ -extern U_BOOT_DRIVER(rockchip_rk3328_cru); -extern U_BOOT_DRIVER(rockchip_rk3328_dmc); -extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); -extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); -extern U_BOOT_DRIVER(ns16550_serial); -extern U_BOOT_DRIVER(rockchip_rk3328_grf); - -/* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */ -extern UCLASS_DRIVER(clk); -extern UCLASS_DRIVER(mmc); -extern UCLASS_DRIVER(ram); -extern UCLASS_DRIVER(serial); -extern UCLASS_DRIVER(syscon); diff --git a/package/boot/uboot-rockchip/src/of-platdata/rock-pi-e-rk3328/dt-plat.c b/package/boot/uboot-rockchip/src/of-platdata/rock-pi-e-rk3328/dt-plat.c deleted file mode 100644 index f86414d5d3529a..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/rock-pi-e-rk3328/dt-plat.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares the U_BOOT_DRIVER() records and platform data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -/* Allow use of U_BOOT_DRVINFO() in this file */ -#define DT_PLAT_C - -#include -#include -#include - -/* - * driver_info declarations, ordered by 'struct driver_info' linker_list idx: - * - * idx driver_info driver - * --- -------------------- -------------------- - * 0: clock_controller_at_ff440000 rockchip_rk3328_cru - * 1: dmc rockchip_rk3328_dmc - * 2: mmc_at_ff500000 rockchip_rk3288_dw_mshc - * 3: mmc_at_ff520000 rockchip_rk3288_dw_mshc - * 4: serial_at_ff130000 ns16550_serial - * 5: syscon_at_ff100000 rockchip_rk3328_grf - * --- -------------------- -------------------- - */ - -/* - * Node /clock-controller@ff440000 index 0 - * driver rockchip_rk3328_cru parent None - */ -static struct dtd_rockchip_rk3328_cru dtv_clock_controller_at_ff440000 = { - .reg = {0xff440000, 0x1000}, - .rockchip_grf = 0x38, -}; -U_BOOT_DRVINFO(clock_controller_at_ff440000) = { - .name = "rockchip_rk3328_cru", - .plat = &dtv_clock_controller_at_ff440000, - .plat_size = sizeof(dtv_clock_controller_at_ff440000), - .parent_idx = -1, -}; - -/* - * Node /dmc index 1 - * driver rockchip_rk3328_dmc parent None - */ -static struct dtd_rockchip_rk3328_dmc dtv_dmc = { - .reg = {0xff400000, 0x1000, 0xff780000, 0x3000, 0xff100000, 0x1000, 0xff440000, 0x1000, - 0xff720000, 0x1000, 0xff798000, 0x1000}, - .rockchip_sdram_params = {0x1, 0xc, 0x3, 0x1, 0x0, 0x0, 0x10, 0x10, - 0x10, 0x10, 0x0, 0x9028b189, 0x0, 0x21, 0x482, 0x15, - 0x222, 0xff, 0x14d, 0x3, 0x1, 0x0, 0x0, 0x0, - 0x43041001, 0x64, 0x28003b, 0xd0, 0x20053, 0xd4, 0x20000, 0xd8, - 0x100, 0xdc, 0x3200000, 0xe0, 0x0, 0xe4, 0x90000, 0xf4, - 0xf011f, 0x100, 0x7090b06, 0x104, 0x50209, 0x108, 0x3030407, 0x10c, - 0x202006, 0x110, 0x3020204, 0x114, 0x3030202, 0x120, 0x903, 0x180, - 0x800020, 0x184, 0x0, 0x190, 0x7010001, 0x198, 0x5001100, 0x1a0, - 0xc0400003, 0x240, 0x6000604, 0x244, 0x201, 0x250, 0xf00, 0x490, - 0x1, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0x4, 0xa, 0x28, 0x6, 0x2c, - 0x0, 0x30, 0x5, 0xffffffff, 0xffffffff, 0x77, 0x88, 0x79, - 0x79, 0x87, 0x97, 0x87, 0x78, 0x77, 0x78, 0x87, - 0x88, 0x87, 0x87, 0x77, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x79, 0x9, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, - 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x79, 0x9, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x79, 0x9, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, - 0x9, 0x77, 0x78, 0x77, 0x77, 0x77, 0x77, 0x77, - 0x77, 0x77, 0x79, 0x9}, -}; -U_BOOT_DRVINFO(dmc) = { - .name = "rockchip_rk3328_dmc", - .plat = &dtv_dmc, - .plat_size = sizeof(dtv_dmc), - .parent_idx = -1, -}; - -/* - * Node /mmc@ff500000 index 2 - * driver rockchip_rk3288_dw_mshc parent None - */ -static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff500000 = { - .bus_width = 0x4, - .cap_mmc_highspeed = true, - .cap_sd_highspeed = true, - .card_detect_delay = 0xc8, - .clocks = { - {0, {317}}, - {0, {33}}, - {0, {74}}, - {0, {78}},}, - .disable_wp = true, - .fifo_depth = 0x100, - .interrupts = {0x0, 0xc, 0x4}, - .max_frequency = 0x8f0d180, - .num_slots = 0x1, - .pinctrl_0 = {0x45, 0x46, 0x47, 0x48}, - .pinctrl_names = "default", - .reg = {0xff500000, 0x4000}, - .supports_sd = true, - .u_boot_spl_fifo_mode = true, - .vmmc_supply = 0x49, -}; -U_BOOT_DRVINFO(mmc_at_ff500000) = { - .name = "rockchip_rk3288_dw_mshc", - .plat = &dtv_mmc_at_ff500000, - .plat_size = sizeof(dtv_mmc_at_ff500000), - .parent_idx = -1, -}; - -/* - * Node /mmc@ff520000 index 3 - * driver rockchip_rk3288_dw_mshc parent None - */ -static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff520000 = { - .bus_width = 0x8, - .cap_mmc_highspeed = true, - .clocks = { - {0, {319}}, - {0, {35}}, - {0, {76}}, - {0, {80}},}, - .disable_wp = true, - .fifo_depth = 0x100, - .interrupts = {0x0, 0xe, 0x4}, - .max_frequency = 0x8f0d180, - .mmc_hs200_1_8v = true, - .non_removable = true, - .num_slots = 0x1, - .pinctrl_0 = {0x4a, 0x4b, 0x4c, 0x0}, - .pinctrl_names = "default", - .reg = {0xff520000, 0x4000}, - .supports_emmc = true, - .u_boot_spl_fifo_mode = true, - .vmmc_supply = 0x1c, - .vqmmc_supply = 0x1d, -}; -U_BOOT_DRVINFO(mmc_at_ff520000) = { - .name = "rockchip_rk3288_dw_mshc", - .plat = &dtv_mmc_at_ff520000, - .plat_size = sizeof(dtv_mmc_at_ff520000), - .parent_idx = -1, -}; - -/* - * Node /serial@ff130000 index 4 - * driver ns16550_serial parent None - */ -static struct dtd_ns16550_serial dtv_serial_at_ff130000 = { - .clock_frequency = 0x16e3600, - .clocks = { - {0, {40}}, - {0, {212}},}, - .dma_names = {"tx", "rx"}, - .dmas = {0x10, 0x6, 0x10, 0x7}, - .interrupts = {0x0, 0x39, 0x4}, - .pinctrl_0 = 0x24, - .pinctrl_names = "default", - .reg = {0xff130000, 0x100}, - .reg_io_width = 0x4, - .reg_shift = 0x2, -}; -U_BOOT_DRVINFO(serial_at_ff130000) = { - .name = "ns16550_serial", - .plat = &dtv_serial_at_ff130000, - .plat_size = sizeof(dtv_serial_at_ff130000), - .parent_idx = -1, -}; - -/* - * Node /syscon@ff100000 index 5 - * driver rockchip_rk3328_grf parent None - */ -static struct dtd_rockchip_rk3328_grf dtv_syscon_at_ff100000 = { - .reg = {0xff100000, 0x1000}, -}; -U_BOOT_DRVINFO(syscon_at_ff100000) = { - .name = "rockchip_rk3328_grf", - .plat = &dtv_syscon_at_ff100000, - .plat_size = sizeof(dtv_syscon_at_ff100000), - .parent_idx = -1, -}; - diff --git a/package/boot/uboot-rockchip/src/of-platdata/rock-pi-e-rk3328/dt-structs-gen.h b/package/boot/uboot-rockchip/src/of-platdata/rock-pi-e-rk3328/dt-structs-gen.h deleted file mode 100644 index fae089030bac95..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/rock-pi-e-rk3328/dt-structs-gen.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * DO NOT MODIFY - * - * Defines the structs used to hold devicetree data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include -struct dtd_ns16550_serial { - fdt32_t clock_frequency; - struct phandle_1_arg clocks[2]; - const char * dma_names[2]; - fdt32_t dmas[4]; - fdt32_t interrupts[3]; - fdt32_t pinctrl_0; - const char * pinctrl_names; - fdt64_t reg[2]; - fdt32_t reg_io_width; - fdt32_t reg_shift; -}; -struct dtd_rockchip_rk3288_dw_mshc { - fdt32_t bus_width; - bool cap_mmc_highspeed; - bool cap_sd_highspeed; - fdt32_t card_detect_delay; - struct phandle_1_arg clocks[4]; - bool disable_wp; - fdt32_t fifo_depth; - fdt32_t interrupts[3]; - fdt32_t max_frequency; - bool mmc_hs200_1_8v; - bool non_removable; - fdt32_t num_slots; - fdt32_t pinctrl_0[4]; - const char * pinctrl_names; - fdt64_t reg[2]; - bool supports_emmc; - bool supports_sd; - bool u_boot_spl_fifo_mode; - fdt32_t vmmc_supply; - fdt32_t vqmmc_supply; -}; -struct dtd_rockchip_rk3328_cru { - fdt64_t reg[2]; - fdt32_t rockchip_grf; -}; -struct dtd_rockchip_rk3328_dmc { - fdt64_t reg[12]; - fdt32_t rockchip_sdram_params[196]; -}; -struct dtd_rockchip_rk3328_grf { - fdt64_t reg[2]; -}; diff --git a/package/boot/uboot-rockchip/src/of-platdata/rock64-rk3328/dt-decl.h b/package/boot/uboot-rockchip/src/of-platdata/rock64-rk3328/dt-decl.h deleted file mode 100644 index a13aaea1fb1ce1..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/rock64-rk3328/dt-decl.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares externs for all device/uclass instances. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include - -/* driver declarations - these allow DM_DRIVER_GET() to be used */ -extern U_BOOT_DRIVER(rockchip_rk3328_cru); -extern U_BOOT_DRIVER(rockchip_rk3328_dmc); -extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); -extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); -extern U_BOOT_DRIVER(ns16550_serial); -extern U_BOOT_DRIVER(rockchip_rk3328_spi); -extern U_BOOT_DRIVER(jedec_spi_nor); -extern U_BOOT_DRIVER(rockchip_rk3328_grf); - -/* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */ -extern UCLASS_DRIVER(clk); -extern UCLASS_DRIVER(mmc); -extern UCLASS_DRIVER(ram); -extern UCLASS_DRIVER(serial); -extern UCLASS_DRIVER(spi_flash); -extern UCLASS_DRIVER(syscon); diff --git a/package/boot/uboot-rockchip/src/of-platdata/rock64-rk3328/dt-plat.c b/package/boot/uboot-rockchip/src/of-platdata/rock64-rk3328/dt-plat.c deleted file mode 100644 index 70a8c001a3f170..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/rock64-rk3328/dt-plat.c +++ /dev/null @@ -1,219 +0,0 @@ -/* - * DO NOT MODIFY - * - * Declares the U_BOOT_DRIVER() records and platform data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -/* Allow use of U_BOOT_DRVINFO() in this file */ -#define DT_PLAT_C - -#include -#include -#include - -/* - * driver_info declarations, ordered by 'struct driver_info' linker_list idx: - * - * idx driver_info driver - * --- -------------------- -------------------- - * 0: clock_controller_at_ff440000 rockchip_rk3328_cru - * 1: dmc rockchip_rk3328_dmc - * 2: mmc_at_ff500000 rockchip_rk3288_dw_mshc - * 3: mmc_at_ff520000 rockchip_rk3288_dw_mshc - * 4: serial_at_ff130000 ns16550_serial - * 5: spi_at_ff190000 rockchip_rk3328_spi - * 6: spiflash_at_0 jedec_spi_nor - * 7: syscon_at_ff100000 rockchip_rk3328_grf - * --- -------------------- -------------------- - */ - -/* - * Node /clock-controller@ff440000 index 0 - * driver rockchip_rk3328_cru parent None - */ -static struct dtd_rockchip_rk3328_cru dtv_clock_controller_at_ff440000 = { - .reg = {0xff440000, 0x1000}, - .rockchip_grf = 0x3b, -}; -U_BOOT_DRVINFO(clock_controller_at_ff440000) = { - .name = "rockchip_rk3328_cru", - .plat = &dtv_clock_controller_at_ff440000, - .plat_size = sizeof(dtv_clock_controller_at_ff440000), - .parent_idx = -1, -}; - -/* - * Node /dmc index 1 - * driver rockchip_rk3328_dmc parent None - */ -static struct dtd_rockchip_rk3328_dmc dtv_dmc = { - .reg = {0xff400000, 0x1000, 0xff780000, 0x3000, 0xff100000, 0x1000, 0xff440000, 0x1000, - 0xff720000, 0x1000, 0xff798000, 0x1000}, - .rockchip_sdram_params = {0x1, 0xc, 0x3, 0x1, 0x0, 0x0, 0x10, 0x10, - 0x10, 0x10, 0x0, 0x98899459, 0x0, 0x2e, 0x544, 0x15, - 0x432, 0xff, 0x320, 0x6, 0x1, 0x0, 0x1, 0x0, - 0x43041008, 0x64, 0x300054, 0xd0, 0x500002, 0xd4, 0x10000, 0xd8, - 0xe03, 0xdc, 0x43001a, 0xe0, 0x10000, 0xe4, 0xe0005, 0xf4, - 0xf011f, 0x100, 0xb141b11, 0x104, 0x3031a, 0x108, 0x3060809, 0x10c, - 0x606000, 0x110, 0x8020409, 0x114, 0x1010606, 0x118, 0x2020004, 0x120, - 0x404, 0x138, 0x58, 0x180, 0x900024, 0x184, 0x1400000, 0x190, - 0x7050002, 0x198, 0x5001100, 0x1a0, 0xc0400003, 0x240, 0xa020b28, 0x244, - 0x101, 0x250, 0xf00, 0x490, 0x1, 0xffffffff, 0xffffffff, 0xffffffff, - 0xffffffff, 0xffffffff, 0xffffffff, 0x4, 0xb, 0x28, 0xc, 0x2c, - 0x0, 0x30, 0x6, 0xffffffff, 0xffffffff, 0x77, 0x88, 0x79, - 0x79, 0x87, 0x97, 0x87, 0x78, 0x77, 0x78, 0x87, - 0x88, 0x87, 0x87, 0x77, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x79, 0x9, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, - 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x79, 0x9, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, - 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, 0x78, 0x77, - 0x78, 0x77, 0x78, 0x77, 0x79, 0x9, 0x78, 0x78, - 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, - 0x9, 0x77, 0x78, 0x77, 0x77, 0x77, 0x77, 0x77, - 0x77, 0x77, 0x79, 0x9}, -}; -U_BOOT_DRVINFO(dmc) = { - .name = "rockchip_rk3328_dmc", - .plat = &dtv_dmc, - .plat_size = sizeof(dtv_dmc), - .parent_idx = -1, -}; - -/* - * Node /mmc@ff500000 index 2 - * driver rockchip_rk3288_dw_mshc parent None - */ -static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff500000 = { - .bus_width = 0x4, - .cap_mmc_highspeed = true, - .cap_sd_highspeed = true, - .clocks = { - {0, {317}}, - {0, {33}}, - {0, {74}}, - {0, {78}},}, - .disable_wp = true, - .fifo_depth = 0x100, - .interrupts = {0x0, 0xc, 0x4}, - .max_frequency = 0x8f0d180, - .pinctrl_0 = {0x4a, 0x4b, 0x4c, 0x4d}, - .pinctrl_names = "default", - .reg = {0xff500000, 0x4000}, - .u_boot_spl_fifo_mode = true, - .vmmc_supply = 0x4e, -}; -U_BOOT_DRVINFO(mmc_at_ff500000) = { - .name = "rockchip_rk3288_dw_mshc", - .plat = &dtv_mmc_at_ff500000, - .plat_size = sizeof(dtv_mmc_at_ff500000), - .parent_idx = -1, -}; - -/* - * Node /mmc@ff520000 index 3 - * driver rockchip_rk3288_dw_mshc parent None - */ -static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff520000 = { - .bus_width = 0x8, - .cap_mmc_highspeed = true, - .clocks = { - {0, {319}}, - {0, {35}}, - {0, {76}}, - {0, {80}},}, - .fifo_depth = 0x100, - .interrupts = {0x0, 0xe, 0x4}, - .max_frequency = 0x8f0d180, - .mmc_hs200_1_8v = true, - .non_removable = true, - .pinctrl_0 = {0x4f, 0x50, 0x51, 0x0}, - .pinctrl_names = "default", - .reg = {0xff520000, 0x4000}, - .u_boot_spl_fifo_mode = true, - .vmmc_supply = 0x1e, - .vqmmc_supply = 0x1f, -}; -U_BOOT_DRVINFO(mmc_at_ff520000) = { - .name = "rockchip_rk3288_dw_mshc", - .plat = &dtv_mmc_at_ff520000, - .plat_size = sizeof(dtv_mmc_at_ff520000), - .parent_idx = -1, -}; - -/* - * Node /serial@ff130000 index 4 - * driver ns16550_serial parent None - */ -static struct dtd_ns16550_serial dtv_serial_at_ff130000 = { - .clock_frequency = 0x16e3600, - .clocks = { - {0, {40}}, - {0, {212}},}, - .dma_names = {"tx", "rx"}, - .dmas = {0x10, 0x6, 0x10, 0x7}, - .interrupts = {0x0, 0x39, 0x4}, - .pinctrl_0 = 0x27, - .pinctrl_names = "default", - .reg = {0xff130000, 0x100}, - .reg_io_width = 0x4, - .reg_shift = 0x2, -}; -U_BOOT_DRVINFO(serial_at_ff130000) = { - .name = "ns16550_serial", - .plat = &dtv_serial_at_ff130000, - .plat_size = sizeof(dtv_serial_at_ff130000), - .parent_idx = -1, -}; - -/* Node /spi@ff190000 index 5 */ -static struct dtd_rockchip_rk3328_spi dtv_spi_at_ff190000 = { - .clocks = { - {0, {32}}, - {0, {209}},}, - .dma_names = {"tx", "rx"}, - .dmas = {0x10, 0x8, 0x10, 0x9}, - .interrupts = {0x0, 0x31, 0x4}, - .pinctrl_0 = {0x2f, 0x30, 0x31, 0x32}, - .pinctrl_names = "default", - .reg = {0xff190000, 0x1000}, -}; -U_BOOT_DRVINFO(spi_at_ff190000) = { - .name = "rockchip_rk3328_spi", - .plat = &dtv_spi_at_ff190000, - .plat_size = sizeof(dtv_spi_at_ff190000), - .parent_idx = -1, -}; - -/* - * Node /spi@ff190000/spiflash@0 index 6 - * driver jedec_spi_nor parent None - */ -static struct dtd_jedec_spi_nor dtv_spiflash_at_0 = { - .reg = {0x0}, - .spi_max_frequency = 0x2faf080, -}; -U_BOOT_DRVINFO(spiflash_at_0) = { - .name = "jedec_spi_nor", - .plat = &dtv_spiflash_at_0, - .plat_size = sizeof(dtv_spiflash_at_0), - .parent_idx = 5, -}; - -/* - * Node /syscon@ff100000 index 7 - * driver rockchip_rk3328_grf parent None - */ -static struct dtd_rockchip_rk3328_grf dtv_syscon_at_ff100000 = { - .reg = {0xff100000, 0x1000}, -}; -U_BOOT_DRVINFO(syscon_at_ff100000) = { - .name = "rockchip_rk3328_grf", - .plat = &dtv_syscon_at_ff100000, - .plat_size = sizeof(dtv_syscon_at_ff100000), - .parent_idx = -1, -}; - diff --git a/package/boot/uboot-rockchip/src/of-platdata/rock64-rk3328/dt-structs-gen.h b/package/boot/uboot-rockchip/src/of-platdata/rock64-rk3328/dt-structs-gen.h deleted file mode 100644 index e15d848729528e..00000000000000 --- a/package/boot/uboot-rockchip/src/of-platdata/rock64-rk3328/dt-structs-gen.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * DO NOT MODIFY - * - * Defines the structs used to hold devicetree data. - * This was generated by dtoc from a .dtb (device tree binary) file. - */ - -#include -#include -struct dtd_jedec_spi_nor { - fdt32_t reg[1]; - fdt32_t spi_max_frequency; -}; -struct dtd_ns16550_serial { - fdt32_t clock_frequency; - struct phandle_1_arg clocks[2]; - const char * dma_names[2]; - fdt32_t dmas[4]; - fdt32_t interrupts[3]; - fdt32_t pinctrl_0; - const char * pinctrl_names; - fdt64_t reg[2]; - fdt32_t reg_io_width; - fdt32_t reg_shift; -}; -struct dtd_rockchip_rk3288_dw_mshc { - fdt32_t bus_width; - bool cap_mmc_highspeed; - bool cap_sd_highspeed; - struct phandle_1_arg clocks[4]; - bool disable_wp; - fdt32_t fifo_depth; - fdt32_t interrupts[3]; - fdt32_t max_frequency; - bool mmc_hs200_1_8v; - bool non_removable; - fdt32_t pinctrl_0[4]; - const char * pinctrl_names; - fdt64_t reg[2]; - bool u_boot_spl_fifo_mode; - fdt32_t vmmc_supply; - fdt32_t vqmmc_supply; -}; -struct dtd_rockchip_rk3328_cru { - fdt64_t reg[2]; - fdt32_t rockchip_grf; -}; -struct dtd_rockchip_rk3328_dmc { - fdt64_t reg[12]; - fdt32_t rockchip_sdram_params[196]; -}; -struct dtd_rockchip_rk3328_grf { - fdt64_t reg[2]; -}; -struct dtd_rockchip_rk3328_spi { - struct phandle_1_arg clocks[2]; - const char * dma_names[2]; - fdt32_t dmas[4]; - fdt32_t interrupts[3]; - fdt32_t pinctrl_0[4]; - const char * pinctrl_names; - fdt64_t reg[2]; -}; diff --git a/package/boot/uboot-sifiveu/Makefile b/package/boot/uboot-sifiveu/Makefile index 5def1c1fcb801b..4cbfe344af84bb 100644 --- a/package/boot/uboot-sifiveu/Makefile +++ b/package/boot/uboot-sifiveu/Makefile @@ -10,6 +10,8 @@ PKG_RELEASE:=1 PKG_VERSION:=2022.10 PKG_HASH:=50b4482a505bc281ba8470c399a3c26e145e29b23500bc35c50debd7fa46bdf8 +UBOOT_USE_INTREE_DTC:=1 + include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk diff --git a/package/boot/uboot-sifiveu/patches/300-force-pylibfdt-build.patch b/package/boot/uboot-sifiveu/patches/300-force-pylibfdt-build.patch deleted file mode 100644 index 4abf13eda869fe..00000000000000 --- a/package/boot/uboot-sifiveu/patches/300-force-pylibfdt-build.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -2028,26 +2028,7 @@ endif - # Check dtc and pylibfdt, if DTC is provided, else build them - PHONY += scripts_dtc - scripts_dtc: scripts_basic -- $(Q)if test "$(DTC)" = "$(DTC_INTREE)"; then \ -- $(MAKE) $(build)=scripts/dtc; \ -- else \ -- if ! $(DTC) -v >/dev/null; then \ -- echo '*** Failed to check dtc version: $(DTC)'; \ -- false; \ -- else \ -- if test "$(call dtc-version)" -lt $(DTC_MIN_VERSION); then \ -- echo '*** Your dtc is too old, please upgrade to dtc $(DTC_MIN_VERSION) or newer'; \ -- false; \ -- else \ -- if [ -n "$(CONFIG_PYLIBFDT)" ]; then \ -- if ! echo "import libfdt" | $(PYTHON3) 2>/dev/null; then \ -- echo '*** pylibfdt does not seem to be available with $(PYTHON3)'; \ -- false; \ -- fi; \ -- fi; \ -- fi; \ -- fi; \ -- fi -+ $(MAKE) $(build)=scripts/dtc - - # --------------------------------------------------------------------------- - quiet_cmd_cpp_lds = LDS $@ diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile index 17905802c31fb9..7f50992e6955c6 100644 --- a/package/boot/uboot-sunxi/Makefile +++ b/package/boot/uboot-sunxi/Makefile @@ -15,6 +15,8 @@ PKG_HASH:=e31cac91545ff41b71cec5d8c22afd695645cd6e2a442ccdacacd60534069341 PKG_MAINTAINER:=Zoltan HERPAI +UBOOT_USE_INTREE_DTC:=1 + include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk diff --git a/package/boot/uboot-sunxi/patches/260-add-missing-type-u64.patch b/package/boot/uboot-sunxi/patches/260-add-missing-type-u64.patch deleted file mode 100644 index a6204c7b69e105..00000000000000 --- a/package/boot/uboot-sunxi/patches/260-add-missing-type-u64.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/include/linux/types.h -+++ b/include/linux/types.h -@@ -1,6 +1,7 @@ - #ifndef _LINUX_TYPES_H - #define _LINUX_TYPES_H - -+typedef unsigned long long __u64; - #include - #include - #include diff --git a/package/boot/uboot-sunxi/patches/300-force-pylibfdt-build.patch b/package/boot/uboot-sunxi/patches/300-force-pylibfdt-build.patch deleted file mode 100644 index d34ed6f2ae55aa..00000000000000 --- a/package/boot/uboot-sunxi/patches/300-force-pylibfdt-build.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -2000,26 +2000,7 @@ endif - # Check dtc and pylibfdt, if DTC is provided, else build them - PHONY += scripts_dtc - scripts_dtc: scripts_basic -- $(Q)if test "$(DTC)" = "$(DTC_INTREE)"; then \ -- $(MAKE) $(build)=scripts/dtc; \ -- else \ -- if ! $(DTC) -v >/dev/null; then \ -- echo '*** Failed to check dtc version: $(DTC)'; \ -- false; \ -- else \ -- if test "$(call dtc-version)" -lt $(DTC_MIN_VERSION); then \ -- echo '*** Your dtc is too old, please upgrade to dtc $(DTC_MIN_VERSION) or newer'; \ -- false; \ -- else \ -- if [ -n "$(CONFIG_PYLIBFDT)" ]; then \ -- if ! echo "import libfdt" | $(PYTHON3) 2>/dev/null; then \ -- echo '*** pylibfdt does not seem to be available with $(PYTHON3)'; \ -- false; \ -- fi; \ -- fi; \ -- fi; \ -- fi; \ -- fi -+ $(MAKE) $(build)=scripts/dtc - - # --------------------------------------------------------------------------- - quiet_cmd_cpp_lds = LDS $@ diff --git a/package/devel/binutils/Makefile b/package/devel/binutils/Makefile index 8547190e99b14d..3a54a0be92c672 100644 --- a/package/devel/binutils/Makefile +++ b/package/devel/binutils/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=binutils -PKG_VERSION:=2.40 +PKG_VERSION:=2.41 PKG_RELEASE:=1 PKG_SOURCE_URL:=@GNU/binutils PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_VERSION:=$(PKG_VERSION) -PKG_HASH:=0f8a4c272d7f17f369ded10a4aca28b8e304828e95526da482b0ccc4dfc9d8e1 +PKG_HASH:=ae9a5789e23459e59606e6714723f2d3ffc31c03174191ef0d015bdf06007450 PKG_FIXUP:=patch-libtool PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof gprofng binutils ld libiberty gold intl libctf libsframe diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile index 4c0d6469a2fbf5..3efbce28f40772 100644 --- a/package/devel/gdb/Makefile +++ b/package/devel/gdb/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb -PKG_VERSION:=12.1 -PKG_RELEASE:=3 +PKG_VERSION:=13.2 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb -PKG_HASH:=0e1793bf8f2b54d53f46dea84ccfd446f48f81b297b28c4f7fc017b818d69fed +PKG_HASH:=fd5bebb7be1833abdb6e023c2f498a354498281df9d05523d8915babeb893f0a PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 @@ -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/devel/gdb/patches/001-Add-support-for-readline-8.2.patch b/package/devel/gdb/patches/001-Add-support-for-readline-8.2.patch deleted file mode 100644 index eb93c7f2907a67..00000000000000 --- a/package/devel/gdb/patches/001-Add-support-for-readline-8.2.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 1add37b567a7dee39d99f37b37802034c3fce9c4 Mon Sep 17 00:00:00 2001 -From: Andreas Schwab -Date: Sun, 20 Mar 2022 14:01:54 +0100 -Subject: [PATCH] Add support for readline 8.2 - -In readline 8.2 the type of rl_completer_word_break_characters changed to -include const. ---- - gdb/completer.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/gdb/completer.c -+++ b/gdb/completer.c -@@ -36,7 +36,7 @@ - calling a hook instead so we eliminate the CLI dependency. */ - #include "gdbcmd.h" - --/* Needed for rl_completer_word_break_characters() and for -+/* Needed for rl_completer_word_break_characters and for - rl_filename_completion_function. */ - #include "readline/readline.h" - -@@ -2011,7 +2011,7 @@ gdb_completion_word_break_characters_thr - rl_basic_quote_characters = NULL; - } - -- return rl_completer_word_break_characters; -+ return (char *) rl_completer_word_break_characters; - } - - char * diff --git a/package/devel/gdb/patches/110-shared_libgcc.patch b/package/devel/gdb/patches/110-shared_libgcc.patch index f1602bc69506e7..44d4ffa77f358b 100644 --- a/package/devel/gdb/patches/110-shared_libgcc.patch +++ b/package/devel/gdb/patches/110-shared_libgcc.patch @@ -1,6 +1,6 @@ --- a/configure.ac +++ b/configure.ac -@@ -1314,13 +1314,13 @@ if test -z "$LD"; then +@@ -1435,13 +1435,13 @@ if test -z "$LD"; then fi fi @@ -17,7 +17,7 @@ AC_LANG_PUSH(C++) AC_LINK_IFELSE([AC_LANG_SOURCE([ #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) -@@ -1719,7 +1719,7 @@ AC_ARG_WITH(stage1-ldflags, +@@ -1838,7 +1838,7 @@ AC_ARG_WITH(stage1-ldflags, # trust that they are doing what they want. if test "$with_static_standard_libraries" = yes -a "$stage1_libs" = "" \ -a "$have_static_libs" = yes; then @@ -26,7 +26,7 @@ fi]) AC_SUBST(stage1_ldflags) -@@ -1748,7 +1748,7 @@ AC_ARG_WITH(boot-ldflags, +@@ -1867,7 +1867,7 @@ AC_ARG_WITH(boot-ldflags, # statically. But if the user explicitly specified the libraries to # use, trust that they are doing what they want. if test "$poststage1_libs" = ""; then @@ -37,7 +37,7 @@ --- a/configure +++ b/configure -@@ -5275,14 +5275,14 @@ if test -z "$LD"; then +@@ -5442,14 +5442,14 @@ if test -z "$LD"; then fi fi @@ -56,7 +56,7 @@ ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -@@ -6167,7 +6167,7 @@ else +@@ -8440,7 +8440,7 @@ else # trust that they are doing what they want. if test "$with_static_standard_libraries" = yes -a "$stage1_libs" = "" \ -a "$have_static_libs" = yes; then @@ -65,7 +65,7 @@ fi fi -@@ -6203,7 +6203,7 @@ else +@@ -8476,7 +8476,7 @@ else # statically. But if the user explicitly specified the libraries to # use, trust that they are doing what they want. if test "$poststage1_libs" = ""; then diff --git a/package/devel/gdb/patches/130-gdb-ctrl-c.patch b/package/devel/gdb/patches/130-gdb-ctrl-c.patch index f793a71cae0222..8650ce844c7770 100644 --- a/package/devel/gdb/patches/130-gdb-ctrl-c.patch +++ b/package/devel/gdb/patches/130-gdb-ctrl-c.patch @@ -24,12 +24,12 @@ Signed-off-by: Khem Raj --- a/gdbserver/linux-low.cc +++ b/gdbserver/linux-low.cc -@@ -5496,7 +5496,7 @@ linux_process_target::request_interrupt +@@ -5467,7 +5467,7 @@ linux_process_target::request_interrupt { /* Send a SIGINT to the process group. This acts just like the user typed a ^C on the controlling terminal. */ -- ::kill (-signal_pid, SIGINT); -+ ::kill (signal_pid, SIGINT); - } - - bool +- int res = ::kill (-signal_pid, SIGINT); ++ int res = ::kill (signal_pid, SIGINT); + if (res == -1) + warning (_("Sending SIGINT to process group of pid %ld failed: %s"), + signal_pid, safe_strerror (errno)); diff --git a/package/devel/kselftests-bpf/Makefile b/package/devel/kselftests-bpf/Makefile index ae845486bd45d7..0a5b874e04db7d 100644 --- a/package/devel/kselftests-bpf/Makefile +++ b/package/devel/kselftests-bpf/Makefile @@ -42,7 +42,7 @@ MAKE_VARS = \ CROSS_COMPILE="$(TARGET_CROSS)" \ SAN_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ LDLIBS="$(TARGET_LDFLAGS)" \ - TOOLCHAIN_INCLUDE="$(TOOLCHAIN_DIR)/include" \ + TOOLCHAIN_INCLUDE="$(TOOLCHAIN_INC_DIRS)" \ VMLINUX_BTF="$(LINUX_DIR)/vmlinux" MAKE_FLAGS = \ diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile index e572cc0315d98d..3343177c3e914f 100644 --- a/package/devel/strace/Makefile +++ b/package/devel/strace/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=strace -PKG_VERSION:=6.4 +PKG_VERSION:=6.5 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION) -PKG_HASH:=27987dbac57fdfd260c6db4dc8328df35c95c6867c8a3d4371d59cdcf4eb9238 +PKG_HASH:=dfb051702389e1979a151892b5901afc9e93bbc1c70d84c906ade3224ca91980 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=LGPL-2.1-or-later diff --git a/package/devel/valgrind/Makefile b/package/devel/valgrind/Makefile index f696b28c3c79e9..9f8a2e9e79acb4 100644 --- a/package/devel/valgrind/Makefile +++ b/package/devel/valgrind/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=valgrind -PKG_VERSION:=3.21.0 +PKG_VERSION:=3.22.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://sourceware.org/pub/valgrind/ -PKG_HASH:=10ce1618bb3e33fad16eb79552b0a3e1211762448a0d7fce11c8a6243b9ac971 +PKG_HASH:=c811db5add2c5f729944caf47c4e7a65dcaabb9461e472b578765dd7bf6d2d4c PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0+ diff --git a/package/devel/valgrind/patches/130-mips_fix_soft_float.patch b/package/devel/valgrind/patches/130-mips_fix_soft_float.patch index 9d3482815c49b1..7c7122ecac916e 100644 --- a/package/devel/valgrind/patches/130-mips_fix_soft_float.patch +++ b/package/devel/valgrind/patches/130-mips_fix_soft_float.patch @@ -48,7 +48,7 @@ This fixes the following error message when compiling with a GCC 10 MIPS BE 32: --- a/coregrind/m_machine.c +++ b/coregrind/m_machine.c -@@ -2106,6 +2106,7 @@ Bool VG_(machine_get_hwcaps)( void ) +@@ -2109,6 +2109,7 @@ Bool VG_(machine_get_hwcaps)( void ) we are using alternative way to determine FP mode */ ULong result = 0; @@ -56,7 +56,7 @@ This fixes the following error message when compiling with a GCC 10 MIPS BE 32: if (!VG_MINIMAL_SETJMP(env_unsup_insn)) { __asm__ volatile ( ".set push\n\t" -@@ -2123,6 +2124,9 @@ Bool VG_(machine_get_hwcaps)( void ) +@@ -2126,6 +2127,9 @@ Bool VG_(machine_get_hwcaps)( void ) fpmode = (result != 0x3FF0000000000000ull); } diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 96497af0c336d2..06181e4f6e316d 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git -PKG_SOURCE_DATE:=2023-09-16 -PKG_SOURCE_VERSION:=57aa1b1562ac60f11a6bec8be02cd3b68b12b3fa -PKG_MIRROR_HASH:=f8f9ab78ae85180a6e601d7c911d6c350b0cc132172d4baefc8f9fe07566ce0f +PKG_SOURCE_DATE:=2023-11-10 +PKG_SOURCE_VERSION:=0c2e810e71ed0a59fb00246c7fa2c236ff67a0ee +PKG_MIRROR_HASH:=fc6016540bd2c67484952d0e4432d740f0e022d9b688e851bb6321def8d36844 PKG_FLAGS:=nonshared @@ -37,6 +37,7 @@ ALLWIFIBOARDS:= \ netgear_rax120v2 \ netgear_wax218 \ netgear_wax620 \ + netgear_wax630 \ prpl_haze \ qnap_301w \ redmi_ax6 \ @@ -44,6 +45,7 @@ ALLWIFIBOARDS:= \ xiaomi_ax3600 \ xiaomi_ax9000 \ yyets_le1 \ + yuncore_ax880 \ zte_mf289f \ zte_mf287 \ zte_mf287plus \ @@ -144,6 +146,7 @@ $(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800)) $(eval $(call generate-ipq-wifi-package,netgear_rax120v2,Netgear RAX120v2)) $(eval $(call generate-ipq-wifi-package,netgear_wax218,Netgear WAX218)) $(eval $(call generate-ipq-wifi-package,netgear_wax620,Netgear WAX620)) +$(eval $(call generate-ipq-wifi-package,netgear_wax630,Netgear WAX630)) $(eval $(call generate-ipq-wifi-package,qnap_301w,QNAP 301w)) $(eval $(call generate-ipq-wifi-package,prpl_haze,prpl Haze)) $(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6)) @@ -151,6 +154,7 @@ $(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9)) $(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600)) $(eval $(call generate-ipq-wifi-package,xiaomi_ax9000,Xiaomi AX9000)) $(eval $(call generate-ipq-wifi-package,yyets_le1,YYeTs LE1)) +$(eval $(call generate-ipq-wifi-package,yuncore_ax880,Yuncore AX880)) $(eval $(call generate-ipq-wifi-package,zte_mf289f,ZTE MF289F)) $(eval $(call generate-ipq-wifi-package,zte_mf287,ZTE MF287)) $(eval $(call generate-ipq-wifi-package,zte_mf287plus,ZTE MF287Plus)) diff --git a/package/firmware/ixp4xx-microcode/Makefile b/package/firmware/ixp4xx-microcode/Makefile new file mode 100644 index 00000000000000..5ee04a757a2c4a --- /dev/null +++ b/package/firmware/ixp4xx-microcode/Makefile @@ -0,0 +1,77 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2007-2023 OpenWrt.org + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ixp4xx-microcode +PKG_VERSION:=2.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=IPL_ixp400NpeLibraryWithCrypto-2_4.zip +PKG_SOURCE_URL:=http://downloads.openwrt.org/sources +PKG_HASH:=1b1170d0657847248589d946048c0aeaa9cd671966fc5bec5933283309485eaa + +PKG_FLAGS:=nonshared + +include $(INCLUDE_DIR)/package.mk + +# Ethernet or WAN support, pick one +define Package/ixp4xx-microcode-ethernet + SECTION:=firmware + CATEGORY:=Firmware + TITLE:=IXP4xx ethernet firmware + DEPENDS:=@TARGET_ixp4xx +endef +define Package/ixp4xx-microcode-wan + SECTION:=firmware + CATEGORY:=Firmware + TITLE:=IXP4xx WAN firmware + DEPENDS:=@TARGET_ixp4xx +endef + +define Package/ixp4xx-microcode-ethernet/description + This package contains the microcode needed to use the network engines in + IXP4xx CPUs for ethernet on all three NPEs. +endef +define Package/ixp4xx-microcode-wan/description + This package contains the microcode needed to use the network engines in + IXP4xx CPUs for ethernet on NPE-A and NPE-B and WAN (HSS) on NPE-C. +endef + +define Build/Prepare + rm -rf $(PKG_BUILD_DIR) + mkdir -p $(PKG_BUILD_DIR) + unzip -d $(PKG_BUILD_DIR)/ $(DL_DIR)/$(PKG_SOURCE) + mv $(PKG_BUILD_DIR)/ixp400_xscale_sw/src/npeDl/IxNpeMicrocode.c $(PKG_BUILD_DIR)/ + rm -rf $(PKG_BUILD_DIR)/ixp400_xscale_sw + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +define Build/Compile + (cd $(PKG_BUILD_DIR); \ + $(HOSTCC) -Wall -I$(STAGING_DIR_HOST)/include IxNpeMicrocode.c -o IxNpeMicrocode; \ + ./IxNpeMicrocode -be \ + ) +endef + +define Package/ixp4xx-microcode-ethernet/install + $(INSTALL_DIR) $(1)/lib/firmware + $(INSTALL_DIR) $(1)/usr/share/doc + $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-A $(1)/lib/firmware/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-B $(1)/lib/firmware/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-C $(1)/lib/firmware/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/LICENSE.IPL $(1)/usr/share/doc/ +endef +define Package/ixp4xx-microcode-wan/install + $(INSTALL_DIR) $(1)/lib/firmware + $(INSTALL_DIR) $(1)/usr/share/doc + $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-A-HSS $(1)/lib/firmware/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-B $(1)/lib/firmware/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/NPE-C $(1)/lib/firmware/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/LICENSE.IPL $(1)/usr/share/doc/ +endef + + +$(eval $(call BuildPackage,ixp4xx-microcode-ethernet)) +$(eval $(call BuildPackage,ixp4xx-microcode-wan)) diff --git a/package/firmware/ixp4xx-microcode/src/IxNpeMicrocode.h b/package/firmware/ixp4xx-microcode/src/IxNpeMicrocode.h new file mode 100644 index 00000000000000..4a843db104f978 --- /dev/null +++ b/package/firmware/ixp4xx-microcode/src/IxNpeMicrocode.h @@ -0,0 +1,148 @@ +/* + * IxNpeMicrocode.h - Headerfile for compiling the Intel microcode C file + * + * Copyright (C) 2006 Christian Hohnstaedt + * + * This file is released under the GPLv2 + * + * + * compile with + * + * gcc -Wall IxNpeMicrocode.c -o IxNpeMicrocode + * + * Executing the resulting binary on your build-host creates the + * "NPE-[ABC].xxxxxxxx" files containing the selected microcode + * + * fetch the IxNpeMicrocode.c from the Intel Access Library. + * It will include this header. + * + * select Images for every NPE from the following + * (used C++ comments for easy uncommenting ....) + */ + +// #define IX_NPEDL_NPEIMAGE_NPEA_ETH_SPAN_MASK_FIREWALL_VLAN_QOS_HDR_CONV_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEA_ETH_SPAN_VLAN_QOS_HDR_CONV_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEA_ETH_LEARN_FILTER_SPAN_MASK_FIREWALL_VLAN_QOS_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEA_HSS_TSLOT_SWITCH +#define IX_NPEDL_NPEIMAGE_NPEA_ETH_SPAN_FIREWALL_VLAN_QOS_HDR_CONV +// #define IX_NPEDL_NPEIMAGE_NPEA_ETH_LEARN_FILTER_SPAN_FIREWALL_VLAN_QOS +// #define IX_NPEDL_NPEIMAGE_NPEA_ETH_LEARN_FILTER_SPAN_FIREWALL +#define IX_NPEDL_NPEIMAGE_NPEA_HSS_2_PORT +// #define IX_NPEDL_NPEIMAGE_NPEA_DMA +// #define IX_NPEDL_NPEIMAGE_NPEA_ATM_MPHY_12_PORT +// #define IX_NPEDL_NPEIMAGE_NPEA_HSS0_ATM_MPHY_1_PORT +// #define IX_NPEDL_NPEIMAGE_NPEA_HSS0_ATM_SPHY_1_PORT +// #define IX_NPEDL_NPEIMAGE_NPEA_HSS0 +// #define IX_NPEDL_NPEIMAGE_NPEA_WEP + + +// #define IX_NPEDL_NPEIMAGE_NPEB_ETH_SPAN_MASK_FIREWALL_VLAN_QOS_HDR_CONV_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEB_ETH_SPAN_VLAN_QOS_HDR_CONV_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEB_ETH_LEARN_FILTER_SPAN_MASK_FIREWALL_VLAN_QOS_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEB_DMA +#define IX_NPEDL_NPEIMAGE_NPEB_ETH_SPAN_FIREWALL_VLAN_QOS_HDR_CONV +// #define IX_NPEDL_NPEIMAGE_NPEB_ETH_LEARN_FILTER_SPAN_FIREWALL_VLAN_QOS +// #define IX_NPEDL_NPEIMAGE_NPEB_ETH_LEARN_FILTER_SPAN_FIREWALL + + +// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_SPAN_MASK_FIREWALL_VLAN_QOS_HDR_CONV_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_SPAN_VLAN_QOS_HDR_CONV_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_LEARN_FILTER_SPAN_MASK_FIREWALL_VLAN_QOS_EXTMIB +// #define IX_NPEDL_NPEIMAGE_NPEC_DMA +// #define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_ETH_LEARN_FILTER_SPAN +// #define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_ETH_LEARN_FILTER_FIREWALL +#define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_CCM_ETH +// #define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_AES_CCM_EXTSHA_ETH +// #define IX_NPEDL_NPEIMAGE_NPEC_CRYPTO_ETH_LEARN_FILTER_SPAN_FIREWALL +// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_SPAN_FIREWALL_VLAN_QOS_HDR_CONV +// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_LEARN_FILTER_SPAN_FIREWALL_VLAN_QOS +// #define IX_NPEDL_NPEIMAGE_NPEC_ETH_LEARN_FILTER_SPAN_FIREWALL + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define to_le32(x) (x) +#define to_be32(x) bswap_32(x) +#else +#define to_be32(x) (x) +#define to_le32(x) bswap_32(x) +#endif + +struct dl_image { + unsigned magic; + unsigned id; + unsigned size; + unsigned data[0]; +}; + +const unsigned IxNpeMicrocode_array[]; + +int main(int argc, char *argv[]) +{ + struct dl_image *image = (struct dl_image *)IxNpeMicrocode_array; + int imgsiz, i, fd, cnt; + const unsigned *arrayptr = IxNpeMicrocode_array; + const char *names[] = { "IXP425", "IXP465", "unknown" }; + int bigendian = 1; + + if (argc > 1) { + if (!strcmp(argv[1], "-le")) + bigendian = 0; + else if (!strcmp(argv[1], "-be")) + bigendian = 1; + else { + printf("Usage: %s <-le|-be>\n", argv[0]); + return EXIT_FAILURE; + } + } + + for (image = (struct dl_image *)arrayptr, cnt=0; + (image->id != 0xfeedf00d) && (image->magic == 0xfeedf00d); + image = (struct dl_image *)(arrayptr), cnt++) + { + unsigned char field[4]; + imgsiz = image->size + 3; + *(unsigned*)field = to_be32(image->id); + char filename[40], slnk[10]; + + sprintf(filename, "NPE-%c.%08x", (field[0] & 0xf) + 'A', + image->id); + if (image->id == 0x00090000) + sprintf(slnk, "NPE-%c-HSS", (field[0] & 0xf) + 'A'); + else + sprintf(slnk, "NPE-%c", (field[0] & 0xf) + 'A'); + + printf("Writing image: %s.NPE_%c Func: %2x Rev: %02x.%02x " + "Size: %5d to: '%s'\n", + names[field[0] >> 4], (field[0] & 0xf) + 'A', + field[1], field[2], field[3], imgsiz*4, filename); + fd = open(filename, O_CREAT | O_RDWR | O_TRUNC, 0644); + if (fd >= 0) { + for (i=0; i PKG_BUILD_PARALLEL:=1 diff --git a/package/kernel/ath10k-ct/patches/100-ath10k-ct-port-compilation-warning-for-debug-level-t.patch b/package/kernel/ath10k-ct/patches/100-ath10k-ct-port-compilation-warning-for-debug-level-t.patch new file mode 100644 index 00000000000000..f4522c87b4365b --- /dev/null +++ b/package/kernel/ath10k-ct/patches/100-ath10k-ct-port-compilation-warning-for-debug-level-t.patch @@ -0,0 +1,111 @@ +From a227621b46df8a7a5c276131b245f40eac7513fb Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Fri, 3 Nov 2023 04:03:08 +0100 +Subject: [PATCH] ath10k-ct: port compilation warning for debug level to kernel + 6.4 + +Port compilation warning for debug level previously fixed in other +kernel to kernel version 6.4. + +Signed-off-by: Christian Marangi +--- + ath10k-6.4/debug.c | 85 ++++++++++++++++++++++++++-------------------- + 1 file changed, 48 insertions(+), 37 deletions(-) + +--- a/ath10k-6.4/debug.c ++++ b/ath10k-6.4/debug.c +@@ -1345,47 +1345,58 @@ static const struct file_operations fops + .llseek = default_llseek, + }; + ++static const char debug_level_buf[] = ++ "To change debug level, set value adding up desired flags:\n" ++ "PCI: 0x1\n" ++ "WMI: 0x2\n" ++ "HTC: 0x4\n" ++ "HTT: 0x8\n" ++ "MAC: 0x10\n" ++ "BOOT: 0x20\n" ++ "PCI-DUMP: 0x40\n" ++ "HTT-DUMP: 0x80\n" ++ "MGMT: 0x100\n" ++ "DATA: 0x200\n" ++ "BMI: 0x400\n" ++ "REGULATORY: 0x800\n" ++ "TESTMODE: 0x1000\n" ++ "WMI-PRINT: 0x2000\n" ++ "PCI-PS: 0x4000\n" ++ "AHB: 0x8000\n" ++ "SDIO: 0x10000\n" ++ "SDIO_DUMP: 0x20000\n" ++ "USB: 0x40000\n" ++ "USB_BULK: 0x80000\n" ++ "SNOC: 0x100000\n" ++ "QMI: 0x200000\n" ++ "BEACONS: 0x8000000\n" ++ "NO-FW-DBGLOG:0x10000000\n" ++ "MAC2: 0x20000000\n" ++ "INFO-AS-DBG: 0x40000000\n" ++ "FW: 0x80000000\n" ++ "ALL: 0xEFFFFFFF\n"; ++ ++#define READ_DEBUG_LEVEL_SIZE sizeof(debug_level_buf) + 60 ++ + static ssize_t ath10k_read_debug_level(struct file *file, + char __user *user_buf, + size_t count, loff_t *ppos) + { +- int sz; +- const char buf[] = +- "To change debug level, set value adding up desired flags:\n" +- "PCI: 0x1\n" +- "WMI: 0x2\n" +- "HTC: 0x4\n" +- "HTT: 0x8\n" +- "MAC: 0x10\n" +- "BOOT: 0x20\n" +- "PCI-DUMP: 0x40\n" +- "HTT-DUMP: 0x80\n" +- "MGMT: 0x100\n" +- "DATA: 0x200\n" +- "BMI: 0x400\n" +- "REGULATORY: 0x800\n" +- "TESTMODE: 0x1000\n" +- "WMI-PRINT: 0x2000\n" +- "PCI-PS: 0x4000\n" +- "AHB: 0x8000\n" +- "SDIO: 0x10000\n" +- "SDIO_DUMP: 0x20000\n" +- "USB: 0x40000\n" +- "USB_BULK: 0x80000\n" +- "SNOC: 0x100000\n" +- "QMI: 0x200000\n" +- "BEACONS: 0x8000000\n" +- "NO-FW-DBGLOG:0x10000000\n" +- "MAC2: 0x20000000\n" +- "INFO-AS-DBG: 0x40000000\n" +- "FW: 0x80000000\n" +- "ALL: 0xEFFFFFFF\n"; +- char wbuf[sizeof(buf) + 60]; +- sz = snprintf(wbuf, sizeof(wbuf), "Current debug level: 0x%x\n\n%s", +- ath10k_debug_mask, buf); +- wbuf[sizeof(wbuf) - 1] = 0; ++ int sz, ret; ++ char *wbuf; ++ ++ wbuf = kcalloc(READ_DEBUG_LEVEL_SIZE, sizeof(char), GFP_KERNEL); ++ if (!wbuf) ++ return -ENOMEM; ++ ++ sz = snprintf(wbuf, READ_DEBUG_LEVEL_SIZE, ++ "Current debug level: 0x%x\n\n%s", ++ ath10k_debug_mask, debug_level_buf); ++ ++ ret = simple_read_from_buffer(user_buf, count, ppos, wbuf, sz); ++ kfree(wbuf); + +- return simple_read_from_buffer(user_buf, count, ppos, wbuf, sz); ++ return ret; + } + + /* Set logging level. diff --git a/package/kernel/ath10k-ct/patches/130-ath10k-read-qcom-coexist-support-as-a-u32.patch b/package/kernel/ath10k-ct/patches/130-ath10k-read-qcom-coexist-support-as-a-u32.patch index 77e2724991ea87..891973f38dbe2b 100644 --- a/package/kernel/ath10k-ct/patches/130-ath10k-read-qcom-coexist-support-as-a-u32.patch +++ b/package/kernel/ath10k-ct/patches/130-ath10k-read-qcom-coexist-support-as-a-u32.patch @@ -39,8 +39,8 @@ that the feature is properly initialized: Signed-off-by: Vincent Tremblay ---- a/ath10k-6.2/core.c -+++ b/ath10k-6.2/core.c +--- a/ath10k-6.4/core.c ++++ b/ath10k-6.4/core.c @@ -2869,14 +2869,14 @@ done: static void ath10k_core_fetch_btcoex_dt(struct ath10k *ar) { diff --git a/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch index 844c089e888f56..8eb587b877b5ca 100644 --- a/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch @@ -66,24 +66,24 @@ v13: * cleanup includes - ath10k-6.2/Kconfig | 10 +++ - ath10k-6.2/Makefile | 1 + - ath10k-6.2/core.c | 22 +++++++ - ath10k-6.2/core.h | 9 ++- - ath10k-6.2/hw.h | 1 + - ath10k-6.2/leds.c | 103 ++++++++++++++++++++++++++++++ - ath10k-6.2/leds.h | 45 +++++++++++++ - ath10k-6.2/mac.c | 1 + - ath10k-6.2/wmi-ops.h | 32 ++++++++++ - ath10k-6.2/wmi-tlv.c | 2 + - ath10k-6.2/wmi.c | 54 ++++++++++++++++ - ath10k-6.2/wmi.h | 35 ++++++++++ + ath10k-6.4/Kconfig | 10 +++ + ath10k-6.4/Makefile | 1 + + ath10k-6.4/core.c | 22 +++++++ + ath10k-6.4/core.h | 9 ++- + ath10k-6.4/hw.h | 1 + + ath10k-6.4/leds.c | 103 ++++++++++++++++++++++++++++++ + ath10k-6.4/leds.h | 45 +++++++++++++ + ath10k-6.4/mac.c | 1 + + ath10k-6.4/wmi-ops.h | 32 ++++++++++ + ath10k-6.4/wmi-tlv.c | 2 + + ath10k-6.4/wmi.c | 54 ++++++++++++++++ + ath10k-6.4/wmi.h | 35 ++++++++++ 12 files changed, 314 insertions(+), 1 deletion(-) - create mode 100644 ath10k-6.2/leds.c - create mode 100644 ath10k-6.2/leds.h + create mode 100644 ath10k-6.4/leds.c + create mode 100644 ath10k-6.4/leds.h ---- a/ath10k-6.2/Kconfig -+++ b/ath10k-6.2/Kconfig +--- a/ath10k-6.4/Kconfig ++++ b/ath10k-6.4/Kconfig @@ -67,6 +67,16 @@ config ATH10K_DEBUGFS If unsure, say Y to make it easier to debug problems. @@ -101,8 +101,8 @@ v13: config ATH10K_SPECTRAL bool "Atheros ath10k spectral scan support" depends on ATH10K_DEBUGFS ---- a/ath10k-6.2/Makefile -+++ b/ath10k-6.2/Makefile +--- a/ath10k-6.4/Makefile ++++ b/ath10k-6.4/Makefile @@ -20,6 +20,7 @@ ath10k_core-$(CONFIG_ATH10K_SPECTRAL) += ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o @@ -111,8 +111,8 @@ v13: ath10k_core-$(CONFIG_MAC80211_DEBUGFS) += debugfs_sta.o ath10k_core-$(CONFIG_PM) += wow.o ath10k_core-$(CONFIG_ATH10K_CE) += ce.o ---- a/ath10k-6.2/core.c -+++ b/ath10k-6.2/core.c +--- a/ath10k-6.4/core.c ++++ b/ath10k-6.4/core.c @@ -28,6 +28,7 @@ #include "testmode.h" #include "wmi-ops.h" @@ -200,8 +200,8 @@ v13: ath10k_thermal_unregister(ar); /* Stop spectral before unregistering from mac80211 to remove the * relayfs debugfs file cleanly. Otherwise the parent debugfs tree ---- a/ath10k-6.2/core.h -+++ b/ath10k-6.2/core.h +--- a/ath10k-6.4/core.h ++++ b/ath10k-6.4/core.h @@ -14,6 +14,7 @@ #include #include @@ -224,8 +224,8 @@ v13: /* protected by data_lock */ u32 rx_crc_err_drop; u32 fw_crash_counter; ---- a/ath10k-6.2/hw.h -+++ b/ath10k-6.2/hw.h +--- a/ath10k-6.4/hw.h ++++ b/ath10k-6.4/hw.h @@ -523,6 +523,7 @@ struct ath10k_hw_params { const char *name; u32 patch_load_addr; @@ -235,7 +235,7 @@ v13: /* Type of hw cycle counter wraparound logic, for more info --- /dev/null -+++ b/ath10k-6.2/leds.c ++++ b/ath10k-6.4/leds.c @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2005-2011 Atheros Communications Inc. @@ -341,7 +341,7 @@ v13: +} + --- /dev/null -+++ b/ath10k-6.2/leds.h ++++ b/ath10k-6.4/leds.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018, The Linux Foundation. All rights reserved. @@ -384,8 +384,8 @@ v13: + +#endif +#endif /* _LEDS_H_ */ ---- a/ath10k-6.2/mac.c -+++ b/ath10k-6.2/mac.c +--- a/ath10k-6.4/mac.c ++++ b/ath10k-6.4/mac.c @@ -25,6 +25,7 @@ #include "wmi-tlv.h" #include "wmi-ops.h" @@ -394,8 +394,8 @@ v13: /*********/ /* Rates */ ---- a/ath10k-6.2/wmi-ops.h -+++ b/ath10k-6.2/wmi-ops.h +--- a/ath10k-6.4/wmi-ops.h ++++ b/ath10k-6.4/wmi-ops.h @@ -228,7 +228,10 @@ struct wmi_ops { const struct wmi_bb_timing_cfg_arg *arg); struct sk_buff *(*gen_per_peer_per_tid_cfg)(struct ath10k *ar, @@ -443,8 +443,8 @@ v13: static inline int ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level) { ---- a/ath10k-6.2/wmi-tlv.c -+++ b/ath10k-6.2/wmi-tlv.c +--- a/ath10k-6.4/wmi-tlv.c ++++ b/ath10k-6.4/wmi-tlv.c @@ -4601,6 +4601,8 @@ static const struct wmi_ops wmi_tlv_ops .gen_echo = ath10k_wmi_tlv_op_gen_echo, .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf, @@ -454,8 +454,8 @@ v13: }; static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = { ---- a/ath10k-6.2/wmi.c -+++ b/ath10k-6.2/wmi.c +--- a/ath10k-6.4/wmi.c ++++ b/ath10k-6.4/wmi.c @@ -8438,6 +8438,49 @@ ath10k_wmi_op_gen_peer_set_param(struct return skb; } @@ -552,8 +552,8 @@ v13: }; int ath10k_wmi_attach(struct ath10k *ar) ---- a/ath10k-6.2/wmi.h -+++ b/ath10k-6.2/wmi.h +--- a/ath10k-6.4/wmi.h ++++ b/ath10k-6.4/wmi.h @@ -3133,6 +3133,41 @@ enum wmi_10_4_feature_mask { }; diff --git a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch index 8ac2776f9229fa..4f9cf83c48875a 100644 --- a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch @@ -9,13 +9,13 @@ traffic. Signed-off-by: Mathias Kresin --- - ath10k-6.2/core.h | 4 ++++ - ath10k-6.2/leds.c | 4 +--- - ath10k-6.2/mac.c | 2 +- + ath10k-6.4/core.h | 4 ++++ + ath10k-6.4/leds.c | 4 +--- + ath10k-6.4/mac.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) ---- a/ath10k-6.2/core.h -+++ b/ath10k-6.2/core.h +--- a/ath10k-6.4/core.h ++++ b/ath10k-6.4/core.h @@ -1701,6 +1701,10 @@ struct ath10k { u8 csi_data[4096]; u16 csi_data_len; @@ -27,8 +27,8 @@ Signed-off-by: Mathias Kresin /* must be last */ u8 drv_priv[] __aligned(sizeof(void *)); }; ---- a/ath10k-6.2/leds.c -+++ b/ath10k-6.2/leds.c +--- a/ath10k-6.4/leds.c ++++ b/ath10k-6.4/leds.c @@ -81,9 +81,7 @@ int ath10k_leds_register(struct ath10k * ar->leds.cdev.name = ar->leds.label; @@ -40,9 +40,9 @@ Signed-off-by: Mathias Kresin ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev); if (ret) ---- a/ath10k-6.2/mac.c -+++ b/ath10k-6.2/mac.c -@@ -11617,7 +11617,7 @@ int ath10k_mac_register(struct ath10k *a +--- a/ath10k-6.4/mac.c ++++ b/ath10k-6.4/mac.c +@@ -11616,7 +11616,7 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; #ifdef CPTCFG_MAC80211_LEDS diff --git a/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch b/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch index 1471902be3bb51..b0e6ef76fa49d8 100644 --- a/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch +++ b/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch @@ -1,5 +1,5 @@ ---- a/ath10k-6.2/htt.h -+++ b/ath10k-6.2/htt.h +--- a/ath10k-6.4/htt.h ++++ b/ath10k-6.4/htt.h @@ -237,7 +237,11 @@ enum htt_rx_ring_flags { }; diff --git a/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch b/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch index 145b2e7c3586db..82109995d994e5 100644 --- a/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch +++ b/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch @@ -1,5 +1,5 @@ ---- a/ath10k-6.2/pci.c -+++ b/ath10k-6.2/pci.c +--- a/ath10k-6.4/pci.c ++++ b/ath10k-6.4/pci.c @@ -131,7 +131,11 @@ static const struct ce_attr pci_host_ce_ .flags = CE_ATTR_FLAGS, .src_nentries = 0, diff --git a/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch b/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch index 40f262464b137a..8aef577debc3fa 100644 --- a/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch +++ b/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch @@ -13,12 +13,12 @@ own loss detection mechanism. Signed-off-by: David Bauer --- - ath10k-6.2/mac.c | 1 - + ath10k-6.4/mac.c | 1 - 1 file changed, 1 deletion(-) ---- a/ath10k-6.2/mac.c -+++ b/ath10k-6.2/mac.c -@@ -11306,7 +11306,6 @@ int ath10k_mac_register(struct ath10k *a +--- a/ath10k-6.4/mac.c ++++ b/ath10k-6.4/mac.c +@@ -11305,7 +11305,6 @@ int ath10k_mac_register(struct ath10k *a ieee80211_hw_set(ar->hw, CHANCTX_STA_CSA); ieee80211_hw_set(ar->hw, QUEUE_CONTROL); ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG); diff --git a/package/kernel/bpf-headers/Makefile b/package/kernel/bpf-headers/Makefile index 733f3586727082..5efd2e1cf0fb74 100644 --- a/package/kernel/bpf-headers/Makefile +++ b/package/kernel/bpf-headers/Makefile @@ -19,7 +19,7 @@ include $(INCLUDE_DIR)/kernel-$(PKG_PATCHVER) PKG_VERSION:=$(PKG_PATCHVER)$(strip $(LINUX_VERSION-$(PKG_PATCHVER))) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=$(LINUX_SITE) +PKG_SOURCE_URL:=@KERNEL/linux/kernel/v$(word 1,$(subst ., ,$(PKG_PATCHVER))).x PKG_HASH:=$(LINUX_KERNEL_HASH-$(strip $(PKG_VERSION))) PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/bpf-headers/$(PKG_NAME)-$(PKG_VERSION) diff --git a/package/kernel/linux/Makefile b/package/kernel/linux/Makefile index ff917602701ab6..c88b5c1b319419 100644 --- a/package/kernel/linux/Makefile +++ b/package/kernel/linux/Makefile @@ -37,6 +37,9 @@ endef define Build/Configure endef +define Build/Quilt +endef + define Build/Compile endef diff --git a/package/kernel/linux/modules/block.mk b/package/kernel/linux/modules/block.mk index 4ee3f78f3809a2..5e6eefa76a9491 100644 --- a/package/kernel/linux/modules/block.mk +++ b/package/kernel/linux/modules/block.mk @@ -496,12 +496,12 @@ $(eval $(call KernelPackage,nbd)) define KernelPackage/nvme SUBMENU:=$(BLOCK_MENU) TITLE:=NVM Express block device - DEPENDS:=@PCI_SUPPORT + DEPENDS:=@PCI_SUPPORT +kmod-hwmon-core KCONFIG:= \ CONFIG_NVME_CORE \ CONFIG_BLK_DEV_NVME \ CONFIG_NVME_MULTIPATH=n \ - CONFIG_NVME_HWMON=n + CONFIG_NVME_HWMON=y FILES:= \ $(LINUX_DIR)/drivers/nvme/host/nvme-core.ko \ $(LINUX_DIR)/drivers/nvme/host/nvme.ko diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index 501be4b0a02c88..dd17d868fa1522 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -399,6 +399,19 @@ endef $(eval $(call KernelPackage,crypto-hw-hifn-795x)) +define KernelPackage/crypto-hw-ixp4xx + TITLE:=Intel IXP4xx crypto accelerator + DEPENDS:=@TARGET_ixp4xx +kmod-random-core +kmod-crypto-manager +kmod-crypto-authenc +kmod-crypto-des + KCONFIG:= \ + CONFIG_CRYPTO_HW=y \ + CONFIG_CRYPTO_DEV_IXP4XX + FILES:=$(LINUX_DIR)/drivers/crypto/ixp4xx_crypto.ko + AUTOLOAD:=$(call AutoProbe,ixp4xx_crypto) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-hw-ixp4xx)) + define KernelPackage/crypto-hw-padlock TITLE:=VIA PadLock ACE with AES/SHA hw crypto module @@ -523,6 +536,8 @@ define KernelPackage/crypto-lib-chacha20/arm FILES:=$(LINUX_DIR)/arch/arm/crypto/chacha-neon.ko endef +KernelPackage/crypto-lib-chacha20/armeb=$(KernelPackage/crypto-lib-chacha20/arm) + define KernelPackage/crypto-lib-chacha20/aarch64 KCONFIG+=CONFIG_CRYPTO_CHACHA20_NEON FILES+=$(LINUX_DIR)/arch/arm64/crypto/chacha-neon.ko @@ -616,6 +631,8 @@ define KernelPackage/crypto-lib-poly1305/arm FILES:=$(LINUX_DIR)/arch/arm/crypto/poly1305-arm.ko endef +KernelPackage/crypto-lib-poly1305/armeb=$(KernelPackage/crypto-lib-poly1305/arm) + define KernelPackage/crypto-lib-poly1305/aarch64 KCONFIG+=CONFIG_CRYPTO_POLY1305_NEON FILES:=$(LINUX_DIR)/arch/arm64/crypto/poly1305-neon.ko diff --git a/package/kernel/linux/modules/hwmon.mk b/package/kernel/linux/modules/hwmon.mk index 092bdf2b107d36..8638d50823535a 100644 --- a/package/kernel/linux/modules/hwmon.mk +++ b/package/kernel/linux/modules/hwmon.mk @@ -77,6 +77,23 @@ endef $(eval $(call KernelPackage,hwmon-adt7475)) +define KernelPackage/hwmon-coretemp + TITLE:=Intel Core/Core2/Atom temperature sensor + KCONFIG:=CONFIG_SENSORS_CORETEMP + FILES:=$(LINUX_DIR)/drivers/hwmon/coretemp.ko + AUTOLOAD:=$(call AutoProbe,coretemp) + $(call AddDepends/hwmon,) +endef + +define KernelPackage/hwmon-coretemp/description + Kernel module for Intel Core/Core2/Atom temperature monitoring support. + Most of the family 6 CPUs are supported. + Check Documentation/hwmon/coretemp.rst for details. +endef + +$(eval $(call KernelPackage,hwmon-coretemp)) + + define KernelPackage/hwmon-dme1737 TITLE:=SMSC DME1737 and compatible monitoring support KCONFIG:=CONFIG_SENSORS_DME1737 diff --git a/package/kernel/linux/modules/leds.mk b/package/kernel/linux/modules/leds.mk index fcf9c987e8ece4..24af1b7f615afe 100644 --- a/package/kernel/linux/modules/leds.mk +++ b/package/kernel/linux/modules/leds.mk @@ -147,6 +147,22 @@ endef $(eval $(call KernelPackage,leds-apu)) +define KernelPackage/leds-mlxcpld + SUBMENU:=$(LEDS_MENU) + TITLE:=LED support for the Mellanox boards + FILES:=$(LINUX_DIR)/drivers/leds/leds-mlxcpld.ko + KCONFIG:=CONFIG_LEDS_MLXCPLD + AUTOLOAD:=$(call AutoProbe,leds-mlxcpld) +endef + +define KernelPackage/leds-mlxcpld/description + This option enables support for the LEDs on the Mellanox + boards. +endef + +$(eval $(call KernelPackage,leds-mlxcpld)) + + define KernelPackage/leds-pca955x SUBMENU:=$(LEDS_MENU) TITLE:=LED driver for PCA955x I2C chips diff --git a/package/kernel/linux/modules/lib.mk b/package/kernel/linux/modules/lib.mk index c7d32d73170f6d..8d67a3187a6272 100644 --- a/package/kernel/linux/modules/lib.mk +++ b/package/kernel/linux/modules/lib.mk @@ -318,3 +318,29 @@ define KernelPackage/oid-registry endef $(eval $(call KernelPackage,oid-registry)) + + +define KernelPackage/lib-objagg + SUBMENU:=$(LIB_MENU) + TITLE:=objagg support + FILES:=$(LINUX_DIR)/lib/objagg.ko + KCONFIG:= \ + CONFIG_OBJAGG \ + CONFIG_TEST_OBJAGG=n + AUTOLOAD:=$(call AutoProbe,objagg) +endef + +$(eval $(call KernelPackage,lib-objagg)) + + +define KernelPackage/lib-parman + SUBMENU:=$(LIB_MENU) + TITLE:=parman support + FILES:=$(LINUX_DIR)/lib/parman.ko + KCONFIG:= \ + CONFIG_PARMAN \ + CONFIG_TEST_PARMAN=n + AUTOLOAD:=$(call AutoProbe,parman) +endef + +$(eval $(call KernelPackage,lib-parman)) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index b0d69e022069ca..d357b233f2a0d4 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -224,6 +224,22 @@ endef $(eval $(call KernelPackage,phylib-broadcom)) +define KernelPackage/phy-amd + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=AMD PHY driver + KCONFIG:=CONFIG_AMD_PHY + DEPENDS:=+kmod-libphy + FILES:=$(LINUX_DIR)/drivers/net/phy/amd.ko + AUTOLOAD:=$(call AutoProbe,amd,1) +endef + +define KernelPackage/phy-amd/description + Currently supports the AMD and Altima PHYs. +endef + +$(eval $(call KernelPackage,phy-amd)) + + define KernelPackage/phy-ax88796b SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Asix PHY driver @@ -362,9 +378,11 @@ $(eval $(call KernelPackage,phy-smsc)) define KernelPackage/phy-aquantia SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Aquantia Ethernet PHYs - DEPENDS:=+kmod-libphy +kmod-hwmon-core + DEPENDS:=+kmod-libphy +kmod-hwmon-core +kmod-lib-crc-ccitt KCONFIG:=CONFIG_AQUANTIA_PHY - FILES:=$(LINUX_DIR)/drivers/net/phy/aquantia.ko + FILES:= \ + $(LINUX_DIR)/drivers/net/phy/aquantia.ko@lt6.1 \ + $(LINUX_DIR)/drivers/net/phy/aquantia/aquantia.ko@ge6.1 AUTOLOAD:=$(call AutoLoad,18,aquantia,1) endef @@ -1327,7 +1345,7 @@ $(eval $(call KernelPackage,mlx4-core)) define KernelPackage/mlx5-core SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Mellanox ConnectX(R) mlx5 core Network Driver - DEPENDS:=@PCI_SUPPORT +kmod-ptp + DEPENDS:=@PCI_SUPPORT +kmod-ptp +kmod-mlxfw FILES:=$(LINUX_DIR)/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko KCONFIG:= CONFIG_MLX5_CORE \ CONFIG_MLX5_CORE_EN=y \ @@ -1356,6 +1374,119 @@ endef $(eval $(call KernelPackage,mlx5-core)) +define KernelPackage/mlxfw + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Mellanox Technologies firmware flash module + FILES:=$(LINUX_DIR)/drivers/net/ethernet/mellanox/mlxfw/mlxfw.ko + KCONFIG:=CONFIG_MLXFW + AUTOLOAD:=$(call AutoProbe,mlxfw) +endef + +define KernelPackage/mlxfw/description + This driver supports Mellanox Technologies Firmware + flashing common logic. +endef + +$(eval $(call KernelPackage,mlxfw)) + + +define KernelPackage/mlxsw-core + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Mellanox Technologies Switch ASICs support + DEPENDS:=+kmod-mlxfw +kmod-hwmon-core + FILES:=$(LINUX_DIR)/drivers/net/ethernet/mellanox/mlxsw/mlxsw_core.ko + KCONFIG:= \ + CONFIG_MLXSW_CORE \ + CONFIG_MLXSW_CORE_HWMON=y \ + CONFIG_MLXSW_CORE_THERMAL=y + AUTOLOAD:=$(call AutoProbe,mlxsw_core) +endef + +define KernelPackage/mlxsw-core/description + This driver supports Mellanox Technologies Switch ASICs family. +endef + +$(eval $(call KernelPackage,mlxsw-core)) + + +define KernelPackage/mlxsw-i2c + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=I2C bus implementation for Mellanox Technologies Switch ASICs + DEPENDS:=+kmod-mlxsw-core +kmod-i2c-core + FILES:=$(LINUX_DIR)/drivers/net/ethernet/mellanox/mlxsw/mlxsw_i2c.ko + KCONFIG:=CONFIG_MLXSW_I2C + AUTOLOAD:=$(call AutoProbe,mlxsw_i2c) +endef + +define KernelPackage/mlxsw-i2c/description + This is I2C bus implementation for Mellanox Technologies Switch ASICs. +endef + +$(eval $(call KernelPackage,mlxsw-i2c)) + + +define KernelPackage/mlxsw-minimal + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Mellanox Technologies minimal I2C support + DEPENDS:=+kmod-mlxsw-core +kmod-mlxsw-i2c + FILES:=$(LINUX_DIR)/drivers/net/ethernet/mellanox/mlxsw/mlxsw_minimal.ko + KCONFIG:=CONFIG_MLXSW_MINIMAL + AUTOLOAD:=$(call AutoProbe,mlxsw_minimal) +endef + +define KernelPackage/mlxsw-minimal/description + This driver supports I2C access for Mellanox Technologies Switch + ASICs. +endef + +$(eval $(call KernelPackage,mlxsw-minimal)) + + +define KernelPackage/mlxsw-pci + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=PCI bus implementation for Mellanox Technologies Switch ASICs + DEPENDS:=@PCI_SUPPORT +kmod-mlxsw-core + FILES:=$(LINUX_DIR)/drivers/net/ethernet/mellanox/mlxsw/mlxsw_pci.ko + KCONFIG:=CONFIG_MLXSW_PCI + AUTOLOAD:=$(call AutoProbe,mlxsw_pci) +endef + +define KernelPackage/mlxsw-pci/description + This is PCI bus implementation for Mellanox Technologies Switch ASICs. +endef + +$(eval $(call KernelPackage,mlxsw-pci)) + + +define KernelPackage/mlxsw-spectrum + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Mellanox Technologies Spectrum family support + DEPENDS:= \ + +kmod-mlxsw-core +kmod-mlxsw-pci +kmod-lib-objagg +kmod-lib-parman \ + +kmod-ip6-tunnel +kmod-ptp +kmod-sched-act-sample +kmod-vxlan + FILES:=$(LINUX_DIR)/drivers/net/ethernet/mellanox/mlxsw/mlxsw_spectrum.ko + KCONFIG:= \ + CONFIG_MLXSW_SPECTRUM \ + CONFIG_NET_SWITCHDEV=y \ + CONFIG_MLXSW_SPECTRUM_DCB=y \ + CONFIG_DCB=y \ + CONFIG_AMD_XGBE_DCB=n \ + CONFIG_IXGBE_DCB=n \ + CONFIG_I40E_DCB=n \ + CONFIG_QLCNIC_DCB=n \ + CONFIG_FSL_DPAA2_ETH_DCB=n \ + CONFIG_FSL_DPAA2_SWITCH=n + AUTOLOAD:=$(call AutoProbe,mlxsw_spectrum) +endef + +define KernelPackage/mlxsw-spectrum/description + This driver supports Mellanox Technologies + Spectrum/Spectrum-2/Spectrum-3/Spectrum-4 Ethernet Switch ASICs. +endef + +$(eval $(call KernelPackage,mlxsw-spectrum)) + + define KernelPackage/net-selftests SUBMENU:=$(NETWORK_DEVICES_MENU) DEPENDS:=+kmod-libphy @@ -1411,6 +1542,26 @@ endef $(eval $(call KernelPackage,sfp)) + +define KernelPackage/stmmac-core + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Synopsis Ethernet Controller core (NXP,STMMicro,others) + DEPENDS:=@TARGET_x86_64||TARGET_armsr_armv8 +kmod-pcs-xpcs +kmod-ptp \ + +kmod-of-mdio + KCONFIG:=CONFIG_STMMAC_ETH \ + CONFIG_STMMAC_SELFTESTS=n \ + CONFIG_STMMAC_PLATFORM \ + CONFIG_CONFIG_DWMAC_DWC_QOS_ETH=n \ + CONFIG_DWMAC_GENERIC + FILES=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/stmmac.ko \ + $(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/stmmac-platform.ko \ + $(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.ko + AUTOLOAD=$(call AutoLoad,40,stmmac stmmac-platform dwmac-generic) +endef + +$(eval $(call KernelPackage,stmmac-core)) + + define KernelPackage/igc SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Intel(R) Ethernet Controller I225 Series support diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index ac26c2a15037cf..face5794727736 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -728,6 +728,22 @@ endef $(eval $(call KernelPackage,rtc-pcf2127)) +define KernelPackage/rtc-r7301 + SUBMENU:=$(OTHER_MENU) + TITLE:=Epson RTC7301 support + DEFAULT:=m if ALL_KMODS && RTC_SUPPORT + DEPENDS:=+kmod-regmap-mmio + KCONFIG:=CONFIG_RTC_DRV_R7301 \ + CONFIG_RTC_CLASS=y + FILES:=$(LINUX_DIR)/drivers/rtc/rtc-r7301.ko + AUTOLOAD:=$(call AutoProbe,rtc-r7301) +endef + +define KernelPackage/rtc-r7301/description + Kernel module for Epson RTC7301 RTC chip +endef + +$(eval $(call KernelPackage,rtc-r7301)) define KernelPackage/rtc-rs5c372a SUBMENU:=$(OTHER_MENU) @@ -780,6 +796,22 @@ endef $(eval $(call KernelPackage,rtc-s35390a)) +define KernelPackage/rtc-x1205 + SUBMENU:=$(OTHER_MENU) + TITLE:=Xicor Intersil X1205 + DEFAULT:=m if ALL_KMODS && RTC_SUPPORT + DEPENDS:=+kmod-i2c-core + KCONFIG:=CONFIG_RTC_DRV_X1205 \ + CONFIG_RTC_CLASS=y + FILES:=$(LINUX_DIR)/drivers/rtc/rtc-x1205.ko + AUTOLOAD:=$(call AutoProbe,rtc-x1205) +endef + +define KernelPackage/rtc-x1205/description + Kernel module for Xicor Intersil X1205 I2C RTC chip +endef + +$(eval $(call KernelPackage,rtc-x1205)) define KernelPackage/mtdtests SUBMENU:=$(OTHER_MENU) @@ -1014,31 +1046,33 @@ define KernelPackage/zram/description endef define KernelPackage/zram/config - choice - prompt "ZRAM Default compressor" - default ZRAM_DEF_COMP_LZORLE + if PACKAGE_kmod-zram + choice + prompt "ZRAM Default compressor" + default ZRAM_DEF_COMP_LZORLE - config ZRAM_DEF_COMP_LZORLE + config ZRAM_DEF_COMP_LZORLE bool "lzo-rle" select PACKAGE_kmod-lib-lzo - config ZRAM_DEF_COMP_LZO + config ZRAM_DEF_COMP_LZO bool "lzo" select PACKAGE_kmod-lib-lzo - config ZRAM_DEF_COMP_LZ4 + config ZRAM_DEF_COMP_LZ4 bool "lz4" select PACKAGE_kmod-lib-lz4 - config ZRAM_DEF_COMP_LZ4HC + config ZRAM_DEF_COMP_LZ4HC bool "lz4-hc" select PACKAGE_kmod-lib-lz4hc - config ZRAM_DEF_COMP_ZSTD + config ZRAM_DEF_COMP_ZSTD bool "zstd" select PACKAGE_kmod-lib-zstd - endchoice + endchoice + endif endef $(eval $(call KernelPackage,zram)) diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index 45efd7449f8db8..6218ec994c8357 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -534,7 +534,6 @@ $(eval $(call KernelPackage,usb-wdm)) define KernelPackage/usb-audio TITLE:=Support for USB audio devices KCONFIG:= \ - CONFIG_USB_AUDIO \ CONFIG_SND_USB=y \ CONFIG_SND_USB_AUDIO $(call AddDepends/usb) @@ -751,8 +750,9 @@ $(eval $(call KernelPackage,usb-serial-mct)) define KernelPackage/usb-serial-mos7720 TITLE:=Support for Moschip MOS7720 devices - KCONFIG:=CONFIG_USB_SERIAL_MOS7720 + KCONFIG:=CONFIG_USB_SERIAL_MOS7720 CONFIG_USB_SERIAL_MOS7715_PARPORT=y FILES:=$(LINUX_DIR)/drivers/usb/serial/mos7720.ko + DEPENDS:=+kmod-ppdev AUTOLOAD:=$(call AutoProbe,mos7720) $(call AddDepends/usb-serial) endef diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 860609305f4539..1bf4db6e5f0554 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -940,7 +940,7 @@ mac80211_setup_supplicant() { if [ "$mode" = "sta" ]; then wpa_supplicant_add_network "$ifname" else - wpa_supplicant_add_network "$ifname" "$freq" "$htmode" "$noscan" + wpa_supplicant_add_network "$ifname" "$freq" "$htmode" "$hostapd_noscan" fi wpa_supplicant_add_interface "$ifname" "$mode" diff --git a/package/kernel/mac80211/patches/ath/100-wifi-ath-add-struct_group-for-struct-ath_cycle_count.patch b/package/kernel/mac80211/patches/ath/100-wifi-ath-add-struct_group-for-struct-ath_cycle_count.patch new file mode 100644 index 00000000000000..6c476e90581172 --- /dev/null +++ b/package/kernel/mac80211/patches/ath/100-wifi-ath-add-struct_group-for-struct-ath_cycle_count.patch @@ -0,0 +1,117 @@ +From e8053643b6d70e23a634f14e4408f3a6d1d3a6bf Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Sat, 27 May 2023 09:04:48 +0000 +Subject: [PATCH] wifi: ath: add struct_group for struct ath_cycle_counters + +Add a struct_group to around all members in struct ath_cycle_counters. +It can help the compiler detect the intended bounds of the memcpy() and +memset(). + +This patch fixes the following build warning: + +In function 'fortify_memset_chk', + inlined from 'ath9k_ps_wakeup' at /home/db/openwrt/build_dir/target-mips_24kc_musl/linux-ath79_generic/backports-6.1.24/drivers/net/wireless/ath/ath9k/main.c:140:3: +./include/linux/fortify-string.h:314:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] + 314 | __write_overflow_field(p_size_field, size); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Shiji Yang +--- + drivers/net/wireless/ath/ath.h | 10 ++++++---- + drivers/net/wireless/ath/ath5k/ani.c | 2 +- + drivers/net/wireless/ath/ath5k/base.c | 4 ++-- + drivers/net/wireless/ath/ath5k/mac80211-ops.c | 2 +- + drivers/net/wireless/ath/ath9k/link.c | 2 +- + drivers/net/wireless/ath/ath9k/main.c | 4 ++-- + drivers/net/wireless/ath/hw.c | 2 +- + 7 files changed, 14 insertions(+), 12 deletions(-) + +--- a/drivers/net/wireless/ath/ath.h ++++ b/drivers/net/wireless/ath/ath.h +@@ -43,10 +43,12 @@ struct ath_ani { + }; + + struct ath_cycle_counters { +- u32 cycles; +- u32 rx_busy; +- u32 rx_frame; +- u32 tx_frame; ++ struct_group(cnts, ++ u32 cycles; ++ u32 rx_busy; ++ u32 rx_frame; ++ u32 tx_frame; ++ ); + }; + + enum ath_device_state { +--- a/drivers/net/wireless/ath/ath5k/ani.c ++++ b/drivers/net/wireless/ath/ath5k/ani.c +@@ -379,7 +379,7 @@ ath5k_hw_ani_get_listen_time(struct ath5 + spin_lock_bh(&common->cc_lock); + + ath_hw_cycle_counters_update(common); +- memcpy(&as->last_cc, &common->cc_ani, sizeof(as->last_cc)); ++ memcpy(&as->last_cc.cnts, &common->cc_ani.cnts, sizeof(as->last_cc.cnts)); + + /* clears common->cc_ani */ + listen = ath_hw_get_listen_time(common); +--- a/drivers/net/wireless/ath/ath5k/base.c ++++ b/drivers/net/wireless/ath/ath5k/base.c +@@ -2985,8 +2985,8 @@ ath5k_reset(struct ath5k_hw *ah, struct + memset(&ah->survey, 0, sizeof(ah->survey)); + spin_lock_bh(&common->cc_lock); + ath_hw_cycle_counters_update(common); +- memset(&common->cc_survey, 0, sizeof(common->cc_survey)); +- memset(&common->cc_ani, 0, sizeof(common->cc_ani)); ++ memset(&common->cc_survey.cnts, 0, sizeof(common->cc_survey.cnts)); ++ memset(&common->cc_ani.cnts, 0, sizeof(common->cc_ani.cnts)); + spin_unlock_bh(&common->cc_lock); + + /* +--- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c ++++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c +@@ -665,7 +665,7 @@ ath5k_get_survey(struct ieee80211_hw *hw + ah->survey.time_rx += cc->rx_frame / div; + ah->survey.time_tx += cc->tx_frame / div; + } +- memset(cc, 0, sizeof(*cc)); ++ memset(&cc->cnts, 0, sizeof(cc->cnts)); + spin_unlock_bh(&common->cc_lock); + + memcpy(survey, &ah->survey, sizeof(*survey)); +--- a/drivers/net/wireless/ath/ath9k/link.c ++++ b/drivers/net/wireless/ath/ath9k/link.c +@@ -536,7 +536,7 @@ int ath_update_survey_stats(struct ath_s + if (cc->cycles > 0) + ret = cc->rx_busy * 100 / cc->cycles; + +- memset(cc, 0, sizeof(*cc)); ++ memset(&cc->cnts, 0, sizeof(cc->cnts)); + + ath_update_survey_nf(sc, pos); + +--- a/drivers/net/wireless/ath/ath9k/main.c ++++ b/drivers/net/wireless/ath/ath9k/main.c +@@ -135,8 +135,8 @@ void ath9k_ps_wakeup(struct ath_softc *s + if (power_mode != ATH9K_PM_AWAKE) { + spin_lock(&common->cc_lock); + ath_hw_cycle_counters_update(common); +- memset(&common->cc_survey, 0, sizeof(common->cc_survey)); +- memset(&common->cc_ani, 0, sizeof(common->cc_ani)); ++ memset(&common->cc_survey.cnts, 0, sizeof(common->cc_survey.cnts)); ++ memset(&common->cc_ani.cnts, 0, sizeof(common->cc_ani.cnts)); + spin_unlock(&common->cc_lock); + } + +--- a/drivers/net/wireless/ath/hw.c ++++ b/drivers/net/wireless/ath/hw.c +@@ -183,7 +183,7 @@ int32_t ath_hw_get_listen_time(struct at + listen_time = (cc->cycles - cc->rx_frame - cc->tx_frame) / + (common->clockrate * 1000); + +- memset(cc, 0, sizeof(*cc)); ++ memset(&cc->cnts, 0, sizeof(cc->cnts)); + + return listen_time; + } diff --git a/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch b/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch index 4c6b175ebe2174..23b7340e25c4a8 100644 --- a/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch +++ b/package/kernel/mac80211/patches/ath/400-ath_move_debug_code.patch @@ -14,7 +14,7 @@ CFLAGS_trace.o := -I$(src) --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h -@@ -319,14 +319,7 @@ void _ath_dbg(struct ath_common *common, +@@ -321,14 +321,7 @@ void _ath_dbg(struct ath_common *common, #endif /* CPTCFG_ATH_DEBUG */ /** Returns string describing opmode, or NULL if unknown mode. */ diff --git a/package/kernel/mac80211/patches/ath11k/0016-wifi-ath11k-add-chip-id-board-name-while-searching-b.patch b/package/kernel/mac80211/patches/ath11k/0016-wifi-ath11k-add-chip-id-board-name-while-searching-b.patch new file mode 100644 index 00000000000000..662e28f4ef8d18 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0016-wifi-ath11k-add-chip-id-board-name-while-searching-b.patch @@ -0,0 +1,214 @@ +From 1133af5aea588a58043244a4ecb5ce511b310356 Mon Sep 17 00:00:00 2001 +From: Wen Gong +Date: Wed, 30 Aug 2023 02:02:26 -0400 +Subject: [PATCH] wifi: ath11k: add chip id board name while searching + board-2.bin for WCN6855 + +Sometimes board-2.bin does not have the board data which matched the +parameters such as bus type, vendor, device, subsystem-vendor, +subsystem-device, qmi-chip-id and qmi-board-id, then wlan will load fail. + +Hence add another type which only matches the bus type and qmi-chip-id, +then the ratio of missing board data reduced. + +Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 + +Signed-off-by: Wen Gong +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230830060226.18664-1-quic_wgong@quicinc.com +--- + drivers/net/wireless/ath/ath11k/core.c | 108 ++++++++++++++++++++----- + 1 file changed, 87 insertions(+), 21 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.c ++++ b/drivers/net/wireless/ath/ath11k/core.c +@@ -985,9 +985,15 @@ int ath11k_core_check_dt(struct ath11k_b + return 0; + } + ++enum ath11k_bdf_name_type { ++ ATH11K_BDF_NAME_FULL, ++ ATH11K_BDF_NAME_BUS_NAME, ++ ATH11K_BDF_NAME_CHIP_ID, ++}; ++ + static int __ath11k_core_create_board_name(struct ath11k_base *ab, char *name, + size_t name_len, bool with_variant, +- bool bus_type_mode) ++ enum ath11k_bdf_name_type name_type) + { + /* strlen(',variant=') + strlen(ab->qmi.target.bdf_ext) */ + char variant[9 + ATH11K_QMI_BDF_EXT_STR_LENGTH] = { 0 }; +@@ -998,11 +1004,8 @@ static int __ath11k_core_create_board_na + + switch (ab->id.bdf_search) { + case ATH11K_BDF_SEARCH_BUS_AND_BOARD: +- if (bus_type_mode) +- scnprintf(name, name_len, +- "bus=%s", +- ath11k_bus_str(ab->hif.bus)); +- else ++ switch (name_type) { ++ case ATH11K_BDF_NAME_FULL: + scnprintf(name, name_len, + "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x,qmi-chip-id=%d,qmi-board-id=%d%s", + ath11k_bus_str(ab->hif.bus), +@@ -1012,6 +1015,19 @@ static int __ath11k_core_create_board_na + ab->qmi.target.chip_id, + ab->qmi.target.board_id, + variant); ++ break; ++ case ATH11K_BDF_NAME_BUS_NAME: ++ scnprintf(name, name_len, ++ "bus=%s", ++ ath11k_bus_str(ab->hif.bus)); ++ break; ++ case ATH11K_BDF_NAME_CHIP_ID: ++ scnprintf(name, name_len, ++ "bus=%s,qmi-chip-id=%d", ++ ath11k_bus_str(ab->hif.bus), ++ ab->qmi.target.chip_id); ++ break; ++ } + break; + default: + scnprintf(name, name_len, +@@ -1030,19 +1046,29 @@ static int __ath11k_core_create_board_na + static int ath11k_core_create_board_name(struct ath11k_base *ab, char *name, + size_t name_len) + { +- return __ath11k_core_create_board_name(ab, name, name_len, true, false); ++ return __ath11k_core_create_board_name(ab, name, name_len, true, ++ ATH11K_BDF_NAME_FULL); + } + + static int ath11k_core_create_fallback_board_name(struct ath11k_base *ab, char *name, + size_t name_len) + { +- return __ath11k_core_create_board_name(ab, name, name_len, false, false); ++ return __ath11k_core_create_board_name(ab, name, name_len, false, ++ ATH11K_BDF_NAME_FULL); + } + + static int ath11k_core_create_bus_type_board_name(struct ath11k_base *ab, char *name, + size_t name_len) + { +- return __ath11k_core_create_board_name(ab, name, name_len, false, true); ++ return __ath11k_core_create_board_name(ab, name, name_len, false, ++ ATH11K_BDF_NAME_BUS_NAME); ++} ++ ++static int ath11k_core_create_chip_id_board_name(struct ath11k_base *ab, char *name, ++ size_t name_len) ++{ ++ return __ath11k_core_create_board_name(ab, name, name_len, false, ++ ATH11K_BDF_NAME_CHIP_ID); + } + + const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab, +@@ -1289,16 +1315,21 @@ int ath11k_core_fetch_board_data_api_1(s + #define BOARD_NAME_SIZE 200 + int ath11k_core_fetch_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd) + { +- char boardname[BOARD_NAME_SIZE], fallback_boardname[BOARD_NAME_SIZE]; ++ char *boardname = NULL, *fallback_boardname = NULL, *chip_id_boardname = NULL; + char *filename, filepath[100]; +- int ret; ++ int ret = 0; + + filename = ATH11K_BOARD_API2_FILE; ++ boardname = kzalloc(BOARD_NAME_SIZE, GFP_KERNEL); ++ if (!boardname) { ++ ret = -ENOMEM; ++ goto exit; ++ } + +- ret = ath11k_core_create_board_name(ab, boardname, sizeof(boardname)); ++ ret = ath11k_core_create_board_name(ab, boardname, BOARD_NAME_SIZE); + if (ret) { + ath11k_err(ab, "failed to create board name: %d", ret); +- return ret; ++ goto exit; + } + + ab->bd_api = 2; +@@ -1307,13 +1338,19 @@ int ath11k_core_fetch_bdf(struct ath11k_ + ATH11K_BD_IE_BOARD_NAME, + ATH11K_BD_IE_BOARD_DATA); + if (!ret) +- goto success; ++ goto exit; ++ ++ fallback_boardname = kzalloc(BOARD_NAME_SIZE, GFP_KERNEL); ++ if (!fallback_boardname) { ++ ret = -ENOMEM; ++ goto exit; ++ } + + ret = ath11k_core_create_fallback_board_name(ab, fallback_boardname, +- sizeof(fallback_boardname)); ++ BOARD_NAME_SIZE); + if (ret) { + ath11k_err(ab, "failed to create fallback board name: %d", ret); +- return ret; ++ goto exit; + } + + ret = ath11k_core_fetch_board_data_api_n(ab, bd, fallback_boardname, +@@ -1321,7 +1358,28 @@ int ath11k_core_fetch_bdf(struct ath11k_ + ATH11K_BD_IE_BOARD_NAME, + ATH11K_BD_IE_BOARD_DATA); + if (!ret) +- goto success; ++ goto exit; ++ ++ chip_id_boardname = kzalloc(BOARD_NAME_SIZE, GFP_KERNEL); ++ if (!chip_id_boardname) { ++ ret = -ENOMEM; ++ goto exit; ++ } ++ ++ ret = ath11k_core_create_chip_id_board_name(ab, chip_id_boardname, ++ BOARD_NAME_SIZE); ++ if (ret) { ++ ath11k_err(ab, "failed to create chip id board name: %d", ret); ++ goto exit; ++ } ++ ++ ret = ath11k_core_fetch_board_data_api_n(ab, bd, chip_id_boardname, ++ ATH11K_BD_IE_BOARD, ++ ATH11K_BD_IE_BOARD_NAME, ++ ATH11K_BD_IE_BOARD_DATA); ++ ++ if (!ret) ++ goto exit; + + ab->bd_api = 1; + ret = ath11k_core_fetch_board_data_api_1(ab, bd, ATH11K_DEFAULT_BOARD_FILE); +@@ -1334,14 +1392,22 @@ int ath11k_core_fetch_bdf(struct ath11k_ + ath11k_err(ab, "failed to fetch board data for %s from %s\n", + fallback_boardname, filepath); + ++ ath11k_err(ab, "failed to fetch board data for %s from %s\n", ++ chip_id_boardname, filepath); ++ + ath11k_err(ab, "failed to fetch board.bin from %s\n", + ab->hw_params.fw.dir); +- return ret; + } + +-success: +- ath11k_dbg(ab, ATH11K_DBG_BOOT, "using board api %d\n", ab->bd_api); +- return 0; ++exit: ++ kfree(boardname); ++ kfree(fallback_boardname); ++ kfree(chip_id_boardname); ++ ++ if (!ret) ++ ath11k_dbg(ab, ATH11K_DBG_BOOT, "using board api %d\n", ab->bd_api); ++ ++ return ret; + } + + int ath11k_core_fetch_regdb(struct ath11k_base *ab, struct ath11k_board_data *bd) diff --git a/package/kernel/mac80211/patches/ath11k/0017-wifi-ath11k-fix-boot-failure-with-one-MSI-vector.patch b/package/kernel/mac80211/patches/ath11k/0017-wifi-ath11k-fix-boot-failure-with-one-MSI-vector.patch new file mode 100644 index 00000000000000..9101a1ea1ce557 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0017-wifi-ath11k-fix-boot-failure-with-one-MSI-vector.patch @@ -0,0 +1,103 @@ +From 39564b475ac5a589e6c22c43a08cbd283c295d2c Mon Sep 17 00:00:00 2001 +From: Baochen Qiang +Date: Thu, 7 Sep 2023 09:56:06 +0800 +Subject: [PATCH] wifi: ath11k: fix boot failure with one MSI vector + +Commit 5b32b6dd96633 ("ath11k: Remove core PCI references from +PCI common code") breaks with one MSI vector because it moves +affinity setting after IRQ request, see below log: + +[ 1417.278835] ath11k_pci 0000:02:00.0: failed to receive control response completion, polling.. +[ 1418.302829] ath11k_pci 0000:02:00.0: Service connect timeout +[ 1418.302833] ath11k_pci 0000:02:00.0: failed to connect to HTT: -110 +[ 1418.303669] ath11k_pci 0000:02:00.0: failed to start core: -110 + +The detail is, if do affinity request after IRQ activated, +which is done in request_irq(), kernel caches that request and +returns success directly. Later when a subsequent MHI interrupt is +fired, kernel will do the real affinity setting work, as a result, +changs the MSI vector. However at that time host has configured +old vector to hardware, so host never receives CE or DP interrupts. + +Fix it by setting affinity before registering MHI controller +where host is, for the first time, doing IRQ request. + +Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 +Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 +Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-01160-QCAMSLSWPLZ-1 + +Fixes: 5b32b6dd9663 ("ath11k: Remove core PCI references from PCI common code") +Signed-off-by: Baochen Qiang +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230907015606.16297-1-quic_bqiang@quicinc.com +--- + drivers/net/wireless/ath/ath11k/pci.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/pci.c ++++ b/drivers/net/wireless/ath/ath11k/pci.c +@@ -852,10 +852,16 @@ unsupported_wcn6855_soc: + if (ret) + goto err_pci_disable_msi; + ++ ret = ath11k_pci_set_irq_affinity_hint(ab_pci, cpumask_of(0)); ++ if (ret) { ++ ath11k_err(ab, "failed to set irq affinity %d\n", ret); ++ goto err_pci_disable_msi; ++ } ++ + ret = ath11k_mhi_register(ab_pci); + if (ret) { + ath11k_err(ab, "failed to register mhi: %d\n", ret); +- goto err_pci_disable_msi; ++ goto err_irq_affinity_cleanup; + } + + ret = ath11k_hal_srng_init(ab); +@@ -876,12 +882,6 @@ unsupported_wcn6855_soc: + goto err_ce_free; + } + +- ret = ath11k_pci_set_irq_affinity_hint(ab_pci, cpumask_of(0)); +- if (ret) { +- ath11k_err(ab, "failed to set irq affinity %d\n", ret); +- goto err_free_irq; +- } +- + /* kernel may allocate a dummy vector before request_irq and + * then allocate a real vector when request_irq is called. + * So get msi_data here again to avoid spurious interrupt +@@ -890,20 +890,17 @@ unsupported_wcn6855_soc: + ret = ath11k_pci_config_msi_data(ab_pci); + if (ret) { + ath11k_err(ab, "failed to config msi_data: %d\n", ret); +- goto err_irq_affinity_cleanup; ++ goto err_free_irq; + } + + ret = ath11k_core_init(ab); + if (ret) { + ath11k_err(ab, "failed to init core: %d\n", ret); +- goto err_irq_affinity_cleanup; ++ goto err_free_irq; + } + ath11k_qmi_fwreset_from_cold_boot(ab); + return 0; + +-err_irq_affinity_cleanup: +- ath11k_pci_set_irq_affinity_hint(ab_pci, NULL); +- + err_free_irq: + ath11k_pcic_free_irq(ab); + +@@ -916,6 +913,9 @@ err_hal_srng_deinit: + err_mhi_unregister: + ath11k_mhi_unregister(ab_pci); + ++err_irq_affinity_cleanup: ++ ath11k_pci_set_irq_affinity_hint(ab_pci, NULL); ++ + err_pci_disable_msi: + ath11k_pci_free_msi(ab_pci); + diff --git a/package/kernel/mac80211/patches/ath11k/0018-wifi-ath11k-drop-NULL-pointer-check-in-ath11k_update.patch b/package/kernel/mac80211/patches/ath11k/0018-wifi-ath11k-drop-NULL-pointer-check-in-ath11k_update.patch new file mode 100644 index 00000000000000..ccf7461a75865d --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0018-wifi-ath11k-drop-NULL-pointer-check-in-ath11k_update.patch @@ -0,0 +1,32 @@ +From ac13a7842ab46a87aa315514d6d7e19b03cb2adc Mon Sep 17 00:00:00 2001 +From: Dmitry Antipov +Date: Wed, 6 Sep 2023 12:36:55 +0300 +Subject: [PATCH] wifi: ath11k: drop NULL pointer check in + ath11k_update_per_peer_tx_stats() + +Since 'user_stats' is a fixed-size array of 'struct htt_ppdu_user_stats' +in 'struct htt_ppdu_stats', any of its member can't be NULL and so +relevant check may be dropped. + +Found by Linux Verification Center (linuxtesting.org) with SVACE. + +Signed-off-by: Dmitry Antipov +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230906093704.14001-1-dmantipov@yandex.ru +--- + drivers/net/wireless/ath/ath11k/dp_rx.c | 3 --- + 1 file changed, 3 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -1388,9 +1388,6 @@ ath11k_update_per_peer_tx_stats(struct a + u8 tid = HTT_PPDU_STATS_NON_QOS_TID; + bool is_ampdu = false; + +- if (!usr_stats) +- return; +- + if (!(usr_stats->tlv_flags & BIT(HTT_PPDU_STATS_TAG_USR_RATE))) + return; + diff --git a/package/kernel/mac80211/patches/ath11k/0019-wifi-ath11k-drop-redundant-check-in-ath11k_dp_rx_mon.patch b/package/kernel/mac80211/patches/ath11k/0019-wifi-ath11k-drop-redundant-check-in-ath11k_dp_rx_mon.patch new file mode 100644 index 00000000000000..ace199315b2ff6 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0019-wifi-ath11k-drop-redundant-check-in-ath11k_dp_rx_mon.patch @@ -0,0 +1,38 @@ +From 82ae3f4635382ff23e2ece55b5d5e713223951ec Mon Sep 17 00:00:00 2001 +From: Dmitry Antipov +Date: Thu, 24 Aug 2023 10:50:44 +0300 +Subject: [PATCH] wifi: ath11k: drop redundant check in + ath11k_dp_rx_mon_dest_process() + +In 'ath11k_dp_rx_mon_dest_process()', 'mon_dst_srng' points to +a member of 'srng_list', which is a fixed-size array inside +'struct ath11k_hal'. This way, if 'ring_id' is valid (i. e. +between 0 and HAL_SRNG_RING_ID_MAX - 1 inclusive), 'mon_dst_srng' +can't be NULL and so relevant check may be dropped. + +Found by Linux Verification Center (linuxtesting.org) with SVACE. + +Signed-off-by: Dmitry Antipov +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230824075121.121144-1-dmantipov@yandex.ru +--- + drivers/net/wireless/ath/ath11k/dp_rx.c | 7 ------- + 1 file changed, 7 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -5094,13 +5094,6 @@ static void ath11k_dp_rx_mon_dest_proces + + mon_dst_srng = &ar->ab->hal.srng_list[ring_id]; + +- if (!mon_dst_srng) { +- ath11k_warn(ar->ab, +- "HAL Monitor Destination Ring Init Failed -- %p", +- mon_dst_srng); +- return; +- } +- + spin_lock_bh(&pmon->mon_lock); + + ath11k_hal_srng_access_begin(ar->ab, mon_dst_srng); diff --git a/package/kernel/mac80211/patches/ath11k/0020-wifi-ath11k-remove-unused-members-of-struct-ath11k_b.patch b/package/kernel/mac80211/patches/ath11k/0020-wifi-ath11k-remove-unused-members-of-struct-ath11k_b.patch new file mode 100644 index 00000000000000..ffb210cc106a40 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0020-wifi-ath11k-remove-unused-members-of-struct-ath11k_b.patch @@ -0,0 +1,46 @@ +From 9066794113c4813b6ce4a66ed6ce14ecdf35625d Mon Sep 17 00:00:00 2001 +From: Dmitry Antipov +Date: Thu, 24 Aug 2023 10:50:45 +0300 +Subject: [PATCH] wifi: ath11k: remove unused members of 'struct ath11k_base' + +Remove set but otherwise unused 'wlan_init_status' and +'wmi_ready' members of 'struct ath11k_base', adjust +'ath11k_wmi_tlv_rdy_parse()' accordingly. + +Signed-off-by: Dmitry Antipov +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230824075121.121144-2-dmantipov@yandex.ru +--- + drivers/net/wireless/ath/ath11k/core.h | 2 -- + drivers/net/wireless/ath/ath11k/wmi.c | 2 -- + 2 files changed, 4 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -901,8 +901,6 @@ struct ath11k_base { + struct list_head peers; + wait_queue_head_t peer_mapping_wq; + u8 mac_addr[ETH_ALEN]; +- bool wmi_ready; +- u32 wlan_init_status; + int irq_num[ATH11K_IRQ_NUM_MAX]; + struct ath11k_ext_irq_grp ext_irq_grp[ATH11K_EXT_IRQ_GRP_NUM_MAX]; + struct ath11k_targ_cap target_caps; +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -7222,14 +7222,12 @@ static int ath11k_wmi_tlv_rdy_parse(stru + memset(&fixed_param, 0, sizeof(fixed_param)); + memcpy(&fixed_param, (struct wmi_ready_event *)ptr, + min_t(u16, sizeof(fixed_param), len)); +- ab->wlan_init_status = fixed_param.ready_event_min.status; + rdy_parse->num_extra_mac_addr = + fixed_param.ready_event_min.num_extra_mac_addr; + + ether_addr_copy(ab->mac_addr, + fixed_param.ready_event_min.mac_addr.addr); + ab->pktlog_defs_checksum = fixed_param.pktlog_defs_checksum; +- ab->wmi_ready = true; + break; + case WMI_TAG_ARRAY_FIXED_STRUCT: + addr_list = (struct wmi_mac_addr *)ptr; diff --git a/package/kernel/mac80211/patches/ath11k/0021-wifi-ath11k-use-kstrtoul_from_user-where-appropriate.patch b/package/kernel/mac80211/patches/ath11k/0021-wifi-ath11k-use-kstrtoul_from_user-where-appropriate.patch new file mode 100644 index 00000000000000..7a6b11b6d3f50e --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0021-wifi-ath11k-use-kstrtoul_from_user-where-appropriate.patch @@ -0,0 +1,60 @@ +From 458f66c30df2b8495790cf6fca76ebad44046921 Mon Sep 17 00:00:00 2001 +From: Dmitry Antipov +Date: Thu, 21 Sep 2023 11:16:57 +0300 +Subject: [PATCH] wifi: ath11k: use kstrtoul_from_user() where appropriate + +Use 'kstrtoul_from_user()' in 'ath11k_write_file_spectral_count()' +and 'ath11k_write_file_spectral_bins()' + +Signed-off-by: Dmitry Antipov +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230824075121.121144-4-dmantipov@yandex.ru +--- + drivers/net/wireless/ath/ath11k/spectral.c | 26 +++++++--------------- + 1 file changed, 8 insertions(+), 18 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/spectral.c ++++ b/drivers/net/wireless/ath/ath11k/spectral.c +@@ -386,16 +386,11 @@ static ssize_t ath11k_write_file_spectra + { + struct ath11k *ar = file->private_data; + unsigned long val; +- char buf[32]; +- ssize_t len; +- +- len = min(count, sizeof(buf) - 1); +- if (copy_from_user(buf, user_buf, len)) +- return -EFAULT; ++ ssize_t ret; + +- buf[len] = '\0'; +- if (kstrtoul(buf, 0, &val)) +- return -EINVAL; ++ ret = kstrtoul_from_user(user_buf, count, 0, &val); ++ if (ret) ++ return ret; + + if (val > ATH11K_SPECTRAL_SCAN_COUNT_MAX) + return -EINVAL; +@@ -441,16 +436,11 @@ static ssize_t ath11k_write_file_spectra + { + struct ath11k *ar = file->private_data; + unsigned long val; +- char buf[32]; +- ssize_t len; +- +- len = min(count, sizeof(buf) - 1); +- if (copy_from_user(buf, user_buf, len)) +- return -EFAULT; ++ ssize_t ret; + +- buf[len] = '\0'; +- if (kstrtoul(buf, 0, &val)) +- return -EINVAL; ++ ret = kstrtoul_from_user(user_buf, count, 0, &val); ++ if (ret) ++ return ret; + + if (val < ATH11K_SPECTRAL_MIN_BINS || + val > ar->ab->hw_params.spectral.max_fft_bins) diff --git a/package/kernel/mac80211/patches/ath11k/0022-wifi-ath11k-remove-unnecessary-void-conversions.patch b/package/kernel/mac80211/patches/ath11k/0022-wifi-ath11k-remove-unnecessary-void-conversions.patch new file mode 100644 index 00000000000000..cbd664dad58d3c --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0022-wifi-ath11k-remove-unnecessary-void-conversions.patch @@ -0,0 +1,248 @@ +From 87fd0602610d6965c45afc61780ac98842e8f902 Mon Sep 17 00:00:00 2001 +From: Wu Yunchuan +Date: Thu, 21 Sep 2023 11:50:05 +0300 +Subject: [PATCH] wifi: ath11k: remove unnecessary (void*) conversions + +No need cast (void *) to (struct ath11k_base *), +struct hal_rx_msdu_link *), (struct ath11k_buffer_addr *) or +other types. + +Signed-off-by: Wu Yunchuan +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230919045150.524304-1-yunchuan@nfschina.com +--- + drivers/net/wireless/ath/ath11k/dp.c | 2 +- + drivers/net/wireless/ath/ath11k/dp_rx.c | 13 +++++-------- + drivers/net/wireless/ath/ath11k/hal.c | 8 +++----- + drivers/net/wireless/ath/ath11k/hal_rx.c | 17 +++++++---------- + drivers/net/wireless/ath/ath11k/hal_tx.c | 2 +- + drivers/net/wireless/ath/ath11k/mac.c | 4 ++-- + drivers/net/wireless/ath/ath11k/spectral.c | 2 +- + drivers/net/wireless/ath/ath11k/wmi.c | 6 +++--- + 8 files changed, 23 insertions(+), 31 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/dp.c ++++ b/drivers/net/wireless/ath/ath11k/dp.c +@@ -1009,7 +1009,7 @@ void ath11k_dp_vdev_tx_attach(struct ath + + static int ath11k_dp_tx_pending_cleanup(int buf_id, void *skb, void *ctx) + { +- struct ath11k_base *ab = (struct ath11k_base *)ctx; ++ struct ath11k_base *ab = ctx; + struct sk_buff *msdu = skb; + + dma_unmap_single(ab->dev, ATH11K_SKB_CB(msdu)->paddr, msdu->len, +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -1256,7 +1256,7 @@ static int ath11k_htt_tlv_ppdu_stats_par + int cur_user; + u16 peer_id; + +- ppdu_info = (struct htt_ppdu_stats_info *)data; ++ ppdu_info = data; + + switch (tag) { + case HTT_PPDU_STATS_TAG_COMMON: +@@ -4486,8 +4486,7 @@ int ath11k_dp_rx_monitor_link_desc_retur + src_srng_desc = ath11k_hal_srng_src_get_next_entry(ar->ab, hal_srng); + + if (src_srng_desc) { +- struct ath11k_buffer_addr *src_desc = +- (struct ath11k_buffer_addr *)src_srng_desc; ++ struct ath11k_buffer_addr *src_desc = src_srng_desc; + + *src_desc = *((struct ath11k_buffer_addr *)p_last_buf_addr_info); + } else { +@@ -4506,8 +4505,7 @@ void ath11k_dp_rx_mon_next_link_desc_get + u8 *rbm, + void **pp_buf_addr_info) + { +- struct hal_rx_msdu_link *msdu_link = +- (struct hal_rx_msdu_link *)rx_msdu_link_desc; ++ struct hal_rx_msdu_link *msdu_link = rx_msdu_link_desc; + struct ath11k_buffer_addr *buf_addr_info; + + buf_addr_info = (struct ath11k_buffer_addr *)&msdu_link->buf_addr_info; +@@ -4548,7 +4546,7 @@ static void ath11k_hal_rx_msdu_list_get( + u32 first = FIELD_PREP(RX_MSDU_DESC_INFO0_FIRST_MSDU_IN_MPDU, 1); + u8 tmp = 0; + +- msdu_link = (struct hal_rx_msdu_link *)msdu_link_desc; ++ msdu_link = msdu_link_desc; + msdu_details = &msdu_link->msdu_link[0]; + + for (i = 0; i < HAL_RX_NUM_MSDU_DESC; i++) { +@@ -4645,8 +4643,7 @@ ath11k_dp_rx_mon_mpdu_pop(struct ath11k + bool is_frag, is_first_msdu; + bool drop_mpdu = false; + struct ath11k_skb_rxcb *rxcb; +- struct hal_reo_entrance_ring *ent_desc = +- (struct hal_reo_entrance_ring *)ring_entry; ++ struct hal_reo_entrance_ring *ent_desc = ring_entry; + int buf_id; + u32 rx_link_buf_info[2]; + u8 rbm; +--- a/drivers/net/wireless/ath/ath11k/hal.c ++++ b/drivers/net/wireless/ath/ath11k/hal.c +@@ -571,7 +571,7 @@ u32 ath11k_hal_ce_get_desc_size(enum hal + void ath11k_hal_ce_src_set_desc(void *buf, dma_addr_t paddr, u32 len, u32 id, + u8 byte_swap_data) + { +- struct hal_ce_srng_src_desc *desc = (struct hal_ce_srng_src_desc *)buf; ++ struct hal_ce_srng_src_desc *desc = buf; + + desc->buffer_addr_low = paddr & HAL_ADDR_LSB_REG_MASK; + desc->buffer_addr_info = +@@ -586,8 +586,7 @@ void ath11k_hal_ce_src_set_desc(void *bu + + void ath11k_hal_ce_dst_set_desc(void *buf, dma_addr_t paddr) + { +- struct hal_ce_srng_dest_desc *desc = +- (struct hal_ce_srng_dest_desc *)buf; ++ struct hal_ce_srng_dest_desc *desc = buf; + + desc->buffer_addr_low = paddr & HAL_ADDR_LSB_REG_MASK; + desc->buffer_addr_info = +@@ -597,8 +596,7 @@ void ath11k_hal_ce_dst_set_desc(void *bu + + u32 ath11k_hal_ce_dst_status_get_length(void *buf) + { +- struct hal_ce_srng_dst_status_desc *desc = +- (struct hal_ce_srng_dst_status_desc *)buf; ++ struct hal_ce_srng_dst_status_desc *desc = buf; + u32 len; + + len = FIELD_GET(HAL_CE_DST_STATUS_DESC_FLAGS_LEN, desc->flags); +--- a/drivers/net/wireless/ath/ath11k/hal_rx.c ++++ b/drivers/net/wireless/ath/ath11k/hal_rx.c +@@ -265,7 +265,7 @@ out: + void ath11k_hal_rx_buf_addr_info_set(void *desc, dma_addr_t paddr, + u32 cookie, u8 manager) + { +- struct ath11k_buffer_addr *binfo = (struct ath11k_buffer_addr *)desc; ++ struct ath11k_buffer_addr *binfo = desc; + u32 paddr_lo, paddr_hi; + + paddr_lo = lower_32_bits(paddr); +@@ -279,7 +279,7 @@ void ath11k_hal_rx_buf_addr_info_set(voi + void ath11k_hal_rx_buf_addr_info_get(void *desc, dma_addr_t *paddr, + u32 *cookie, u8 *rbm) + { +- struct ath11k_buffer_addr *binfo = (struct ath11k_buffer_addr *)desc; ++ struct ath11k_buffer_addr *binfo = desc; + + *paddr = + (((u64)FIELD_GET(BUFFER_ADDR_INFO1_ADDR, binfo->info1)) << 32) | +@@ -292,7 +292,7 @@ void ath11k_hal_rx_msdu_link_info_get(vo + u32 *msdu_cookies, + enum hal_rx_buf_return_buf_manager *rbm) + { +- struct hal_rx_msdu_link *link = (struct hal_rx_msdu_link *)link_desc; ++ struct hal_rx_msdu_link *link = link_desc; + struct hal_rx_msdu_details *msdu; + int i; + +@@ -699,7 +699,7 @@ u32 ath11k_hal_reo_qdesc_size(u32 ba_win + void ath11k_hal_reo_qdesc_setup(void *vaddr, int tid, u32 ba_window_size, + u32 start_seq, enum hal_pn_type type) + { +- struct hal_rx_reo_queue *qdesc = (struct hal_rx_reo_queue *)vaddr; ++ struct hal_rx_reo_queue *qdesc = vaddr; + struct hal_rx_reo_queue_ext *ext_desc; + + memset(qdesc, 0, sizeof(*qdesc)); +@@ -809,8 +809,7 @@ static inline void + ath11k_hal_rx_handle_ofdma_info(void *rx_tlv, + struct hal_rx_user_status *rx_user_status) + { +- struct hal_rx_ppdu_end_user_stats *ppdu_end_user = +- (struct hal_rx_ppdu_end_user_stats *)rx_tlv; ++ struct hal_rx_ppdu_end_user_stats *ppdu_end_user = rx_tlv; + + rx_user_status->ul_ofdma_user_v0_word0 = __le32_to_cpu(ppdu_end_user->info6); + +@@ -821,8 +820,7 @@ static inline void + ath11k_hal_rx_populate_byte_count(void *rx_tlv, void *ppduinfo, + struct hal_rx_user_status *rx_user_status) + { +- struct hal_rx_ppdu_end_user_stats *ppdu_end_user = +- (struct hal_rx_ppdu_end_user_stats *)rx_tlv; ++ struct hal_rx_ppdu_end_user_stats *ppdu_end_user = rx_tlv; + + rx_user_status->mpdu_ok_byte_count = + FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_OK_BYTE_COUNT, +@@ -1540,8 +1538,7 @@ void ath11k_hal_rx_reo_ent_buf_paddr_get + u32 *sw_cookie, void **pp_buf_addr, + u8 *rbm, u32 *msdu_cnt) + { +- struct hal_reo_entrance_ring *reo_ent_ring = +- (struct hal_reo_entrance_ring *)rx_desc; ++ struct hal_reo_entrance_ring *reo_ent_ring = rx_desc; + struct ath11k_buffer_addr *buf_addr_info; + struct rx_mpdu_desc *rx_mpdu_desc_info_details; + +--- a/drivers/net/wireless/ath/ath11k/hal_tx.c ++++ b/drivers/net/wireless/ath/ath11k/hal_tx.c +@@ -37,7 +37,7 @@ static const u8 dscp_tid_map[DSCP_TID_MA + void ath11k_hal_tx_cmd_desc_setup(struct ath11k_base *ab, void *cmd, + struct hal_tx_info *ti) + { +- struct hal_tcl_data_cmd *tcl_cmd = (struct hal_tcl_data_cmd *)cmd; ++ struct hal_tcl_data_cmd *tcl_cmd = cmd; + + tcl_cmd->buf_addr_info.info0 = + FIELD_PREP(BUFFER_ADDR_INFO0_ADDR, ti->paddr); +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -6970,8 +6970,8 @@ err: + + static int ath11k_mac_vif_unref(int buf_id, void *skb, void *ctx) + { +- struct ieee80211_vif *vif = (struct ieee80211_vif *)ctx; +- struct ath11k_skb_cb *skb_cb = ATH11K_SKB_CB((struct sk_buff *)skb); ++ struct ieee80211_vif *vif = ctx; ++ struct ath11k_skb_cb *skb_cb = ATH11K_SKB_CB(skb); + + if (skb_cb->vif == vif) + skb_cb->vif = NULL; +--- a/drivers/net/wireless/ath/ath11k/spectral.c ++++ b/drivers/net/wireless/ath/ath11k/spectral.c +@@ -592,7 +592,7 @@ int ath11k_spectral_process_fft(struct a + return -EINVAL; + } + +- tlv = (struct spectral_tlv *)data; ++ tlv = data; + tlv_len = FIELD_GET(SPECTRAL_TLV_HDR_LEN, __le32_to_cpu(tlv->header)); + /* convert Dword into bytes */ + tlv_len *= ATH11K_SPECTRAL_DWORD_SIZE; +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -2281,7 +2281,7 @@ int ath11k_wmi_send_scan_start_cmd(struc + tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) | + FIELD_PREP(WMI_TLV_LEN, len); + ptr += TLV_HDR_SIZE; +- tmp_ptr = (u32 *)ptr; ++ tmp_ptr = ptr; + + for (i = 0; i < params->num_chan; ++i) + tmp_ptr[i] = params->chan_list[i]; +@@ -4148,7 +4148,7 @@ static int ath11k_init_cmd_send(struct a + ptr += TLV_HDR_SIZE + len; + + if (param->hw_mode_id != WMI_HOST_HW_MODE_MAX) { +- hw_mode = (struct wmi_pdev_set_hw_mode_cmd_param *)ptr; ++ hw_mode = ptr; + hw_mode->tlv_header = FIELD_PREP(WMI_TLV_TAG, + WMI_TAG_PDEV_SET_HW_MODE_CMD) | + FIELD_PREP(WMI_TLV_LEN, +@@ -4168,7 +4168,7 @@ static int ath11k_init_cmd_send(struct a + len = sizeof(*band_to_mac); + + for (idx = 0; idx < param->num_band_to_mac; idx++) { +- band_to_mac = (void *)ptr; ++ band_to_mac = ptr; + + band_to_mac->tlv_header = FIELD_PREP(WMI_TLV_TAG, + WMI_TAG_PDEV_BAND_TO_MAC) | diff --git a/package/kernel/mac80211/patches/ath11k/0023-wifi-ath11k-fix-ath11k_mac_op_remain_on_channel-stac.patch b/package/kernel/mac80211/patches/ath11k/0023-wifi-ath11k-fix-ath11k_mac_op_remain_on_channel-stac.patch new file mode 100644 index 00000000000000..2c7f196f8eed64 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0023-wifi-ath11k-fix-ath11k_mac_op_remain_on_channel-stac.patch @@ -0,0 +1,96 @@ +From 4fd15bb705d3faa7e6adab2daba2e3af80d9b6bd Mon Sep 17 00:00:00 2001 +From: Dmitry Antipov +Date: Tue, 26 Sep 2023 07:29:04 +0300 +Subject: [PATCH] wifi: ath11k: fix ath11k_mac_op_remain_on_channel() stack + usage + +When compiling with clang 16.0.6, I've noticed the following: + +drivers/net/wireless/ath/ath11k/mac.c:8903:12: warning: stack frame +size (1032) exceeds limit (1024) in 'ath11k_mac_op_remain_on_channel' +[-Wframe-larger-than] +static int ath11k_mac_op_remain_on_channel(struct ieee80211_hw *hw, + ^ +68/1032 (6.59%) spills, 964/1032 (93.41%) variables + +So switch to kzalloc()'ed instance of 'struct scan_req_params' like +it's done in 'ath11k_mac_op_hw_scan()'. Compile tested only. + +Signed-off-by: Dmitry Antipov +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230926042906.13725-1-dmantipov@yandex.ru +--- + drivers/net/wireless/ath/ath11k/mac.c | 44 +++++++++++++++------------ + 1 file changed, 25 insertions(+), 19 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -8908,7 +8908,7 @@ static int ath11k_mac_op_remain_on_chann + { + struct ath11k *ar = hw->priv; + struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); +- struct scan_req_params arg; ++ struct scan_req_params *arg; + int ret; + u32 scan_time_msec; + +@@ -8940,27 +8940,31 @@ static int ath11k_mac_op_remain_on_chann + + scan_time_msec = ar->hw->wiphy->max_remain_on_channel_duration * 2; + +- memset(&arg, 0, sizeof(arg)); +- ath11k_wmi_start_scan_init(ar, &arg); +- arg.num_chan = 1; +- arg.chan_list = kcalloc(arg.num_chan, sizeof(*arg.chan_list), +- GFP_KERNEL); +- if (!arg.chan_list) { ++ arg = kzalloc(sizeof(*arg), GFP_KERNEL); ++ if (!arg) { + ret = -ENOMEM; + goto exit; + } ++ ath11k_wmi_start_scan_init(ar, arg); ++ arg->num_chan = 1; ++ arg->chan_list = kcalloc(arg->num_chan, sizeof(*arg->chan_list), ++ GFP_KERNEL); ++ if (!arg->chan_list) { ++ ret = -ENOMEM; ++ goto free_arg; ++ } + +- arg.vdev_id = arvif->vdev_id; +- arg.scan_id = ATH11K_SCAN_ID; +- arg.chan_list[0] = chan->center_freq; +- arg.dwell_time_active = scan_time_msec; +- arg.dwell_time_passive = scan_time_msec; +- arg.max_scan_time = scan_time_msec; +- arg.scan_flags |= WMI_SCAN_FLAG_PASSIVE; +- arg.scan_flags |= WMI_SCAN_FILTER_PROBE_REQ; +- arg.burst_duration = duration; ++ arg->vdev_id = arvif->vdev_id; ++ arg->scan_id = ATH11K_SCAN_ID; ++ arg->chan_list[0] = chan->center_freq; ++ arg->dwell_time_active = scan_time_msec; ++ arg->dwell_time_passive = scan_time_msec; ++ arg->max_scan_time = scan_time_msec; ++ arg->scan_flags |= WMI_SCAN_FLAG_PASSIVE; ++ arg->scan_flags |= WMI_SCAN_FILTER_PROBE_REQ; ++ arg->burst_duration = duration; + +- ret = ath11k_start_scan(ar, &arg); ++ ret = ath11k_start_scan(ar, arg); + if (ret) { + ath11k_warn(ar->ab, "failed to start roc scan: %d\n", ret); + +@@ -8986,7 +8990,9 @@ static int ath11k_mac_op_remain_on_chann + ret = 0; + + free_chan_list: +- kfree(arg.chan_list); ++ kfree(arg->chan_list); ++free_arg: ++ kfree(arg); + exit: + mutex_unlock(&ar->conf_mutex); + return ret; diff --git a/package/kernel/mac80211/patches/ath11k/0024-wifi-ath11k-mac-fix-struct-ieee80211_sband_iftype_da.patch b/package/kernel/mac80211/patches/ath11k/0024-wifi-ath11k-mac-fix-struct-ieee80211_sband_iftype_da.patch new file mode 100644 index 00000000000000..90da6a8c44aff2 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0024-wifi-ath11k-mac-fix-struct-ieee80211_sband_iftype_da.patch @@ -0,0 +1,67 @@ +From 9e61589ac3c2d23c528d3ffd44604d98553ea1cb Mon Sep 17 00:00:00 2001 +From: Kalle Valo +Date: Wed, 27 Sep 2023 17:27:08 +0300 +Subject: [PATCH] wifi: ath11k: mac: fix struct ieee80211_sband_iftype_data + handling + +Commit e8c1841278a7 ("wifi: cfg80211: annotate iftype_data pointer with +sparse") added sparse checks for struct ieee80211_sband_iftype_data handling +which immediately found an issue in ath11k: + +drivers/net/wireless/ath/ath11k/mac.c:7952:22: warning: incorrect type in argument 1 (different address spaces) +drivers/net/wireless/ath/ath11k/mac.c:7952:22: expected struct ieee80211_sta_he_cap const *he_cap +drivers/net/wireless/ath/ath11k/mac.c:7952:22: got struct ieee80211_sta_he_cap const [noderef] __iftype_data * + +The problem here is that we are accessing sband->iftype_data directly even +though we should use for_each_sband_iftype_data() or similar. Fortunately +there's ieee80211_get_he_iftype_cap_vif() which is just what we need here so +use it to get HE capabilities. + +Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 + +Reported-by: Johannes Berg +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230927142708.2897504-2-kvalo@kernel.org +--- + drivers/net/wireless/ath/ath11k/mac.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -7913,12 +7913,14 @@ ath11k_mac_get_tx_mcs_map(const struct i + + static bool + ath11k_mac_bitrate_mask_get_single_nss(struct ath11k *ar, ++ struct ath11k_vif *arvif, + enum nl80211_band band, + const struct cfg80211_bitrate_mask *mask, + int *nss) + { + struct ieee80211_supported_band *sband = &ar->mac.sbands[band]; + u16 vht_mcs_map = le16_to_cpu(sband->vht_cap.vht_mcs.tx_mcs_map); ++ const struct ieee80211_sta_he_cap *he_cap; + u16 he_mcs_map = 0; + u8 ht_nss_mask = 0; + u8 vht_nss_mask = 0; +@@ -7949,7 +7951,11 @@ ath11k_mac_bitrate_mask_get_single_nss(s + return false; + } + +- he_mcs_map = le16_to_cpu(ath11k_mac_get_tx_mcs_map(&sband->iftype_data->he_cap)); ++ he_cap = ieee80211_get_he_iftype_cap_vif(sband, arvif->vif); ++ if (!he_cap) ++ return false; ++ ++ he_mcs_map = le16_to_cpu(ath11k_mac_get_tx_mcs_map(he_cap)); + + for (i = 0; i < ARRAY_SIZE(mask->control[band].he_mcs); i++) { + if (mask->control[band].he_mcs[i] == 0) +@@ -8365,7 +8371,7 @@ ath11k_mac_op_set_bitrate_mask(struct ie + ieee80211_iterate_stations_atomic(ar->hw, + ath11k_mac_disable_peer_fixed_rate, + arvif); +- } else if (ath11k_mac_bitrate_mask_get_single_nss(ar, band, mask, ++ } else if (ath11k_mac_bitrate_mask_get_single_nss(ar, arvif, band, mask, + &single_nss)) { + rate = WMI_FIXED_RATE_NONE; + nss = single_nss; diff --git a/package/kernel/mac80211/patches/ath11k/0025-wifi-ath11k-fix-CAC-running-state-during-virtual-int.patch b/package/kernel/mac80211/patches/ath11k/0025-wifi-ath11k-fix-CAC-running-state-during-virtual-int.patch new file mode 100644 index 00000000000000..eee0bf0fb5a93b --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0025-wifi-ath11k-fix-CAC-running-state-during-virtual-int.patch @@ -0,0 +1,80 @@ +From 69fcb525905600a151997cd16367bb92c34a2b14 Mon Sep 17 00:00:00 2001 +From: Aditya Kumar Singh +Date: Tue, 3 Oct 2023 17:26:54 +0300 +Subject: [PATCH] wifi: ath11k: fix CAC running state during virtual interface + start + +Currently channel definition's primary channel's DFS CAC time +as well as primary channel's state i.e usable are used to set +the CAC_RUNNING flag for the ath11k radio structure. However, +this is wrong since certain channel definition are possbile +where primary channel may not be a DFS channel but, secondary +channel is a DFS channel. For example - channel 36 with 160 MHz +bandwidth. +In such cases, the flag will not be set which is wrong. + +Fix this issue by using cfg80211_chandef_dfs_usable() function +from cfg80211 which return trues if at least one channel is in +usable state. + +While at it, modify the CAC running debug log message to print +the CAC time as well in milli-seconds. + +Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 + +Signed-off-by: Aditya Kumar Singh +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230912051857.2284-3-quic_adisi@quicinc.com +--- + drivers/net/wireless/ath/ath11k/mac.c | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -5,6 +5,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -7196,6 +7197,7 @@ ath11k_mac_vdev_start_restart(struct ath + struct wmi_vdev_start_req_arg arg = {}; + const struct cfg80211_chan_def *chandef = &ctx->def; + int ret = 0; ++ unsigned int dfs_cac_time; + + lockdep_assert_held(&ar->conf_mutex); + +@@ -7275,20 +7277,21 @@ ath11k_mac_vdev_start_restart(struct ath + ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM started, vdev_id %d\n", + arvif->vif->addr, arvif->vdev_id); + +- /* Enable CAC Flag in the driver by checking the channel DFS cac time, +- * i.e dfs_cac_ms value which will be valid only for radar channels +- * and state as NL80211_DFS_USABLE which indicates CAC needs to be ++ /* Enable CAC Flag in the driver by checking the all sub-channel's DFS ++ * state as NL80211_DFS_USABLE which indicates CAC needs to be + * done before channel usage. This flags is used to drop rx packets. + * during CAC. + */ + /* TODO Set the flag for other interface types as required */ +- if (arvif->vdev_type == WMI_VDEV_TYPE_AP && +- chandef->chan->dfs_cac_ms && +- chandef->chan->dfs_state == NL80211_DFS_USABLE) { ++ if (arvif->vdev_type == WMI_VDEV_TYPE_AP && ctx->radar_enabled && ++ cfg80211_chandef_dfs_usable(ar->hw->wiphy, chandef)) { + set_bit(ATH11K_CAC_RUNNING, &ar->dev_flags); ++ dfs_cac_time = cfg80211_chandef_dfs_cac_time(ar->hw->wiphy, ++ chandef); + ath11k_dbg(ab, ATH11K_DBG_MAC, +- "CAC Started in chan_freq %d for vdev %d\n", +- arg.channel.freq, arg.vdev_id); ++ "cac started dfs_cac_time %u center_freq %d center_freq1 %d for vdev %d\n", ++ dfs_cac_time, arg.channel.freq, chandef->center_freq1, ++ arg.vdev_id); + } + + ret = ath11k_mac_set_txbf_conf(arvif); diff --git a/package/kernel/mac80211/patches/ath11k/0026-wifi-ath11k-fix-Tx-power-value-during-active-CAC.patch b/package/kernel/mac80211/patches/ath11k/0026-wifi-ath11k-fix-Tx-power-value-during-active-CAC.patch new file mode 100644 index 00000000000000..79c1d735b8255f --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0026-wifi-ath11k-fix-Tx-power-value-during-active-CAC.patch @@ -0,0 +1,43 @@ +From 77f1ee6fd8b6e470f721d05a2e269039d5cafcb7 Mon Sep 17 00:00:00 2001 +From: Aditya Kumar Singh +Date: Tue, 3 Oct 2023 17:26:54 +0300 +Subject: [PATCH] wifi: ath11k: fix Tx power value during active CAC + +Tx power is fetched from firmware's pdev stats. However, during active +CAC, firmware does not fill the current Tx power and sends the max +initialised value filled during firmware init. If host sends this power +to user space, this is wrong since in certain situations, the Tx power +could be greater than the max allowed by the regulatory. Hence, host +should not be fetching the Tx power during an active CAC. + +Fix this issue by returning -EAGAIN error so that user space knows that there's +no valid value available. + +Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 + +Fixes: 9a2aa68afe3d ("wifi: ath11k: add get_txpower mac ops") +Signed-off-by: Aditya Kumar Singh +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230912051857.2284-4-quic_adisi@quicinc.com +--- + drivers/net/wireless/ath/ath11k/mac.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -9060,6 +9060,14 @@ static int ath11k_mac_op_get_txpower(str + if (ar->state != ATH11K_STATE_ON) + goto err_fallback; + ++ /* Firmware doesn't provide Tx power during CAC hence no need to fetch ++ * the stats. ++ */ ++ if (test_bit(ATH11K_CAC_RUNNING, &ar->dev_flags)) { ++ mutex_unlock(&ar->conf_mutex); ++ return -EAGAIN; ++ } ++ + req_param.pdev_id = ar->pdev->pdev_id; + req_param.stats_id = WMI_REQUEST_PDEV_STAT; + diff --git a/package/kernel/mac80211/patches/ath11k/0027-wifi-ath11k-call-ath11k_mac_fils_discovery-without-c.patch b/package/kernel/mac80211/patches/ath11k/0027-wifi-ath11k-call-ath11k_mac_fils_discovery-without-c.patch new file mode 100644 index 00000000000000..d233492513d6d7 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0027-wifi-ath11k-call-ath11k_mac_fils_discovery-without-c.patch @@ -0,0 +1,37 @@ +From e149353e6562f3e3246f75dfc4cca6a0cc5b4efc Mon Sep 17 00:00:00 2001 +From: Aloka Dixit +Date: Mon, 9 Oct 2023 10:13:54 +0300 +Subject: [PATCH] wifi: ath11k: call ath11k_mac_fils_discovery() without + condition + +Mac80211 does not set flags BSS_CHANGED_FILS_DISCOVERY and +BSS_CHANGED_UNSOL_BCAST_PROBE_RESP if there are no updates to +FILS discovery and unsolicited broadcast probe response transmission +configurations respectively. This results in the transmissions getting +stopped during BSS change operations which do not include these +attributes. Remove the checks for the flags and always send the existing +configuration to firmware. + +Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 + +Signed-off-by: Aloka Dixit +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20231004044915.6817-1-quic_alokad@quicinc.com +--- + drivers/net/wireless/ath/ath11k/mac.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -3732,9 +3732,7 @@ static void ath11k_mac_op_bss_info_chang + arvif->vdev_id, ret); + } + +- if (changed & BSS_CHANGED_FILS_DISCOVERY || +- changed & BSS_CHANGED_UNSOL_BCAST_PROBE_RESP) +- ath11k_mac_fils_discovery(arvif, info); ++ ath11k_mac_fils_discovery(arvif, info); + + if (changed & BSS_CHANGED_ARP_FILTER) { + ipv4_cnt = min(vif->cfg.arp_addr_cnt, ATH11K_IPV4_MAX_COUNT); diff --git a/package/kernel/mac80211/patches/ath11k/0028-wifi-ath11k-ath11k_debugfs_register-fix-format-trunc.patch b/package/kernel/mac80211/patches/ath11k/0028-wifi-ath11k-ath11k_debugfs_register-fix-format-trunc.patch new file mode 100644 index 00000000000000..df8a4283fae3c6 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0028-wifi-ath11k-ath11k_debugfs_register-fix-format-trunc.patch @@ -0,0 +1,39 @@ +From a47111663491ff2829df0626493ce81b48dd880a Mon Sep 17 00:00:00 2001 +From: Kalle Valo +Date: Tue, 10 Oct 2023 09:22:50 +0300 +Subject: [PATCH] wifi: ath11k: ath11k_debugfs_register(): fix + format-truncation warning + +In v6.6-rc4 with GCC 13.2 I see a new warning: + +drivers/net/wireless/ath/ath11k/debugfs.c: In function 'ath11k_debugfs_register': +drivers/net/wireless/ath/ath11k/debugfs.c:1597:51: error: '%d' directive output may be truncated writing between 1 and 3 bytes into a region of size 2 [-Werror=format-truncation=] +drivers/net/wireless/ath/ath11k/debugfs.c:1597:48: note: directive argument in the range [0, 255] +drivers/net/wireless/ath/ath11k/debugfs.c:1597:9: note: 'snprintf' output between 5 and 7 bytes into a destination of size 5 + +Increase the size of pdev_name to 10 bytes to make sure there's enough room for +the string. Also change the format to '%u' as ar->pdev_idx is u8. + +Compile tested only. + +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20231010062250.2580951-1-kvalo@kernel.org +--- + drivers/net/wireless/ath/ath11k/debugfs.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1591,10 +1591,10 @@ static const struct file_operations fops + int ath11k_debugfs_register(struct ath11k *ar) + { + struct ath11k_base *ab = ar->ab; +- char pdev_name[5]; ++ char pdev_name[10]; + char buf[100] = {0}; + +- snprintf(pdev_name, sizeof(pdev_name), "%s%d", "mac", ar->pdev_idx); ++ snprintf(pdev_name, sizeof(pdev_name), "%s%u", "mac", ar->pdev_idx); + + ar->debug.debugfs_pdev = debugfs_create_dir(pdev_name, ab->debugfs_soc); + if (IS_ERR(ar->debug.debugfs_pdev)) diff --git a/package/kernel/mac80211/patches/ath11k/0029-wifi-ath11k-add-parsing-of-phy-bitmap-for-reg-rules.patch b/package/kernel/mac80211/patches/ath11k/0029-wifi-ath11k-add-parsing-of-phy-bitmap-for-reg-rules.patch new file mode 100644 index 00000000000000..10d517a27a579a --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0029-wifi-ath11k-add-parsing-of-phy-bitmap-for-reg-rules.patch @@ -0,0 +1,84 @@ +From 534c2dd8099a9cc4bad8ea8b3c7fa1f730e10d5d Mon Sep 17 00:00:00 2001 +From: Aditya Kumar Singh +Date: Tue, 10 Oct 2023 10:27:19 +0300 +Subject: [PATCH] wifi: ath11k: add parsing of phy bitmap for reg rules + +Certain regulatory domains could put restrictions on phy mode operation. +For example, in a few countries HE Operation is not allowed. For such +countries, firmware indicates this via phy bitmap in each reg rule. + +Currently, there is no logic to parse this info and then pass it on to the +cfg80211/regulatory. + +Add parsing of this phy bitmap from the regulatory channel change event and +then accordingly map it to cfg80211/regulatory flags and pass it on to it. + +While at it, correct typo in debug print s/dsf/dfs. + +Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 + +Signed-off-by: Aditya Kumar Singh +Acked-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20231004092655.25020-1-quic_adisi@quicinc.com +--- + drivers/net/wireless/ath/ath11k/reg.c | 11 +++++++++++ + drivers/net/wireless/ath/ath11k/reg.h | 3 +++ + drivers/net/wireless/ath/ath11k/wmi.c | 5 +++-- + 3 files changed, 17 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/reg.c ++++ b/drivers/net/wireless/ath/ath11k/reg.c +@@ -352,6 +352,16 @@ static u32 ath11k_map_fw_reg_flags(u16 r + return flags; + } + ++static u32 ath11k_map_fw_phy_flags(u32 phy_flags) ++{ ++ u32 flags = 0; ++ ++ if (phy_flags & ATH11K_REG_PHY_BITMAP_NO11AX) ++ flags |= NL80211_RRF_NO_HE; ++ ++ return flags; ++} ++ + static bool + ath11k_reg_can_intersect(struct ieee80211_reg_rule *rule1, + struct ieee80211_reg_rule *rule2) +@@ -685,6 +695,7 @@ ath11k_reg_build_regd(struct ath11k_base + } + + flags |= ath11k_map_fw_reg_flags(reg_rule->flags); ++ flags |= ath11k_map_fw_phy_flags(reg_info->phybitmap); + + ath11k_reg_update_rule(tmp_regd->reg_rules + i, + reg_rule->start_freq, +--- a/drivers/net/wireless/ath/ath11k/reg.h ++++ b/drivers/net/wireless/ath/ath11k/reg.h +@@ -24,6 +24,9 @@ enum ath11k_dfs_region { + ATH11K_DFS_REG_UNDEF, + }; + ++/* Phy bitmaps */ ++#define ATH11K_REG_PHY_BITMAP_NO11AX BIT(5) ++ + /* ATH11K Regulatory API's */ + void ath11k_reg_init(struct ath11k *ar); + void ath11k_reg_free(struct ath11k_base *ab); +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -5440,10 +5440,11 @@ static int ath11k_pull_reg_chan_list_ext + } + + ath11k_dbg(ab, ATH11K_DBG_WMI, +- "cc_ext %s dsf %d BW: min_2ghz %d max_2ghz %d min_5ghz %d max_5ghz %d", ++ "cc_ext %s dfs %d BW: min_2ghz %d max_2ghz %d min_5ghz %d max_5ghz %d phy_bitmap 0x%x", + reg_info->alpha2, reg_info->dfs_region, + reg_info->min_bw_2ghz, reg_info->max_bw_2ghz, +- reg_info->min_bw_5ghz, reg_info->max_bw_5ghz); ++ reg_info->min_bw_5ghz, reg_info->max_bw_5ghz, ++ reg_info->phybitmap); + + ath11k_dbg(ab, ATH11K_DBG_WMI, + "num_2ghz_reg_rules %d num_5ghz_reg_rules %d", diff --git a/package/kernel/mac80211/patches/ath11k/0030-wifi-ath11k-Remove-unused-struct-ath11k_htc_frame.patch b/package/kernel/mac80211/patches/ath11k/0030-wifi-ath11k-Remove-unused-struct-ath11k_htc_frame.patch new file mode 100644 index 00000000000000..df4235388a57ae --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0030-wifi-ath11k-Remove-unused-struct-ath11k_htc_frame.patch @@ -0,0 +1,38 @@ +From 480d230bef0ecd06e72ae3a84117142e38e77503 Mon Sep 17 00:00:00 2001 +From: Jeff Johnson +Date: Mon, 9 Oct 2023 09:36:54 -0700 +Subject: [PATCH] wifi: ath11k: Remove unused struct ath11k_htc_frame + +struct ath11k_htc_frame is unused, and since it illogically contains +two consecutive flexible arrays, it could never be used, so remove it. + +No functional changes, compile tested only. + +Signed-off-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20231009-ath11k_htc_frame-v1-1-81d405b7a195@quicinc.com +--- + drivers/net/wireless/ath/ath11k/htc.h | 12 ------------ + 1 file changed, 12 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/htc.h ++++ b/drivers/net/wireless/ath/ath11k/htc.h +@@ -156,18 +156,6 @@ struct ath11k_htc_record { + }; + } __packed __aligned(4); + +-/* note: the trailer offset is dynamic depending +- * on payload length. this is only a struct layout draft +- */ +-struct ath11k_htc_frame { +- struct ath11k_htc_hdr hdr; +- union { +- struct ath11k_htc_msg msg; +- u8 payload[0]; +- }; +- struct ath11k_htc_record trailer[0]; +-} __packed __aligned(4); +- + enum ath11k_htc_svc_gid { + ATH11K_HTC_SVC_GRP_RSVD = 0, + ATH11K_HTC_SVC_GRP_WMI = 1, diff --git a/package/kernel/mac80211/patches/ath11k/0031-wifi-ath11k-Introduce-and-use-ath11k_sta_to_arsta.patch b/package/kernel/mac80211/patches/ath11k/0031-wifi-ath11k-Introduce-and-use-ath11k_sta_to_arsta.patch new file mode 100644 index 00000000000000..59af3b929795b9 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/0031-wifi-ath11k-Introduce-and-use-ath11k_sta_to_arsta.patch @@ -0,0 +1,384 @@ +From 10c65f97b424fcee439463f933140df2a0022f98 Mon Sep 17 00:00:00 2001 +From: Jeff Johnson +Date: Mon, 9 Oct 2023 09:39:42 -0700 +Subject: [PATCH] wifi: ath11k: Introduce and use ath11k_sta_to_arsta() + +Currently, the logic to return an ath11k_sta pointer, given a +ieee80211_sta pointer, uses typecasting throughout the driver. In +general, conversion functions are preferable to typecasting since +using a conversion function allows the compiler to validate the types +of both the input and output parameters. + +ath11k already defines a conversion function ath11k_vif_to_arvif() for +a similar conversion. So introduce ath11k_sta_to_arsta() for this use +case, and convert all of the existing typecasting to use this +function. + +No functional changes, compile tested only. + +Signed-off-by: Jeff Johnson +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20231009-ath11k_sta_to_arsta-v1-1-1563e3a307e8@quicinc.com +--- + drivers/net/wireless/ath/ath11k/core.h | 5 ++++ + drivers/net/wireless/ath/ath11k/debugfs.c | 4 +-- + drivers/net/wireless/ath/ath11k/debugfs_sta.c | 30 +++++++++---------- + drivers/net/wireless/ath/ath11k/dp_rx.c | 8 ++--- + drivers/net/wireless/ath/ath11k/dp_tx.c | 4 +-- + drivers/net/wireless/ath/ath11k/mac.c | 18 +++++------ + drivers/net/wireless/ath/ath11k/peer.c | 2 +- + drivers/net/wireless/ath/ath11k/wmi.c | 6 ++-- + 8 files changed, 41 insertions(+), 36 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -1223,6 +1223,11 @@ static inline struct ath11k_vif *ath11k_ + return (struct ath11k_vif *)vif->drv_priv; + } + ++static inline struct ath11k_sta *ath11k_sta_to_arsta(struct ieee80211_sta *sta) ++{ ++ return (struct ath11k_sta *)sta->drv_priv; ++} ++ + static inline struct ath11k *ath11k_ab_to_ar(struct ath11k_base *ab, + int mac_id) + { +--- a/drivers/net/wireless/ath/ath11k/debugfs.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs.c +@@ -1459,7 +1459,7 @@ static void ath11k_reset_peer_ps_duratio + struct ieee80211_sta *sta) + { + struct ath11k *ar = data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + + spin_lock_bh(&ar->data_lock); + arsta->ps_total_duration = 0; +@@ -1510,7 +1510,7 @@ static void ath11k_peer_ps_state_disable + struct ieee80211_sta *sta) + { + struct ath11k *ar = data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + + spin_lock_bh(&ar->data_lock); + arsta->peer_ps_state = WMI_PEER_PS_STATE_DISABLED; +--- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c ++++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c +@@ -136,7 +136,7 @@ static ssize_t ath11k_dbg_sta_dump_tx_st + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + struct ath11k_htt_data_stats *stats; + static const char *str_name[ATH11K_STATS_TYPE_MAX] = {"succ", "fail", +@@ -243,7 +243,7 @@ static ssize_t ath11k_dbg_sta_dump_rx_st + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + struct ath11k_rx_peer_stats *rx_stats = arsta->rx_stats; + int len = 0, i, retval = 0; +@@ -340,7 +340,7 @@ static int + ath11k_dbg_sta_open_htt_peer_stats(struct inode *inode, struct file *file) + { + struct ieee80211_sta *sta = inode->i_private; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + struct debug_htt_stats_req *stats_req; + int type = ar->debug.htt_stats.type; +@@ -376,7 +376,7 @@ static int + ath11k_dbg_sta_release_htt_peer_stats(struct inode *inode, struct file *file) + { + struct ieee80211_sta *sta = inode->i_private; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + + mutex_lock(&ar->conf_mutex); +@@ -413,7 +413,7 @@ static ssize_t ath11k_dbg_sta_write_peer + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + int ret, enable; + +@@ -453,7 +453,7 @@ static ssize_t ath11k_dbg_sta_read_peer_ + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + char buf[32] = {0}; + int len; +@@ -480,7 +480,7 @@ static ssize_t ath11k_dbg_sta_write_delb + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + u32 tid, initiator, reason; + int ret; +@@ -531,7 +531,7 @@ static ssize_t ath11k_dbg_sta_write_addb + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + u32 tid, status; + int ret; +@@ -581,7 +581,7 @@ static ssize_t ath11k_dbg_sta_write_addb + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + u32 tid, buf_size; + int ret; +@@ -632,7 +632,7 @@ static ssize_t ath11k_dbg_sta_read_aggr_ + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + char buf[64]; + int len = 0; +@@ -652,7 +652,7 @@ static ssize_t ath11k_dbg_sta_write_aggr + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + u32 aggr_mode; + int ret; +@@ -697,7 +697,7 @@ ath11k_write_htt_peer_stats_reset(struct + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + struct htt_ext_stats_cfg_params cfg_params = { 0 }; + int ret; +@@ -756,7 +756,7 @@ static ssize_t ath11k_dbg_sta_read_peer_ + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + char buf[20]; + int len; +@@ -783,7 +783,7 @@ static ssize_t ath11k_dbg_sta_read_curre + loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + u64 time_since_station_in_power_save; + char buf[20]; +@@ -817,7 +817,7 @@ static ssize_t ath11k_dbg_sta_read_total + size_t count, loff_t *ppos) + { + struct ieee80211_sta *sta = file->private_data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + char buf[20]; + u64 power_save_duration; +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -1099,7 +1099,7 @@ int ath11k_dp_rx_ampdu_start(struct ath1 + struct ieee80211_ampdu_params *params) + { + struct ath11k_base *ab = ar->ab; +- struct ath11k_sta *arsta = (void *)params->sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(params->sta); + int vdev_id = arsta->arvif->vdev_id; + int ret; + +@@ -1117,7 +1117,7 @@ int ath11k_dp_rx_ampdu_stop(struct ath11 + { + struct ath11k_base *ab = ar->ab; + struct ath11k_peer *peer; +- struct ath11k_sta *arsta = (void *)params->sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(params->sta); + int vdev_id = arsta->arvif->vdev_id; + dma_addr_t paddr; + bool active; +@@ -1456,7 +1456,7 @@ ath11k_update_per_peer_tx_stats(struct a + } + + sta = peer->sta; +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(sta); + + memset(&arsta->txrate, 0, sizeof(arsta->txrate)); + +@@ -5242,7 +5242,7 @@ int ath11k_dp_rx_process_mon_status(stru + goto next_skb; + } + +- arsta = (struct ath11k_sta *)peer->sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(peer->sta); + ath11k_dp_rx_update_peer_stats(arsta, ppdu_info); + + if (ath11k_debugfs_is_pktlog_peer_valid(ar, peer->addr)) +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -467,7 +467,7 @@ void ath11k_dp_tx_update_txcompl(struct + } + + sta = peer->sta; +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(sta); + + memset(&arsta->txrate, 0, sizeof(arsta->txrate)); + pkt_type = FIELD_GET(HAL_TX_RATE_STATS_INFO0_PKT_TYPE, +@@ -627,7 +627,7 @@ static void ath11k_dp_tx_complete_msdu(s + ieee80211_free_txskb(ar->hw, msdu); + return; + } +- arsta = (struct ath11k_sta *)peer->sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(peer->sta); + status.sta = peer->sta; + status.skb = msdu; + status.info = info; +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -2832,7 +2832,7 @@ static void ath11k_peer_assoc_prepare(st + + lockdep_assert_held(&ar->conf_mutex); + +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(sta); + + memset(arg, 0, sizeof(*arg)); + +@@ -4313,7 +4313,7 @@ static int ath11k_mac_op_set_key(struct + ath11k_warn(ab, "peer %pM disappeared!\n", peer_addr); + + if (sta) { +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(sta); + + switch (key->cipher) { + case WLAN_CIPHER_SUITE_TKIP: +@@ -4904,7 +4904,7 @@ static int ath11k_mac_station_add(struct + { + struct ath11k_base *ab = ar->ab; + struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct peer_create_params peer_param; + int ret; + +@@ -5028,7 +5028,7 @@ static int ath11k_mac_op_sta_state(struc + { + struct ath11k *ar = hw->priv; + struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k_peer *peer; + int ret = 0; + +@@ -5194,7 +5194,7 @@ static void ath11k_mac_op_sta_set_4addr( + struct ieee80211_sta *sta, bool enabled) + { + struct ath11k *ar = hw->priv; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + + if (enabled && !arsta->use_4addr_set) { + ieee80211_queue_work(ar->hw, &arsta->set_4addr_wk); +@@ -5208,7 +5208,7 @@ static void ath11k_mac_op_sta_rc_update( + u32 changed) + { + struct ath11k *ar = hw->priv; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); + struct ath11k_peer *peer; + u32 bw, smps; +@@ -6201,7 +6201,7 @@ static void ath11k_mac_op_tx(struct ieee + } + + if (control->sta) +- arsta = (struct ath11k_sta *)control->sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(control->sta); + + ret = ath11k_dp_tx(ar, arvif, arsta, skb); + if (unlikely(ret)) { +@@ -8233,7 +8233,7 @@ static void ath11k_mac_set_bitrate_mask_ + struct ieee80211_sta *sta) + { + struct ath11k_vif *arvif = data; +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arvif->ar; + + spin_lock_bh(&ar->data_lock); +@@ -8637,7 +8637,7 @@ static void ath11k_mac_op_sta_statistics + struct ieee80211_sta *sta, + struct station_info *sinfo) + { +- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; ++ struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); + struct ath11k *ar = arsta->arvif->ar; + s8 signal; + bool db2dbm = test_bit(WMI_TLV_SERVICE_HW_DB2DBM_CONVERSION_SUPPORT, +--- a/drivers/net/wireless/ath/ath11k/peer.c ++++ b/drivers/net/wireless/ath/ath11k/peer.c +@@ -446,7 +446,7 @@ int ath11k_peer_create(struct ath11k *ar + peer->sec_type_grp = HAL_ENCRYPT_TYPE_OPEN; + + if (sta) { +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(sta); + arsta->tcl_metadata |= FIELD_PREP(HTT_TCL_META_DATA_TYPE, 0) | + FIELD_PREP(HTT_TCL_META_DATA_PEER_ID, + peer->peer_id); +--- a/drivers/net/wireless/ath/ath11k/wmi.c ++++ b/drivers/net/wireless/ath/ath11k/wmi.c +@@ -6453,7 +6453,7 @@ static int ath11k_wmi_tlv_rssi_chain_par + goto exit; + } + +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(sta); + + BUILD_BUG_ON(ARRAY_SIZE(arsta->chain_signal) > + ARRAY_SIZE(stats_rssi->rssi_avg_beacon)); +@@ -6541,7 +6541,7 @@ static int ath11k_wmi_tlv_fw_stats_data_ + arvif->bssid, + NULL); + if (sta) { +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(sta); + arsta->rssi_beacon = src->beacon_snr; + ath11k_dbg(ab, ATH11K_DBG_WMI, + "stats vdev id %d snr %d\n", +@@ -7468,7 +7468,7 @@ static void ath11k_wmi_event_peer_sta_ps + goto exit; + } + +- arsta = (struct ath11k_sta *)sta->drv_priv; ++ arsta = ath11k_sta_to_arsta(sta); + + spin_lock_bh(&ar->data_lock); + diff --git a/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch b/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch index aacbb348399278..71373b2136f76a 100644 --- a/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch +++ b/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch @@ -31,7 +31,7 @@ Signed-off-by: Robert Marko { .hw_rev = ATH11K_HW_IPQ8074, .name = "ipq8074 hw2.0", -@@ -1974,7 +1974,8 @@ static void ath11k_core_reset(struct wor +@@ -2040,7 +2040,8 @@ static void ath11k_core_reset(struct wor static int ath11k_init_hw_params(struct ath11k_base *ab) { const struct ath11k_hw_params *hw_params = NULL; @@ -41,7 +41,7 @@ Signed-off-by: Robert Marko for (i = 0; i < ARRAY_SIZE(ath11k_hw_params); i++) { hw_params = &ath11k_hw_params[i]; -@@ -1990,7 +1991,31 @@ static int ath11k_init_hw_params(struct +@@ -2056,7 +2057,31 @@ static int ath11k_init_hw_params(struct ab->hw_params = *hw_params; diff --git a/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch b/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch index 5b02bcba660769..74317e0262a44d 100644 --- a/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch +++ b/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch @@ -23,7 +23,7 @@ Signed-off-by: Aditya Kumar Singh --- a/drivers/net/wireless/ath/ath11k/reg.c +++ b/drivers/net/wireless/ath/ath11k/reg.c -@@ -352,129 +352,6 @@ static u32 ath11k_map_fw_reg_flags(u16 r +@@ -362,129 +362,6 @@ static u32 ath11k_map_fw_phy_flags(u32 p return flags; } @@ -153,7 +153,7 @@ Signed-off-by: Aditya Kumar Singh static const char * ath11k_reg_get_regdom_str(enum nl80211_dfs_regions dfs_region) { -@@ -609,9 +486,9 @@ ath11k_reg_update_weather_radar_band(str +@@ -619,9 +496,9 @@ ath11k_reg_update_weather_radar_band(str struct ieee80211_regdomain * ath11k_reg_build_regd(struct ath11k_base *ab, @@ -165,7 +165,7 @@ Signed-off-by: Aditya Kumar Singh struct cur_reg_rule *reg_rule; u8 i = 0, j = 0, k = 0; u8 num_rules; -@@ -628,26 +505,26 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -638,26 +515,26 @@ ath11k_reg_build_regd(struct ath11k_base num_rules += reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP]; if (!num_rules) @@ -199,16 +199,16 @@ Signed-off-by: Aditya Kumar Singh reg_info->dfs_region, num_rules); /* Update reg_rules[] below. Firmware is expected to * send these rules in order(2 GHz rules first and then 5 GHz) -@@ -686,7 +563,7 @@ ath11k_reg_build_regd(struct ath11k_base - +@@ -697,7 +574,7 @@ ath11k_reg_build_regd(struct ath11k_base flags |= ath11k_map_fw_reg_flags(reg_rule->flags); + flags |= ath11k_map_fw_phy_flags(reg_info->phybitmap); - ath11k_reg_update_rule(tmp_regd->reg_rules + i, + ath11k_reg_update_rule(new_regd->reg_rules + i, reg_rule->start_freq, reg_rule->end_freq, max_bw, reg_rule->ant_gain, reg_rule->reg_power, -@@ -701,7 +578,7 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -712,7 +589,7 @@ ath11k_reg_build_regd(struct ath11k_base reg_info->dfs_region == ATH11K_DFS_REG_ETSI && (reg_rule->end_freq > ETSI_WEATHER_RADAR_BAND_LOW && reg_rule->start_freq < ETSI_WEATHER_RADAR_BAND_HIGH)){ @@ -217,7 +217,7 @@ Signed-off-by: Aditya Kumar Singh reg_rule, &i, flags, max_bw); continue; -@@ -712,37 +589,20 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -723,37 +600,20 @@ ath11k_reg_build_regd(struct ath11k_base "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d) (%d, %d)\n", i + 1, reg_rule->start_freq, reg_rule->end_freq, max_bw, reg_rule->ant_gain, reg_rule->reg_power, @@ -260,7 +260,7 @@ Signed-off-by: Aditya Kumar Singh --- a/drivers/net/wireless/ath/ath11k/reg.h +++ b/drivers/net/wireless/ath/ath11k/reg.h -@@ -30,7 +30,7 @@ void ath11k_reg_free(struct ath11k_base +@@ -33,7 +33,7 @@ void ath11k_reg_free(struct ath11k_base void ath11k_regd_update_work(struct work_struct *work); struct ieee80211_regdomain * ath11k_reg_build_regd(struct ath11k_base *ab, @@ -271,7 +271,7 @@ Signed-off-by: Aditya Kumar Singh #endif --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -7059,24 +7059,12 @@ static void ath11k_wmi_htc_tx_complete(s +@@ -7060,24 +7060,12 @@ static void ath11k_wmi_htc_tx_complete(s wake_up(&wmi->tx_ce_desc_wq); } @@ -296,7 +296,7 @@ Signed-off-by: Aditya Kumar Singh int ret = 0, pdev_idx, i, j; struct ath11k *ar; -@@ -7140,17 +7128,7 @@ static int ath11k_reg_chan_list_event(st +@@ -7141,17 +7129,7 @@ static int ath11k_reg_chan_list_event(st (char *)reg_info->alpha2, 2)) goto mem_free; diff --git a/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch b/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch index 2f5e75be8a3051..d23d70b2ce7d17 100644 --- a/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch +++ b/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch @@ -1,14 +1,24 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1413,6 +1413,54 @@ void ath9k_deinit_debug(struct ath_softc - ath9k_cmn_spectral_deinit_debug(&sc->spec_priv); - } +@@ -1471,6 +1471,7 @@ int ath9k_init_debug(struct ath_hw *ah) + + ath9k_cmn_debug_base_eeprom(sc->debug.debugfs_phy, sc->sc_ah); + ath9k_cmn_debug_modal_eeprom(sc->debug.debugfs_phy, sc->sc_ah); ++ ath9k_cmn_debug_eeprom(sc->debug.debugfs_phy, sc->sc_ah); + debugfs_create_u32("gpio_mask", 0600, + sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask); +--- a/drivers/net/wireless/ath/ath9k/common-debug.c ++++ b/drivers/net/wireless/ath/ath9k/common-debug.c +@@ -260,3 +260,58 @@ void ath9k_cmn_debug_phy_err(struct dent + &fops_phy_err); + } + EXPORT_SYMBOL(ath9k_cmn_debug_phy_err); ++ +static ssize_t read_file_eeprom(struct file *file, char __user *user_buf, + size_t count, loff_t *ppos) +{ -+ struct ath_softc *sc = file->private_data; -+ struct ath_hw *ah = sc->sc_ah; ++ struct ath_hw *ah = file->private_data; + struct ath_common *common = ath9k_hw_common(ah); + int bytes = 0; + int pos = *ppos; @@ -52,15 +62,31 @@ + .owner = THIS_MODULE +}; + - int ath9k_init_debug(struct ath_hw *ah) - { - struct ath_common *common = ath9k_hw_common(ah); -@@ -1432,6 +1480,8 @@ int ath9k_init_debug(struct ath_hw *ah) - ath9k_tx99_init_debug(sc); - ath9k_cmn_spectral_init_debug(&sc->spec_priv, sc->debug.debugfs_phy); - -+ debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc, ++void ath9k_cmn_debug_eeprom(struct dentry *debugfs_phy, ++ struct ath_hw *ah) ++{ ++ debugfs_create_file("eeprom", S_IRUSR, debugfs_phy, ah, + &fops_eeprom); - debugfs_create_devm_seqfile(sc->dev, "dma", sc->debug.debugfs_phy, - read_file_dma); - debugfs_create_devm_seqfile(sc->dev, "interrupt", sc->debug.debugfs_phy, ++} ++EXPORT_SYMBOL(ath9k_cmn_debug_eeprom); +--- a/drivers/net/wireless/ath/ath9k/common-debug.h ++++ b/drivers/net/wireless/ath/ath9k/common-debug.h +@@ -69,6 +69,8 @@ void ath9k_cmn_debug_modal_eeprom(struct + struct ath_hw *ah); + void ath9k_cmn_debug_base_eeprom(struct dentry *debugfs_phy, + struct ath_hw *ah); ++void ath9k_cmn_debug_eeprom(struct dentry *debugfs_phy, ++ struct ath_hw *ah); + void ath9k_cmn_debug_stat_rx(struct ath_rx_stats *rxstats, + struct ath_rx_status *rs); + void ath9k_cmn_debug_recv(struct dentry *debugfs_phy, +--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c ++++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c +@@ -519,6 +519,7 @@ int ath9k_htc_init_debug(struct ath_hw * + + ath9k_cmn_debug_base_eeprom(priv->debug.debugfs_phy, priv->ah); + ath9k_cmn_debug_modal_eeprom(priv->debug.debugfs_phy, priv->ah); ++ ath9k_cmn_debug_eeprom(priv->debug.debugfs_phy, priv->ah); + + return 0; + } diff --git a/package/kernel/mac80211/patches/ath9k/512-ath9k_channelbw_debugfs.patch b/package/kernel/mac80211/patches/ath9k/512-ath9k_channelbw_debugfs.patch index 94a191e0d80452..54abb4d4254087 100644 --- a/package/kernel/mac80211/patches/ath9k/512-ath9k_channelbw_debugfs.patch +++ b/package/kernel/mac80211/patches/ath9k/512-ath9k_channelbw_debugfs.patch @@ -1,70 +1,16 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1461,6 +1461,52 @@ static const struct file_operations fops - .owner = THIS_MODULE - }; +@@ -1472,6 +1472,7 @@ int ath9k_init_debug(struct ath_hw *ah) + ath9k_cmn_debug_base_eeprom(sc->debug.debugfs_phy, sc->sc_ah); + ath9k_cmn_debug_modal_eeprom(sc->debug.debugfs_phy, sc->sc_ah); + ath9k_cmn_debug_eeprom(sc->debug.debugfs_phy, sc->sc_ah); ++ ath9k_cmn_debug_chanbw(sc->debug.debugfs_phy, sc->sc_ah); -+ -+static ssize_t read_file_chan_bw(struct file *file, char __user *user_buf, -+ size_t count, loff_t *ppos) -+{ -+ struct ath_softc *sc = file->private_data; -+ struct ath_common *common = ath9k_hw_common(sc->sc_ah); -+ char buf[32]; -+ unsigned int len; -+ -+ len = sprintf(buf, "0x%08x\n", common->chan_bw); -+ return simple_read_from_buffer(user_buf, count, ppos, buf, len); -+} -+ -+static ssize_t write_file_chan_bw(struct file *file, const char __user *user_buf, -+ size_t count, loff_t *ppos) -+{ -+ struct ath_softc *sc = file->private_data; -+ struct ath_common *common = ath9k_hw_common(sc->sc_ah); -+ unsigned long chan_bw; -+ char buf[32]; -+ ssize_t len; -+ -+ len = min(count, sizeof(buf) - 1); -+ if (copy_from_user(buf, user_buf, len)) -+ return -EFAULT; -+ -+ buf[len] = '\0'; -+ if (kstrtoul(buf, 0, &chan_bw)) -+ return -EINVAL; -+ -+ common->chan_bw = chan_bw; -+ if (!test_bit(ATH_OP_INVALID, &common->op_flags)) -+ ath9k_ops.config(sc->hw, IEEE80211_CONF_CHANGE_CHANNEL); -+ -+ return count; -+} -+ -+static const struct file_operations fops_chanbw = { -+ .read = read_file_chan_bw, -+ .write = write_file_chan_bw, -+ .open = simple_open, -+ .owner = THIS_MODULE, -+ .llseek = default_llseek, -+}; -+ -+ - int ath9k_init_debug(struct ath_hw *ah) - { - struct ath_common *common = ath9k_hw_common(ah); -@@ -1482,6 +1528,8 @@ int ath9k_init_debug(struct ath_hw *ah) - - debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc, - &fops_eeprom); -+ debugfs_create_file("chanbw", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, -+ sc, &fops_chanbw); - debugfs_create_devm_seqfile(sc->dev, "dma", sc->debug.debugfs_phy, - read_file_dma); - debugfs_create_devm_seqfile(sc->dev, "interrupt", sc->debug.debugfs_phy, + debugfs_create_u32("gpio_mask", 0600, + sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask); --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h -@@ -151,6 +151,7 @@ struct ath_common { +@@ -153,6 +153,7 @@ struct ath_common { int debug_mask; enum ath_device_state state; unsigned long op_flags; @@ -72,6 +18,14 @@ struct ath_ani ani; +@@ -181,6 +182,7 @@ struct ath_common { + const struct ath_ops *ops; + const struct ath_bus_ops *bus_ops; + const struct ath_ps_ops *ps_ops; ++ const struct ieee80211_ops *ieee_ops; + + bool btcoex_enabled; + bool disable_ani; --- a/drivers/net/wireless/ath/ath9k/common.c +++ b/drivers/net/wireless/ath/ath9k/common.c @@ -297,11 +297,13 @@ EXPORT_SYMBOL(ath9k_cmn_get_hw_crypto_ke @@ -123,3 +77,115 @@ return channel; } +--- a/drivers/net/wireless/ath/ath9k/common-debug.c ++++ b/drivers/net/wireless/ath/ath9k/common-debug.c +@@ -316,3 +316,55 @@ void ath9k_cmn_debug_eeprom(struct dentr + &fops_eeprom); + } + EXPORT_SYMBOL(ath9k_cmn_debug_eeprom); ++ ++static ssize_t read_file_chan_bw(struct file *file, char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath_hw *ah = file->private_data; ++ struct ath_common *common = ath9k_hw_common(ah); ++ char buf[32]; ++ unsigned int len; ++ ++ len = sprintf(buf, "0x%08x\n", common->chan_bw); ++ return simple_read_from_buffer(user_buf, count, ppos, buf, len); ++} ++ ++static ssize_t write_file_chan_bw(struct file *file, const char __user *user_buf, ++ size_t count, loff_t *ppos) ++{ ++ struct ath_hw *ah = file->private_data; ++ struct ath_common *common = ath9k_hw_common(ah); ++ unsigned long chan_bw; ++ char buf[32]; ++ ssize_t len; ++ ++ len = min(count, sizeof(buf) - 1); ++ if (copy_from_user(buf, user_buf, len)) ++ return -EFAULT; ++ ++ buf[len] = '\0'; ++ if (kstrtoul(buf, 0, &chan_bw)) ++ return -EINVAL; ++ ++ common->chan_bw = chan_bw; ++ if (!test_bit(ATH_OP_INVALID, &common->op_flags)) ++ common->ieee_ops->config(ah->hw, IEEE80211_CONF_CHANGE_CHANNEL); ++ ++ return count; ++} ++ ++static const struct file_operations fops_chanbw = { ++ .read = read_file_chan_bw, ++ .write = write_file_chan_bw, ++ .open = simple_open, ++ .owner = THIS_MODULE, ++ .llseek = default_llseek, ++}; ++ ++void ath9k_cmn_debug_chanbw(struct dentry *debugfs_phy, ++ struct ath_hw *ah) ++{ ++ debugfs_create_file("chanbw", S_IRUSR | S_IWUSR, debugfs_phy, ah, ++ &fops_chanbw); ++} ++EXPORT_SYMBOL(ath9k_cmn_debug_chanbw); +--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c ++++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c +@@ -520,6 +520,7 @@ int ath9k_htc_init_debug(struct ath_hw * + ath9k_cmn_debug_base_eeprom(priv->debug.debugfs_phy, priv->ah); + ath9k_cmn_debug_modal_eeprom(priv->debug.debugfs_phy, priv->ah); + ath9k_cmn_debug_eeprom(priv->debug.debugfs_phy, priv->ah); ++ ath9k_cmn_debug_chanbw(priv->debug.debugfs_phy, priv->ah); + + return 0; + } +--- a/drivers/net/wireless/ath/ath9k/common-debug.h ++++ b/drivers/net/wireless/ath/ath9k/common-debug.h +@@ -71,6 +71,8 @@ void ath9k_cmn_debug_base_eeprom(struct + struct ath_hw *ah); + void ath9k_cmn_debug_eeprom(struct dentry *debugfs_phy, + struct ath_hw *ah); ++void ath9k_cmn_debug_chanbw(struct dentry *debugfs_phy, ++ struct ath_hw *ah); + void ath9k_cmn_debug_stat_rx(struct ath_rx_stats *rxstats, + struct ath_rx_status *rs); + void ath9k_cmn_debug_recv(struct dentry *debugfs_phy, +--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c ++++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c +@@ -631,6 +631,7 @@ static int ath9k_init_priv(struct ath9k_ + priv->ah = ah; + + common = ath9k_hw_common(ah); ++ common->ieee_ops = &ath9k_htc_ops; + common->ops = &ah->reg_ops; + common->ps_ops = &ath9k_htc_ps_ops; + common->bus_ops = &ath9k_usb_bus_ops; +@@ -746,9 +747,9 @@ static void ath9k_set_hw_capab(struct at + + hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN | + WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL | +- WIPHY_FLAG_HAS_CHANNEL_SWITCH; +- +- hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS; ++ WIPHY_FLAG_HAS_CHANNEL_SWITCH | ++ WIPHY_FLAG_SUPPORTS_5_10_MHZ | ++ WIPHY_FLAG_SUPPORTS_TDLS; + + hw->queues = 4; + hw->max_listen_interval = 1; +--- a/drivers/net/wireless/ath/ath9k/init.c ++++ b/drivers/net/wireless/ath/ath9k/init.c +@@ -733,6 +733,7 @@ static int ath9k_init_softc(u16 devid, s + if (!ath9k_is_chanctx_enabled()) + sc->cur_chan->hw_queue_base = 0; + ++ common->ieee_ops = &ath9k_ops; + common->ops = &ah->reg_ops; + common->bus_ops = bus_ops; + common->ps_ops = &ath9k_ps_ops; diff --git a/package/kernel/mac80211/patches/ath9k/530-ath9k_extra_leds.patch b/package/kernel/mac80211/patches/ath9k/530-ath9k_extra_leds.patch index af656b832ee813..9568b091de3c13 100644 --- a/package/kernel/mac80211/patches/ath9k/530-ath9k_extra_leds.patch +++ b/package/kernel/mac80211/patches/ath9k/530-ath9k_extra_leds.patch @@ -181,7 +181,7 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -1088,7 +1088,7 @@ int ath9k_init_device(u16 devid, struct +@@ -1089,7 +1089,7 @@ int ath9k_init_device(u16 devid, struct #ifdef CPTCFG_MAC80211_LEDS /* must be initialized before ieee80211_register_hw */ @@ -192,9 +192,9 @@ #endif --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1506,6 +1506,61 @@ static const struct file_operations fops - .llseek = default_llseek, - }; +@@ -128,6 +128,61 @@ static const struct file_operations fops + + #define DMA_BUF_LEN 1024 +#ifdef CONFIG_MAC80211_LEDS + @@ -252,12 +252,12 @@ +#endif + - int ath9k_init_debug(struct ath_hw *ah) - { -@@ -1530,6 +1585,10 @@ int ath9k_init_debug(struct ath_hw *ah) - &fops_eeprom); - debugfs_create_file("chanbw", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, - sc, &fops_chanbw); + static ssize_t read_file_ani(struct file *file, char __user *user_buf, + size_t count, loff_t *ppos) +@@ -1432,6 +1487,10 @@ int ath9k_init_debug(struct ath_hw *ah) + ath9k_tx99_init_debug(sc); + ath9k_cmn_spectral_init_debug(&sc->spec_priv, sc->debug.debugfs_phy); + +#ifdef CONFIG_MAC80211_LEDS + debugfs_create_file("gpio_led", S_IWUSR, + sc->debug.debugfs_phy, sc, &fops_gpio_led); diff --git a/package/kernel/mac80211/patches/build/004-fix-kconf-compiling.patch b/package/kernel/mac80211/patches/build/004-fix-kconf-compiling.patch new file mode 100644 index 00000000000000..8bae8367f7666a --- /dev/null +++ b/package/kernel/mac80211/patches/build/004-fix-kconf-compiling.patch @@ -0,0 +1,47 @@ +--- a/Makefile.real ++++ b/Makefile.real +@@ -6,6 +6,18 @@ else + export BACKPORTS_GIT_TRACKER_DEF= + endif + ++ifneq ($(LLVM),) ++ifneq ($(filter %/,$(LLVM)),) ++LLVM_PREFIX := $(LLVM) ++else ifneq ($(filter -%,$(LLVM)),) ++LLVM_SUFFIX := $(LLVM) ++endif ++ ++HOSTCC = $(LLVM_PREFIX)clang$(LLVM_SUFFIX) ++else ++HOSTCC = gcc ++endif ++ + # disable built-in rules for this file + .SUFFIXES: + +@@ -24,21 +36,21 @@ listnewconfig oldaskconfig oldconfig \ + silentoldconfig olddefconfig oldnoconfig \ + allnoconfig allyesconfig allmodconfig \ + alldefconfig randconfig: +- @$(MAKE) -C kconf conf ++ @$(MAKE) -C kconf CC=$(HOSTCC) conf + @./kconf/conf --$@ Kconfig + + .PHONY: usedefconfig + usedefconfig: +- @$(MAKE) -C kconf conf ++ @$(MAKE) -C kconf CC=$(HOSTCC) conf + @./kconf/conf --defconfig=defconfig Kconfig + + .PHONY: savedefconfig + savedefconfig: +- @$(MAKE) -C kconf conf ++ @$(MAKE) -C kconf CC=$(HOSTCC) conf + @./kconf/conf --savedefconfig=defconfig Kconfig + + defconfig-%:: +- @$(MAKE) -C kconf conf ++ @$(MAKE) -C kconf CC=$(HOSTCC) conf + @./kconf/conf --defconfig=defconfigs/$(@:defconfig-%=%) Kconfig + + .config: diff --git a/package/kernel/mac80211/patches/rt2x00/000-v6.6-wifi-rt2x00-correct-MAC_SYS_CTRL-register-RX-mask-i.patch b/package/kernel/mac80211/patches/rt2x00/000-v6.6-wifi-rt2x00-correct-MAC_SYS_CTRL-register-RX-mask-i.patch new file mode 100644 index 00000000000000..c84b5a140840e4 --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/000-v6.6-wifi-rt2x00-correct-MAC_SYS_CTRL-register-RX-mask-i.patch @@ -0,0 +1,28 @@ +From 186f2432741f6d28d86ff723ac7830446affddfc Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Sat, 5 Aug 2023 17:17:28 +0800 +Subject: wifi: rt2x00: correct MAC_SYS_CTRL register RX mask in R-Calibration + +For MAC_SYS_CTRL register, Bit[2] controls MAC_TX_EN and Bit[3] +controls MAC_RX_EN (Bit index starts from 0). Therefore, 0x08 is +the correct mask for RX. + +Signed-off-by: Shiji Yang +Acked-by: Stanislaw Gruszka +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/TYAP286MB03150B571B67B896A504AC34BC0EA@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -8561,7 +8561,7 @@ static void rt2800_r_calibration(struct + rt2x00_warn(rt2x00dev, "Wait MAC Tx Status to MAX !!!\n"); + + maccfg = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL); +- maccfg &= (~0x04); ++ maccfg &= (~0x08); + rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, maccfg); + + if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_RX))) diff --git a/package/kernel/mac80211/patches/rt2x00/997-wifi-rt2x00-limit-MT7620-TX-power-based-on-eeprom-ca.patch b/package/kernel/mac80211/patches/rt2x00/001-v6.6-wifi-rt2x00-limit-MT7620-TX-power-based-on-eeprom.patch similarity index 73% rename from package/kernel/mac80211/patches/rt2x00/997-wifi-rt2x00-limit-MT7620-TX-power-based-on-eeprom-ca.patch rename to package/kernel/mac80211/patches/rt2x00/001-v6.6-wifi-rt2x00-limit-MT7620-TX-power-based-on-eeprom.patch index fd1b3d8bf3b6ee..aa843d4219878d 100644 --- a/package/kernel/mac80211/patches/rt2x00/997-wifi-rt2x00-limit-MT7620-TX-power-based-on-eeprom-ca.patch +++ b/package/kernel/mac80211/patches/rt2x00/001-v6.6-wifi-rt2x00-limit-MT7620-TX-power-based-on-eeprom.patch @@ -1,7 +1,7 @@ +From 821b5192c955144bd2f0aeea6cd153e1aedd16e1 Mon Sep 17 00:00:00 2001 From: Shiji Yang -Date: Sat, 22 Jul 2023 21:56:30 +0800 -Subject: [PATCH] wifi: rt2x00: limit MT7620 TX power based on eeprom - calibration +Date: Fri, 11 Aug 2023 14:34:54 +0800 +Subject: wifi: rt2x00: limit MT7620 TX power based on eeprom calibration In the vendor driver, the current channel power is queried from EEPROM_TXPOWER_BG1 and EEPROM_TXPOWER_BG2. And then the mixed value @@ -18,29 +18,36 @@ Based on these eeprom values, this patch adds basic TX power control for the MT7620 and limits its maximum TX power. This can avoid the link speed decrease caused by chip overheating. rt2800_config_alc() function has also been renamed to rt2800_config_alc_rt6352() because -it's only used by RT6352(MT7620). +it's only used by RT6352 (MT7620). Notice: It's still need some work to sync the max channel power to the user -interface. This part is missing from the rt2x00 driver structure. If +interface. This part is missing from the rt2x00 driver framework. If we set the power exceed the calibration value, it won't take effect. Signed-off-by: Shiji Yang +Acked-by: Stanislaw Gruszka +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/TYAP286MB03159090ED14044215E59FD6BC10A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM --- - .../net/wireless/ralink/rt2x00/rt2800lib.c | 49 +++++++++++++------ - 1 file changed, 34 insertions(+), 15 deletions(-) + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 57 ++++++++++++++++++-------- + 1 file changed, 40 insertions(+), 17 deletions(-) --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -3891,28 +3891,47 @@ static void rt2800_config_channel_rf7620 +@@ -3865,28 +3865,51 @@ static void rt2800_config_channel_rf7620 } } -static void rt2800_config_alc(struct rt2x00_dev *rt2x00dev, -+static void rt2800_config_alc_rt6352(struct rt2x00_dev *rt2x00dev, - struct ieee80211_channel *chan, - int power_level) { +- struct ieee80211_channel *chan, +- int power_level) { - u16 eeprom, target_power, max_power; ++static void rt2800_config_alc_rt6352(struct rt2x00_dev *rt2x00dev, ++ struct ieee80211_channel *chan, ++ int power_level) ++{ ++ int cur_channel = rt2x00dev->rf_channel; + u16 eeprom, chan_power, rate_power, target_power; + u16 tx_power[2]; + s8 *power_group[2]; @@ -57,27 +64,29 @@ Signed-off-by: Shiji Yang - max_power = chan->max_power * 2; - if (max_power > 0x2f) - max_power = 0x2f; -+ /* get per channel power, 2 channels in total, unit is 0.5dBm */ ++ if (WARN_ON(cur_channel < 1 || cur_channel > 14)) ++ return; ++ ++ /* get per chain power, 2 chains in total, unit is 0.5dBm */ + power_level = (power_level - 3) * 2; -+ /* -+ * We can't get the accurate TX power. Based on some tests, the real ++ ++ /* We can't get the accurate TX power. Based on some tests, the real + * TX power is approximately equal to channel_power + (max)rate_power. + * Usually max rate_power is the gain of the OFDM 6M rate. The antenna + * gain and externel PA gain are not included as we are unable to + * obtain these values. + */ + rate_power = rt2800_eeprom_read_from_array(rt2x00dev, -+ EEPROM_TXPOWER_BYRATE, 1) & 0x3f; ++ EEPROM_TXPOWER_BYRATE, 1); ++ rate_power &= 0x3f; + power_level -= rate_power; + if (power_level < 1) + power_level = 1; -+ if (power_level > chan->max_power * 2) -+ power_level = chan->max_power * 2; + + power_group[0] = rt2800_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_BG1); + power_group[1] = rt2800_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_BG2); + for (cnt = 0; cnt < 2; cnt++) { -+ chan_power = power_group[cnt][rt2x00dev->rf_channel - 1]; ++ chan_power = power_group[cnt][cur_channel - 1]; + if (chan_power >= 0x20 || chan_power == 0) + chan_power = 0x10; + tx_power[cnt] = power_level < chan_power ? power_level : chan_power; @@ -95,7 +104,7 @@ Signed-off-by: Shiji Yang eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1); if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_INTERNAL_TX_ALC)) { -@@ -5321,7 +5340,7 @@ static void rt2800_config_txpower_rt6352 +@@ -5268,7 +5291,7 @@ static void rt2800_config_txpower_rt6352 rt2x00_set_field32(&pwreg, TX_PWR_CFG_9B_STBC_MCS7, t); rt2800_register_write(rt2x00dev, TX_PWR_CFG_9, pwreg); diff --git a/package/kernel/mac80211/patches/rt2x00/999-wifi-rt2x00-fix-MT7620-low-RSSI-issue.patch b/package/kernel/mac80211/patches/rt2x00/002-v6.7-wifi-rt2x00-fix-MT7620-low-RSSI-issue.patch similarity index 76% rename from package/kernel/mac80211/patches/rt2x00/999-wifi-rt2x00-fix-MT7620-low-RSSI-issue.patch rename to package/kernel/mac80211/patches/rt2x00/002-v6.7-wifi-rt2x00-fix-MT7620-low-RSSI-issue.patch index 8f7343d14e30b0..ffb66559d173a1 100644 --- a/package/kernel/mac80211/patches/rt2x00/999-wifi-rt2x00-fix-MT7620-low-RSSI-issue.patch +++ b/package/kernel/mac80211/patches/rt2x00/002-v6.7-wifi-rt2x00-fix-MT7620-low-RSSI-issue.patch @@ -1,6 +1,7 @@ +From 2ecfe6f07e8e6257cad3d3290c5aec2102120041 Mon Sep 17 00:00:00 2001 From: Shiji Yang -Date: Sat, 23 Sep 2023 07:51:39 +0800 -Subject: [PATCH] wifi: rt2x00: fix MT7620 low RSSI issue +Date: Sat, 23 Sep 2023 09:01:01 +0800 +Subject: wifi: rt2x00: fix MT7620 low RSSI issue On Mediatek vendor driver[1], MT7620 (RT6352) uses different RSSI base value '-2' compared to the other RT2x00 chips. This patch @@ -10,13 +11,16 @@ reports on MT7620. [1] Found on MT76x2E_MT7620_LinuxAP_V3.0.4.0_P3 ConvertToRssi(). Signed-off-by: Shiji Yang +Acked-by: Stanislaw Gruszka +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/TYAP286MB031571CDB146C414A908A66DBCFEA@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM --- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -875,6 +875,7 @@ static int rt2800_agc_to_rssi(struct rt2 +@@ -856,6 +856,7 @@ static int rt2800_agc_to_rssi(struct rt2 s8 rssi0 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI0); s8 rssi1 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI1); s8 rssi2 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI2); @@ -24,7 +28,7 @@ Signed-off-by: Shiji Yang u16 eeprom; u8 offset0; u8 offset1; -@@ -899,9 +900,9 @@ static int rt2800_agc_to_rssi(struct rt2 +@@ -880,9 +881,9 @@ static int rt2800_agc_to_rssi(struct rt2 * If the value in the descriptor is 0, it is considered invalid * and the default (extremely low) rssi value is assumed */ diff --git a/package/kernel/mac80211/patches/rt2x00/003-v6.7-wifi-rt2x00-fix-rt2800-watchdog-function.patch b/package/kernel/mac80211/patches/rt2x00/003-v6.7-wifi-rt2x00-fix-rt2800-watchdog-function.patch new file mode 100644 index 00000000000000..f253dacf2b2242 --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/003-v6.7-wifi-rt2x00-fix-rt2800-watchdog-function.patch @@ -0,0 +1,78 @@ +From 69708fbb2c698f262e03360d064c7066e0679953 Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Sat, 14 Oct 2023 14:55:01 +0800 +Subject: wifi: rt2x00: fix rt2800 watchdog function + +The watchdog function is broken on rt2800 series SoCs. This patch +fixes the incorrect watchdog logic to make it work again. + +1. Update current wdt queue index if it's not equal to the previous + index. Watchdog compares the current and previous queue index to + judge if the queue hung. +2. Make sure hung_{rx,tx} 'true' status won't be override by the + normal queue. Any queue hangs should trigger a reset action. +3. Clear the watchdog counter of all queues before resetting the + hardware. This change may help to avoid the reset loop. +4. Change hang check function return type to bool as we only need + to return two status, yes or no. + +Signed-off-by: Shiji Yang +Acked-by: Stanislaw Gruszka +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/TYAP286MB0315BC1D83D31154924F0D39BCD1A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -1237,13 +1237,14 @@ void rt2800_txdone_nostatus(struct rt2x0 + } + EXPORT_SYMBOL_GPL(rt2800_txdone_nostatus); + +-static int rt2800_check_hung(struct data_queue *queue) ++static bool rt2800_check_hung(struct data_queue *queue) + { + unsigned int cur_idx = rt2800_drv_get_dma_done(queue); + +- if (queue->wd_idx != cur_idx) ++ if (queue->wd_idx != cur_idx) { ++ queue->wd_idx = cur_idx; + queue->wd_count = 0; +- else ++ } else + queue->wd_count++; + + return queue->wd_count > 16; +@@ -1280,7 +1281,7 @@ void rt2800_watchdog(struct rt2x00_dev * + case QID_MGMT: + if (rt2x00queue_empty(queue)) + continue; +- hung_tx = rt2800_check_hung(queue); ++ hung_tx = hung_tx || rt2800_check_hung(queue); + break; + case QID_RX: + /* For station mode we should reactive at least +@@ -1289,7 +1290,7 @@ void rt2800_watchdog(struct rt2x00_dev * + */ + if (rt2x00dev->intf_sta_count == 0) + continue; +- hung_rx = rt2800_check_hung(queue); ++ hung_rx = hung_rx || rt2800_check_hung(queue); + break; + default: + break; +@@ -1302,8 +1303,12 @@ void rt2800_watchdog(struct rt2x00_dev * + if (hung_rx) + rt2x00_warn(rt2x00dev, "Watchdog RX hung detected\n"); + +- if (hung_tx || hung_rx) ++ if (hung_tx || hung_rx) { ++ queue_for_each(rt2x00dev, queue) ++ queue->wd_count = 0; ++ + ieee80211_restart_hw(rt2x00dev->hw); ++ } + } + EXPORT_SYMBOL_GPL(rt2800_watchdog); + diff --git a/package/kernel/mac80211/patches/rt2x00/004-1-v6.7-wifi-rt2x00-improve-MT7620-register-initialization.patch b/package/kernel/mac80211/patches/rt2x00/004-1-v6.7-wifi-rt2x00-improve-MT7620-register-initialization.patch new file mode 100644 index 00000000000000..9f4dbb8346e171 --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/004-1-v6.7-wifi-rt2x00-improve-MT7620-register-initialization.patch @@ -0,0 +1,124 @@ +From 1ffe76d5ae78553948d67a978acd9945c2f0a175 Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Thu, 19 Oct 2023 19:58:56 +0800 +Subject: wifi: rt2x00: improve MT7620 register initialization + +1. Do not hard reset the BBP. We can use soft reset instead. This + change has some help to the calibration failure issue. +2. Enable falling back to legacy rate from the HT/RTS rate by + setting the HT_FBK_TO_LEGACY register. +3. Implement MCS rate specific maximum PSDU size. It can improve + the transmission quality under the low RSSI condition. +4. Set BBP_84 register value to 0x19. This is used for extension + channel overlapping IOT. + +Signed-off-by: Shiji Yang +Acked-by: Stanislaw Gruszka +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/TYAP286MB031553CCD4B7A3B89C85935DBCD4A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM +--- + drivers/net/wireless/ralink/rt2x00/rt2800.h | 18 ++++++++++++++++++ + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 24 ++++++++++++++++++++++++ + drivers/net/wireless/ralink/rt2x00/rt2800mmio.c | 3 +++ + 3 files changed, 45 insertions(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h +@@ -871,6 +871,18 @@ + #define LED_CFG_LED_POLAR FIELD32(0x40000000) + + /* ++ * AMPDU_MAX_LEN_20M1S: Per MCS max A-MPDU length, 20 MHz, MCS 0-7 ++ * AMPDU_MAX_LEN_20M2S: Per MCS max A-MPDU length, 20 MHz, MCS 8-15 ++ * AMPDU_MAX_LEN_40M1S: Per MCS max A-MPDU length, 40 MHz, MCS 0-7 ++ * AMPDU_MAX_LEN_40M2S: Per MCS max A-MPDU length, 40 MHz, MCS 8-15 ++ * Maximum A-MPDU length = 2^(AMPDU_MAX - 5) kilobytes ++ */ ++#define AMPDU_MAX_LEN_20M1S 0x1030 ++#define AMPDU_MAX_LEN_20M2S 0x1034 ++#define AMPDU_MAX_LEN_40M1S 0x1038 ++#define AMPDU_MAX_LEN_40M2S 0x103C ++ ++/* + * AMPDU_BA_WINSIZE: Force BlockAck window size + * FORCE_WINSIZE_ENABLE: + * 0: Disable forcing of BlockAck window size +@@ -1545,6 +1557,12 @@ + */ + #define EXP_ACK_TIME 0x1380 + ++/* ++ * HT_FBK_TO_LEGACY: Enable/Disable HT/RTS fallback to OFDM/CCK rate ++ * Not available for legacy SoCs ++ */ ++#define HT_FBK_TO_LEGACY 0x1384 ++ + /* TX_PWR_CFG_5 */ + #define TX_PWR_CFG_5 0x1384 + #define TX_PWR_CFG_5_MCS16_CH0 FIELD32(0x0000000f) +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -5851,6 +5851,7 @@ static int rt2800_init_registers(struct + struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; + u32 reg; + u16 eeprom; ++ u8 bbp; + unsigned int i; + int ret; + +@@ -5860,6 +5861,19 @@ static int rt2800_init_registers(struct + if (ret) + return ret; + ++ if (rt2x00_rt(rt2x00dev, RT6352)) { ++ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, 0x01); ++ ++ bbp = rt2800_bbp_read(rt2x00dev, 21); ++ bbp |= 0x01; ++ rt2800_bbp_write(rt2x00dev, 21, bbp); ++ bbp = rt2800_bbp_read(rt2x00dev, 21); ++ bbp &= (~0x01); ++ rt2800_bbp_write(rt2x00dev, 21, bbp); ++ ++ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, 0x00); ++ } ++ + rt2800_register_write(rt2x00dev, LEGACY_BASIC_RATE, 0x0000013f); + rt2800_register_write(rt2x00dev, HT_BASIC_RATE, 0x00008003); + +@@ -6013,6 +6027,14 @@ static int rt2800_init_registers(struct + reg = rt2800_register_read(rt2x00dev, TX_ALC_CFG_1); + rt2x00_set_field32(®, TX_ALC_CFG_1_ROS_BUSY_EN, 0); + rt2800_register_write(rt2x00dev, TX_ALC_CFG_1, reg); ++ ++ rt2800_register_write(rt2x00dev, AMPDU_MAX_LEN_20M1S, 0x77754433); ++ rt2800_register_write(rt2x00dev, AMPDU_MAX_LEN_20M2S, 0x77765543); ++ rt2800_register_write(rt2x00dev, AMPDU_MAX_LEN_40M1S, 0x77765544); ++ rt2800_register_write(rt2x00dev, AMPDU_MAX_LEN_40M2S, 0x77765544); ++ ++ rt2800_register_write(rt2x00dev, HT_FBK_TO_LEGACY, 0x1010); ++ + } else { + rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000000); + rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606); +@@ -7231,6 +7253,8 @@ static void rt2800_init_bbp_6352(struct + rt2800_bbp_dcoc_write(rt2x00dev, 159, 0x64); + + rt2800_bbp4_mac_if_ctrl(rt2x00dev); ++ ++ rt2800_bbp_write(rt2x00dev, 84, 0x19); + } + + static void rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) +--- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c +@@ -760,6 +760,9 @@ int rt2800mmio_init_registers(struct rt2 + + rt2x00mmio_register_write(rt2x00dev, PWR_PIN_CFG, 0x00000003); + ++ if (rt2x00_rt(rt2x00dev, RT6352)) ++ return 0; ++ + reg = 0; + rt2x00_set_field32(®, MAC_SYS_CTRL_RESET_CSR, 1); + rt2x00_set_field32(®, MAC_SYS_CTRL_RESET_BBP, 1); diff --git a/package/kernel/mac80211/patches/rt2x00/004-2-v6.7-wifi-rt2x00-rework-MT7620-channel-config-function.patch b/package/kernel/mac80211/patches/rt2x00/004-2-v6.7-wifi-rt2x00-rework-MT7620-channel-config-function.patch new file mode 100644 index 00000000000000..1aec73d7622150 --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/004-2-v6.7-wifi-rt2x00-rework-MT7620-channel-config-function.patch @@ -0,0 +1,146 @@ +From a28533c6be1711584bf3ec978309d5c590029821 Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Thu, 19 Oct 2023 19:58:57 +0800 +Subject: wifi: rt2x00: rework MT7620 channel config function + +1. Move the channel configuration code from rt2800_vco_calibration() + to the rt2800_config_channel(). +2. Use MT7620 SoC specific AGC initial LNA value instead of the + RT5592's value. +3. BBP{195,196} pairing write has been replaced with + rt2800_bbp_glrt_write() to reduce redundant code. + +Signed-off-by: Shiji Yang +Acked-by: Stanislaw Gruszka +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/TYAP286MB0315622A4340BFFA530B1B86BCD4A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 91 ++++++++++---------------- + 1 file changed, 35 insertions(+), 56 deletions(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -3861,14 +3861,6 @@ static void rt2800_config_channel_rf7620 + rfcsr |= tx_agc_fc; + rt2800_rfcsr_write_bank(rt2x00dev, 7, 59, rfcsr); + } +- +- if (conf_is_ht40(conf)) { +- rt2800_bbp_glrt_write(rt2x00dev, 141, 0x10); +- rt2800_bbp_glrt_write(rt2x00dev, 157, 0x2f); +- } else { +- rt2800_bbp_glrt_write(rt2x00dev, 141, 0x1a); +- rt2800_bbp_glrt_write(rt2x00dev, 157, 0x40); +- } + } + + static void rt2800_config_alc_rt6352(struct rt2x00_dev *rt2x00dev, +@@ -4437,32 +4429,46 @@ static void rt2800_config_channel(struct + usleep_range(1000, 1500); + } + +- if (rt2x00_rt(rt2x00dev, RT5592) || rt2x00_rt(rt2x00dev, RT6352)) { +- reg = 0x10; +- if (!conf_is_ht40(conf)) { +- if (rt2x00_rt(rt2x00dev, RT6352) && +- rt2x00_has_cap_external_lna_bg(rt2x00dev)) { +- reg |= 0x5; +- } else { +- reg |= 0xa; +- } +- } +- rt2800_bbp_write(rt2x00dev, 195, 141); +- rt2800_bbp_write(rt2x00dev, 196, reg); ++ if (rt2x00_rt(rt2x00dev, RT5592)) { ++ bbp = conf_is_ht40(conf) ? 0x10 : 0x1a; ++ rt2800_bbp_glrt_write(rt2x00dev, 141, bbp); + +- /* AGC init. +- * Despite the vendor driver using different values here for +- * RT6352 chip, we use 0x1c for now. This may have to be changed +- * once TSSI got implemented. +- */ +- reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2*rt2x00dev->lna_gain; +- rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg); ++ bbp = (rf->channel <= 14 ? 0x1c : 0x24) + 2 * rt2x00dev->lna_gain; ++ rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, bbp); + +- if (rt2x00_rt(rt2x00dev, RT5592)) +- rt2800_iq_calibrate(rt2x00dev, rf->channel); ++ rt2800_iq_calibrate(rt2x00dev, rf->channel); + } + + if (rt2x00_rt(rt2x00dev, RT6352)) { ++ /* BBP for GLRT BW */ ++ bbp = conf_is_ht40(conf) ? ++ 0x10 : rt2x00_has_cap_external_lna_bg(rt2x00dev) ? ++ 0x15 : 0x1a; ++ rt2800_bbp_glrt_write(rt2x00dev, 141, bbp); ++ ++ bbp = conf_is_ht40(conf) ? 0x2f : 0x40; ++ rt2800_bbp_glrt_write(rt2x00dev, 157, bbp); ++ ++ if (rt2x00dev->default_ant.rx_chain_num == 1) { ++ rt2800_bbp_write(rt2x00dev, 91, 0x07); ++ rt2800_bbp_write(rt2x00dev, 95, 0x1a); ++ rt2800_bbp_glrt_write(rt2x00dev, 128, 0xa0); ++ rt2800_bbp_glrt_write(rt2x00dev, 170, 0x12); ++ rt2800_bbp_glrt_write(rt2x00dev, 171, 0x10); ++ } else { ++ rt2800_bbp_write(rt2x00dev, 91, 0x06); ++ rt2800_bbp_write(rt2x00dev, 95, 0x9a); ++ rt2800_bbp_glrt_write(rt2x00dev, 128, 0xe0); ++ rt2800_bbp_glrt_write(rt2x00dev, 170, 0x30); ++ rt2800_bbp_glrt_write(rt2x00dev, 171, 0x30); ++ } ++ ++ /* AGC init */ ++ bbp = rf->channel <= 14 ? 0x04 + 2 * rt2x00dev->lna_gain : 0; ++ rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, bbp); ++ ++ usleep_range(1000, 1500); ++ + if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, + &rt2x00dev->cap_flags)) { + reg = rt2800_register_read(rt2x00dev, RF_CONTROL3); +@@ -5608,26 +5614,6 @@ void rt2800_vco_calibration(struct rt2x0 + rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin); + + if (rt2x00_rt(rt2x00dev, RT6352)) { +- if (rt2x00dev->default_ant.rx_chain_num == 1) { +- rt2800_bbp_write(rt2x00dev, 91, 0x07); +- rt2800_bbp_write(rt2x00dev, 95, 0x1A); +- rt2800_bbp_write(rt2x00dev, 195, 128); +- rt2800_bbp_write(rt2x00dev, 196, 0xA0); +- rt2800_bbp_write(rt2x00dev, 195, 170); +- rt2800_bbp_write(rt2x00dev, 196, 0x12); +- rt2800_bbp_write(rt2x00dev, 195, 171); +- rt2800_bbp_write(rt2x00dev, 196, 0x10); +- } else { +- rt2800_bbp_write(rt2x00dev, 91, 0x06); +- rt2800_bbp_write(rt2x00dev, 95, 0x9A); +- rt2800_bbp_write(rt2x00dev, 195, 128); +- rt2800_bbp_write(rt2x00dev, 196, 0xE0); +- rt2800_bbp_write(rt2x00dev, 195, 170); +- rt2800_bbp_write(rt2x00dev, 196, 0x30); +- rt2800_bbp_write(rt2x00dev, 195, 171); +- rt2800_bbp_write(rt2x00dev, 196, 0x30); +- } +- + if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { + rt2800_bbp_write(rt2x00dev, 75, 0x68); + rt2800_bbp_write(rt2x00dev, 76, 0x4C); +@@ -5635,13 +5621,6 @@ void rt2800_vco_calibration(struct rt2x0 + rt2800_bbp_write(rt2x00dev, 80, 0x0C); + rt2800_bbp_write(rt2x00dev, 82, 0xB6); + } +- +- /* On 11A, We should delay and wait RF/BBP to be stable +- * and the appropriate time should be 1000 micro seconds +- * 2005/06/05 - On 11G, we also need this delay time. +- * Otherwise it's difficult to pass the WHQL. +- */ +- usleep_range(1000, 1500); + } + } + EXPORT_SYMBOL_GPL(rt2800_vco_calibration); diff --git a/package/kernel/mac80211/patches/rt2x00/004-3-v6.7-wifi-rt2x00-rework-MT7620-PA-LNA-RF-calibration.patch b/package/kernel/mac80211/patches/rt2x00/004-3-v6.7-wifi-rt2x00-rework-MT7620-PA-LNA-RF-calibration.patch new file mode 100644 index 00000000000000..64cd599c02b360 --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/004-3-v6.7-wifi-rt2x00-rework-MT7620-PA-LNA-RF-calibration.patch @@ -0,0 +1,241 @@ +From cca74bed37af1c8217bcd8282d9b384efdbf73bd Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Thu, 19 Oct 2023 19:58:58 +0800 +Subject: wifi: rt2x00: rework MT7620 PA/LNA RF calibration + +1. Move MT7620 PA/LNA calibration code to dedicated functions. +2. For external PA/LNA devices, restore RF and BBP registers before + R-Calibration. +3. Do Rx DCOC calibration again before RXIQ calibration. +4. Add some missing LNA related registers' initialization. + +Signed-off-by: Shiji Yang +Acked-by: Stanislaw Gruszka +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/TYAP286MB0315979F92DC563019B8F238BCD4A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 176 +++++++++++++++++-------- + drivers/net/wireless/ralink/rt2x00/rt2x00.h | 6 + + 2 files changed, 130 insertions(+), 52 deletions(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -4468,41 +4468,6 @@ static void rt2800_config_channel(struct + rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, bbp); + + usleep_range(1000, 1500); +- +- if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, +- &rt2x00dev->cap_flags)) { +- reg = rt2800_register_read(rt2x00dev, RF_CONTROL3); +- reg |= 0x00000101; +- rt2800_register_write(rt2x00dev, RF_CONTROL3, reg); +- +- reg = rt2800_register_read(rt2x00dev, RF_BYPASS3); +- reg |= 0x00000101; +- rt2800_register_write(rt2x00dev, RF_BYPASS3, reg); +- +- rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0x73); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0x73); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0x73); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 46, 0x27); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0xC8); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xA4); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x05); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x27); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0xC8); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xA4); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 57, 0x05); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x27); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0xC8); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xA4); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x05); +- rt2800_rfcsr_write_dccal(rt2x00dev, 05, 0x00); +- +- rt2800_register_write(rt2x00dev, TX0_RF_GAIN_CORRECT, +- 0x36303636); +- rt2800_register_write(rt2x00dev, TX0_RF_GAIN_ATTEN, +- 0x6C6C6B6C); +- rt2800_register_write(rt2x00dev, TX1_RF_GAIN_ATTEN, +- 0x6C6C6B6C); +- } + } + + bbp = rt2800_bbp_read(rt2x00dev, 4); +@@ -5612,16 +5577,6 @@ void rt2800_vco_calibration(struct rt2x0 + } + } + rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin); +- +- if (rt2x00_rt(rt2x00dev, RT6352)) { +- if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { +- rt2800_bbp_write(rt2x00dev, 75, 0x68); +- rt2800_bbp_write(rt2x00dev, 76, 0x4C); +- rt2800_bbp_write(rt2x00dev, 79, 0x1C); +- rt2800_bbp_write(rt2x00dev, 80, 0x0C); +- rt2800_bbp_write(rt2x00dev, 82, 0xB6); +- } +- } + } + EXPORT_SYMBOL_GPL(rt2800_vco_calibration); + +@@ -10348,6 +10303,128 @@ do_cal: + rt2800_register_write(rt2x00dev, RF_BYPASS0, MAC_RF_BYPASS0); + } + ++static void rt2800_restore_rf_bbp_rt6352(struct rt2x00_dev *rt2x00dev) ++{ ++ if (rt2x00_has_cap_external_pa(rt2x00dev)) { ++ rt2800_register_write(rt2x00dev, RF_CONTROL3, 0x0); ++ rt2800_register_write(rt2x00dev, RF_BYPASS3, 0x0); ++ } ++ ++ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x16); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x23); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x02); ++ } ++ ++ if (rt2x00_has_cap_external_pa(rt2x00dev)) { ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0xd3); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0xb3); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0xd5); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 46, 0x27); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x6c); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xfc); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x1f); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x27); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x66); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xff); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 57, 0x1c); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x20); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0x6b); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xf7); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x09); ++ } ++ ++ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { ++ rt2800_bbp_write(rt2x00dev, 75, 0x60); ++ rt2800_bbp_write(rt2x00dev, 76, 0x44); ++ rt2800_bbp_write(rt2x00dev, 79, 0x1c); ++ rt2800_bbp_write(rt2x00dev, 80, 0x0c); ++ rt2800_bbp_write(rt2x00dev, 82, 0xB6); ++ } ++ ++ if (rt2x00_has_cap_external_pa(rt2x00dev)) { ++ rt2800_register_write(rt2x00dev, TX0_RF_GAIN_CORRECT, 0x3630363a); ++ rt2800_register_write(rt2x00dev, TX0_RF_GAIN_ATTEN, 0x6c6c666c); ++ rt2800_register_write(rt2x00dev, TX1_RF_GAIN_ATTEN, 0x6c6c666c); ++ } ++} ++ ++static void rt2800_calibration_rt6352(struct rt2x00_dev *rt2x00dev) ++{ ++ u32 reg; ++ ++ if (rt2x00_has_cap_external_pa(rt2x00dev) || ++ rt2x00_has_cap_external_lna_bg(rt2x00dev)) ++ rt2800_restore_rf_bbp_rt6352(rt2x00dev); ++ ++ rt2800_r_calibration(rt2x00dev); ++ rt2800_rf_self_txdc_cal(rt2x00dev); ++ rt2800_rxdcoc_calibration(rt2x00dev); ++ rt2800_bw_filter_calibration(rt2x00dev, true); ++ rt2800_bw_filter_calibration(rt2x00dev, false); ++ rt2800_loft_iq_calibration(rt2x00dev); ++ ++ /* missing DPD calibration for internal PA devices */ ++ ++ rt2800_rxdcoc_calibration(rt2x00dev); ++ rt2800_rxiq_calibration(rt2x00dev); ++ ++ if (!rt2x00_has_cap_external_pa(rt2x00dev) && ++ !rt2x00_has_cap_external_lna_bg(rt2x00dev)) ++ return; ++ ++ if (rt2x00_has_cap_external_pa(rt2x00dev)) { ++ reg = rt2800_register_read(rt2x00dev, RF_CONTROL3); ++ reg |= 0x00000101; ++ rt2800_register_write(rt2x00dev, RF_CONTROL3, reg); ++ ++ reg = rt2800_register_read(rt2x00dev, RF_BYPASS3); ++ reg |= 0x00000101; ++ rt2800_register_write(rt2x00dev, RF_BYPASS3, reg); ++ } ++ ++ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x42); ++ } ++ ++ if (rt2x00_has_cap_external_pa(rt2x00dev)) { ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0x73); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0x73); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0x73); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 46, 0x27); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0xc8); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xa4); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x05); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x27); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0xc8); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xa4); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 57, 0x05); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x27); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0xc8); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xa4); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x05); ++ } ++ ++ if (rt2x00_has_cap_external_pa(rt2x00dev)) ++ rt2800_rfcsr_write_dccal(rt2x00dev, 05, 0x00); ++ ++ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { ++ rt2800_bbp_write(rt2x00dev, 75, 0x68); ++ rt2800_bbp_write(rt2x00dev, 76, 0x4c); ++ rt2800_bbp_write(rt2x00dev, 79, 0x1c); ++ rt2800_bbp_write(rt2x00dev, 80, 0x0c); ++ rt2800_bbp_write(rt2x00dev, 82, 0xb6); ++ } ++ ++ if (rt2x00_has_cap_external_pa(rt2x00dev)) { ++ rt2800_register_write(rt2x00dev, TX0_RF_GAIN_CORRECT, 0x36303636); ++ rt2800_register_write(rt2x00dev, TX0_RF_GAIN_ATTEN, 0x6c6c6b6c); ++ rt2800_register_write(rt2x00dev, TX1_RF_GAIN_ATTEN, 0x6c6c6b6c); ++ } ++} ++ + static void rt2800_init_rfcsr_6352(struct rt2x00_dev *rt2x00dev) + { + /* Initialize RF central register to default value */ +@@ -10612,13 +10689,8 @@ static void rt2800_init_rfcsr_6352(struc + rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00); + rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C); + +- rt2800_r_calibration(rt2x00dev); +- rt2800_rf_self_txdc_cal(rt2x00dev); +- rt2800_rxdcoc_calibration(rt2x00dev); +- rt2800_bw_filter_calibration(rt2x00dev, true); +- rt2800_bw_filter_calibration(rt2x00dev, false); +- rt2800_loft_iq_calibration(rt2x00dev); +- rt2800_rxiq_calibration(rt2x00dev); ++ /* Do calibration and init PA/LNA */ ++ rt2800_calibration_rt6352(rt2x00dev); + } + + static void rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev) +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h +@@ -1263,6 +1263,12 @@ rt2x00_has_cap_external_lna_bg(struct rt + } + + static inline bool ++rt2x00_has_cap_external_pa(struct rt2x00_dev *rt2x00dev) ++{ ++ return rt2x00_has_cap_flag(rt2x00dev, CAPABILITY_EXTERNAL_PA_TX0); ++} ++ ++static inline bool + rt2x00_has_cap_double_antenna(struct rt2x00_dev *rt2x00dev) + { + return rt2x00_has_cap_flag(rt2x00dev, CAPABILITY_DOUBLE_ANTENNA); diff --git a/package/kernel/mac80211/patches/rt2x00/005-1-v6.8-wifi-rt2x00-introduce-DMA-busy-check-watchdog-for-rt.patch b/package/kernel/mac80211/patches/rt2x00/005-1-v6.8-wifi-rt2x00-introduce-DMA-busy-check-watchdog-for-rt.patch new file mode 100644 index 00000000000000..c1c322573305b8 --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/005-1-v6.8-wifi-rt2x00-introduce-DMA-busy-check-watchdog-for-rt.patch @@ -0,0 +1,177 @@ +From b1275cdd7456ef811747dfb4f3c46310ddd300cd Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Sat, 4 Nov 2023 16:57:58 +0800 +Subject: wifi: rt2x00: introduce DMA busy check watchdog for rt2800 + +When I tried to fix the watchdog of rt2800, I found that sometimes +the watchdog can not reset the hung device. This is because the +queue is not completely stuck, it just becomes very slow. The MTK +vendor driver for the new chip MT7603/MT7612 has a DMA busy watchdog +to detect device hangs by checking DMA busy status. This watchdog +implementation is something similar to it. To reduce unnecessary +reset, we can check the INT_SOURCE_CSR register together as I found +that when the radio hung, the RX/TX coherent interrupt will always +stuck at triggered state. + +The 'watchdog' module parameter has been extended to control all +watchdogs(0=disabled, 1=hang watchdog, 2=DMA watchdog, 3=both). This +new watchdog function is a slight schedule and it won't affect the +transmission speed. So we can turn on it by default. Due to the +INT_SOURCE_CSR register is invalid on rt2800 USB NICs, the DMA busy +watchdog will be automatically disabled for them. + +Tested on MT7620 and RT5350. + +Signed-off-by: Shiji Yang +Acked-by: Stanislaw Gruszka +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/TYAP286MB0315D7462CE08A119A99DE34BCA4A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM +--- + drivers/net/wireless/ralink/rt2x00/rt2800.h | 4 ++ + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 77 ++++++++++++++++++++++---- + drivers/net/wireless/ralink/rt2x00/rt2x00.h | 3 + + 3 files changed, 73 insertions(+), 11 deletions(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h +@@ -3194,4 +3194,8 @@ enum rt2800_eeprom_word { + */ + #define BCN_TBTT_OFFSET 64 + ++/* Watchdog type mask */ ++#define RT2800_WATCHDOG_HANG BIT(0) ++#define RT2800_WATCHDOG_DMA_BUSY BIT(1) ++ + #endif /* RT2800_H */ +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -30,9 +30,10 @@ + #include "rt2800lib.h" + #include "rt2800.h" + +-static bool modparam_watchdog; +-module_param_named(watchdog, modparam_watchdog, bool, S_IRUGO); +-MODULE_PARM_DESC(watchdog, "Enable watchdog to detect tx/rx hangs and reset hardware if detected"); ++static unsigned int modparam_watchdog = RT2800_WATCHDOG_DMA_BUSY; ++module_param_named(watchdog, modparam_watchdog, uint, 0444); ++MODULE_PARM_DESC(watchdog, "Enable watchdog to recover tx/rx hangs.\n" ++ "\t\t(0=disabled, 1=hang watchdog, 2=DMA watchdog(default), 3=both)"); + + /* + * Register access. +@@ -1261,15 +1262,12 @@ static void rt2800_update_survey(struct + chan_survey->time_ext_busy += rt2800_register_read(rt2x00dev, CH_BUSY_STA_SEC); + } + +-void rt2800_watchdog(struct rt2x00_dev *rt2x00dev) ++static bool rt2800_watchdog_hung(struct rt2x00_dev *rt2x00dev) + { + struct data_queue *queue; + bool hung_tx = false; + bool hung_rx = false; + +- if (test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags)) +- return; +- + rt2800_update_survey(rt2x00dev); + + queue_for_each(rt2x00dev, queue) { +@@ -1297,18 +1295,72 @@ void rt2800_watchdog(struct rt2x00_dev * + } + } + ++ if (!hung_tx && !hung_rx) ++ return false; ++ + if (hung_tx) + rt2x00_warn(rt2x00dev, "Watchdog TX hung detected\n"); + + if (hung_rx) + rt2x00_warn(rt2x00dev, "Watchdog RX hung detected\n"); + +- if (hung_tx || hung_rx) { +- queue_for_each(rt2x00dev, queue) +- queue->wd_count = 0; ++ queue_for_each(rt2x00dev, queue) ++ queue->wd_count = 0; ++ ++ return true; ++} ++ ++static bool rt2800_watchdog_dma_busy(struct rt2x00_dev *rt2x00dev) ++{ ++ bool busy_rx, busy_tx; ++ u32 reg_cfg = rt2800_register_read(rt2x00dev, WPDMA_GLO_CFG); ++ u32 reg_int = rt2800_register_read(rt2x00dev, INT_SOURCE_CSR); ++ ++ if (rt2x00_get_field32(reg_cfg, WPDMA_GLO_CFG_RX_DMA_BUSY) && ++ rt2x00_get_field32(reg_int, INT_SOURCE_CSR_RX_COHERENT)) ++ rt2x00dev->rxdma_busy++; ++ else ++ rt2x00dev->rxdma_busy = 0; + ++ if (rt2x00_get_field32(reg_cfg, WPDMA_GLO_CFG_TX_DMA_BUSY) && ++ rt2x00_get_field32(reg_int, INT_SOURCE_CSR_TX_COHERENT)) ++ rt2x00dev->txdma_busy++; ++ else ++ rt2x00dev->txdma_busy = 0; ++ ++ busy_rx = rt2x00dev->rxdma_busy > 30 ? true : false; ++ busy_tx = rt2x00dev->txdma_busy > 30 ? true : false; ++ ++ if (!busy_rx && !busy_tx) ++ return false; ++ ++ if (busy_rx) ++ rt2x00_warn(rt2x00dev, "Watchdog RX DMA busy detected\n"); ++ ++ if (busy_tx) ++ rt2x00_warn(rt2x00dev, "Watchdog TX DMA busy detected\n"); ++ ++ rt2x00dev->rxdma_busy = 0; ++ rt2x00dev->txdma_busy = 0; ++ ++ return true; ++} ++ ++void rt2800_watchdog(struct rt2x00_dev *rt2x00dev) ++{ ++ bool reset = false; ++ ++ if (test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags)) ++ return; ++ ++ if (modparam_watchdog & RT2800_WATCHDOG_DMA_BUSY) ++ reset = rt2800_watchdog_dma_busy(rt2x00dev); ++ ++ if (modparam_watchdog & RT2800_WATCHDOG_HANG) ++ reset = rt2800_watchdog_hung(rt2x00dev) || reset; ++ ++ if (reset) + ieee80211_restart_hw(rt2x00dev->hw); +- } + } + EXPORT_SYMBOL_GPL(rt2800_watchdog); + +@@ -12016,6 +12068,9 @@ int rt2800_probe_hw(struct rt2x00_dev *r + __set_bit(REQUIRE_TASKLET_CONTEXT, &rt2x00dev->cap_flags); + } + ++ /* USB NICs don't support DMA watchdog as INT_SOURCE_CSR is invalid */ ++ if (rt2x00_is_usb(rt2x00dev)) ++ modparam_watchdog &= ~RT2800_WATCHDOG_DMA_BUSY; + if (modparam_watchdog) { + __set_bit(CAPABILITY_RESTART_HW, &rt2x00dev->cap_flags); + rt2x00dev->link.watchdog_interval = msecs_to_jiffies(100); +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h +@@ -926,6 +926,9 @@ struct rt2x00_dev { + */ + u16 beacon_int; + ++ /* Rx/Tx DMA busy watchdog counter */ ++ u16 rxdma_busy, txdma_busy; ++ + /** + * Timestamp of last received beacon + */ diff --git a/package/kernel/mac80211/patches/rt2x00/005-2-v6.8-wifi-rt2x00-disable-RTS-threshold-for-rt2800-by-defa.patch b/package/kernel/mac80211/patches/rt2x00/005-2-v6.8-wifi-rt2x00-disable-RTS-threshold-for-rt2800-by-defa.patch new file mode 100644 index 00000000000000..b3e95da5a60d0b --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/005-2-v6.8-wifi-rt2x00-disable-RTS-threshold-for-rt2800-by-defa.patch @@ -0,0 +1,43 @@ +From 570beb6285fd355904b22625da20809f477096c5 Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Sat, 4 Nov 2023 16:57:59 +0800 +Subject: wifi: rt2x00: disable RTS threshold for rt2800 by default + +rt2800 has a lot of registers to control the RTS enable/disable +status for different rates. And the driver control them via +rt2800_set_rts_threshold(). When RTS was disabled in user +interface, this function won't be called at all. This means that +the RTS is still 'on' for CCK and OFDM rates. So we'd better to +disable them by default because it should be like this. The RTS +for HT20 and HT40 is already default off so we don't need to +touch them. If we toggle the RTS status, these register bits +will be enable/disable again by rt2800_set_rts_threshold(). + +Signed-off-by: Shiji Yang +Acked-by: Stanislaw Gruszka +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/TYAP286MB03155DDB953155B7A2DE849ABCA4A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -6100,7 +6100,7 @@ static int rt2800_init_registers(struct + rt2x00_set_field32(®, CCK_PROT_CFG_TX_OP_ALLOW_MM40, 0); + rt2x00_set_field32(®, CCK_PROT_CFG_TX_OP_ALLOW_GF20, 1); + rt2x00_set_field32(®, CCK_PROT_CFG_TX_OP_ALLOW_GF40, 0); +- rt2x00_set_field32(®, CCK_PROT_CFG_RTS_TH_EN, 1); ++ rt2x00_set_field32(®, CCK_PROT_CFG_RTS_TH_EN, 0); + rt2800_register_write(rt2x00dev, CCK_PROT_CFG, reg); + + reg = rt2800_register_read(rt2x00dev, OFDM_PROT_CFG); +@@ -6113,7 +6113,7 @@ static int rt2800_init_registers(struct + rt2x00_set_field32(®, OFDM_PROT_CFG_TX_OP_ALLOW_MM40, 0); + rt2x00_set_field32(®, OFDM_PROT_CFG_TX_OP_ALLOW_GF20, 1); + rt2x00_set_field32(®, OFDM_PROT_CFG_TX_OP_ALLOW_GF40, 0); +- rt2x00_set_field32(®, OFDM_PROT_CFG_RTS_TH_EN, 1); ++ rt2x00_set_field32(®, OFDM_PROT_CFG_RTS_TH_EN, 0); + rt2800_register_write(rt2x00dev, OFDM_PROT_CFG, reg); + + reg = rt2800_register_read(rt2x00dev, MM20_PROT_CFG); diff --git a/package/kernel/mac80211/patches/rt2x00/005-3-v6.8-wifi-rt2x00-restart-beacon-queue-when-hardware-reset.patch b/package/kernel/mac80211/patches/rt2x00/005-3-v6.8-wifi-rt2x00-restart-beacon-queue-when-hardware-reset.patch new file mode 100644 index 00000000000000..1fa7b8b0fb99cc --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/005-3-v6.8-wifi-rt2x00-restart-beacon-queue-when-hardware-reset.patch @@ -0,0 +1,67 @@ +From a11d965a218f0cd95b13fe44d0bcd8a20ce134a8 Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Sat, 4 Nov 2023 16:58:00 +0800 +Subject: wifi: rt2x00: restart beacon queue when hardware reset + +When a hardware reset is triggered, all registers are reset, so all +queues are forced to stop in hardware interface. However, mac80211 +will not automatically stop the queue. If we don't manually stop the +beacon queue, the queue will be deadlocked and unable to start again. +This patch fixes the issue where Apple devices cannot connect to the +AP after calling ieee80211_restart_hw(). + +Signed-off-by: Shiji Yang +Acked-by: Stanislaw Gruszka +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/TYAP286MB031530EB6D98DCE4DF20766CBCA4A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM +--- + drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 3 +++ + drivers/net/wireless/ralink/rt2x00/rt2x00mac.c | 11 +++++++++++ + 2 files changed, 14 insertions(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +@@ -101,6 +101,7 @@ void rt2x00lib_disable_radio(struct rt2x + rt2x00link_stop_tuner(rt2x00dev); + rt2x00queue_stop_queues(rt2x00dev); + rt2x00queue_flush_queues(rt2x00dev, true); ++ rt2x00queue_stop_queue(rt2x00dev->bcn); + + /* + * Disable radio. +@@ -1286,6 +1287,7 @@ int rt2x00lib_start(struct rt2x00_dev *r + rt2x00dev->intf_ap_count = 0; + rt2x00dev->intf_sta_count = 0; + rt2x00dev->intf_associated = 0; ++ rt2x00dev->intf_beaconing = 0; + + /* Enable the radio */ + retval = rt2x00lib_enable_radio(rt2x00dev); +@@ -1312,6 +1314,7 @@ void rt2x00lib_stop(struct rt2x00_dev *r + rt2x00dev->intf_ap_count = 0; + rt2x00dev->intf_sta_count = 0; + rt2x00dev->intf_associated = 0; ++ rt2x00dev->intf_beaconing = 0; + } + + static inline void rt2x00lib_set_if_combinations(struct rt2x00_dev *rt2x00dev) +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c +@@ -598,6 +598,17 @@ void rt2x00mac_bss_info_changed(struct i + */ + if (changes & BSS_CHANGED_BEACON_ENABLED) { + mutex_lock(&intf->beacon_skb_mutex); ++ ++ /* ++ * Clear the 'enable_beacon' flag and clear beacon because ++ * the beacon queue has been stopped after hardware reset. ++ */ ++ if (test_bit(DEVICE_STATE_RESET, &rt2x00dev->flags) && ++ intf->enable_beacon) { ++ intf->enable_beacon = false; ++ rt2x00queue_clear_beacon(rt2x00dev, vif); ++ } ++ + if (!bss_conf->enable_beacon && intf->enable_beacon) { + rt2x00dev->intf_beaconing--; + intf->enable_beacon = false; diff --git a/package/kernel/mac80211/patches/rt2x00/101-wifi-rt2x00-correct-wrong-BBP-register-in-RxDCOC-cal.patch b/package/kernel/mac80211/patches/rt2x00/101-wifi-rt2x00-correct-wrong-BBP-register-in-RxDCOC-cal.patch new file mode 100644 index 00000000000000..253d1d9c1964c6 --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/101-wifi-rt2x00-correct-wrong-BBP-register-in-RxDCOC-cal.patch @@ -0,0 +1,26 @@ +From: Shiji Yang +Date: Thu, 9 Nov 2023 12:01:18 +0800 +Subject: [PATCH] wifi: rt2x00: correct wrong BBP register in RxDCOC + calibration + +Refer to Mediatek vendor driver RxDCOC_Calibration() function, when +performing gainfreeze calibration, we should write register 140 +instead of 141. This fix can reduce the total calibration time from +6 seconds to 1 second. + +Signed-off-by: Shiji Yang +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -8711,7 +8711,7 @@ static void rt2800_rxdcoc_calibration(st + rt2800_rfcsr_write_bank(rt2x00dev, 5, 4, saverfb5r4); + rt2800_rfcsr_write_bank(rt2x00dev, 7, 4, saverfb7r4); + +- rt2800_bbp_write(rt2x00dev, 158, 141); ++ rt2800_bbp_write(rt2x00dev, 158, 140); + bbpreg = rt2800_bbp_read(rt2x00dev, 159); + bbpreg = bbpreg & (~0x40); + rt2800_bbp_write(rt2x00dev, 159, bbpreg); diff --git a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch b/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch similarity index 54% rename from package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch rename to package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch index 6ef356516fb03f..5040b5af621ea1 100644 --- a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch +++ b/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch @@ -1,3 +1,24 @@ +From 1046fc9e98936991aeb0b0656c84833d96a63c0f Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Sun, 15 Oct 2023 14:22:49 +0200 +Subject: [PATCH 1/5] wifi: rt2x00: Add support for loading EEPROM from + userspace + +Add support for loading EEPROM from userspace. + +Signed-off-by: Christian Marangi +--- + drivers/net/wireless/ralink/rt2x00/Kconfig | 5 ++ + drivers/net/wireless/ralink/rt2x00/Makefile | 1 + + .../net/wireless/ralink/rt2x00/rt2800soc.c | 15 +--- + drivers/net/wireless/ralink/rt2x00/rt2x00.h | 1 + + .../net/wireless/ralink/rt2x00/rt2x00dev.c | 9 +++ + .../net/wireless/ralink/rt2x00/rt2x00eeprom.c | 75 +++++++++++++++++++ + .../net/wireless/ralink/rt2x00/rt2x00soc.c | 1 + + .../net/wireless/ralink/rt2x00/rt2x00soc.h | 9 +++ + 8 files changed, 102 insertions(+), 14 deletions(-) + create mode 100644 drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c + --- a/local-symbols +++ b/local-symbols @@ -350,6 +350,7 @@ RT2X00_LIB_FIRMWARE= @@ -46,33 +67,6 @@ obj-$(CPTCFG_RT2X00_LIB) += rt2x00lib.o obj-$(CPTCFG_RT2X00_LIB_MMIO) += rt2x00mmio.o ---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h -+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h -@@ -47,6 +47,8 @@ struct rt2800_drv_data { - struct ieee80211_sta *wcid_to_sta[STA_IDS_SIZE]; - }; - -+#include "rt2800.h" -+ - struct rt2800_ops { - u32 (*register_read)(struct rt2x00_dev *rt2x00dev, - const unsigned int offset); -@@ -145,6 +147,15 @@ static inline int rt2800_read_eeprom(str - { - const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv; - -+ if (rt2x00dev->eeprom_file) { -+ memcpy(rt2x00dev->eeprom, rt2x00dev->eeprom_file->data, -+ EEPROM_SIZE); -+ return 0; -+ } -+ -+ if (!rt2800ops->read_eeprom) -+ return -EINVAL; -+ - return rt2800ops->read_eeprom(rt2x00dev); - } - --- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c @@ -90,19 +90,6 @@ static int rt2800soc_set_device_state(st @@ -95,11 +89,12 @@ /* Firmware functions */ static char *rt2800soc_get_firmware_name(struct rt2x00_dev *rt2x00dev) { -@@ -168,7 +155,6 @@ static const struct rt2800_ops rt2800soc +@@ -168,7 +155,7 @@ static const struct rt2800_ops rt2800soc .register_multiread = rt2x00mmio_register_multiread, .register_multiwrite = rt2x00mmio_register_multiwrite, .regbusy_read = rt2x00mmio_regbusy_read, - .read_eeprom = rt2800soc_read_eeprom, ++ .read_eeprom = rt2x00lib_read_eeprom, .hwcrypt_disabled = rt2800soc_hwcrypt_disabled, .drv_write_firmware = rt2800soc_write_firmware, .drv_init_registers = rt2800mmio_init_registers, @@ -113,77 +108,24 @@ /* * Capabilities -@@ -980,6 +981,11 @@ struct rt2x00_dev { - const struct firmware *fw; - - /* -+ * EEPROM image. -+ */ -+ const struct firmware *eeprom_file; -+ -+ /* - * FIFO for storing tx status reports between isr and tasklet. - */ - DECLARE_KFIFO_PTR(txstatus_fifo, u32); ---- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c -@@ -1420,6 +1420,10 @@ int rt2x00lib_probe_dev(struct rt2x00_de - INIT_DELAYED_WORK(&rt2x00dev->autowakeup_work, rt2x00lib_autowakeup); - INIT_WORK(&rt2x00dev->sleep_work, rt2x00lib_sleep); - -+ retval = rt2x00lib_load_eeprom_file(rt2x00dev); -+ if (retval) -+ goto exit; -+ - /* - * Let the driver probe the device to detect the capabilities. - */ -@@ -1560,6 +1564,11 @@ void rt2x00lib_remove_dev(struct rt2x00_ - * Free the driver data. - */ - kfree(rt2x00dev->drv_data); -+ -+ /* -+ * Free EEPROM image. -+ */ -+ rt2x00lib_free_eeprom_file(rt2x00dev); - } - EXPORT_SYMBOL_GPL(rt2x00lib_remove_dev); - --- /dev/null +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c -@@ -0,0 +1,106 @@ -+/* -+ Copyright (C) 2004 - 2009 Ivo van Doorn -+ Copyright (C) 2004 - 2009 Gertjan van Wingerde -+ -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the -+ Free Software Foundation, Inc., -+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +@@ -0,0 +1,77 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++/* Copyright (C) 2004 - 2009 Ivo van Doorn ++ * Copyright (C) 2004 - 2009 Gertjan van Wingerde ++ * + */ + -+/* -+ Module: rt2x00lib -+ Abstract: rt2x00 eeprom file loading routines. ++/* Module: rt2x00lib ++ * Abstract: rt2x00 eeprom file loading routines. + */ + +#include +#include + +#include "rt2x00.h" -+#include "rt2x00lib.h" ++#include "rt2x00soc.h" + +static const char * +rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev) @@ -196,7 +138,7 @@ + return NULL; +} + -+static int rt2x00lib_request_eeprom_file(struct rt2x00_dev *rt2x00dev) ++static int rt2x00lib_read_eeprom_file(struct rt2x00_dev *rt2x00dev) +{ + const struct firmware *ee; + const char *ee_name; @@ -233,8 +175,7 @@ + goto err_release_ee; + } + -+ rt2x00dev->eeprom_file = ee; -+ return 0; ++ memcpy(rt2x00dev->eeprom, ee->data, rt2x00dev->ops->eeprom_size); + +err_release_ee: + release_firmware(ee); @@ -242,48 +183,11 @@ + return retval; +} + -+int rt2x00lib_load_eeprom_file(struct rt2x00_dev *rt2x00dev) -+{ -+ int retval; -+ -+ retval = rt2x00lib_request_eeprom_file(rt2x00dev); -+ if (retval) -+ return retval; -+ -+ return 0; -+} -+ -+void rt2x00lib_free_eeprom_file(struct rt2x00_dev *rt2x00dev) -+{ -+ if (rt2x00dev->eeprom_file && rt2x00dev->eeprom_file->size) -+ release_firmware(rt2x00dev->eeprom_file); -+ rt2x00dev->eeprom_file = NULL; -+} ---- a/drivers/net/wireless/ralink/rt2x00/rt2x00lib.h -+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00lib.h -@@ -286,6 +286,22 @@ static inline void rt2x00lib_free_firmwa - #endif /* CPTCFG_RT2X00_LIB_FIRMWARE */ - - /* -+ * EEPROM file handlers. -+ */ -+#ifdef CPTCFG_RT2X00_LIB_EEPROM -+int rt2x00lib_load_eeprom_file(struct rt2x00_dev *rt2x00dev); -+void rt2x00lib_free_eeprom_file(struct rt2x00_dev *rt2x00dev); -+#else -+static inline int rt2x00lib_load_eeprom_file(struct rt2x00_dev *rt2x00dev) ++int rt2x00lib_read_eeprom(struct rt2x00_dev *rt2x00dev) +{ -+ return 0; ++ return rt2x00lib_read_eeprom_file(rt2x00dev); +} -+static inline void rt2x00lib_free_eeprom_file(struct rt2x00_dev *rt2x00dev) -+{ -+} -+#endif /* CPTCFG_RT2X00_LIB_EEPROM */ -+ -+/* - * Debugfs handlers. - */ - #ifdef CPTCFG_RT2X00_LIB_DEBUGFS ++EXPORT_SYMBOL_GPL(rt2x00lib_read_eeprom); --- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c @@ -86,6 +86,7 @@ int rt2x00soc_probe(struct platform_devi @@ -294,3 +198,19 @@ rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_SOC); retval = rt2x00soc_alloc_reg(rt2x00dev); +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.h ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.h +@@ -26,4 +26,13 @@ int rt2x00soc_resume(struct platform_dev + #define rt2x00soc_resume NULL + #endif /* CONFIG_PM */ + ++/* ++ * EEPROM file handlers. ++ */ ++#ifdef CPTCFG_RT2X00_LIB_EEPROM ++int rt2x00lib_read_eeprom(struct rt2x00_dev *rt2x00dev); ++#else ++#define rt2x00lib_read_eeprom NULL ++#endif /* CPTCFG_RT2X00_LIB_EEPROM */ ++ + #endif /* RT2X00SOC_H */ diff --git a/package/kernel/mac80211/patches/rt2x00/602-02-wifi-rt2x00-Add-option-to-pass-EEPROM-file-name-from.patch b/package/kernel/mac80211/patches/rt2x00/602-02-wifi-rt2x00-Add-option-to-pass-EEPROM-file-name-from.patch new file mode 100644 index 00000000000000..90055b911f0fff --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/602-02-wifi-rt2x00-Add-option-to-pass-EEPROM-file-name-from.patch @@ -0,0 +1,43 @@ +From 15329d8b206d9c04ffad49aecd37f5d0bfb85768 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Sun, 15 Oct 2023 14:23:19 +0200 +Subject: [PATCH 2/5] wifi: rt2x00: Add option to pass EEPROM file name from DT + +Add option to pass EEPROM file name from DT using ralink,eeprom binding. + +Signed-off-by: Christian Marangi +--- + drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c +@@ -10,6 +10,7 @@ + + #include + #include ++#include + + #include "rt2x00.h" + #include "rt2x00soc.h" +@@ -18,10 +19,20 @@ static const char * + rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev) + { + struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data; ++#ifdef CONFIG_OF ++ struct device_node *np; ++ const char *eep; ++#endif + + if (pdata && pdata->eeprom_file_name) + return pdata->eeprom_file_name; + ++#ifdef CONFIG_OF ++ np = rt2x00dev->dev->of_node; ++ if (np && !of_property_read_string(np, "ralink,eeprom", &eep)) ++ return eep; ++#endif ++ + return NULL; + } + diff --git a/package/kernel/mac80211/patches/rt2x00/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch b/package/kernel/mac80211/patches/rt2x00/602-03-wifi-rt2x00-Add-support-for-loading-EEPROM-from-MTD.patch similarity index 63% rename from package/kernel/mac80211/patches/rt2x00/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch rename to package/kernel/mac80211/patches/rt2x00/602-03-wifi-rt2x00-Add-support-for-loading-EEPROM-from-MTD.patch index 7338eb15b20e91..fab4bf39c05a98 100644 --- a/package/kernel/mac80211/patches/rt2x00/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch +++ b/package/kernel/mac80211/patches/rt2x00/602-03-wifi-rt2x00-Add-support-for-loading-EEPROM-from-MTD.patch @@ -1,14 +1,16 @@ -From 339fe73f340161a624cc08e738d2244814852c3e Mon Sep 17 00:00:00 2001 +From 71261ca81b491a4c3b08690347c12e96a75ad0d0 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sun, 17 Mar 2013 00:55:04 +0100 -Subject: [PATCH] rt2x00: load eeprom on SoC from a mtd device defines inside - OF +Subject: [PATCH 3/5] wifi: rt2x00: Add support for loading EEPROM from MTD + +Add support for loading EEPROM from MTD. Signed-off-by: John Crispin +Signed-off-by: Christian Marangi --- - drivers/net/wireless/ralink/rt2x00/Kconfig | 1 + - drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c | 65 +++++++++++++++++++++++ - 2 files changed, 66 insertions(+) + drivers/net/wireless/ralink/rt2x00/Kconfig | 1 + + .../net/wireless/ralink/rt2x00/rt2x00eeprom.c | 66 +++++++++++++++++++ + 2 files changed, 67 insertions(+) --- a/drivers/net/wireless/ralink/rt2x00/Kconfig +++ b/drivers/net/wireless/ralink/rt2x00/Kconfig @@ -22,7 +24,7 @@ Signed-off-by: John Crispin Supported chips: RT2880, RT3050, RT3052, RT3350, RT3352. --- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c -@@ -26,11 +26,76 @@ +@@ -10,11 +10,69 @@ #include #include @@ -33,21 +35,20 @@ Signed-off-by: John Crispin #include #include "rt2x00.h" - #include "rt2x00lib.h" + #include "rt2x00soc.h" +#if IS_ENABLED(CONFIG_MTD) +static int rt2800lib_read_eeprom_mtd(struct rt2x00_dev *rt2x00dev) +{ + int ret = -EINVAL; +#ifdef CONFIG_OF -+ static struct firmware mtd_fw; + struct device_node *np = rt2x00dev->dev->of_node, *mtd_np = NULL; -+ size_t retlen, len = rt2x00dev->ops->eeprom_size; -+ int i, size, offset = 0; ++ int size, offset = 0; + struct mtd_info *mtd; + const char *part; + const __be32 *list; + phandle phandle; ++ size_t retlen; + + list = of_get_property(np, "ralink,mtd-eeprom", &size); + if (!list) @@ -74,21 +75,15 @@ Signed-off-by: John Crispin + if (size > sizeof(*list)) + offset = be32_to_cpup(list); + -+ ret = mtd_read(mtd, offset, len, &retlen, (u_char *) rt2x00dev->eeprom); ++ ret = mtd_read(mtd, offset, rt2x00dev->ops->eeprom_size, ++ &retlen, (u_char *)rt2x00dev->eeprom); + put_mtd_device(mtd); + -+ if ((retlen != rt2x00dev->ops->eeprom_size) || ret) { ++ if (retlen != rt2x00dev->ops->eeprom_size || ret) { + dev_err(rt2x00dev->dev, "failed to load eeprom from device \"%s\"\n", part); + return ret; + } + -+ if (of_find_property(np, "ralink,mtd-eeprom-swap", NULL)) -+ for (i = 0; i < len/sizeof(u16); i++) -+ rt2x00dev->eeprom[i] = swab16(rt2x00dev->eeprom[i]); -+ -+ rt2x00dev->eeprom_file = &mtd_fw; -+ mtd_fw.data = (const u8 *) rt2x00dev->eeprom; -+ + dev_info(rt2x00dev->dev, "loaded eeprom from mtd device \"%s\"\n", part); +#endif + @@ -99,15 +94,18 @@ Signed-off-by: John Crispin static const char * rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev) { -@@ -58,6 +123,11 @@ static int rt2x00lib_request_eeprom_file - const char *ee_name; - int retval; +@@ -83,6 +141,14 @@ err_exit: + int rt2x00lib_read_eeprom(struct rt2x00_dev *rt2x00dev) + { ++ int ret; ++ +#if IS_ENABLED(CONFIG_MTD) -+ if (!rt2800lib_read_eeprom_mtd(rt2x00dev)) ++ ret = rt2800lib_read_eeprom_mtd(rt2x00dev); ++ if (!ret) + return 0; +#endif + - ee_name = rt2x00lib_get_eeprom_file_name(rt2x00dev); - if (!ee_name && test_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags)) { - rt2x00_err(rt2x00dev, "Required EEPROM name is missing."); + return rt2x00lib_read_eeprom_file(rt2x00dev); + } + EXPORT_SYMBOL_GPL(rt2x00lib_read_eeprom); diff --git a/package/kernel/mac80211/patches/rt2x00/602-04-wifi-rt2x00-Support-EEPROM-swap-binding.patch b/package/kernel/mac80211/patches/rt2x00/602-04-wifi-rt2x00-Support-EEPROM-swap-binding.patch new file mode 100644 index 00000000000000..392910d224b9e6 --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/602-04-wifi-rt2x00-Support-EEPROM-swap-binding.patch @@ -0,0 +1,44 @@ +From 9c9a3c27b96e057f3c3f47151d7a170d84e3bb5f Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Sun, 15 Oct 2023 15:31:47 +0200 +Subject: [PATCH 4/5] wifi: rt2x00: Support EEPROM swap binding + +Add binding "ralink,eeprom-swap" to swap bytes of EEPROM before using +it. + +Signed-off-by: Christian Marangi +--- + drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c +@@ -20,6 +20,19 @@ + #include "rt2x00soc.h" + + #if IS_ENABLED(CONFIG_MTD) ++static void rt2800lib_eeprom_swap(struct rt2x00_dev *rt2x00dev) ++{ ++ struct device_node *np = rt2x00dev->dev->of_node; ++ size_t len = rt2x00dev->ops->eeprom_size; ++ int i; ++ ++ if (!of_find_property(np, "ralink,eeprom-swap", NULL)) ++ return; ++ ++ for (i = 0; i < len / sizeof(u16); i++) ++ rt2x00dev->eeprom[i] = swab16(rt2x00dev->eeprom[i]); ++} ++ + static int rt2800lib_read_eeprom_mtd(struct rt2x00_dev *rt2x00dev) + { + int ret = -EINVAL; +@@ -66,6 +79,8 @@ static int rt2800lib_read_eeprom_mtd(str + return ret; + } + ++ rt2800lib_eeprom_swap(rt2x00dev); ++ + dev_info(rt2x00dev->dev, "loaded eeprom from mtd device \"%s\"\n", part); + #endif + diff --git a/package/kernel/mac80211/patches/rt2x00/602-05-wifi-rt2x00-support-loading-eeprom-from-NVMEM-cells.patch b/package/kernel/mac80211/patches/rt2x00/602-05-wifi-rt2x00-support-loading-eeprom-from-NVMEM-cells.patch new file mode 100644 index 00000000000000..e6633363bd380c --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/602-05-wifi-rt2x00-support-loading-eeprom-from-NVMEM-cells.patch @@ -0,0 +1,97 @@ +From 9008cdacdc41f8233f4444b86cf3a17201686e2d Mon Sep 17 00:00:00 2001 +From: Shiji Yang +Date: Tue, 18 Jul 2023 20:18:16 +0800 +Subject: [PATCH 5/5] wifi: rt2x00: support loading eeprom from NVMEM cells + +This patch allows rt2x00 to load eeprom from "eeprom" NVMEM cell. + +Example: + +/* load eeprom from NVMEM provider 'eep' */ +&wmac { + nvmem-cells = <&eep>; + nvmem-cell-names = "eeprom"; +}; + +Signed-off-by: Shiji Yang +Signed-off-by: Christian Marangi +--- + .../net/wireless/ralink/rt2x00/rt2x00eeprom.c | 41 ++++++++++++++++++- + 1 file changed, 40 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c +@@ -14,12 +14,12 @@ + #include + #include + #endif ++#include + #include + + #include "rt2x00.h" + #include "rt2x00soc.h" + +-#if IS_ENABLED(CONFIG_MTD) + static void rt2800lib_eeprom_swap(struct rt2x00_dev *rt2x00dev) + { + struct device_node *np = rt2x00dev->dev->of_node; +@@ -33,6 +33,7 @@ static void rt2800lib_eeprom_swap(struct + rt2x00dev->eeprom[i] = swab16(rt2x00dev->eeprom[i]); + } + ++#if IS_ENABLED(CONFIG_MTD) + static int rt2800lib_read_eeprom_mtd(struct rt2x00_dev *rt2x00dev) + { + int ret = -EINVAL; +@@ -88,6 +89,40 @@ static int rt2800lib_read_eeprom_mtd(str + } + #endif + ++static int rt2800lib_read_eeprom_nvmem(struct rt2x00_dev *rt2x00dev) ++{ ++ struct device_node *np = rt2x00dev->dev->of_node; ++ unsigned int len = rt2x00dev->ops->eeprom_size; ++ struct nvmem_cell *cell; ++ const void *data; ++ size_t retlen; ++ int ret = 0; ++ ++ cell = of_nvmem_cell_get(np, "eeprom"); ++ if (IS_ERR(cell)) ++ return PTR_ERR(cell); ++ ++ data = nvmem_cell_read(cell, &retlen); ++ nvmem_cell_put(cell); ++ ++ if (IS_ERR(data)) ++ return PTR_ERR(data); ++ ++ if (retlen != len) { ++ dev_err(rt2x00dev->dev, "invalid eeprom size, required: 0x%04x\n", len); ++ ret = -EINVAL; ++ goto exit; ++ } ++ ++ memcpy(rt2x00dev->eeprom, data, len); ++ ++ rt2800lib_eeprom_swap(rt2x00dev); ++ ++exit: ++ kfree(data); ++ return ret; ++} ++ + static const char * + rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev) + { +@@ -164,6 +199,10 @@ int rt2x00lib_read_eeprom(struct rt2x00_ + return 0; + #endif + ++ ret = rt2800lib_read_eeprom_nvmem(rt2x00dev); ++ if (!ret) ++ return 0; ++ + return rt2x00lib_read_eeprom_file(rt2x00dev); + } + EXPORT_SYMBOL_GPL(rt2x00lib_read_eeprom); diff --git a/package/kernel/mac80211/patches/rt2x00/603-rt2x00-of_load_eeprom_filename.patch b/package/kernel/mac80211/patches/rt2x00/603-rt2x00-of_load_eeprom_filename.patch deleted file mode 100644 index 431e090237286d..00000000000000 --- a/package/kernel/mac80211/patches/rt2x00/603-rt2x00-of_load_eeprom_filename.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c -@@ -26,6 +26,7 @@ - - #include - #include -+#include - - #include "rt2x00.h" - #include "rt2x00lib.h" -@@ -34,10 +35,20 @@ static const char * - rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev) - { - struct rt2x00_platform_data *pdata = rt2x00dev->dev->platform_data; -+#ifdef CONFIG_OF -+ struct device_node *np; -+ const char *eep; -+#endif - - if (pdata && pdata->eeprom_file_name) - return pdata->eeprom_file_name; - -+#ifdef CONFIG_OF -+ np = rt2x00dev->dev->of_node; -+ if (np && of_property_read_string(np, "ralink,eeprom", &eep) == 0) -+ return eep; -+#endif -+ - return NULL; - } - diff --git a/package/kernel/mac80211/patches/rt2x00/606-rt2x00-allow_disabling_bands_through_platform_data.patch b/package/kernel/mac80211/patches/rt2x00/606-rt2x00-allow_disabling_bands_through_platform_data.patch index ffee2189d2d3b1..ab09a68297fdaa 100644 --- a/package/kernel/mac80211/patches/rt2x00/606-rt2x00-allow_disabling_bands_through_platform_data.patch +++ b/package/kernel/mac80211/patches/rt2x00/606-rt2x00-allow_disabling_bands_through_platform_data.patch @@ -12,7 +12,7 @@ #endif /* _RT2X00_PLATFORM_H */ --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c -@@ -1007,6 +1007,22 @@ static int rt2x00lib_probe_hw_modes(stru +@@ -1008,6 +1008,22 @@ static int rt2x00lib_probe_hw_modes(stru unsigned int num_rates; unsigned int i; diff --git a/package/kernel/mac80211/patches/rt2x00/607-rt2x00-add_platform_data_mac_addr.patch b/package/kernel/mac80211/patches/rt2x00/607-rt2x00-add_platform_data_mac_addr.patch index 37553bb80a07c5..79f99ffdf4a23e 100644 --- a/package/kernel/mac80211/patches/rt2x00/607-rt2x00-add_platform_data_mac_addr.patch +++ b/package/kernel/mac80211/patches/rt2x00/607-rt2x00-add_platform_data_mac_addr.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c -@@ -989,6 +989,12 @@ static void rt2x00lib_rate(struct ieee80 +@@ -990,6 +990,12 @@ static void rt2x00lib_rate(struct ieee80 void rt2x00lib_set_mac_address(struct rt2x00_dev *rt2x00dev, u8 *eeprom_mac_addr) { diff --git a/package/kernel/mac80211/patches/rt2x00/608-rt2x00-allow_disabling_bands_through_dts.patch b/package/kernel/mac80211/patches/rt2x00/608-rt2x00-allow_disabling_bands_through_dts.patch index 6211809c0a0c40..31f2f0261fd5e3 100644 --- a/package/kernel/mac80211/patches/rt2x00/608-rt2x00-allow_disabling_bands_through_dts.patch +++ b/package/kernel/mac80211/patches/rt2x00/608-rt2x00-allow_disabling_bands_through_dts.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c -@@ -1012,6 +1012,16 @@ static int rt2x00lib_probe_hw_modes(stru +@@ -1013,6 +1013,16 @@ static int rt2x00lib_probe_hw_modes(stru struct ieee80211_rate *rates; unsigned int num_rates; unsigned int i; diff --git a/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch b/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch index 8964f8bf1057b6..c06ed07030e753 100644 --- a/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch +++ b/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c -@@ -225,10 +225,17 @@ static int rt2800soc_probe(struct platfo +@@ -226,10 +226,17 @@ static int rt2800soc_probe(struct platfo return rt2x00soc_probe(pdev, &rt2800soc_ops); } diff --git a/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch b/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch index 7b50bc275e2fb0..8ee4e6cafa6aba 100644 --- a/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch +++ b/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch @@ -8,7 +8,7 @@ #include "rt2x00.h" #include "rt2800lib.h" -@@ -11129,6 +11130,17 @@ static int rt2800_init_eeprom(struct rt2 +@@ -11285,6 +11286,17 @@ static int rt2800_init_eeprom(struct rt2 rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC); rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY); diff --git a/package/kernel/mac80211/patches/rt2x00/611-rt2x00-add-AP+STA-support.patch b/package/kernel/mac80211/patches/rt2x00/611-rt2x00-add-AP+STA-support.patch index aa2b25ba7f5da5..9564f02eddec52 100644 --- a/package/kernel/mac80211/patches/rt2x00/611-rt2x00-add-AP+STA-support.patch +++ b/package/kernel/mac80211/patches/rt2x00/611-rt2x00-add-AP+STA-support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c -@@ -1359,7 +1359,7 @@ static inline void rt2x00lib_set_if_comb +@@ -1362,7 +1362,7 @@ static inline void rt2x00lib_set_if_comb */ if_limit = &rt2x00dev->if_limits_ap; if_limit->max = rt2x00dev->ops->max_ap_intf; diff --git a/package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch index 4bb1cf424829aa..3e48eab5d20225 100644 --- a/package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch +++ b/package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch @@ -27,7 +27,7 @@ Signed-off-by: Daniel Golle --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -304,6 +304,24 @@ static void rt2800_rf_write(struct rt2x0 +@@ -305,6 +305,24 @@ static void rt2800_rf_write(struct rt2x0 mutex_unlock(&rt2x00dev->csr_mutex); } @@ -52,67 +52,27 @@ Signed-off-by: Daniel Golle static const unsigned int rt2800_eeprom_map[EEPROM_WORD_COUNT] = { [EEPROM_CHIP_ID] = 0x0000, [EEPROM_VERSION] = 0x0001, -@@ -4469,6 +4487,29 @@ static void rt2800_config_channel(struct - rt2800_register_write(rt2x00dev, TX1_RF_GAIN_ATTEN, - 0x6C6C6B6C); - } -+ -+ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { -+ reg = rt2800_register_read(rt2x00dev, RF_CONTROL3); -+ reg |= 0x00000101; -+ rt2800_register_write(rt2x00dev, RF_CONTROL3, reg); -+ -+ reg = rt2800_register_read(rt2x00dev, RF_BYPASS3); -+ reg |= 0x00000101; -+ rt2800_register_write(rt2x00dev, RF_BYPASS3, reg); -+ -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x42); -+ rt2800_bbp_write(rt2x00dev, 75, 0x68); -+ rt2800_bbp_write(rt2x00dev, 76, 0x4C); -+ rt2800_bbp_write(rt2x00dev, 79, 0x1C); -+ rt2800_bbp_write(rt2x00dev, 80, 0x0C); -+ rt2800_bbp_write(rt2x00dev, 82, 0xB6); -+ /* bank 0 RF reg 42 and glrt BBP reg 141 will be set in -+ * config channel function in dependence of channel and -+ * HT20/HT40 so don't touch it -+ */ -+ } - } +@@ -10407,8 +10425,10 @@ static void rt2800_calibration_rt6352(st + u32 reg; - bbp = rt2800_bbp_read(rt2x00dev, 4); -@@ -10581,6 +10622,7 @@ static void rt2800_init_rfcsr_6352(struc - rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00); - rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C); + if (rt2x00_has_cap_external_pa(rt2x00dev) || +- rt2x00_has_cap_external_lna_bg(rt2x00dev)) ++ rt2x00_has_cap_external_lna_bg(rt2x00dev)) { ++ rt6352_enable_pa_pin(rt2x00dev, 0); + rt2800_restore_rf_bbp_rt6352(rt2x00dev); ++ } -+ rt6352_enable_pa_pin(rt2x00dev, 0); rt2800_r_calibration(rt2x00dev); rt2800_rf_self_txdc_cal(rt2x00dev); - rt2800_rxdcoc_calibration(rt2x00dev); -@@ -10588,6 +10630,22 @@ static void rt2800_init_rfcsr_6352(struc - rt2800_bw_filter_calibration(rt2x00dev, false); - rt2800_loft_iq_calibration(rt2x00dev); - rt2800_rxiq_calibration(rt2x00dev); +@@ -10426,6 +10446,8 @@ static void rt2800_calibration_rt6352(st + !rt2x00_has_cap_external_lna_bg(rt2x00dev)) + return; + + rt6352_enable_pa_pin(rt2x00dev, 1); + -+ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x42); -+ rt2800_bbp_write(rt2x00dev, 75, 0x68); -+ rt2800_bbp_write(rt2x00dev, 76, 0x4C); -+ rt2800_bbp_write(rt2x00dev, 79, 0x1C); -+ rt2800_bbp_write(rt2x00dev, 80, 0x0C); -+ rt2800_bbp_write(rt2x00dev, 82, 0xB6); -+ /* bank 0 RF reg 42 and glrt BBP reg 141 will be set in config -+ * channel function in dependence of channel and HT20/HT40, -+ * so don't touch them here. -+ */ -+ } - } - - static void rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev) + if (rt2x00_has_cap_external_pa(rt2x00dev)) { + reg = rt2800_register_read(rt2x00dev, RF_CONTROL3); + reg |= 0x00000101; --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h @@ -28,6 +28,7 @@ @@ -123,7 +83,7 @@ Signed-off-by: Daniel Golle #include #include -@@ -1029,6 +1030,11 @@ struct rt2x00_dev { +@@ -1027,6 +1028,11 @@ struct rt2x00_dev { /* Clock for System On Chip devices. */ struct clk *clk; diff --git a/package/kernel/mac80211/patches/rt2x00/995-rt2x00-mt7620-introduce-accessors-for-CHIP_VER-register.patch b/package/kernel/mac80211/patches/rt2x00/995-rt2x00-mt7620-introduce-accessors-for-CHIP_VER-register.patch index 97a56de2b3d844..19f1edc928bce9 100644 --- a/package/kernel/mac80211/patches/rt2x00/995-rt2x00-mt7620-introduce-accessors-for-CHIP_VER-register.patch +++ b/package/kernel/mac80211/patches/rt2x00/995-rt2x00-mt7620-introduce-accessors-for-CHIP_VER-register.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h -@@ -78,6 +78,9 @@ struct rt2800_ops { +@@ -76,6 +76,9 @@ struct rt2800_ops { int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev); __le32 *(*drv_get_txwi)(struct queue_entry *entry); unsigned int (*drv_get_dma_done)(struct data_queue *queue); @@ -10,7 +10,7 @@ }; static inline u32 rt2800_register_read(struct rt2x00_dev *rt2x00dev, -@@ -195,6 +198,27 @@ static inline unsigned int rt2800_drv_ge +@@ -184,6 +187,27 @@ static inline unsigned int rt2800_drv_ge return rt2800ops->drv_get_dma_done(queue); } @@ -104,7 +104,7 @@ static const struct ieee80211_ops rt2800soc_mac80211_ops = { .tx = rt2x00mac_tx, .wake_tx_queue = ieee80211_handle_wake_tx_queue, -@@ -160,6 +187,9 @@ static const struct rt2800_ops rt2800soc +@@ -161,6 +188,9 @@ static const struct rt2800_ops rt2800soc .drv_init_registers = rt2800mmio_init_registers, .drv_get_txwi = rt2800mmio_get_txwi, .drv_get_dma_done = rt2800mmio_get_dma_done, diff --git a/package/kernel/mac80211/patches/rt2x00/996-rt2x00-mt7620-differentiate-based-on-SoC-CHIP_VER.patch b/package/kernel/mac80211/patches/rt2x00/996-rt2x00-mt7620-differentiate-based-on-SoC-CHIP_VER.patch index 4b3e549109d561..0f699f5e18b013 100644 --- a/package/kernel/mac80211/patches/rt2x00/996-rt2x00-mt7620-differentiate-based-on-SoC-CHIP_VER.patch +++ b/package/kernel/mac80211/patches/rt2x00/996-rt2x00-mt7620-differentiate-based-on-SoC-CHIP_VER.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2800.h +++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h -@@ -1044,6 +1044,11 @@ +@@ -1056,6 +1056,11 @@ #define MIMO_PS_CFG_RX_STBY_POL FIELD32(0x00000010) #define MIMO_PS_CFG_RX_RX_STBY0 FIELD32(0x00000020) @@ -14,7 +14,7 @@ */ --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -3778,14 +3778,16 @@ static void rt2800_config_channel_rf7620 +@@ -3836,14 +3836,16 @@ static void rt2800_config_channel_rf7620 rt2x00_set_field8(&rfcsr, RFCSR19_K, rf->rf4); rt2800_rfcsr_write(rt2x00dev, 19, rfcsr); @@ -39,7 +39,7 @@ rfcsr = rt2800_rfcsr_read(rt2x00dev, 1); rt2x00_set_field8(&rfcsr, RFCSR1_TX2_EN_MT7620, -@@ -3819,18 +3821,23 @@ static void rt2800_config_channel_rf7620 +@@ -3877,18 +3879,23 @@ static void rt2800_config_channel_rf7620 rt2800_rfcsr_write_dccal(rt2x00dev, 59, 0x20); } @@ -73,7 +73,7 @@ if (!test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags)) { if (conf_is_ht40(conf)) { -@@ -3929,25 +3936,29 @@ static void rt2800_config_alc(struct rt2 +@@ -4002,25 +4009,29 @@ static void rt2800_config_alc_rt6352(str if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY))) rt2x00_warn(rt2x00dev, "RF busy while configuring ALC\n"); @@ -121,7 +121,17 @@ rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, mac_sys_ctrl); rt2800_vco_calibration(rt2x00dev); -@@ -6011,18 +6022,33 @@ static int rt2800_init_registers(struct +@@ -4513,7 +4524,8 @@ static void rt2800_config_channel(struct + if (rt2x00_rt(rt2x00dev, RT6352)) { + /* BBP for GLRT BW */ + bbp = conf_is_ht40(conf) ? +- 0x10 : rt2x00_has_cap_external_lna_bg(rt2x00dev) ? ++ 0x10 : !rt2x00_has_cap_external_lna_bg(rt2x00dev) ? ++ 0x1a : rt2800_hw_get_chippkg(rt2x00dev) == 1 ? + 0x15 : 0x1a; + rt2800_bbp_glrt_write(rt2x00dev, 141, bbp); + +@@ -6017,18 +6029,33 @@ static int rt2800_init_registers(struct } else if (rt2x00_rt(rt2x00dev, RT5350)) { rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404); } else if (rt2x00_rt(rt2x00dev, RT6352)) { @@ -167,7 +177,7 @@ reg = rt2800_register_read(rt2x00dev, TX_ALC_CFG_1); rt2x00_set_field32(®, TX_ALC_CFG_1_ROS_BUSY_EN, 0); rt2800_register_write(rt2x00dev, TX_ALC_CFG_1, reg); -@@ -7127,14 +7153,16 @@ static void rt2800_init_bbp_6352(struct +@@ -7141,14 +7168,16 @@ static void rt2800_init_bbp_6352(struct rt2800_bbp_write(rt2x00dev, 188, 0x00); rt2800_bbp_write(rt2x00dev, 189, 0x00); @@ -192,7 +202,27 @@ /* BBP for G band GLRT function (BBP_128 ~ BBP_221) */ rt2800_bbp_glrt_write(rt2x00dev, 0, 0x00); -@@ -10406,31 +10434,36 @@ static void rt2800_init_rfcsr_6352(struc +@@ -10381,6 +10410,9 @@ static void rt2800_restore_rf_bbp_rt6352 + rt2800_register_write(rt2x00dev, RF_BYPASS3, 0x0); + } + ++ if (rt2800_hw_get_chippkg(rt2x00dev) != 1) ++ return; ++ + if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { + rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x16); + rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x23); +@@ -10458,6 +10490,9 @@ static void rt2800_calibration_rt6352(st + rt2800_register_write(rt2x00dev, RF_BYPASS3, reg); + } + ++ if (rt2800_hw_get_chippkg(rt2x00dev) != 1) ++ return; ++ + if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { + rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66); + rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20); +@@ -10548,31 +10583,36 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rfcsr_write(rt2x00dev, 42, 0x5B); rt2800_rfcsr_write(rt2x00dev, 43, 0x00); @@ -254,7 +284,7 @@ /* Initialize RF channel register to default value */ rt2800_rfcsr_write_chanreg(rt2x00dev, 0, 0x03); -@@ -10496,63 +10529,71 @@ static void rt2800_init_rfcsr_6352(struc +@@ -10638,63 +10678,71 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rfcsr_write_bank(rt2x00dev, 6, 45, 0xC5); @@ -288,33 +318,6 @@ - rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0x6B); - rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xF7); - rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x09); -- -- rt2800_rfcsr_write_chanreg(rt2x00dev, 10, 0x51); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x06); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 19, 0xA7); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 28, 0x2C); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x64); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 8, 0x51); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 9, 0x36); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 11, 0x53); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x16); -- -- rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x6C); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xFC); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x1F); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x27); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x66); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0x6B); -- -- /* Initialize RF channel register for DRQFN */ -- rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0xD3); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0xE3); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0xE5); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x28); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x68); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xF7); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x02); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xC7); + if (rt2800_hw_get_chipver(rt2x00dev) > 1) { + rt2800_rfcsr_write_chanreg(rt2x00dev, 9, 0x47); + rt2800_rfcsr_write_chanreg(rt2x00dev, 10, 0x71); @@ -347,7 +350,16 @@ + rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xF7); + rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x09); + } -+ + +- rt2800_rfcsr_write_chanreg(rt2x00dev, 10, 0x51); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x06); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 19, 0xA7); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 28, 0x2C); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x64); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 8, 0x51); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 9, 0x36); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 11, 0x53); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x16); + if (rt2800_hw_get_chipver(rt2x00dev) > 1 && + rt2800_hw_get_chipeco(rt2x00dev) >= 2) { + rt2800_rfcsr_write_chanreg(rt2x00dev, 10, 0x51); @@ -367,7 +379,23 @@ + rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x66); + rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0x6B); + } -+ + +- rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x6C); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xFC); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x1F); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x27); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x66); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0x6B); +- +- /* Initialize RF channel register for DRQFN */ +- rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0xD3); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0xE3); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0xE5); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x28); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x68); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xF7); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x02); +- rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xC7); + if (rt2800_hw_get_chippkg(rt2x00dev) == 0 && + rt2800_hw_get_chipver(rt2x00dev) == 1) { + /* Initialize RF channel register for DRQFN */ @@ -383,7 +411,7 @@ /* Initialize RF DC calibration register to default value */ rt2800_rfcsr_write_dccal(rt2x00dev, 0, 0x47); -@@ -10615,12 +10656,17 @@ static void rt2800_init_rfcsr_6352(struc +@@ -10757,12 +10805,17 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rfcsr_write_dccal(rt2x00dev, 62, 0x00); rt2800_rfcsr_write_dccal(rt2x00dev, 63, 0x00); @@ -404,5 +432,5 @@ + rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C); + } - rt6352_enable_pa_pin(rt2x00dev, 0); - rt2800_r_calibration(rt2x00dev); + /* Do calibration and init PA/LNA */ + rt2800_calibration_rt6352(rt2x00dev); diff --git a/package/kernel/mac80211/patches/rt2x00/998-wifi-rt2x00-rework-MT7620-PA-LNA-RF-calibration.patch b/package/kernel/mac80211/patches/rt2x00/998-wifi-rt2x00-rework-MT7620-PA-LNA-RF-calibration.patch deleted file mode 100644 index ca1da8a8d28b16..00000000000000 --- a/package/kernel/mac80211/patches/rt2x00/998-wifi-rt2x00-rework-MT7620-PA-LNA-RF-calibration.patch +++ /dev/null @@ -1,413 +0,0 @@ -From: Shiji Yang -Date: Tue, 25 Jul 2023 20:05:06 +0800 -Subject: [PATCH] wifi: rt2x00: rework MT7620 PA/LNA RF calibration - -1. Move MT7620 PA/LNA calibration code to dedicated functions. -2. For external PA/LNA devices, restore RF and BBP registers before - R-Calibration. -3. Do Rx DCOC calibration again before RXIQ calibration. -4. Correct MAC_SYS_CTRL register RX mask to 0x08 in R-Calibration - function. For MAC_SYS_CTRL register, Bit[2] controls MAC_TX_EN - and Bit[3] controls MAC_RX_EN (Bit index starts from 0). -5. Move the channel configuration code from rt2800_vco_calibration() - to the rt2800_config_channel(). -6. Use MT7620 SOC specific AGC initial LNA value instead of the - RT5592's value. -7. Adjust the register operation sequence according to the vendor - driver code. This may not be useful, but it can make things - clearer when developers try to review it. - -Signed-off-by: Shiji Yang ---- - .../net/wireless/ralink/rt2x00/rt2800lib.c | 306 ++++++++++-------- - drivers/net/wireless/ralink/rt2x00/rt2x00.h | 6 + - 2 files changed, 182 insertions(+), 130 deletions(-) - ---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -3881,14 +3881,6 @@ static void rt2800_config_channel_rf7620 - rfcsr |= tx_agc_fc; - rt2800_rfcsr_write_bank(rt2x00dev, 7, 59, rfcsr); - } -- -- if (conf_is_ht40(conf)) { -- rt2800_bbp_glrt_write(rt2x00dev, 141, 0x10); -- rt2800_bbp_glrt_write(rt2x00dev, 157, 0x2f); -- } else { -- rt2800_bbp_glrt_write(rt2x00dev, 141, 0x1a); -- rt2800_bbp_glrt_write(rt2x00dev, 157, 0x40); -- } - } - - static void rt2800_config_alc_rt6352(struct rt2x00_dev *rt2x00dev, -@@ -4457,89 +4449,63 @@ static void rt2800_config_channel(struct - usleep_range(1000, 1500); - } - -- if (rt2x00_rt(rt2x00dev, RT5592) || rt2x00_rt(rt2x00dev, RT6352)) { -+ if (rt2x00_rt(rt2x00dev, RT5592)) { - reg = 0x10; -- if (!conf_is_ht40(conf)) { -- if (rt2x00_rt(rt2x00dev, RT6352) && -- rt2x00_has_cap_external_lna_bg(rt2x00dev)) { -- reg |= 0x5; -- } else { -- reg |= 0xa; -- } -- } -+ if (!conf_is_ht40(conf)) -+ reg |= 0xa; - rt2800_bbp_write(rt2x00dev, 195, 141); - rt2800_bbp_write(rt2x00dev, 196, reg); - -- /* AGC init. -- * Despite the vendor driver using different values here for -- * RT6352 chip, we use 0x1c for now. This may have to be changed -- * once TSSI got implemented. -- */ - reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2*rt2x00dev->lna_gain; - rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg); -- -- if (rt2x00_rt(rt2x00dev, RT5592)) -- rt2800_iq_calibrate(rt2x00dev, rf->channel); -+ -+ rt2800_iq_calibrate(rt2x00dev, rf->channel); - } - - if (rt2x00_rt(rt2x00dev, RT6352)) { -- if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, -- &rt2x00dev->cap_flags)) { -- reg = rt2800_register_read(rt2x00dev, RF_CONTROL3); -- reg |= 0x00000101; -- rt2800_register_write(rt2x00dev, RF_CONTROL3, reg); -- -- reg = rt2800_register_read(rt2x00dev, RF_BYPASS3); -- reg |= 0x00000101; -- rt2800_register_write(rt2x00dev, RF_BYPASS3, reg); -- -- rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0x73); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0x73); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0x73); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 46, 0x27); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0xC8); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xA4); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x05); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x27); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0xC8); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xA4); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 57, 0x05); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x27); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0xC8); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xA4); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x05); -- rt2800_rfcsr_write_dccal(rt2x00dev, 05, 0x00); -+ /* BBP for GLRT BW */ -+ if (conf_is_ht40(conf)) { -+ rt2800_bbp_glrt_write(rt2x00dev, 141, 0x10); -+ rt2800_bbp_glrt_write(rt2x00dev, 157, 0x2f); -+ } else { -+ rt2800_bbp_glrt_write(rt2x00dev, 141, 0x1a); -+ rt2800_bbp_glrt_write(rt2x00dev, 157, 0x40); - -- rt2800_register_write(rt2x00dev, TX0_RF_GAIN_CORRECT, -- 0x36303636); -- rt2800_register_write(rt2x00dev, TX0_RF_GAIN_ATTEN, -- 0x6C6C6B6C); -- rt2800_register_write(rt2x00dev, TX1_RF_GAIN_ATTEN, -- 0x6C6C6B6C); -+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 && -+ rt2x00_has_cap_external_lna_bg(rt2x00dev)) -+ rt2800_bbp_glrt_write(rt2x00dev, 141, 0x15); - } - -- if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { -- reg = rt2800_register_read(rt2x00dev, RF_CONTROL3); -- reg |= 0x00000101; -- rt2800_register_write(rt2x00dev, RF_CONTROL3, reg); -- -- reg = rt2800_register_read(rt2x00dev, RF_BYPASS3); -- reg |= 0x00000101; -- rt2800_register_write(rt2x00dev, RF_BYPASS3, reg); -- -- rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20); -- rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x42); -- rt2800_bbp_write(rt2x00dev, 75, 0x68); -- rt2800_bbp_write(rt2x00dev, 76, 0x4C); -- rt2800_bbp_write(rt2x00dev, 79, 0x1C); -- rt2800_bbp_write(rt2x00dev, 80, 0x0C); -- rt2800_bbp_write(rt2x00dev, 82, 0xB6); -- /* bank 0 RF reg 42 and glrt BBP reg 141 will be set in -- * config channel function in dependence of channel and -- * HT20/HT40 so don't touch it -- */ -+ if (rt2x00dev->default_ant.rx_chain_num == 1) { -+ rt2800_bbp_write(rt2x00dev, 91, 0x07); -+ rt2800_bbp_write(rt2x00dev, 95, 0x1A); -+ rt2800_bbp_write(rt2x00dev, 195, 128); -+ rt2800_bbp_write(rt2x00dev, 196, 0xA0); -+ rt2800_bbp_write(rt2x00dev, 195, 170); -+ rt2800_bbp_write(rt2x00dev, 196, 0x12); -+ rt2800_bbp_write(rt2x00dev, 195, 171); -+ rt2800_bbp_write(rt2x00dev, 196, 0x10); -+ } else { -+ rt2800_bbp_write(rt2x00dev, 91, 0x06); -+ rt2800_bbp_write(rt2x00dev, 95, 0x9A); -+ rt2800_bbp_write(rt2x00dev, 195, 128); -+ rt2800_bbp_write(rt2x00dev, 196, 0xE0); -+ rt2800_bbp_write(rt2x00dev, 195, 170); -+ rt2800_bbp_write(rt2x00dev, 196, 0x30); -+ rt2800_bbp_write(rt2x00dev, 195, 171); -+ rt2800_bbp_write(rt2x00dev, 196, 0x30); - } -+ -+ /* AGC init */ -+ reg = rf->channel <= 14 ? 0x04 + 2 * rt2x00dev->lna_gain : 0; -+ rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg); -+ -+ /* On 11A, We should delay and wait RF/BBP to be stable -+ * and the appropriate time should be 1000 micro seconds -+ * 2005/06/05 - On 11G, we also need this delay time. -+ * Otherwise it's difficult to pass the WHQL. -+ */ -+ usleep_range(1000, 1500); - } - - bbp = rt2800_bbp_read(rt2x00dev, 4); -@@ -5649,43 +5615,6 @@ void rt2800_vco_calibration(struct rt2x0 - } - } - rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin); -- -- if (rt2x00_rt(rt2x00dev, RT6352)) { -- if (rt2x00dev->default_ant.rx_chain_num == 1) { -- rt2800_bbp_write(rt2x00dev, 91, 0x07); -- rt2800_bbp_write(rt2x00dev, 95, 0x1A); -- rt2800_bbp_write(rt2x00dev, 195, 128); -- rt2800_bbp_write(rt2x00dev, 196, 0xA0); -- rt2800_bbp_write(rt2x00dev, 195, 170); -- rt2800_bbp_write(rt2x00dev, 196, 0x12); -- rt2800_bbp_write(rt2x00dev, 195, 171); -- rt2800_bbp_write(rt2x00dev, 196, 0x10); -- } else { -- rt2800_bbp_write(rt2x00dev, 91, 0x06); -- rt2800_bbp_write(rt2x00dev, 95, 0x9A); -- rt2800_bbp_write(rt2x00dev, 195, 128); -- rt2800_bbp_write(rt2x00dev, 196, 0xE0); -- rt2800_bbp_write(rt2x00dev, 195, 170); -- rt2800_bbp_write(rt2x00dev, 196, 0x30); -- rt2800_bbp_write(rt2x00dev, 195, 171); -- rt2800_bbp_write(rt2x00dev, 196, 0x30); -- } -- -- if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { -- rt2800_bbp_write(rt2x00dev, 75, 0x68); -- rt2800_bbp_write(rt2x00dev, 76, 0x4C); -- rt2800_bbp_write(rt2x00dev, 79, 0x1C); -- rt2800_bbp_write(rt2x00dev, 80, 0x0C); -- rt2800_bbp_write(rt2x00dev, 82, 0xB6); -- } -- -- /* On 11A, We should delay and wait RF/BBP to be stable -- * and the appropriate time should be 1000 micro seconds -- * 2005/06/05 - On 11G, we also need this delay time. -- * Otherwise it's difficult to pass the WHQL. -- */ -- usleep_range(1000, 1500); -- } - } - EXPORT_SYMBOL_GPL(rt2800_vco_calibration); - -@@ -8650,7 +8579,7 @@ static void rt2800_r_calibration(struct - rt2x00_warn(rt2x00dev, "Wait MAC Tx Status to MAX !!!\n"); - - maccfg = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL); -- maccfg &= (~0x04); -+ maccfg &= (~0x08); - rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, maccfg); - - if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_RX))) -@@ -10686,30 +10615,143 @@ static void rt2800_init_rfcsr_6352(struc - rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00); - rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C); - } -+} - -- rt6352_enable_pa_pin(rt2x00dev, 0); -- rt2800_r_calibration(rt2x00dev); -- rt2800_rf_self_txdc_cal(rt2x00dev); -- rt2800_rxdcoc_calibration(rt2x00dev); -- rt2800_bw_filter_calibration(rt2x00dev, true); -- rt2800_bw_filter_calibration(rt2x00dev, false); -- rt2800_loft_iq_calibration(rt2x00dev); -- rt2800_rxiq_calibration(rt2x00dev); -- rt6352_enable_pa_pin(rt2x00dev, 1); -+static void rt2800_init_palna_rt6352(struct rt2x00_dev *rt2x00dev) -+{ -+ u32 reg; -+ -+ if (rt2x00_has_cap_external_pa(rt2x00dev)) { -+ reg = rt2800_register_read(rt2x00dev, RF_CONTROL3); -+ reg |= 0x00000101; -+ rt2800_register_write(rt2x00dev, RF_CONTROL3, reg); -+ -+ reg = rt2800_register_read(rt2x00dev, RF_BYPASS3); -+ reg |= 0x00000101; -+ rt2800_register_write(rt2x00dev, RF_BYPASS3, reg); -+ } - -- if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { -+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 && -+ rt2x00_has_cap_external_lna_bg(rt2x00dev)) { - rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66); - rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20); - rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x42); -+ } -+ -+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 && -+ rt2x00_has_cap_external_pa(rt2x00dev)) { -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0x73); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0x73); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0x73); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 46, 0x27); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0xC8); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xA4); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x05); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x27); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0xC8); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xA4); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 57, 0x05); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x27); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0xC8); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xA4); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x05); -+ } -+ -+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 && -+ rt2x00_has_cap_external_pa(rt2x00dev)) -+ rt2800_rfcsr_write_dccal(rt2x00dev, 05, 0x00); -+ -+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 && -+ rt2x00_has_cap_external_lna_bg(rt2x00dev)) { - rt2800_bbp_write(rt2x00dev, 75, 0x68); - rt2800_bbp_write(rt2x00dev, 76, 0x4C); - rt2800_bbp_write(rt2x00dev, 79, 0x1C); - rt2800_bbp_write(rt2x00dev, 80, 0x0C); - rt2800_bbp_write(rt2x00dev, 82, 0xB6); -- /* bank 0 RF reg 42 and glrt BBP reg 141 will be set in config -- * channel function in dependence of channel and HT20/HT40, -- * so don't touch them here. -- */ -+ } -+ -+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 && -+ rt2x00_has_cap_external_pa(rt2x00dev)) { -+ rt2800_register_write(rt2x00dev, TX0_RF_GAIN_CORRECT, 0x36303636); -+ rt2800_register_write(rt2x00dev, TX0_RF_GAIN_ATTEN, 0x6C6C6B6C); -+ rt2800_register_write(rt2x00dev, TX1_RF_GAIN_ATTEN, 0x6C6C6B6C); -+ } -+} -+ -+static void rt2800_restore_rf_bbp_rt6352(struct rt2x00_dev *rt2x00dev) -+{ -+ if (rt2x00_has_cap_external_pa(rt2x00dev)) { -+ rt2800_register_write(rt2x00dev, RF_CONTROL3, 0x0); -+ rt2800_register_write(rt2x00dev, RF_BYPASS3, 0x0); -+ } -+ -+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 && -+ rt2x00_has_cap_external_lna_bg(rt2x00dev)) { -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x16); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x23); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x02); -+ } -+ -+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 && -+ rt2x00_has_cap_external_pa(rt2x00dev)) { -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0xD3); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0xB3); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0xD5); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 46, 0x27); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x6C); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xFC); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x1F); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x27); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x66); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xFF); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 57, 0x1C); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x20); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0x6B); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xF7); -+ rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x09); -+ } -+ -+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 && -+ rt2x00_has_cap_external_lna_bg(rt2x00dev)) { -+ rt2800_bbp_write(rt2x00dev, 75, 0x60); -+ rt2800_bbp_write(rt2x00dev, 76, 0x44); -+ rt2800_bbp_write(rt2x00dev, 79, 0x1C); -+ rt2800_bbp_write(rt2x00dev, 80, 0x0C); -+ rt2800_bbp_write(rt2x00dev, 82, 0xB6); -+ } -+ -+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 && -+ rt2x00_has_cap_external_pa(rt2x00dev)) { -+ rt2800_register_write(rt2x00dev, TX0_RF_GAIN_CORRECT, 0x3630363A); -+ rt2800_register_write(rt2x00dev, TX0_RF_GAIN_ATTEN, 0x6C6C666C); -+ rt2800_register_write(rt2x00dev, TX1_RF_GAIN_ATTEN, 0x6C6C666C); -+ } -+} -+ -+static void rt2800_calibration_rt6352(struct rt2x00_dev *rt2x00dev) -+{ -+ if (rt2x00_has_cap_external_pa(rt2x00dev) || -+ rt2x00_has_cap_external_lna_bg(rt2x00dev)) { -+ rt6352_enable_pa_pin(rt2x00dev, 0); -+ rt2800_restore_rf_bbp_rt6352(rt2x00dev); -+ } -+ -+ rt2800_r_calibration(rt2x00dev); -+ rt2800_rf_self_txdc_cal(rt2x00dev); -+ rt2800_rxdcoc_calibration(rt2x00dev); -+ rt2800_bw_filter_calibration(rt2x00dev, true); -+ rt2800_bw_filter_calibration(rt2x00dev, false); -+ rt2800_loft_iq_calibration(rt2x00dev); -+ -+ /* missing DPD Calibration for devices using internal PA */ -+ -+ rt2800_rxdcoc_calibration(rt2x00dev); -+ rt2800_rxiq_calibration(rt2x00dev); -+ -+ if (rt2x00_has_cap_external_pa(rt2x00dev) || -+ rt2x00_has_cap_external_lna_bg(rt2x00dev)) { -+ rt6352_enable_pa_pin(rt2x00dev, 1); -+ rt2800_init_palna_rt6352(rt2x00dev); - } - } - -@@ -10802,6 +10844,10 @@ int rt2800_enable_radio(struct rt2x00_de - rt2800_init_bbp(rt2x00dev); - rt2800_init_rfcsr(rt2x00dev); - -+ /* Do calibration and init PA/LNA for RT6352 */ -+ if (rt2x00_rt(rt2x00dev, RT6352)) -+ rt2800_calibration_rt6352(rt2x00dev); -+ - if (rt2x00_is_usb(rt2x00dev) && - (rt2x00_rt(rt2x00dev, RT3070) || - rt2x00_rt(rt2x00dev, RT3071) || ---- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h -+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h -@@ -1277,6 +1277,12 @@ rt2x00_has_cap_external_lna_bg(struct rt - } - - static inline bool -+rt2x00_has_cap_external_pa(struct rt2x00_dev *rt2x00dev) -+{ -+ return rt2x00_has_cap_flag(rt2x00dev, CAPABILITY_EXTERNAL_PA_TX0); -+} -+ -+static inline bool - rt2x00_has_cap_double_antenna(struct rt2x00_dev *rt2x00dev) - { - return rt2x00_has_cap_flag(rt2x00dev, CAPABILITY_DOUBLE_ANTENNA); diff --git a/package/kernel/mac80211/patches/subsys/313-wifi-cfg80211-export-DFS-CAC-time-and-usable-state-h.patch b/package/kernel/mac80211/patches/subsys/313-wifi-cfg80211-export-DFS-CAC-time-and-usable-state-h.patch new file mode 100644 index 00000000000000..78ec030e18b772 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/313-wifi-cfg80211-export-DFS-CAC-time-and-usable-state-h.patch @@ -0,0 +1,111 @@ +From 30ca8b0c4d6c9fb1d76e5894b1e8bf7c6a12224d Mon Sep 17 00:00:00 2001 +From: Aditya Kumar Singh +Date: Tue, 12 Sep 2023 10:48:55 +0530 +Subject: [PATCH] wifi: cfg80211: export DFS CAC time and usable state helper + functions + +cfg80211 has cfg80211_chandef_dfs_usable() function to know whether +at least one channel in the chandef is in usable state or not. Also, +cfg80211_chandef_dfs_cac_time() function is there which tells the CAC +time required for the given chandef. + +Make these two functions visible to drivers by exporting their symbol +to global list of kernel symbols. + +Lower level drivers can make use of these two functions to be aware +if CAC is required on the given chandef and for how long. For example +drivers which maintains the CAC state internally can make use of these. + +Signed-off-by: Aditya Kumar Singh +Reviewed-by: Jeff Johnson +Link: https://lore.kernel.org/r/20230912051857.2284-2-quic_adisi@quicinc.com +Signed-off-by: Johannes Berg +--- + include/net/cfg80211.h | 24 ++++++++++++++++++++++++ + net/wireless/chan.c | 2 ++ + net/wireless/core.h | 17 ----------------- + 3 files changed, 26 insertions(+), 17 deletions(-) + +--- a/include/net/cfg80211.h ++++ b/include/net/cfg80211.h +@@ -1008,6 +1008,30 @@ int cfg80211_chandef_dfs_required(struct + enum nl80211_iftype iftype); + + /** ++ * cfg80211_chandef_dfs_usable - checks if chandef is DFS usable and we ++ * can/need start CAC on such channel ++ * @wiphy: the wiphy to validate against ++ * @chandef: the channel definition to check ++ * ++ * Return: true if all channels available and at least ++ * one channel requires CAC (NL80211_DFS_USABLE) ++ */ ++bool cfg80211_chandef_dfs_usable(struct wiphy *wiphy, ++ const struct cfg80211_chan_def *chandef); ++ ++/** ++ * cfg80211_chandef_dfs_cac_time - get the DFS CAC time (in ms) for given ++ * channel definition ++ * @wiphy: the wiphy to validate against ++ * @chandef: the channel definition to check ++ * ++ * Returns: DFS CAC time (in ms) which applies for this channel definition ++ */ ++unsigned int ++cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy, ++ const struct cfg80211_chan_def *chandef); ++ ++/** + * nl80211_send_chandef - sends the channel definition. + * @msg: the msg to send channel definition + * @chandef: the channel definition to check +--- a/net/wireless/chan.c ++++ b/net/wireless/chan.c +@@ -666,6 +666,7 @@ bool cfg80211_chandef_dfs_usable(struct + + return (r1 + r2 > 0); + } ++EXPORT_SYMBOL(cfg80211_chandef_dfs_usable); + + /* + * Checks if center frequency of chan falls with in the bandwidth +@@ -965,6 +966,7 @@ cfg80211_chandef_dfs_cac_time(struct wip + + return max(t1, t2); + } ++EXPORT_SYMBOL(cfg80211_chandef_dfs_cac_time); + + static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy, + u32 center_freq, u32 bandwidth, +--- a/net/wireless/core.h ++++ b/net/wireless/core.h +@@ -469,29 +469,12 @@ int cfg80211_scan(struct cfg80211_regist + + extern struct work_struct cfg80211_disconnect_work; + +-/** +- * cfg80211_chandef_dfs_usable - checks if chandef is DFS usable +- * @wiphy: the wiphy to validate against +- * @chandef: the channel definition to check +- * +- * Checks if chandef is usable and we can/need start CAC on such channel. +- * +- * Return: true if all channels available and at least +- * one channel requires CAC (NL80211_DFS_USABLE) +- */ +-bool cfg80211_chandef_dfs_usable(struct wiphy *wiphy, +- const struct cfg80211_chan_def *chandef); +- + void cfg80211_set_dfs_state(struct wiphy *wiphy, + const struct cfg80211_chan_def *chandef, + enum nl80211_dfs_state dfs_state); + + void cfg80211_dfs_channels_update_work(struct work_struct *work); + +-unsigned int +-cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy, +- const struct cfg80211_chan_def *chandef); +- + void cfg80211_sched_dfs_chan_update(struct cfg80211_registered_device *rdev); + + int diff --git a/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch b/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch index d04b1165bfc676..28e2144f7f51ba 100644 --- a/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch +++ b/package/kernel/mac80211/patches/subsys/320-cfg80211-allow-grace-period-for-DFS-available-after-.patch @@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau } } -@@ -873,6 +875,49 @@ static bool cfg80211_get_chans_dfs_avail +@@ -874,6 +876,49 @@ static bool cfg80211_get_chans_dfs_avail return true; } @@ -113,15 +113,15 @@ Signed-off-by: Felix Fietkau { --- a/net/wireless/core.h +++ b/net/wireless/core.h -@@ -487,6 +487,8 @@ void cfg80211_set_dfs_state(struct wiphy +@@ -474,6 +474,8 @@ void cfg80211_set_dfs_state(struct wiphy enum nl80211_dfs_state dfs_state); void cfg80211_dfs_channels_update_work(struct work_struct *work); +void cfg80211_update_last_available(struct wiphy *wiphy, + const struct cfg80211_chan_def *chandef); - unsigned int - cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy, + void cfg80211_sched_dfs_chan_update(struct cfg80211_registered_device *rdev); + --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c @@ -915,6 +915,8 @@ void cfg80211_dfs_channels_update_work(s diff --git a/package/kernel/mac80211/realtek.mk b/package/kernel/mac80211/realtek.mk index 9c143583265e11..04057b3106996c 100644 --- a/package/kernel/mac80211/realtek.mk +++ b/package/kernel/mac80211/realtek.mk @@ -1,7 +1,9 @@ PKG_DRIVERS += \ rtlwifi rtlwifi-pci rtlwifi-btcoexist rtlwifi-usb rtl8192c-common \ rtl8192ce rtl8192se rtl8192de rtl8192cu rtl8723bs rtl8821ae \ - rtl8xxxu rtw88 + 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 @@ -21,8 +23,20 @@ config-y += RTL8XXXU_UNTESTED config-$(call config_package,rtl8723bs) += RTL8723BS config-y += STAGING -config-$(call config_package,rtw88) += RTW88 RTW88_CORE RTW88_PCI -config-y += RTW88_8822BE RTW88_8822CE RTW88_8723DE +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 config-$(CONFIG_PACKAGE_RTW88_DEBUGFS) += RTW88_DEBUGFS @@ -168,18 +182,121 @@ endef define KernelPackage/rtw88 $(call KernelPackage/mac80211/Default) - TITLE:=Realtek RTL8822BE/RTL8822CE/RTL8723DE - DEPENDS+= @(PCI_SUPPORT) +kmod-mac80211 +@DRIVER_11AC_SUPPORT - FILES:=\ - $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822be.ko \ - $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822b.ko \ - $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822ce.ko \ - $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822c.ko \ - $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723de.ko \ - $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723d.ko \ - $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_core.ko \ - $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_pci.ko - AUTOLOAD:=$(call AutoProbe,rtw88_8822be rtw88_8822ce rtw88_8723de) + TITLE:=Realtek RTW88 common part + DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_core.ko + AUTOLOAD:=$(call AutoProbe,rtw88_core) + HIDDEN:=1 +endef + +define KernelPackage/rtw88-pci + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTW88 PCI chips support + DEPENDS+= @PCI_SUPPORT +kmod-rtw88 + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_pci.ko + AUTOLOAD:=$(call AutoProbe,rtw88_pci) + HIDDEN:=1 +endef + +define KernelPackage/rtw88-usb + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTW88 USB chips support + 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 +rtl8822be-firmware +@DRIVER_11AC_SUPPORT + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822b.ko + AUTOLOAD:=$(call AutoProbe,rtw88_8822b) + HIDDEN:=1 +endef + +define KernelPackage/rtw88-8822c + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTL8822C family 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 +endef + +define KernelPackage/rtw88-8723d + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTL8723D family support + 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 + DEPENDS+= +kmod-rtw88-pci +kmod-rtw88-8822b + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822be.ko + AUTOLOAD:=$(call AutoProbe,rtw88_8822be) +endef + +define KernelPackage/rtw88-8822bu + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTL8822BU support + 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 + +define KernelPackage/rtw88-8822ce + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTL8822CE support + DEPENDS+= +kmod-rtw88-pci +kmod-rtw88-8822c + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822ce.ko + 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 + DEPENDS+= +kmod-rtw88-pci +kmod-rtw88-8723d + FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723de.ko + AUTOLOAD:=$(call AutoProbe,rtw88_8723) endef define KernelPackage/rtl8723bs diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index cc8221d7ce1c92..dd75390ee76dd0 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -262,6 +262,11 @@ define KernelPackage/mt7921-firmware TITLE:=MediaTek MT7921 firmware endef +define KernelPackage/mt7922-firmware + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT7922 firmware +endef + define KernelPackage/mt792x-common $(KernelPackage/mt76-default) TITLE:=MediaTek MT792x wireless driver common code @@ -597,6 +602,14 @@ define KernelPackage/mt7921-firmware/install $(1)/lib/firmware/mediatek endef +define KernelPackage/mt7922-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/mediatek + cp \ + $(PKG_BUILD_DIR)/firmware/WIFI_MT7922_patch_mcu_1_1_hdr.bin \ + $(PKG_BUILD_DIR)/firmware/WIFI_RAM_CODE_MT7922_1.bin \ + $(1)/lib/firmware/mediatek +endef + define Package/mt76-test/install mkdir -p $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/mt76-test $(1)/usr/sbin @@ -630,6 +643,7 @@ $(eval $(call KernelPackage,mt7916-firmware)) $(eval $(call KernelPackage,mt7981-firmware)) $(eval $(call KernelPackage,mt7986-firmware)) $(eval $(call KernelPackage,mt7921-firmware)) +$(eval $(call KernelPackage,mt7922-firmware)) $(eval $(call KernelPackage,mt792x-common)) $(eval $(call KernelPackage,mt792x-usb)) $(eval $(call KernelPackage,mt7921-common)) diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index cd1a1b23873682..2e6cd3a31e5299 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -8,16 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwlwifi -PKG_RELEASE=2 +PKG_RELEASE=1 PKG_LICENSE:=ISC PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2023-04-29 -PKG_SOURCE_VERSION:=6a436714d2ea0d0adf39fc4d7d45e6a17fcc9371 -PKG_MIRROR_HASH:=dcc320a8f859b732ff65c7ded0b5199a625bfba05a775a6bed15ed3c10cb2748 +PKG_SOURCE_DATE:=2023-11-29 +PKG_SOURCE_VERSION:=ebf3167445f108346dcff9a31a708534c0bd7cc5 +PKG_MIRROR_HASH:=1d39ad25f4ad1fafff03a70341c2dabde8db4075f56163d40f8ae8aef2e2bb2d PKG_MAINTAINER:=Imre Kaloz PKG_BUILD_PARALLEL:=1 diff --git a/package/kernel/mwlwifi/patches/001-Fix-compilation-warning-with-64-bit-system.patch b/package/kernel/mwlwifi/patches/001-Fix-compilation-warning-with-64-bit-system.patch index 8e71918cf3f828..ee64e050473a3a 100644 --- a/package/kernel/mwlwifi/patches/001-Fix-compilation-warning-with-64-bit-system.patch +++ b/package/kernel/mwlwifi/patches/001-Fix-compilation-warning-with-64-bit-system.patch @@ -111,17 +111,15 @@ cc1: all warnings being treated as errors Signed-off-by: Christian Marangi --- - debugfs.c | 2 +- - hif/fwcmd.c | 2 +- - hif/pcie/pcie.c | 4 ++-- - hif/pcie/tx_ndp.c | 2 +- + debugfs.c | 2 +- + hif/fwcmd.c | 2 +- + hif/pcie/8964/tx_ndp.c | 2 +- + hif/pcie/pcie.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) -diff --git a/debugfs.c b/debugfs.c -index 39b09fd..42efd28 100644 --- a/debugfs.c +++ b/debugfs.c -@@ -1332,7 +1332,7 @@ done: +@@ -1342,7 +1342,7 @@ done: priv->reg_value); else len += scnprintf(p + len, size - len, @@ -130,11 +128,9 @@ index 39b09fd..42efd28 100644 ret, priv->reg_type, priv->reg_offset, priv->reg_value); -diff --git a/hif/fwcmd.c b/hif/fwcmd.c -index 376b58f..582c8d2 100644 --- a/hif/fwcmd.c +++ b/hif/fwcmd.c -@@ -3604,7 +3604,7 @@ int mwl_fwcmd_get_fw_core_dump(struct ieee80211_hw *hw, +@@ -3623,7 +3623,7 @@ int mwl_fwcmd_get_fw_core_dump(struct ie core_dump->size_kb = pcmd->cmd_data.coredump.size_kb; core_dump->flags = pcmd->cmd_data.coredump.flags; memcpy(buff, @@ -143,11 +139,20 @@ index 376b58f..582c8d2 100644 sizeof(struct hostcmd_cmd_get_fw_core_dump) - sizeof(struct hostcmd_cmd_get_fw_core_dump_)), MAX_CORE_DUMP_BUFFER); -diff --git a/hif/pcie/pcie.c b/hif/pcie/pcie.c -index 24453b6..5b6c633 100644 +--- a/hif/pcie/8964/tx_ndp.c ++++ b/hif/pcie/8964/tx_ndp.c +@@ -336,7 +336,7 @@ int pcie_tx_init_ndp(struct ieee80211_hw + + if (sizeof(struct pcie_tx_ctrl_ndp) > + sizeof(tx_info->driver_data)) { +- wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", ++ wiphy_err(hw->wiphy, "driver data is not enough: %zu (%zu)\n", + sizeof(struct pcie_tx_ctrl_ndp), + sizeof(tx_info->driver_data)); + return -ENOMEM; --- a/hif/pcie/pcie.c +++ b/hif/pcie/pcie.c -@@ -1320,8 +1320,8 @@ static void pcie_bf_mimo_ctrl_decode(struct mwl_priv *priv, +@@ -1466,8 +1466,8 @@ static void pcie_bf_mimo_ctrl_decode(struct mwl_priv *priv, &fp_data->f_pos); filp_close(fp_data, current->files); } else { @@ -158,19 +163,3 @@ index 24453b6..5b6c633 100644 } #if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0) -diff --git a/hif/pcie/tx_ndp.c b/hif/pcie/tx_ndp.c -index 6758cde..3140a2e 100644 ---- a/hif/pcie/tx_ndp.c -+++ b/hif/pcie/tx_ndp.c -@@ -335,7 +335,7 @@ int pcie_tx_init_ndp(struct ieee80211_hw *hw) - - if (sizeof(struct pcie_tx_ctrl_ndp) > - sizeof(tx_info->status.status_driver_data)) { -- wiphy_err(hw->wiphy, "driver data is not enough: %d (%d)\n", -+ wiphy_err(hw->wiphy, "driver data is not enough: %zu (%zu)\n", - sizeof(struct pcie_tx_ctrl_ndp), - sizeof(tx_info->status.status_driver_data)); - return -ENOMEM; --- -2.39.2 - diff --git a/package/kernel/mwlwifi/patches/004-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch b/package/kernel/mwlwifi/patches/004-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch index 3d9ec4dcfb3ac2..f37d2f8171a8df 100644 --- a/package/kernel/mwlwifi/patches/004-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch +++ b/package/kernel/mwlwifi/patches/004-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch @@ -19,7 +19,7 @@ Signed-off-by: Robert Marko --- a/hif/pcie/pcie.c +++ b/hif/pcie/pcie.c -@@ -573,7 +573,8 @@ static struct device_node *pcie_get_devi +@@ -685,7 +685,8 @@ static struct device_node *pcie_get_devi struct device_node *dev_node; dev_node = pci_bus_to_OF_node(pcie_priv->pdev->bus); diff --git a/package/kernel/mwlwifi/patches/005-mac80211_update.patch b/package/kernel/mwlwifi/patches/005-mac80211_update.patch index c11cf8c9469d43..92a8f2f70fd9c1 100644 --- a/package/kernel/mwlwifi/patches/005-mac80211_update.patch +++ b/package/kernel/mwlwifi/patches/005-mac80211_update.patch @@ -1,6 +1,6 @@ --- a/core.c +++ b/core.c -@@ -706,7 +706,7 @@ static void mwl_chnl_switch_event(struct +@@ -718,7 +718,7 @@ static void mwl_chnl_switch_event(struct vif = container_of((void *)mwl_vif, struct ieee80211_vif, drv_priv); @@ -11,7 +11,7 @@ spin_unlock_bh(&priv->vif_lock); --- a/debugfs.c +++ b/debugfs.c -@@ -455,9 +455,9 @@ static ssize_t mwl_debugfs_vif_read(stru +@@ -498,9 +498,9 @@ static ssize_t mwl_debugfs_vif_read(stru switch (vif->type) { case NL80211_IFTYPE_AP: len += scnprintf(p + len, size - len, "type: ap\n"); @@ -24,7 +24,7 @@ len += scnprintf(p + len, size - len, "ssid: %s\n", ssid); len += scnprintf(p + len, size - len, -@@ -479,8 +479,8 @@ static ssize_t mwl_debugfs_vif_read(stru +@@ -522,8 +522,8 @@ static ssize_t mwl_debugfs_vif_read(stru "type: unknown\n"); break; } @@ -35,62 +35,58 @@ len += scnprintf(p + len, size - len, "channel: %d: width: %d\n", chan_def->chan->hw_value, -@@ -564,28 +564,28 @@ static ssize_t mwl_debugfs_sta_read(stru - "amsdu cap: 0x%02x\n", - sta_info->amsdu_ctrl.cap); - } -- if (sta->ht_cap.ht_supported) { -+ if (sta->deflink.ht_cap.ht_supported) { - len += scnprintf(p + len, size - len, - "ht_cap: 0x%04x, ampdu: %02x, %02x\n", -- sta->ht_cap.cap, -- sta->ht_cap.ampdu_factor, -- sta->ht_cap.ampdu_density); -+ sta->deflink.ht_cap.cap, -+ sta->deflink.ht_cap.ampdu_factor, -+ sta->deflink.ht_cap.ampdu_density); - len += scnprintf(p + len, size - len, - "rx_mask: 0x%02x, %02x, %02x, %02x\n", -- sta->ht_cap.mcs.rx_mask[0], -- sta->ht_cap.mcs.rx_mask[1], -- sta->ht_cap.mcs.rx_mask[2], -- sta->ht_cap.mcs.rx_mask[3]); -+ sta->deflink.ht_cap.mcs.rx_mask[0], -+ sta->deflink.ht_cap.mcs.rx_mask[1], -+ sta->deflink.ht_cap.mcs.rx_mask[2], -+ sta->deflink.ht_cap.mcs.rx_mask[3]); - } -- if (sta->vht_cap.vht_supported) { -+ if (sta->deflink.vht_cap.vht_supported) { - len += scnprintf(p + len, size - len, - "vht_cap: 0x%08x, mcs: %02x, %02x\n", -- sta->vht_cap.cap, -- sta->vht_cap.vht_mcs.rx_mcs_map, -- sta->vht_cap.vht_mcs.tx_mcs_map); -+ sta->deflink.vht_cap.cap, -+ sta->deflink.vht_cap.vht_mcs.rx_mcs_map, -+ sta->deflink.vht_cap.vht_mcs.tx_mcs_map); - } - len += scnprintf(p + len, size - len, "rx_bw: %d, rx_nss: %d\n", -- sta->bandwidth, sta->rx_nss); -+ sta->deflink.bandwidth, sta->deflink.rx_nss); - len += scnprintf(p + len, size - len, - "tdls: %d, tdls_init: %d\n", - sta->tdls, sta->tdls_initiator); +@@ -596,18 +596,18 @@ static ssize_t mwl_debugfs_sta_read(stru + sta_info->wds ? "true" : "false", + sta_info->ba_hist.enable ? "enable" : "disable", + sta_info->is_amsdu_allowed ? sta_info->amsdu_ctrl.cap : 0 , +- sta->ht_cap.ht_supported ? sta->ht_cap.cap : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.ampdu_factor : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.ampdu_density : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.mcs.rx_mask[0] : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.mcs.rx_mask[1] : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.mcs.rx_mask[2] : 0, +- sta->ht_cap.ht_supported ? sta->ht_cap.mcs.rx_mask[3] : 0, +- sta->vht_cap.vht_supported ? sta->vht_cap.cap : 0, +- sta->vht_cap.vht_supported ? sta->vht_cap.vht_mcs.rx_mcs_map : 0, +- sta->vht_cap.vht_supported ? sta->vht_cap.vht_mcs.tx_mcs_map : 0, +- sta->bandwidth, +- sta->rx_nss, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.cap : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.ampdu_factor : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.ampdu_density : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.mcs.rx_mask[0] : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.mcs.rx_mask[1] : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.mcs.rx_mask[2] : 0, ++ sta->deflink.ht_cap.ht_supported ? sta->deflink.ht_cap.mcs.rx_mask[3] : 0, ++ sta->deflink.vht_cap.vht_supported ? sta->deflink.vht_cap.cap : 0, ++ sta->deflink.vht_cap.vht_supported ? sta->deflink.vht_cap.vht_mcs.rx_mcs_map : 0, ++ sta->deflink.vht_cap.vht_supported ? sta->deflink.vht_cap.vht_mcs.tx_mcs_map : 0, ++ sta->deflink.bandwidth, ++ sta->deflink.rx_nss, + sta->tdls, + sta->tdls_initiator, + sta->wme, --- a/hif/fwcmd.c +++ b/hif/fwcmd.c -@@ -634,8 +634,9 @@ einval: +@@ -633,11 +633,15 @@ einval: + } static int mwl_fwcmd_set_ap_beacon(struct mwl_priv *priv, - struct mwl_vif *mwl_vif, +- struct mwl_vif *mwl_vif, - struct ieee80211_bss_conf *bss_conf) + struct ieee80211_vif *vif) { -+ struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; struct hostcmd_cmd_ap_beacon *pcmd; struct ds_params *phy_ds_param_set; ++ struct mwl_vif *mwl_vif; ++ struct ieee80211_bss_conf *bss_conf; ++ ++ mwl_vif = mwl_dev_get_vif(vif); ++ bss_conf = &vif->bss_conf; -@@ -664,7 +665,7 @@ static int mwl_fwcmd_set_ap_beacon(struc + /* wmm structure of start command is defined less one byte, + * due to following field country is not used, add byte one +@@ -664,7 +668,7 @@ static int mwl_fwcmd_set_ap_beacon(struc pcmd->cmd_hdr.macid = mwl_vif->macid; ether_addr_copy(pcmd->start_cmd.sta_mac_addr, mwl_vif->bssid); @@ -99,16 +95,16 @@ if (priv->chip_type == MWL8997) ether_addr_copy(pcmd->start_cmd.bssid, mwl_vif->bssid); pcmd->start_cmd.bss_type = 1; -@@ -2091,7 +2092,7 @@ int mwl_fwcmd_set_beacon(struct ieee8021 +@@ -2090,7 +2094,7 @@ int mwl_fwcmd_set_beacon(struct ieee8021 if (mwl_fwcmd_set_wsc_ie(hw, b_inf->ie_wsc_len, b_inf->ie_wsc_ptr)) goto err; - if (mwl_fwcmd_set_ap_beacon(priv, mwl_vif, &vif->bss_conf)) -+ if (mwl_fwcmd_set_ap_beacon(priv, mwl_vif, vif)) ++ if (mwl_fwcmd_set_ap_beacon(priv, vif)) goto err; if (b_inf->cap_info & WLAN_CAPABILITY_SPECTRUM_MGMT) -@@ -2153,38 +2154,38 @@ int mwl_fwcmd_set_new_stn_add(struct iee +@@ -2152,38 +2156,38 @@ int mwl_fwcmd_set_new_stn_add(struct iee ether_addr_copy(pcmd->mac_addr, sta->addr); if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ) @@ -161,7 +157,7 @@ } pcmd->is_qos_sta = sta->wme; -@@ -2240,38 +2241,38 @@ int mwl_fwcmd_set_new_stn_add_sc4(struct +@@ -2239,38 +2243,38 @@ int mwl_fwcmd_set_new_stn_add_sc4(struct ether_addr_copy(pcmd->mac_addr, sta->addr); if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ) @@ -214,7 +210,7 @@ } pcmd->is_qos_sta = sta->wme; -@@ -2788,9 +2789,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 +@@ -2787,9 +2791,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 pcmd->ba_info.create_params.flags = cpu_to_le32(ba_flags); pcmd->ba_info.create_params.queue_id = stream->idx; pcmd->ba_info.create_params.param_info = @@ -226,7 +222,7 @@ IEEE80211_HT_AMPDU_PARM_DENSITY); if (direction == BA_FLAG_DIRECTION_UP) { pcmd->ba_info.create_params.reset_seq_no = 0; -@@ -2800,9 +2801,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 +@@ -2799,9 +2803,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 pcmd->ba_info.create_params.current_seq = cpu_to_le16(0); } if (priv->chip_type == MWL8964 && @@ -238,9 +234,51 @@ IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK) >> IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT); } +--- a/hif/pcie/8864/tx.c ++++ b/hif/pcie/8864/tx.c +@@ -743,7 +743,7 @@ void pcie_8864_tx_xmit(struct ieee80211_ + index = SYSADPT_TX_WMM_QUEUES - index - 1; + txpriority = index; + +- if (sta && sta->ht_cap.ht_supported && ++ if (sta && sta->deflink.ht_cap.ht_supported && + !(xmitcontrol & EAGLE_TXD_XMITCTRL_USE_MC_RATE) && + ieee80211_is_data_qos(wh->frame_control)) { + tid = qos & 0xf; +--- a/hif/pcie/8964/tx_ndp.c ++++ b/hif/pcie/8964/tx_ndp.c +@@ -607,7 +607,7 @@ void pcie_tx_xmit_ndp(struct ieee80211_h + pcie_tx_encapsulate_frame(priv, skb, k_conf); + } else { + tid = qos & 0x7; +- if (sta && sta->ht_cap.ht_supported && !eapol_frame && ++ if (sta && sta->deflink.ht_cap.ht_supported && !eapol_frame && + qos != 0xFFFF) { + pcie_tx_count_packet(sta, tid); + spin_lock_bh(&priv->stream_lock); +--- a/hif/pcie/8997/tx.c ++++ b/hif/pcie/8997/tx.c +@@ -81,7 +81,7 @@ static int pcie_txbd_ring_create(struct + wiphy_info(priv->hw->wiphy, + "TX ring: - base: %p, pbase: 0x%x, len: %d\n", + pcie_priv->txbd_ring_vbase, +- pcie_priv->txbd_ring_pbase, ++ (u32)pcie_priv->txbd_ring_pbase, + pcie_priv->txbd_ring_size); + + for (num = 0; num < PCIE_MAX_TXRX_BD; num++) { +@@ -694,7 +694,7 @@ void pcie_8997_tx_xmit(struct ieee80211_ + index = SYSADPT_TX_WMM_QUEUES - index - 1; + txpriority = index; + +- if (sta && sta->ht_cap.ht_supported && ++ if (sta && sta->deflink.ht_cap.ht_supported && + !(xmitcontrol & EAGLE_TXD_XMITCTRL_USE_MC_RATE) && + ieee80211_is_data_qos(wh->frame_control)) { + tid = qos & 0xf; --- a/mac80211.c +++ b/mac80211.c -@@ -371,15 +371,15 @@ static void mwl_mac80211_bss_info_change +@@ -368,15 +368,15 @@ static void mwl_mac80211_bss_info_change } } @@ -259,7 +297,7 @@ { struct mwl_priv *priv = hw->priv; struct mwl_vif *mwl_vif; -@@ -429,8 +429,8 @@ static void mwl_mac80211_bss_info_change +@@ -426,8 +426,8 @@ static void mwl_mac80211_bss_info_change if (changed & (BSS_CHANGED_BEACON_INT | BSS_CHANGED_BEACON)) { struct sk_buff *skb; @@ -270,7 +308,7 @@ (!info->hidden_ssid)) { if (mwl_vif->broadcast_ssid != true) { mwl_fwcmd_broadcast_ssid_enable(hw, vif, true); -@@ -444,7 +444,7 @@ static void mwl_mac80211_bss_info_change +@@ -441,7 +441,7 @@ static void mwl_mac80211_bss_info_change } if (!mwl_vif->set_beacon) { @@ -279,7 +317,7 @@ if (skb) { mwl_fwcmd_set_beacon(hw, vif, skb->data, skb->len); -@@ -461,7 +461,7 @@ static void mwl_mac80211_bss_info_change +@@ -458,7 +458,7 @@ static void mwl_mac80211_bss_info_change static void mwl_mac80211_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, @@ -288,7 +326,7 @@ { switch (vif->type) { case NL80211_IFTYPE_AP: -@@ -584,10 +584,10 @@ static int mwl_mac80211_sta_add(struct i +@@ -583,10 +583,10 @@ static int mwl_mac80211_sta_add(struct i if (vif->type == NL80211_IFTYPE_MESH_POINT) sta_info->is_mesh_node = true; @@ -296,12 +334,12 @@ + if (sta->deflink.ht_cap.ht_supported) { sta_info->is_ampdu_allowed = true; sta_info->is_amsdu_allowed = false; -- if (sta->ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU) -+ if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU) +- if (sta->ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU) { ++ if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU) { sta_info->amsdu_ctrl.cap = MWL_AMSDU_SIZE_8K; - else - sta_info->amsdu_ctrl.cap = MWL_AMSDU_SIZE_4K; -@@ -669,7 +669,7 @@ static int mwl_mac80211_sta_remove(struc + sta_info->amsdu_ctrl.amsdu_allow_size = SYSADPT_AMSDU_8K_MAX_SIZE; + } +@@ -670,7 +670,7 @@ static int mwl_mac80211_sta_remove(struc static int mwl_mac80211_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, @@ -310,7 +348,7 @@ const struct ieee80211_tx_queue_params *params) { struct mwl_priv *priv = hw->priv; -@@ -928,4 +928,5 @@ const struct ieee80211_ops mwl_mac80211_ +@@ -934,4 +934,5 @@ const struct ieee80211_ops mwl_mac80211_ .pre_channel_switch = mwl_mac80211_chnl_switch, .sw_scan_start = mwl_mac80211_sw_scan_start, .sw_scan_complete = mwl_mac80211_sw_scan_complete, @@ -360,34 +398,3 @@ switch (format) { case TX_RATE_FORMAT_LEGACY: ---- a/hif/pcie/tx.c -+++ b/hif/pcie/tx.c -@@ -153,7 +153,7 @@ static int pcie_txbd_ring_create(struct - wiphy_info(priv->hw->wiphy, - "TX ring: - base: %p, pbase: 0x%x, len: %d\n", - pcie_priv->txbd_ring_vbase, -- pcie_priv->txbd_ring_pbase, -+ (u32)pcie_priv->txbd_ring_pbase, - pcie_priv->txbd_ring_size); - - for (num = 0; num < PCIE_MAX_TXRX_BD; num++) { -@@ -1091,7 +1091,7 @@ void pcie_tx_xmit(struct ieee80211_hw *h - index = SYSADPT_TX_WMM_QUEUES - index - 1; - txpriority = index; - -- if (sta && sta->ht_cap.ht_supported && !eapol_frame && -+ if (sta && sta->deflink.ht_cap.ht_supported && !eapol_frame && - ieee80211_is_data_qos(wh->frame_control)) { - tid = qos & 0xf; - pcie_tx_count_packet(sta, tid); ---- a/hif/pcie/tx_ndp.c -+++ b/hif/pcie/tx_ndp.c -@@ -602,7 +602,7 @@ void pcie_tx_xmit_ndp(struct ieee80211_h - pcie_tx_encapsulate_frame(priv, skb, k_conf, NULL); - } else { - tid = qos & 0x7; -- if (sta && sta->ht_cap.ht_supported && !eapol_frame && -+ if (sta && sta->deflink.ht_cap.ht_supported && !eapol_frame && - qos != 0xFFFF) { - pcie_tx_count_packet(sta, tid); - spin_lock_bh(&priv->stream_lock); diff --git a/package/kernel/mwlwifi/patches/006-remove-uaccess-and-get_fs-calls-from-PCIe-for-Kenel-.patch b/package/kernel/mwlwifi/patches/006-remove-uaccess-and-get_fs-calls-from-PCIe-for-Kenel-.patch deleted file mode 100644 index c81561a149daa7..00000000000000 --- a/package/kernel/mwlwifi/patches/006-remove-uaccess-and-get_fs-calls-from-PCIe-for-Kenel-.patch +++ /dev/null @@ -1,53 +0,0 @@ -From ad911365cac3723d1c00d048905a5e22ff4a10f3 Mon Sep 17 00:00:00 2001 -From: Stefan Kalscheuer -Date: Sun, 18 Jun 2023 17:53:27 +0200 -Subject: [PATCH 1/2] remove uaccess and get_fs calls from PCIe for Kenel >= - 5.18 - -Remove the calls to deprecated get_fs and force_uaccess_* API for modern -kernels. - -The get_fs functionality and the transitional force_uaccess_* calls have -been removed Kernel 5.18 [1] while read and write operations have been -refactored, so the code can work on kernel- and userspace data without -the need to shifting the boundary using set_fs(). - -[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=967747bbc084b93b54e66f9047d342232314cd25 - -Signed-off-by: Stefan Kalscheuer ---- - hif/pcie/pcie.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/hif/pcie/pcie.c b/hif/pcie/pcie.c -index 24453b6..bee1cc5 100644 ---- a/hif/pcie/pcie.c -+++ b/hif/pcie/pcie.c -@@ -1294,7 +1294,9 @@ static void pcie_bf_mimo_ctrl_decode(struct mwl_priv *priv, - const char filename[] = "/tmp/BF_MIMO_Ctrl_Field_Output.txt"; - char str_buf[256]; - char *buf = &str_buf[0]; -+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) - mm_segment_t oldfs; -+#endif - - #if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0) - oldfs = get_fs(); -@@ -1302,7 +1304,7 @@ static void pcie_bf_mimo_ctrl_decode(struct mwl_priv *priv, - #elif LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0) - oldfs = get_fs(); - set_fs(KERNEL_DS); --#else -+#elif LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) - oldfs = force_uaccess_begin(); - #endif - -@@ -1326,7 +1328,7 @@ static void pcie_bf_mimo_ctrl_decode(struct mwl_priv *priv, - - #if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0) - set_fs(oldfs); --#else -+#elif LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) - force_uaccess_end(oldfs); - #endif - } diff --git a/package/kernel/mwlwifi/patches/007-replace-usage-of-the-deprecated-pci-dma-compat.h-API.patch b/package/kernel/mwlwifi/patches/007-replace-usage-of-the-deprecated-pci-dma-compat.h-API.patch deleted file mode 100644 index 1faff18c840b57..00000000000000 --- a/package/kernel/mwlwifi/patches/007-replace-usage-of-the-deprecated-pci-dma-compat.h-API.patch +++ /dev/null @@ -1,275 +0,0 @@ -From 61c75dce424c180b633c64613a1948df5a41cf1e Mon Sep 17 00:00:00 2001 -From: Stefan Kalscheuer -Date: Sun, 18 Jun 2023 17:59:07 +0200 -Subject: [PATCH 2/2] replace usage of the deprecated "pci-dma-compat.h" API - -The pci-dma-compat API has been legacy for quite a while and was removed -with 5.18 [1]. Migrate all calls, so the module can be compiled against -modern kernel versions. - -Replace some compat calls: -* pci_set_dma_mask with dma_set_mask -* pci_(un)map_single with dma_(un)map_single -* pci_dma_mapping_error with dma_mapping_error -* PCI_DMA_{FROM,TO}DEVICE with DMA_{FOM,TO}_DEVICE - -[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7968778914e53788a01c2dee2692cab157de9ac0 - -Signed-off-by: Stefan Kalscheuer ---- - hif/pcie/pcie.c | 2 +- - hif/pcie/rx.c | 20 ++++++++++---------- - hif/pcie/rx_ndp.c | 20 ++++++++++---------- - hif/pcie/tx.c | 22 +++++++++++----------- - hif/pcie/tx_ndp.c | 14 +++++++------- - 5 files changed, 39 insertions(+), 39 deletions(-) - -diff --git a/hif/pcie/pcie.c b/hif/pcie/pcie.c -index bee1cc5..d85c29e 100644 ---- a/hif/pcie/pcie.c -+++ b/hif/pcie/pcie.c -@@ -1556,7 +1556,7 @@ static int pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) - return rc; - } - -- rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); -+ rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); - if (rc) { - pr_err("%s: 32-bit PCI DMA not supported\n", - PCIE_DRV_NAME); -diff --git a/hif/pcie/rx.c b/hif/pcie/rx.c -index 91eb984..2857c0f 100644 ---- a/hif/pcie/rx.c -+++ b/hif/pcie/rx.c -@@ -107,11 +107,11 @@ static int pcie_rx_ring_init(struct mwl_priv *priv) - desc->prx_ring[i].rssi = 0x00; - desc->prx_ring[i].pkt_len = - cpu_to_le16(SYSADPT_MAX_AGGR_SIZE); -- dma = pci_map_single(pcie_priv->pdev, -+ dma = dma_map_single(&(pcie_priv->pdev)->dev, - rx_hndl->psk_buff->data, - desc->rx_buf_size, -- PCI_DMA_FROMDEVICE); -- if (pci_dma_mapping_error(pcie_priv->pdev, dma)) { -+ DMA_FROM_DEVICE); -+ if (dma_mapping_error(&(pcie_priv->pdev)->dev, dma)) { - wiphy_err(priv->hw->wiphy, - "failed to map pci memory!\n"); - return -ENOMEM; -@@ -153,11 +153,11 @@ static void pcie_rx_ring_cleanup(struct mwl_priv *priv) - if (!rx_hndl->psk_buff) - continue; - -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - le32_to_cpu - (rx_hndl->pdesc->pphys_buff_data), - desc->rx_buf_size, -- PCI_DMA_FROMDEVICE); -+ DMA_FROM_DEVICE); - - dev_kfree_skb_any(rx_hndl->psk_buff); - -@@ -335,11 +335,11 @@ static inline int pcie_rx_refill(struct mwl_priv *priv, - rx_hndl->pdesc->rssi = 0x00; - rx_hndl->pdesc->pkt_len = cpu_to_le16(desc->rx_buf_size); - -- dma = pci_map_single(pcie_priv->pdev, -+ dma = dma_map_single(&(pcie_priv->pdev)->dev, - rx_hndl->psk_buff->data, - desc->rx_buf_size, -- PCI_DMA_FROMDEVICE); -- if (pci_dma_mapping_error(pcie_priv->pdev, dma)) { -+ DMA_FROM_DEVICE); -+ if (dma_mapping_error(&(pcie_priv->pdev)->dev, dma)) { - dev_kfree_skb_any(rx_hndl->psk_buff); - wiphy_err(priv->hw->wiphy, - "failed to map pci memory!\n"); -@@ -413,10 +413,10 @@ void pcie_rx_recv(unsigned long data) - prx_skb = curr_hndl->psk_buff; - if (!prx_skb) - goto out; -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - le32_to_cpu(curr_hndl->pdesc->pphys_buff_data), - desc->rx_buf_size, -- PCI_DMA_FROMDEVICE); -+ DMA_FROM_DEVICE); - pkt_len = le16_to_cpu(curr_hndl->pdesc->pkt_len); - - if (skb_tailroom(prx_skb) < pkt_len) { -diff --git a/hif/pcie/rx_ndp.c b/hif/pcie/rx_ndp.c -index 228075d..106d559 100644 ---- a/hif/pcie/rx_ndp.c -+++ b/hif/pcie/rx_ndp.c -@@ -86,11 +86,11 @@ static int pcie_rx_ring_init_ndp(struct mwl_priv *priv) - } - skb_reserve(psk_buff, MIN_BYTES_RX_HEADROOM); - -- dma = pci_map_single(pcie_priv->pdev, -+ dma = dma_map_single(&(pcie_priv->pdev)->dev, - psk_buff->data, - desc->rx_buf_size, -- PCI_DMA_FROMDEVICE); -- if (pci_dma_mapping_error(pcie_priv->pdev, dma)) { -+ DMA_FROM_DEVICE); -+ if (dma_mapping_error(&(pcie_priv->pdev)->dev, dma)) { - wiphy_err(priv->hw->wiphy, - "failed to map pci memory!\n"); - return -ENOMEM; -@@ -120,11 +120,11 @@ static void pcie_rx_ring_cleanup_ndp(struct mwl_priv *priv) - if (desc->prx_ring) { - for (i = 0; i < MAX_NUM_RX_DESC; i++) { - if (desc->rx_vbuflist[i]) { -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - le32_to_cpu( - desc->prx_ring[i].data), - desc->rx_buf_size, -- PCI_DMA_FROMDEVICE); -+ DMA_FROM_DEVICE); - desc->rx_vbuflist[i] = NULL; - } - } -@@ -400,11 +400,11 @@ static inline int pcie_rx_refill_ndp(struct mwl_priv *priv, u32 buf_idx) - return -ENOMEM; - skb_reserve(psk_buff, MIN_BYTES_RX_HEADROOM); - -- dma = pci_map_single(pcie_priv->pdev, -+ dma = dma_map_single(&(pcie_priv->pdev)->dev, - psk_buff->data, - desc->rx_buf_size, -- PCI_DMA_FROMDEVICE); -- if (pci_dma_mapping_error(pcie_priv->pdev, dma)) { -+ DMA_FROM_DEVICE); -+ if (dma_mapping_error(&(pcie_priv->pdev)->dev, dma)) { - wiphy_err(priv->hw->wiphy, - "refill: failed to map pci memory!\n"); - return -ENOMEM; -@@ -509,10 +509,10 @@ recheck: - break; - } - -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - le32_to_cpu(prx_desc->data), - desc->rx_buf_size, -- PCI_DMA_FROMDEVICE); -+ DMA_FROM_DEVICE); - - bad_mic = false; - ctrl = le32_to_cpu(prx_ring_done->ctrl); -diff --git a/hif/pcie/tx.c b/hif/pcie/tx.c -index 62a34a8..8f3c828 100644 ---- a/hif/pcie/tx.c -+++ b/hif/pcie/tx.c -@@ -243,11 +243,11 @@ static void pcie_tx_ring_cleanup(struct mwl_priv *priv) - desc->tx_hndl[i].psk_buff->data, - le32_to_cpu( - desc->ptx_ring[i].pkt_ptr)); -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - le32_to_cpu( - desc->ptx_ring[i].pkt_ptr), - desc->tx_hndl[i].psk_buff->len, -- PCI_DMA_TODEVICE); -+ DMA_TO_DEVICE); - dev_kfree_skb_any(desc->tx_hndl[i].psk_buff); - desc->ptx_ring[i].status = - cpu_to_le32(EAGLE_TXD_STATUS_IDLE); -@@ -305,10 +305,10 @@ static void pcie_txbd_ring_delete(struct mwl_priv *priv) - skb = pcie_priv->tx_buf_list[num]; - tx_desc = (struct pcie_tx_desc *)skb->data; - -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - le32_to_cpu(tx_desc->pkt_ptr), - skb->len, -- PCI_DMA_TODEVICE); -+ DMA_TO_DEVICE); - dev_kfree_skb_any(skb); - } - pcie_priv->tx_buf_list[num] = NULL; -@@ -453,9 +453,9 @@ static inline void pcie_tx_skb(struct mwl_priv *priv, int desc_num, - tx_desc->type = tx_ctrl->type; - tx_desc->xmit_control = tx_ctrl->xmit_control; - tx_desc->sap_pkt_info = 0; -- dma = pci_map_single(pcie_priv->pdev, tx_skb->data, -- tx_skb->len, PCI_DMA_TODEVICE); -- if (pci_dma_mapping_error(pcie_priv->pdev, dma)) { -+ dma = dma_map_single(&(pcie_priv->pdev)->dev, tx_skb->data, -+ tx_skb->len, DMA_TO_DEVICE); -+ if (dma_mapping_error(&(pcie_priv->pdev)->dev, dma)) { - dev_kfree_skb_any(tx_skb); - wiphy_err(priv->hw->wiphy, - "failed to map pci memory!\n"); -@@ -676,10 +676,10 @@ static void pcie_pfu_tx_done(struct mwl_priv *priv) - pfu_dma = (struct pcie_pfu_dma_data *)done_skb->data; - tx_desc = &pfu_dma->tx_desc; - dma_data = &pfu_dma->dma_data; -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - le32_to_cpu(data_buf->paddr), - le16_to_cpu(data_buf->len), -- PCI_DMA_TODEVICE); -+ DMA_TO_DEVICE); - tx_desc->pkt_ptr = 0; - tx_desc->pkt_len = 0; - tx_desc->status = cpu_to_le32(EAGLE_TXD_STATUS_IDLE); -@@ -768,10 +768,10 @@ static void pcie_non_pfu_tx_done(struct mwl_priv *priv) - (tx_desc->status & cpu_to_le32(EAGLE_TXD_STATUS_OK)) && - (!(tx_desc->status & - cpu_to_le32(EAGLE_TXD_STATUS_FW_OWNED)))) { -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - le32_to_cpu(tx_desc->pkt_ptr), - le16_to_cpu(tx_desc->pkt_len), -- PCI_DMA_TODEVICE); -+ DMA_TO_DEVICE); - done_skb = tx_hndl->psk_buff; - rate = le32_to_cpu(tx_desc->rate_info); - tx_desc->pkt_ptr = 0; -diff --git a/hif/pcie/tx_ndp.c b/hif/pcie/tx_ndp.c -index 6758cde..f4256c2 100644 ---- a/hif/pcie/tx_ndp.c -+++ b/hif/pcie/tx_ndp.c -@@ -131,10 +131,10 @@ static void pcie_tx_ring_cleanup_ndp(struct mwl_priv *priv) - for (i = 0; i < MAX_TX_RING_SEND_SIZE; i++) { - tx_skb = desc->tx_vbuflist[i]; - if (tx_skb) { -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - desc->pphys_tx_buflist[i], - tx_skb->len, -- PCI_DMA_TODEVICE); -+ DMA_TO_DEVICE); - dev_kfree_skb_any(tx_skb); - desc->pphys_tx_buflist[i] = 0; - desc->tx_vbuflist[i] = NULL; -@@ -266,9 +266,9 @@ static inline int pcie_tx_skb_ndp(struct mwl_priv *priv, - (TXRING_CTRL_TAG_MGMT << TXRING_CTRL_TAG_SHIFT)); - } - -- dma = pci_map_single(pcie_priv->pdev, tx_skb->data, -- tx_skb->len, PCI_DMA_TODEVICE); -- if (pci_dma_mapping_error(pcie_priv->pdev, dma)) { -+ dma = dma_map_single(&(pcie_priv->pdev)->dev, tx_skb->data, -+ tx_skb->len, DMA_TO_DEVICE); -+ if (dma_mapping_error(&(pcie_priv->pdev)->dev, dma)) { - dev_kfree_skb_any(tx_skb); - wiphy_err(priv->hw->wiphy, - "failed to map pci memory!\n"); -@@ -450,10 +450,10 @@ void pcie_tx_done_ndp(struct ieee80211_hw *hw) - "buffer is NULL for tx done ring\n"); - break; - } -- pci_unmap_single(pcie_priv->pdev, -+ dma_unmap_single(&(pcie_priv->pdev)->dev, - desc->pphys_tx_buflist[index], - skb->len, -- PCI_DMA_TODEVICE); -+ DMA_TO_DEVICE); - desc->pphys_tx_buflist[index] = 0; - desc->tx_vbuflist[index] = NULL; - - diff --git a/package/kernel/qca-ssdk/Makefile b/package/kernel/qca-ssdk/Makefile index 7420b038037319..d8c8d6cb167c1d 100644 --- a/package/kernel/qca-ssdk/Makefile +++ b/package/kernel/qca-ssdk/Makefile @@ -1,13 +1,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=qca-ssdk -PKG_RELEASE:=1 +PKG_RELEASE:=4 PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-ssdk.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2023-06-06 -PKG_SOURCE_VERSION:=74caf88aa3b6793c300f676e4fb1c62da7507be9 -PKG_MIRROR_HASH:=6bdb90919b773f5fb432c8b374c9419feac32ba6583ad82dfec5e41628a32dd9 +PKG_SOURCE_DATE:=2023-10-04 +PKG_SOURCE_VERSION:=23a5aa4a4d5834da7a07efb58baebfbee91786b0 +PKG_MIRROR_HASH:=9d169ce924a46a4e530031061d3183b92f23c7f46b3106f0b9ba3587846a73ee PKG_FLAGS:=nonshared PKG_BUILD_FLAGS:=no-lto @@ -31,17 +31,11 @@ endef GCC_VERSION=$(shell echo "$(CONFIG_GCC_VERSION)" | sed 's/[^0-9.]*\([0-9.]*\).*/\1/') -ifdef CONFIG_TOOLCHAIN_BIN_PATH -TOOLCHAIN_BIN_PATH=$(CONFIG_TOOLCHAIN_BIN_PATH) -else -TOOLCHAIN_BIN_PATH=$(TOOLCHAIN_DIR)/bin -endif - LNX_CONFIG_OPTS = LNX_MAKEOPTS='$(KERNEL_MAKEOPTS)' MODULE_TYPE=KSLIB modules MAKE_FLAGS+= \ TARGET_NAME=$(CONFIG_TARGET_NAME) \ - TOOL_PATH=$(TOOLCHAIN_BIN_PATH) \ + TOOL_PATH=$(firstword $(TOOLCHAIN_BIN_DIRS)) \ SYS_PATH=$(LINUX_DIR) \ TOOLPREFIX=$(TARGET_CROSS) \ KVER=$(LINUX_VERSION) \ @@ -49,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/0001-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch b/package/kernel/qca-ssdk/patches/0001-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch index da5387dafc3faf..c627c828987b52 100644 --- a/package/kernel/qca-ssdk/patches/0001-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch +++ b/package/kernel/qca-ssdk/patches/0001-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch @@ -1,7 +1,7 @@ -From cdcafa28c857e4d04c9210feb54dc84e427061fe Mon Sep 17 00:00:00 2001 +From 1d37f4ee9b9588a62bfc87419c8a6d9ef989aa9c Mon Sep 17 00:00:00 2001 From: Robert Marko -Date: Tue, 11 Jan 2022 00:28:42 +0100 -Subject: [PATCH 1/2] qca807x: add a LED quirk for Xiaomi AX9000 +Date: Tue, 7 Nov 2023 12:23:09 +0100 +Subject: [PATCH 1/3] qca807x: add a LED quirk for Xiaomi AX9000 Xiaomi AX9000 has a single LED for each of 4 gigabit ethernet ports that are connected to QCA8075, and that LED is connected to the 100M LED pin. @@ -16,9 +16,9 @@ as well. Signed-off-by: Robert Marko --- - include/hsl/phy/malibu_phy.h | 2 ++ - src/hsl/phy/malibu_phy.c | 11 +++++++++++ - 2 files changed, 13 insertions(+) + include/hsl/phy/malibu_phy.h | 2 ++ + src/hsl/phy/malibu_phy.c | 9 +++++++++ + 2 files changed, 11 insertions(+) --- a/include/hsl/phy/malibu_phy.h +++ b/include/hsl/phy/malibu_phy.h @@ -49,19 +49,17 @@ Signed-off-by: Robert Marko #include "sw.h" #include "fal_port_ctrl.h" #include "hsl_api.h" -@@ -2716,6 +2718,15 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_ - led_status |= MALIBU_LED_1000_CTRL1_100_10_MASK; - malibu_phy_mmd_write(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM, - MALIBU_PHY_MMD7_LED_1000_CTRL1, led_status); +@@ -1809,6 +1811,13 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_ + hsl_phy_modify_mmd(dev_id, phy_addr, A_FALSE, MALIBU_PHY_MMD7_NUM, + MALIBU_PHY_MMD7_LED_1000_CTRL1, MALIBU_LED_1000_CTRL1_100_10_MASK, + MALIBU_LED_1000_CTRL1_100_10_MASK); + if (of_machine_is_compatible("xiaomi,ax9000")) { + /* add 1000M link LED behavior for Xiaomi AX9000 */ -+ led_status = malibu_phy_mmd_read(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM, -+ MALIBU_PHY_MMD7_LED_100_CTRL1); -+ led_status &= ~MALIBU_LED_100_CTRL1_1000_MASK; -+ led_status |= MALIBU_LED_100_CTRL1_1000_MASK; -+ malibu_phy_mmd_write(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM, -+ MALIBU_PHY_MMD7_LED_100_CTRL1, led_status); ++ hsl_phy_modify_mmd(dev_id, phy_addr, A_FALSE, MALIBU_PHY_MMD7_NUM, ++ MALIBU_PHY_MMD7_LED_100_CTRL1, ++ MALIBU_LED_100_CTRL1_1000_MASK, ++ MALIBU_LED_100_CTRL1_1000_MASK); + } /*disable Extended next page*/ - phy_data = malibu_phy_reg_read(dev_id, phy_addr, MALIBU_AUTONEG_ADVERT); - phy_data &= ~MALIBU_EXTENDED_NEXT_PAGE_EN; + hsl_phy_modify_mii(dev_id, phy_addr, MALIBU_AUTONEG_ADVERT, + MALIBU_EXTENDED_NEXT_PAGE_EN, 0); diff --git a/package/kernel/qca-ssdk/patches/0002-qca807x-add-a-LED-quirk-for-Xiaomi-AX3600.patch b/package/kernel/qca-ssdk/patches/0002-qca807x-add-a-LED-quirk-for-Xiaomi-AX3600.patch index 9d456b23990b67..cfbb6cc771351e 100644 --- a/package/kernel/qca-ssdk/patches/0002-qca807x-add-a-LED-quirk-for-Xiaomi-AX3600.patch +++ b/package/kernel/qca-ssdk/patches/0002-qca807x-add-a-LED-quirk-for-Xiaomi-AX3600.patch @@ -1,7 +1,7 @@ -From a750e569aeb4f7b454dbde18cd6d0f2bb1875dfa Mon Sep 17 00:00:00 2001 +From 957ee476ddec289973e0af07917da7bfee660af0 Mon Sep 17 00:00:00 2001 From: Robert Marko -Date: Wed, 26 Jan 2022 14:47:33 +0100 -Subject: [PATCH 2/2] qca807x: add a LED quirk for Xiaomi AX3600 +Date: Tue, 7 Nov 2023 12:24:17 +0100 +Subject: [PATCH 2/3] qca807x: add a LED quirk for Xiaomi AX3600 AX3600 requires the same LED quirk so that PHY LED-s will blink even once Linux resets the PHY. @@ -15,15 +15,15 @@ Signed-off-by: Robert Marko --- a/src/hsl/phy/malibu_phy.c +++ b/src/hsl/phy/malibu_phy.c -@@ -2718,8 +2718,9 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_ - led_status |= MALIBU_LED_1000_CTRL1_100_10_MASK; - malibu_phy_mmd_write(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM, - MALIBU_PHY_MMD7_LED_1000_CTRL1, led_status); +@@ -1811,8 +1811,9 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_ + hsl_phy_modify_mmd(dev_id, phy_addr, A_FALSE, MALIBU_PHY_MMD7_NUM, + MALIBU_PHY_MMD7_LED_1000_CTRL1, MALIBU_LED_1000_CTRL1_100_10_MASK, + MALIBU_LED_1000_CTRL1_100_10_MASK); - if (of_machine_is_compatible("xiaomi,ax9000")) { - /* add 1000M link LED behavior for Xiaomi AX9000 */ -+ /* add 1000M link LED behavior for Xiaomi boards */ + if (of_machine_is_compatible("xiaomi,ax9000") || + of_machine_is_compatible("xiaomi,ax3600")) { - led_status = malibu_phy_mmd_read(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM, - MALIBU_PHY_MMD7_LED_100_CTRL1); - led_status &= ~MALIBU_LED_100_CTRL1_1000_MASK; ++ /* add 1000M link LED behavior for Xiaomi boards */ + hsl_phy_modify_mmd(dev_id, phy_addr, A_FALSE, MALIBU_PHY_MMD7_NUM, + MALIBU_PHY_MMD7_LED_100_CTRL1, + MALIBU_LED_100_CTRL1_1000_MASK, diff --git a/package/kernel/qca-ssdk/patches/0003-Revert-qca-ssdk-enable-invoking-fdb-del-function-for.patch b/package/kernel/qca-ssdk/patches/0003-Revert-qca-ssdk-enable-invoking-fdb-del-function-for.patch new file mode 100644 index 00000000000000..e69edbd3a3171d --- /dev/null +++ b/package/kernel/qca-ssdk/patches/0003-Revert-qca-ssdk-enable-invoking-fdb-del-function-for.patch @@ -0,0 +1,30 @@ +From 73c0992a36bc13e9bb373f98ba246dfc1e29a393 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Tue, 7 Nov 2023 14:21:43 +0100 +Subject: [PATCH 3/3] Revert "[qca-ssdk]: enable invoking fdb del function for + kernel6.1" + +This reverts commit a86765ee6a87145f64344f4872cfe8c5e629dd62. + +Upstream kernel does not have this call present at all, we currently +also dont use it, so revert the commit enabling it. + +Signed-off-by: Robert Marko +--- + src/ref/ref_acl.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/src/ref/ref_acl.c ++++ b/src/ref/ref_acl.c +@@ -229,7 +229,11 @@ _ref_acl_mac_entry_create_rule(a_uint32_ + eth_dev = dev_get_by_name(&init_net, entry->ifname); + if (eth_dev) + { ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++ // TODO: replace with corresponding ver ++#else + br_fdb_delete_by_netdev(eth_dev, entry->src_mac.uc, 0); ++#endif + dev_put(eth_dev); + } + } 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 00000000000000..6aaa579c09e33a --- /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/libs/gmp/Makefile b/package/libs/gmp/Makefile index 601e4f804def78..6bcee784ed8081 100644 --- a/package/libs/gmp/Makefile +++ b/package/libs/gmp/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gmp -PKG_VERSION:=6.2.1 +PKG_VERSION:=6.3.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)$(PKG_REVISION).tar.xz PKG_SOURCE_URL:=@GNU/gmp/ -PKG_HASH:=fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2 +PKG_HASH:=a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898 PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 diff --git a/package/libs/libbpf/Makefile b/package/libs/libbpf/Makefile index a034231138456e..240eb51d68e0f5 100644 --- a/package/libs/libbpf/Makefile +++ b/package/libs/libbpf/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libbpf -PKG_VERSION:=1.2.2 +PKG_VERSION:=1.3.0 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://github.com/libbpf/libbpf -PKG_MIRROR_HASH:=d20f5a226e5729c87c367f3fba61c44d5e13176ef12637d0e0b30629fa3ab0d6 +PKG_MIRROR_HASH:=ff597a3635c2c099419d7e9e8bc44084f7f9e0c4ba2dcd571130165a19ed4ef4 PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=1728e3e4bef0e138ea95ffe62163eb9a6ac6fa32 +PKG_SOURCE_VERSION:=v1.3.0 PKG_ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION))) PKG_MAINTAINER:=Tony Ambardar diff --git a/package/libs/libbpf/patches/001-cflags.patch b/package/libs/libbpf/patches/001-cflags.patch index d6ffc3f907f8ec..4c0e93a75bb826 100644 --- a/package/libs/libbpf/patches/001-cflags.patch +++ b/package/libs/libbpf/patches/001-cflags.patch @@ -6,5 +6,5 @@ +CFLAGS = $(EXTRA_CFLAGS) CFLAGS ?= -g -O2 -Werror -Wall -std=gnu89 - ALL_CFLAGS += $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $(EXTRA_CFLAGS) - ALL_LDFLAGS += $(LDFLAGS) $(EXTRA_LDFLAGS) + ALL_CFLAGS += $(CFLAGS) \ + -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \ diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile index d925ac750d6f0d..063cf2644273f3 100644 --- a/package/libs/libjson-c/Makefile +++ b/package/libs/libjson-c/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=json-c -PKG_VERSION:=0.16 -PKG_RELEASE:=3 +PKG_VERSION:=0.17 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-nodoc.tar.gz PKG_SOURCE_URL:=https://s3.amazonaws.com/json-c_releases/releases/ -PKG_HASH:=ac8a3dd6820daaca579b23fbc74664310fbc3d67f52f6707cda67d21dde5570f +PKG_HASH:=8df3b66597333dd365762cab2de2ff68e41e3808a04b692e696e0550648eefaa PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=MIT diff --git a/package/libs/libjson-c/patches/001-dont-build-docs.patch b/package/libs/libjson-c/patches/001-dont-build-docs.patch index f35da807248744..1de420f8b878bc 100644 --- a/package/libs/libjson-c/patches/001-dont-build-docs.patch +++ b/package/libs/libjson-c/patches/001-dont-build-docs.patch @@ -1,6 +1,6 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -433,8 +433,6 @@ configure_file(json.h.cmakein ${PROJECT_ +@@ -451,8 +451,6 @@ configure_file(json.h.cmakein ${PROJECT_ include_directories(${PROJECT_SOURCE_DIR}) include_directories(${PROJECT_BINARY_DIR}) diff --git a/package/libs/libjson-c/patches/010-fix-build-with-clang-15.patch b/package/libs/libjson-c/patches/010-fix-build-with-clang-15.patch deleted file mode 100644 index d6af772e06b487..00000000000000 --- a/package/libs/libjson-c/patches/010-fix-build-with-clang-15.patch +++ /dev/null @@ -1,184 +0,0 @@ -From 6eca65617aacd19f4928acd5766b8dd20eda0b34 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 13 Aug 2022 20:37:03 -0700 -Subject: [PATCH] Fix build with clang-15+ - -Fixes -json_util.c:63:35: error: a function declaration without a prototype is deprecated in all versions of C [-We -rror,-Wstrict-prototypes] -const char *json_util_get_last_err() - ^ - void - -Signed-off-by: Khem Raj ---- - json_util.c | 2 +- - tests/test1.c | 6 +++--- - tests/test4.c | 2 +- - tests/test_cast.c | 2 +- - tests/test_charcase.c | 2 +- - tests/test_parse.c | 8 ++++---- - tests/test_printbuf.c | 4 ++-- - tests/test_util_file.c | 6 +++--- - 8 files changed, 16 insertions(+), 16 deletions(-) - ---- a/json_util.c -+++ b/json_util.c -@@ -60,7 +60,7 @@ static int _json_object_to_fd(int fd, st - - static char _last_err[256] = ""; - --const char *json_util_get_last_err() -+const char *json_util_get_last_err(void) - { - if (_last_err[0] == '\0') - return NULL; ---- a/tests/test1.c -+++ b/tests/test1.c -@@ -58,7 +58,7 @@ static const char *to_json_string(json_o - #endif - - json_object *make_array(void); --json_object *make_array() -+json_object *make_array(void) - { - json_object *my_array; - -@@ -74,7 +74,7 @@ json_object *make_array() - } - - void test_array_del_idx(void); --void test_array_del_idx() -+void test_array_del_idx(void) - { - int rc; - size_t ii; -@@ -140,7 +140,7 @@ void test_array_del_idx() - } - - void test_array_list_expand_internal(void); --void test_array_list_expand_internal() -+void test_array_list_expand_internal(void) - { - int rc; - size_t ii; ---- a/tests/test4.c -+++ b/tests/test4.c -@@ -28,7 +28,7 @@ void print_hex(const char *s) - } - - static void test_lot_of_adds(void); --static void test_lot_of_adds() -+static void test_lot_of_adds(void) - { - int ii; - char key[50]; ---- a/tests/test_cast.c -+++ b/tests/test_cast.c -@@ -94,7 +94,7 @@ static void getit(struct json_object *ne - printf("new_obj.%s json_object_get_double()=%f\n", field, json_object_get_double(o)); - } - --static void checktype_header() -+static void checktype_header(void) - { - printf("json_object_is_type: %s,%s,%s,%s,%s,%s,%s\n", json_type_to_name(json_type_null), - json_type_to_name(json_type_boolean), json_type_to_name(json_type_double), ---- a/tests/test_charcase.c -+++ b/tests/test_charcase.c -@@ -19,7 +19,7 @@ int main(int argc, char **argv) - } - - /* make sure only lowercase forms are parsed in strict mode */ --static void test_case_parse() -+static void test_case_parse(void) - { - struct json_tokener *tok; - json_object *new_obj; ---- a/tests/test_parse.c -+++ b/tests/test_parse.c -@@ -92,7 +92,7 @@ static void single_basic_parse(const cha - if (getenv("TEST_PARSE_CHUNKSIZE") != NULL) - single_incremental_parse(test_string, clear_serializer); - } --static void test_basic_parse() -+static void test_basic_parse(void) - { - single_basic_parse("\"\003\"", 0); - single_basic_parse("/* hello */\"foo\"", 0); -@@ -195,7 +195,7 @@ static void test_basic_parse() - single_basic_parse("[18446744073709551616]", 1); - } - --static void test_utf8_parse() -+static void test_utf8_parse(void) - { - // json_tokener_parse doesn't support checking for byte order marks. - // It's the responsibility of the caller to detect and skip a BOM. -@@ -222,7 +222,7 @@ static int clear_serializer(json_object - return JSON_C_VISIT_RETURN_CONTINUE; - } - --static void test_verbose_parse() -+static void test_verbose_parse(void) - { - json_object *new_obj; - enum json_tokener_error error = json_tokener_success; -@@ -562,7 +562,7 @@ struct incremental_step - {NULL, -1, -1, json_tokener_success, 0}, - }; - --static void test_incremental_parse() -+static void test_incremental_parse(void) - { - json_object *new_obj; - enum json_tokener_error jerr; ---- a/tests/test_printbuf.c -+++ b/tests/test_printbuf.c -@@ -16,7 +16,7 @@ static void test_printbuf_memset_length( - #define __func__ __FUNCTION__ - #endif - --static void test_basic_printbuf_memset() -+static void test_basic_printbuf_memset(void) - { - struct printbuf *pb; - -@@ -29,7 +29,7 @@ static void test_basic_printbuf_memset() - printf("%s: end test\n", __func__); - } - --static void test_printbuf_memset_length() -+static void test_printbuf_memset_length(void) - { - struct printbuf *pb; - ---- a/tests/test_util_file.c -+++ b/tests/test_util_file.c -@@ -35,7 +35,7 @@ static void test_read_fd_equal(const cha - #define PATH_MAX 256 - #endif - --static void test_write_to_file() -+static void test_write_to_file(void) - { - json_object *jso; - -@@ -231,7 +231,7 @@ static void test_read_valid_nested_with_ - close(d); - } - --static void test_read_nonexistant() -+static void test_read_nonexistant(void) - { - const char *filename = "./not_present.json"; - -@@ -249,7 +249,7 @@ static void test_read_nonexistant() - } - } - --static void test_read_closed() -+static void test_read_closed(void) - { - // Test reading from a closed fd - int d = open("/dev/null", O_RDONLY, 0); diff --git a/package/libs/libmd/Makefile b/package/libs/libmd/Makefile index faba27e5e9479b..06e516cef93f1c 100644 --- a/package/libs/libmd/Makefile +++ b/package/libs/libmd/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libmd -PKG_VERSION:=1.0.4 +PKG_VERSION:=1.1.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://archive.hadrons.org/software/libmd/ -PKG_HASH:=f51c921042e34beddeded4b75557656559cf5b1f2448033b4c1eec11c07e530f +PKG_HASH:=1bd6aa42275313af3141c7cf2e5b964e8b1fd488025caf2f971f43b00776b332 PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=COPYING diff --git a/package/libs/libnl/Makefile b/package/libs/libnl/Makefile index 56549dcc0a24a2..56f2c2825d24bf 100644 --- a/package/libs/libnl/Makefile +++ b/package/libs/libnl/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnl -PKG_VERSION:=3.7.0 +PKG_VERSION:=3.8.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl$(subst .,_,$(PKG_VERSION)) -PKG_HASH:=9fe43ccbeeea72c653bdcf8c93332583135cda46a79507bfd0a483bb57f65939 +PKG_HASH:=bb726c6d7a08b121978d73ff98425bf313fa26a27a331d465e4f1d7ec5b838c6 PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:=COPYING @@ -55,10 +55,16 @@ $(call Package/libnl/default) DEPENDS:=+libnl-route endef +define Package/libnl-cli +$(call Package/libnl/default) + TITLE:=CLI Netlink Library + DEPENDS:=+libnl-genl +libnl-nf +endef + define Package/libnl $(call Package/libnl/default) TITLE:=Full Netlink Library - DEPENDS:=+libnl-genl +libnl-route +libnl-nf + DEPENDS:=+libnl-genl +libnl-route +libnl-nf +libnl-cli endef define Package/libnl-core/description @@ -77,6 +83,10 @@ define Package/libnl-nf/description Netfilter Netlink Library Functions endef +define Package/libnl-cli/description + CLI Netlink Library Functions +endef + define Package/libnl/description Socket handling, connection management, sending and receiving of data, message construction and parsing, object caching system, etc. @@ -98,6 +108,7 @@ define Build/InstallDev $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-genl-3.so $(1)/usr/lib/libnl-genl.so $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-nf-3.so $(1)/usr/lib/libnl-nf.so $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-route-3.so $(1)/usr/lib/libnl-route.so + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-cli-3.so $(1)/usr/lib/libnl-cli.so endef define Package/libnl-core/install @@ -120,6 +131,11 @@ define Package/libnl-nf/install $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-nf-3.so.* $(1)/usr/lib/ endef +define Package/libnl-cli/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-cli-3.so.* $(1)/usr/lib/ +endef + define Package/libnl/install : endef @@ -128,4 +144,5 @@ $(eval $(call BuildPackage,libnl-core)) $(eval $(call BuildPackage,libnl-genl)) $(eval $(call BuildPackage,libnl-route)) $(eval $(call BuildPackage,libnl-nf)) +$(eval $(call BuildPackage,libnl-cli)) $(eval $(call BuildPackage,libnl)) diff --git a/package/libs/libselinux/Makefile b/package/libs/libselinux/Makefile index 816e09f30ce877..f90d4993c836be 100644 --- a/package/libs/libselinux/Makefile +++ b/package/libs/libselinux/Makefile @@ -18,6 +18,8 @@ PKG_LICENSE_FILES:=LICENSE PKG_MAINTAINER:=Thomas Petazzoni PKG_CPE_ID:=cpe:/a:selinuxproject:libselinux +PKG_BUILD_FLAGS:=no-lto + HOST_BUILD_DEPENDS:=libsepol/host musl-fts/host pcre2/host include $(INCLUDE_DIR)/package.mk diff --git a/package/libs/libsepol/Makefile b/package/libs/libsepol/Makefile index 613d19388d5312..b1a34d293e058f 100644 --- a/package/libs/libsepol/Makefile +++ b/package/libs/libsepol/Makefile @@ -16,6 +16,8 @@ PKG_HASH:=78fdaf69924db780bac78546e43d9c44074bad798c2c415d0b9bb96d065ee8a2 PKG_MAINTAINER:=Thomas Petazzoni PKG_CPE_ID:=cpe:/a:selinuxproject:libsepol +PKG_BUILD_FLAGS:=no-lto + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile index c62278adc50ab2..549e604679a83b 100644 --- a/package/libs/libubox/Makefile +++ b/package/libs/libubox/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git -PKG_MIRROR_HASH:=f22de22a784a0135cc2869fe81ff30e52136dca36863ee713503b4be5be01869 -PKG_SOURCE_DATE:=2023-05-23 -PKG_SOURCE_VERSION:=75a3b870cace1171faf57bd55e5a9a2f1564f757 +PKG_MIRROR_HASH:=daf411244a7f87c09c383c6fb69636a038c85f351bba93e80cc9aa530301199e +PKG_SOURCE_DATE:=2023-12-04.1 +PKG_SOURCE_VERSION:=ca3f6d0cdb1e588283c42d039779ceab303ceef2 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE)) CMAKE_INSTALL:=1 diff --git a/package/libs/libxml2/Makefile b/package/libs/libxml2/Makefile index ed1965c0195418..b13e875de74ac5 100644 --- a/package/libs/libxml2/Makefile +++ b/package/libs/libxml2/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libxml2 -PKG_VERSION:=2.11.4 +PKG_VERSION:=2.11.6 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNOME/libxml2/$(basename $(PKG_VERSION)) -PKG_HASH:=737e1d7f8ab3f139729ca13a2494fd17bf30ddb4b7a427cf336252cab57f57f7 +PKG_HASH:=c90eee7506764abbe07bb616b82da452529609815aefef423d66ef080eb0c300 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING diff --git a/package/libs/mbedtls/Config.in b/package/libs/mbedtls/Config.in index ffabd799d32b64..9fbe9f8a4a0ff4 100644 --- a/package/libs/mbedtls/Config.in +++ b/package/libs/mbedtls/Config.in @@ -104,7 +104,7 @@ config MBEDTLS_ECP_DP_SECP384R1_ENABLED config MBEDTLS_ECP_DP_SECP521R1_ENABLED bool "MBEDTLS_ECP_DP_SECP521R1_ENABLED" - default n + default y config MBEDTLS_ECP_DP_SECP192K1_ENABLED bool "MBEDTLS_ECP_DP_SECP192K1_ENABLED" diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index 4c3cb965c55e21..246b21a8531a1f 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mbedtls -PKG_VERSION:=2.28.4 -PKG_RELEASE:=1 +PKG_VERSION:=2.28.5 +PKG_RELEASE:=2 PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=578c4dcd15bbff3f5cd56aa07cd4f850fc733634e3d5947be4f7157d5bfd81ac +PKG_HASH:=849e86b626e42ded6bf67197b64aa771daa54e2a7e2868dc67e1e4711959e5e3 PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=gpl-2.0.txt diff --git a/package/libs/mbedtls/patches/100-x509-crt-verify-SAN-iPAddress.patch b/package/libs/mbedtls/patches/100-x509-crt-verify-SAN-iPAddress.patch index 02632cdb4ba1d8..4ad2e8c7dbe4ae 100644 --- a/package/libs/mbedtls/patches/100-x509-crt-verify-SAN-iPAddress.patch +++ b/package/libs/mbedtls/patches/100-x509-crt-verify-SAN-iPAddress.patch @@ -33,7 +33,7 @@ Signed-off-by: Glenn Strauss #include #else #include -@@ -3001,6 +3005,61 @@ find_parent: +@@ -3002,6 +3006,61 @@ find_parent: } } @@ -95,7 +95,7 @@ Signed-off-by: Glenn Strauss /* * Check for CN match */ -@@ -3021,24 +3080,51 @@ static int x509_crt_check_cn(const mbedt +@@ -3022,24 +3081,51 @@ static int x509_crt_check_cn(const mbedt return -1; } @@ -158,7 +158,7 @@ Signed-off-by: Glenn Strauss } /* -@@ -3049,31 +3135,23 @@ static void x509_crt_verify_name(const m +@@ -3050,31 +3136,23 @@ static void x509_crt_verify_name(const m uint32_t *flags) { const mbedtls_x509_name *name; diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 459d367372f749..4b1388e7af6d49 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl -PKG_VERSION:=3.0.11 +PKG_VERSION:=3.0.12 PKG_RELEASE:=1 PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto @@ -24,7 +24,7 @@ PKG_SOURCE_URL:= \ ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \ ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/old/$(PKG_BASE)/ -PKG_HASH:=b3425d3bb4a2218d0697eb41f7fc0cdede016ed19ca49d168b78e8d947887f55 +PKG_HASH:=f93c9e8edde5e9166119de31755fc87b4aa34863662f67ddfcba14d0b6b69b61 PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE diff --git a/package/libs/openssl/patches/120-strip-cflags-from-binary.patch b/package/libs/openssl/patches/120-strip-cflags-from-binary.patch index c4f2540395b415..ebdb940b426669 100644 --- a/package/libs/openssl/patches/120-strip-cflags-from-binary.patch +++ b/package/libs/openssl/patches/120-strip-cflags-from-binary.patch @@ -10,7 +10,7 @@ Signed-off-by: Eneas U de Queiroz --- a/crypto/build.info +++ b/crypto/build.info -@@ -111,7 +111,7 @@ DEFINE[../libcrypto]=$UPLINKDEF +@@ -109,7 +109,7 @@ DEFINE[../libcrypto]=$UPLINKDEF DEPEND[info.o]=buildinf.h DEPEND[cversion.o]=buildinf.h diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile index f9f8ac956bebb6..ea36af5da44a67 100644 --- a/package/libs/toolchain/Makefile +++ b/package/libs/toolchain/Makefile @@ -454,6 +454,9 @@ define Build/Prepare mkdir -p $(PKG_BUILD_DIR) endef +define Build/Quilt +endef + LIBGCC_A=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc_pic.a)) LIBGCC_MAP=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.map)) LIBGCC_SO=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so.*)) @@ -652,12 +655,23 @@ else exit 0 endef + define Package/glibc/install + endef + + LD_MUSL_NAME = $(notdir $(firstword $(wildcard $(TOOLCHAIN_ROOT_DIR)/lib/libc.so*))) + + define Package/musl/install + $(INSTALL_DIR) $(1)/usr/bin + $(LN) ../../lib/$(LD_MUSL_NAME) $(1)/usr/bin/ldd + endef + define Package/libc/install for file in $(call qstrip,$(CONFIG_LIBC_FILE_SPEC)); do \ $(INSTALL_DIR) $(1)/lib ; \ $(CP) $(call qstrip,$(CONFIG_LIBC_ROOT_DIR))/$$$$file $(1)/lib/ ; \ done ; \ exit 0 + $(call Package/$(LIBC)/install,$1) endef define Package/libpthread/install diff --git a/package/libs/udebug/Makefile b/package/libs/udebug/Makefile new file mode 100644 index 00000000000000..2bc4d37f55ddf7 --- /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:=3f7d32cdfbcbc7a854deefb916a1ee5c5bf59fa154c36fb1e5ff491dae874b8e +PKG_SOURCE_DATE:=2023-11-30 +PKG_SOURCE_VERSION:=b613879cb049123dd9dc68d5e6aef60141ebe483 +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 +libubus +endef + +define Package/udebugd + SECTION:=utils + CATEGORY:=Utilities + TITLE:=OpenWrt debug service + DEPENDS:=+libudebug +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 00000000000000..21d1ecb18f2331 --- /dev/null +++ b/package/libs/udebug/files/udebug.config @@ -0,0 +1,28 @@ +config service procd + option enabled 0 + +config service log + option enabled 0 + option debug 0 + option kernel 1 + option syslog 1 + +config service hostapd + option enabled 0 + option wpa_log 1 + option wpa_nl_rx 0 + option wpa_nl_tx 0 + option wpa_nl_ctrl 0 + +config service wpa_supplicant + option enabled 0 + option wpa_log 1 + option wpa_nl_rx 0 + option wpa_nl_tx 0 + option wpa_nl_ctrl 0 + +config service netifd + option enabled 0 + +config service umdns + option enabled 0 diff --git a/package/libs/udebug/files/udebug.init b/package/libs/udebug/files/udebug.init new file mode 100755 index 00000000000000..b57e962f6fac21 --- /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/libs/ustream-ssl/Makefile b/package/libs/ustream-ssl/Makefile index ae5c8026c208e5..076053abf658f0 100644 --- a/package/libs/ustream-ssl/Makefile +++ b/package/libs/ustream-ssl/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustream-ssl.git -PKG_SOURCE_DATE:=2023-02-25 -PKG_SOURCE_VERSION:=498f6e268d4d2b0ad33b430f4ba1abe397d31496 -PKG_MIRROR_HASH:=a201d065dd613e30886c9f13a0851cec79538192cfe591b6f8ecd88724d55fb1 +PKG_SOURCE_DATE:=2023-11-26 +PKG_SOURCE_VERSION:=263b9a97cf7e1e2467319c23832b705fc01190b5 +PKG_MIRROR_HASH:=1c01d633f21c6cb578a785826d1983284b28f49b20d608d82179842dcdbeed6e CMAKE_INSTALL:=1 PKG_LICENSE:=ISC diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index ae802e210e7ca2..6451dca68d28d3 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl -PKG_VERSION:=5.6.3-stable +PKG_VERSION:=5.6.4-stable PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) -PKG_HASH:=2e74a397fa797c2902d7467d500de904907666afb4ff80f6464f6efd5afb114a +PKG_HASH:=031691906794ff45e1e792561cf31759f5d29ac74936bc8dffb8b14f16d820b4 PKG_FIXUP:=libtool libtool-abiver PKG_INSTALL:=1 diff --git a/package/libs/wolfssl/patches/001-fix-detection-of-cut-tool-in-configure.ac.patch b/package/libs/wolfssl/patches/001-fix-detection-of-cut-tool-in-configure.ac.patch deleted file mode 100644 index 0d0c8b54236ee1..00000000000000 --- a/package/libs/wolfssl/patches/001-fix-detection-of-cut-tool-in-configure.ac.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 41d248461bd9ad44193a4806ecb5361513e8944e Mon Sep 17 00:00:00 2001 -From: jordan -Date: Tue, 27 Jun 2023 13:18:25 -0500 -Subject: [PATCH] fix detection of cut tool in configure.ac - ---- - configure.ac | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - ---- a/configure.ac -+++ b/configure.ac -@@ -8723,10 +8723,11 @@ echo "extern \"C\" {" >> $OPTION_FILE - echo "#endif" >> $OPTION_FILE - echo "" >> $OPTION_FILE - --# check for supported command to trim option with -+# Check for supported command to trim option with. -+# note: cut requires an argument to exit with success. - if colrm >/dev/null 2>&1 /dev/null 2>&1 /dev/null 2>&1 PKG_LICENSE:=ISC diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index 811d745a6fcd62..ccd566e0a76e7a 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -1,13 +1,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=netifd -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2023-09-19 -PKG_SOURCE_VERSION:=7a58b995fdbecd9beed57e4d66d42cb3cf66aee2 -PKG_MIRROR_HASH:=a460a3b912047f8802eb24bb737084a08dad65b2dd520e5f5e7459379d1fcf8c +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 e442d0005b90e9..241f3463e2fb1f 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 af5ca5822ea8a6..0c769602366c29 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -1,8 +1,6 @@ #!/bin/sh /etc/rc.common # Copyright (C) 2007-2012 OpenWrt.org -. /lib/functions.sh - START=19 USE_PROCD=1 @@ -541,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 @@ -568,6 +571,7 @@ dhcp_add() { config_get ra_management "$cfg" ra_management config_get ra_preference "$cfg" ra_preference config_get dns "$cfg" dns + config_get dns_sl "$cfg" domain config_list_foreach "$cfg" "interface_name" append_interface_name "$ifname" @@ -584,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}" @@ -647,6 +651,13 @@ dhcp_add() { fi dhcp_option_append "option6:dns-server,$dnss" "$networkid" + + if [ -n "$dns_sl" ]; then + ddssl="" + for dd in $dns_sl; do append ddssl "$dd" ","; done + fi + + dhcp_option_append "option6:domain-search,$ddssl" "$networkid" fi dhcp_option_add "$cfg" "$networkid" 0 diff --git a/package/network/services/dnsmasq/patches/200-ubus_dns.patch b/package/network/services/dnsmasq/patches/200-ubus_dns.patch index 8a70bb8bdf19bb..ccbe70ab9c3cef 100644 --- a/package/network/services/dnsmasq/patches/200-ubus_dns.patch +++ b/package/network/services/dnsmasq/patches/200-ubus_dns.patch @@ -210,7 +210,7 @@ + return; + + ubus_free(ubus); -+ ubus = NULL; ++ daemon->ubus = NULL; +} + static int ubus_handle_metrics(struct ubus_context *ctx, struct ubus_object *obj, diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 64048a963a480d..17f9dcb581dbea 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=4 +PKG_RELEASE:=6 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git @@ -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/common.uc b/package/network/services/hostapd/files/common.uc index ccffe3eb436219..4c33779af935e1 100644 --- a/package/network/services/hostapd/files/common.uc +++ b/package/network/services/hostapd/files/common.uc @@ -10,6 +10,36 @@ const iftypes = { monitor: nl80211.const.NL80211_IFTYPE_MONITOR, }; +const mesh_params = { + mesh_retry_timeout: "retry_timeout", + mesh_confirm_timeout: "confirm_timeout", + mesh_holding_timeout: "holding_timeout", + mesh_max_peer_links: "max_peer_links", + mesh_max_retries: "max_retries", + mesh_ttl: "ttl", + mesh_element_ttl: "element_ttl", + mesh_auto_open_plinks: "auto_open_plinks", + mesh_hwmp_max_preq_retries: "hwmp_max_preq_retries", + mesh_path_refresh_time: "path_refresh_time", + mesh_min_discovery_timeout: "min_discovery_timeout", + mesh_hwmp_active_path_timeout: "hwmp_active_path_timeout", + mesh_hwmp_preq_min_interval: "hwmp_preq_min_interval", + mesh_hwmp_net_diameter_traversal_time: "hwmp_net_diam_trvs_time", + mesh_hwmp_rootmode: "hwmp_rootmode", + mesh_hwmp_rann_interval: "hwmp_rann_interval", + mesh_gate_announcements: "gate_announcements", + mesh_sync_offset_max_neighor: "sync_offset_max_neighbor", + mesh_rssi_threshold: "rssi_threshold", + mesh_hwmp_active_path_to_root_timeout: "hwmp_path_to_root_timeout", + mesh_hwmp_root_interval: "hwmp_root_interval", + mesh_hwmp_confirmation_interval: "hwmp_confirmation_interval", + mesh_awake_window: "awake_window", + mesh_plink_timeout: "plink_timeout", + mesh_fwding: "forwarding", + mesh_power_mode: "power_mode", + mesh_nolearn: "nolearn" +}; + function wdev_remove(name) { nl80211.request(nl80211.const.NL80211_CMD_DEL_INTERFACE, 0, { dev: name }); @@ -94,6 +124,31 @@ function wdev_create(phy, name, data) return null; } +function wdev_set_mesh_params(name, data) +{ + let mesh_cfg = {}; + + for (let key in mesh_params) { + let val = data[key]; + if (val == null) + continue; + mesh_cfg[mesh_params[key]] = int(val); + } + + if (!length(mesh_cfg)) + return null; + + nl80211.request(nl80211.const.NL80211_CMD_SET_MESH_CONFIG, 0, + { dev: name, mesh_params: mesh_cfg }); + + return nl80211.error(); +} + +function wdev_set_up(name, up) +{ + rtnl.request(rtnl.const.RTM_SETLINK, 0, { dev: name, change: 1, flags: up ? 1 : 0 }); +} + function phy_sysfs_file(phy, name) { return trim(readfile(`/sys/class/ieee80211/${phy}/${name}`)); @@ -315,4 +370,4 @@ function vlist_new(cb) { }, vlist_proto); } -export { wdev_remove, wdev_create, is_equal, vlist_new, phy_is_fullmac, phy_open }; +export { wdev_remove, wdev_create, wdev_set_mesh_params, wdev_set_up, is_equal, vlist_new, phy_is_fullmac, phy_open }; diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index 88f01caa93ebfd..b85f523b352fec 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}`); @@ -571,7 +571,7 @@ function iface_load_config(filename) let bss; let line; - while ((line = trim(f.read("line"))) != null) { + while ((line = rtrim(f.read("line"), "\n")) != null) { let val = split(line, "=", 2); if (!val[0]) continue; @@ -593,7 +593,7 @@ function iface_load_config(filename) push(config.radio.data, line); } - while ((line = trim(f.read("line"))) != null) { + while ((line = rtrim(f.read("line"), "\n")) != null) { if (line == "#default_macaddr") bss.default_macaddr = true; @@ -784,6 +784,7 @@ let main_obj = { hostapd.data.ubus = ubus; hostapd.data.obj = ubus.publish("hostapd", main_obj); +hostapd.udebug_set("hostapd", hostapd.data.ubus); function bss_event(type, name, data) { let ubus = hostapd.data.ubus; @@ -798,6 +799,7 @@ return { shutdown: function() { for (let phy in hostapd.data.config) iface_set_config(phy, null); + hostapd.udebug_set(null); hostapd.ubus.disconnect(); }, bss_add: function(name, obj) { diff --git a/package/network/services/hostapd/files/wdev.uc b/package/network/services/hostapd/files/wdev.uc index cf438f7715fc67..ff4d629fd64d0e 100644 --- a/package/network/services/hostapd/files/wdev.uc +++ b/package/network/services/hostapd/files/wdev.uc @@ -1,6 +1,6 @@ #!/usr/bin/env ucode 'use strict'; -import { vlist_new, is_equal, wdev_create, wdev_remove, phy_open } from "/usr/share/hostap/common.uc"; +import { vlist_new, is_equal, wdev_create, wdev_set_mesh_params, wdev_remove, wdev_set_up, phy_open } from "/usr/share/hostap/common.uc"; import { readfile, writefile, basename, readlink, glob } from "fs"; let libubus = require("ubus"); @@ -9,17 +9,6 @@ let phy = shift(ARGV); let command = shift(ARGV); let phydev; -const mesh_params = [ - "mesh_retry_timeout", "mesh_confirm_timeout", "mesh_holding_timeout", "mesh_max_peer_links", - "mesh_max_retries", "mesh_ttl", "mesh_element_ttl", "mesh_hwmp_max_preq_retries", - "mesh_path_refresh_time", "mesh_min_discovery_timeout", "mesh_hwmp_active_path_timeout", - "mesh_hwmp_preq_min_interval", "mesh_hwmp_net_diameter_traversal_time", "mesh_hwmp_rootmode", - "mesh_hwmp_rann_interval", "mesh_gate_announcements", "mesh_sync_offset_max_neighor", - "mesh_rssi_threshold", "mesh_hwmp_active_path_to_root_timeout", "mesh_hwmp_root_interval", - "mesh_hwmp_confirmation_interval", "mesh_awake_window", "mesh_plink_timeout", - "mesh_auto_open_plinks", "mesh_fwding", "mesh_power_mode" -]; - function iface_stop(wdev) { if (keep_devices[wdev.ifname]) @@ -33,7 +22,7 @@ function iface_start(wdev) let ifname = wdev.ifname; if (readfile(`/sys/class/net/${ifname}/ifindex`)) { - system([ "ip", "link", "set", "dev", ifname, "down" ]); + wdev_set_up(ifname, false); wdev_remove(ifname); } let wdev_config = {}; @@ -42,7 +31,7 @@ function iface_start(wdev) if (!wdev_config.macaddr && wdev.mode != "monitor") wdev_config.macaddr = phydev.macaddr_next(); wdev_create(phy, ifname, wdev_config); - system([ "ip", "link", "set", "dev", ifname, "up" ]); + wdev_set_up(ifname, true); if (wdev.freq) system(`iw dev ${ifname} set freq ${wdev.freq} ${wdev.htmode}`); if (wdev.mode == "adhoc") { @@ -60,19 +49,8 @@ function iface_start(wdev) push(cmd, key, wdev[key]); system(cmd); - cmd = ["iw", "dev", ifname, "set", "mesh_param" ]; - let len = length(cmd); - - for (let param in mesh_params) - if (wdev[param]) - push(cmd, param, wdev[param]); - - if (len == length(cmd)) - return; - - system(cmd); + wdev_set_mesh_params(ifname, wdev); } - } function iface_cb(new_if, old_if) diff --git a/package/network/services/hostapd/files/wpa_supplicant.uc b/package/network/services/hostapd/files/wpa_supplicant.uc index cb5f41b1af3ac0..1709bb019e3107 100644 --- a/package/network/services/hostapd/files/wpa_supplicant.uc +++ b/package/network/services/hostapd/files/wpa_supplicant.uc @@ -1,6 +1,6 @@ let libubus = require("ubus"); import { open, readfile } from "fs"; -import { wdev_create, wdev_remove, is_equal, vlist_new, phy_open } from "common"; +import { wdev_create, wdev_set_mesh_params, wdev_remove, is_equal, wdev_set_up, vlist_new, phy_open } from "common"; let ubus = libubus.connect(); @@ -40,6 +40,7 @@ function iface_start(phydev, iface, macaddr_list) let ret = wdev_create(phy, ifname, wdev_config); if (ret) wpas.printf(`Failed to create device ${ifname}: ${ret}`); + wdev_set_up(ifname, true); wpas.add_iface(iface.config); iface.running = true; } @@ -245,6 +246,7 @@ let main_obj = { wpas.data.ubus = ubus; wpas.data.obj = ubus.publish("wpa_supplicant", main_obj); +wpas.udebug_set("wpa_supplicant", wpas.data.ubus); function iface_event(type, name, data) { let ubus = wpas.data.ubus; @@ -316,6 +318,23 @@ return { } iface_hostapd_notify(phy, ifname, iface, state); + + if (state != "COMPLETED") + return; + + let phy_data = wpas.data.config[phy]; + if (!phy_data) + return; + + let iface_data = phy_data.data[ifname]; + if (!iface_data) + return; + + let wdev_config = iface_data.config; + if (!wdev_config || wdev_config.mode != "mesh") + return; + + wdev_set_mesh_params(ifname, wdev_config); }, event: function(ifname, iface, ev, info) { let phy = wpas.data.iface_phy[ifname]; diff --git a/package/network/services/hostapd/files/wpad_acl.json b/package/network/services/hostapd/files/wpad_acl.json index d00fd945ba5824..7532953cabda22 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/135-mbedtls-fix-owe-association.patch b/package/network/services/hostapd/patches/135-mbedtls-fix-owe-association.patch new file mode 100644 index 00000000000000..0c29432d3f83f3 --- /dev/null +++ b/package/network/services/hostapd/patches/135-mbedtls-fix-owe-association.patch @@ -0,0 +1,91 @@ +The code for hostapd-mbedtls did not work when used for OWE association. + +When handling association requests, the buffer offsets and length assumptions were incorrect, leading to never calculating the y point, thus denying association. + +Also when crafting the association response, the buffer contained the trailing key-type. + +Fix up both issues to adhere to the specification and make hostapd-mbedtls work with the OWE security type. + +--- a/src/crypto/crypto_mbedtls.c ++++ b/src/crypto/crypto_mbedtls.c +@@ -2299,25 +2299,30 @@ struct crypto_ecdh * crypto_ecdh_init2(i + struct wpabuf * crypto_ecdh_get_pubkey(struct crypto_ecdh *ecdh, int inc_y) + { + mbedtls_ecp_group *grp = &ecdh->grp; +- size_t len = CRYPTO_EC_plen(grp); ++ size_t prime_len = CRYPTO_EC_plen(grp); ++ size_t output_len = prime_len; ++ u8 output_offset = 0; ++ u8 buf[256]; ++ + #ifdef MBEDTLS_ECP_MONTGOMERY_ENABLED + /* len */ + #endif + #ifdef MBEDTLS_ECP_SHORT_WEIERSTRASS_ENABLED +- if (mbedtls_ecp_get_type(grp) == MBEDTLS_ECP_TYPE_SHORT_WEIERSTRASS) +- len = inc_y ? len*2+1 : len+1; ++ if (mbedtls_ecp_get_type(grp) == MBEDTLS_ECP_TYPE_SHORT_WEIERSTRASS) { ++ output_len = inc_y ? prime_len * 2 + 1 : prime_len + 1; ++ output_offset = 1; ++ } + #endif +- struct wpabuf *buf = wpabuf_alloc(len); +- if (buf == NULL) ++ ++ if (output_len > sizeof(buf)) + return NULL; ++ + inc_y = inc_y ? MBEDTLS_ECP_PF_UNCOMPRESSED : MBEDTLS_ECP_PF_COMPRESSED; +- if (mbedtls_ecp_point_write_binary(grp, &ecdh->Q, inc_y, &len, +- wpabuf_mhead_u8(buf), len) == 0) { +- wpabuf_put(buf, len); +- return buf; ++ if (mbedtls_ecp_point_write_binary(grp, &ecdh->Q, inc_y, &output_len, ++ buf, output_len) == 0) { ++ return wpabuf_alloc_copy(buf + output_offset, output_len - output_offset); + } + +- wpabuf_free(buf); + return NULL; + } + +@@ -2379,10 +2384,7 @@ struct wpabuf * crypto_ecdh_set_peerkey( + os_memcpy(buf+2, key, len); + } + len >>= 1; /*(repurpose len to prime_len)*/ +- } +- else if (key[0] == 0x02 || key[0] == 0x03) { /* (inc_y == 0) */ +- --len; /*(repurpose len to prime_len)*/ +- ++ } else { /* (inc_y == 0) */ + /* mbedtls_ecp_point_read_binary() does not currently support + * MBEDTLS_ECP_PF_COMPRESSED format (buf[1] = 0x02 or 0x03) + * (returns MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE) */ +@@ -2390,22 +2392,21 @@ struct wpabuf * crypto_ecdh_set_peerkey( + /* derive y, amend buf[] with y for UNCOMPRESSED format */ + if (sizeof(buf)-2 < len*2 || len == 0) + return NULL; ++ + buf[0] = (u8)(1+len*2); + buf[1] = 0x04; ++ os_memcpy(buf+2, key, len); ++ + mbedtls_mpi bn; + mbedtls_mpi_init(&bn); +- int ret = mbedtls_mpi_read_binary(&bn, key+1, len) +- || crypto_mbedtls_short_weierstrass_derive_y(grp, &bn, +- key[0] & 1) ++ int ret = mbedtls_mpi_read_binary(&bn, key, len) ++ || crypto_mbedtls_short_weierstrass_derive_y(grp, &bn, 0) + || mbedtls_mpi_write_binary(&bn, buf+2+len, len); + mbedtls_mpi_free(&bn); + if (ret != 0) + return NULL; + } + +- if (key[0] == 0) /*(repurpose len to prime_len)*/ +- len = CRYPTO_EC_plen(grp); +- + if (mbedtls_ecdh_read_public(&ecdh->ctx, buf, buf[0]+1)) + return NULL; + } diff --git a/package/network/services/hostapd/patches/301-mesh-noscan.patch b/package/network/services/hostapd/patches/301-mesh-noscan.patch index 6b5416f0ea57ec..ceb6d0c161f50b 100644 --- a/package/network/services/hostapd/patches/301-mesh-noscan.patch +++ b/package/network/services/hostapd/patches/301-mesh-noscan.patch @@ -24,8 +24,8 @@ frequency); goto out_free; } -+ if (ssid->noscan) -+ conf->noscan = 1; ++ if (conf->noscan) ++ ssid->noscan = 1; if (ssid->mesh_basic_rates == NULL) { /* @@ -45,7 +45,7 @@ unsigned int j; static const int ht40plus[] = { - 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157, 165, 173, -+ 1, 2, 3, 4, 5, 6, 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157, 165, 173, ++ 1, 2, 3, 4, 5, 6, 7, 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157, 165, 173, 184, 192 }; int ht40 = -1; @@ -58,6 +58,15 @@ u8 channel; bool is_6ghz; bool dfs_enabled = wpa_s->conf->country[0] && (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR); +@@ -3080,6 +3080,8 @@ void ibss_mesh_setup_freq(struct wpa_sup + freq->he_enabled = ibss_mesh_can_use_he(wpa_s, ssid, mode, + ieee80211_mode); + freq->channel = channel; ++ if (mode->mode == HOSTAPD_MODE_IEEE80211G && ssid->noscan) ++ ibss_mesh_select_40mhz(wpa_s, ssid, mode, freq, obss_scan, dfs_enabled); + /* Setup higher BW only for 5 GHz */ + if (mode->mode == HOSTAPD_MODE_IEEE80211A) { + ibss_mesh_select_40mhz(wpa_s, ssid, mode, freq, obss_scan, dfs_enabled); --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h @@ -1035,6 +1035,8 @@ struct wpa_ssid { diff --git a/package/network/services/hostapd/patches/310-rescan_immediately.patch b/package/network/services/hostapd/patches/310-rescan_immediately.patch index e12b2059b3e38c..6e0244bca29236 100644 --- a/package/network/services/hostapd/patches/310-rescan_immediately.patch +++ b/package/network/services/hostapd/patches/310-rescan_immediately.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -5767,7 +5767,7 @@ wpa_supplicant_alloc(struct wpa_supplica +@@ -5769,7 +5769,7 @@ wpa_supplicant_alloc(struct wpa_supplica if (wpa_s == NULL) return NULL; wpa_s->scan_req = INITIAL_SCAN_REQ; diff --git a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch index c6fe54efed0220..dc19553e26ea87 100644 --- a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -174,7 +174,7 @@ Signed-hostap: Antonio Quartulli * macsec_policy - Determines the policy for MACsec secure session --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -4175,6 +4175,12 @@ static void wpas_start_assoc_cb(struct w +@@ -4177,6 +4177,12 @@ static void wpas_start_assoc_cb(struct w params.beacon_int = ssid->beacon_int; else params.beacon_int = wpa_s->conf->beacon_int; diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index bc80ef0e813ae1..a6ccf83331fe3e 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -348,7 +348,7 @@ CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -7593,6 +7593,8 @@ struct wpa_supplicant * wpa_supplicant_a +@@ -7595,6 +7595,8 @@ struct wpa_supplicant * wpa_supplicant_a } #endif /* CONFIG_P2P */ @@ -357,7 +357,7 @@ return wpa_s; } -@@ -7619,6 +7621,8 @@ int wpa_supplicant_remove_iface(struct w +@@ -7621,6 +7623,8 @@ int wpa_supplicant_remove_iface(struct w struct wpa_supplicant *parent = wpa_s->parent; #endif /* CONFIG_MESH */ @@ -366,7 +366,7 @@ /* Remove interface from the global list of interfaces */ prev = global->ifaces; if (prev == wpa_s) { -@@ -7965,8 +7969,12 @@ int wpa_supplicant_run(struct wpa_global +@@ -7967,8 +7971,12 @@ int wpa_supplicant_run(struct wpa_global eloop_register_signal_terminate(wpa_supplicant_terminate, global); eloop_register_signal_reconfig(wpa_supplicant_reconfig, global); diff --git a/package/network/services/hostapd/patches/601-ucode_support.patch b/package/network/services/hostapd/patches/601-ucode_support.patch index de182b985d97b3..cfdb51f356cc1b 100644 --- a/package/network/services/hostapd/patches/601-ucode_support.patch +++ b/package/network/services/hostapd/patches/601-ucode_support.patch @@ -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/patches/992-nl80211-add-extra-ies-only-if-allowed-by-driver.patch b/package/network/services/hostapd/patches/992-nl80211-add-extra-ies-only-if-allowed-by-driver.patch new file mode 100644 index 00000000000000..c7b595da57dd54 --- /dev/null +++ b/package/network/services/hostapd/patches/992-nl80211-add-extra-ies-only-if-allowed-by-driver.patch @@ -0,0 +1,62 @@ +From: David Bauer +To: hostap@lists.infradead.org +Cc: =?utf-8?q?=C3=89tienne_Morice?= +Subject: [PATCH] nl80211: add extra-ies only if allowed by driver +Date: Sun, 30 Jan 2022 20:22:00 +0100 +Message-Id: <20220130192200.10883-1-mail@david-bauer.net> +List-Id: + +Upgrading wpa_supplicant from 2.9 to 2.10 breaks broadcom-wl +based adapters. The reason for it is hostapd tries to install additional +IEs for scanning while the driver does not support this. + +The kernel indicates the maximum number of bytes for additional scan IEs +using the NL80211_ATTR_MAX_SCAN_IE_LEN attribute. Save this value and +only add additional scan IEs in case the driver can accommodate these +additional IEs. + +Reported-by: Étienne Morice +Tested-by: Étienne Morice +Signed-off-by: David Bauer +--- + src/drivers/driver.h | 3 +++ + src/drivers/driver_nl80211_capa.c | 4 ++++ + src/drivers/driver_nl80211_scan.c | 2 +- + 3 files changed, 8 insertions(+), 1 deletion(-) + +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -2283,6 +2283,9 @@ struct wpa_driver_capa { + /** Maximum number of iterations in a single scan plan */ + u32 max_sched_scan_plan_iterations; + ++ /** Maximum number of extra IE bytes for scans */ ++ u16 max_scan_ie_len; ++ + /** Whether sched_scan (offloaded scanning) is supported */ + int sched_scan_supported; + +--- a/src/drivers/driver_nl80211_capa.c ++++ b/src/drivers/driver_nl80211_capa.c +@@ -949,6 +949,10 @@ static int wiphy_info_handler(struct nl_ + nla_get_u32(tb[NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS]); + } + ++ if (tb[NL80211_ATTR_MAX_SCAN_IE_LEN]) ++ capa->max_scan_ie_len = ++ nla_get_u16(tb[NL80211_ATTR_MAX_SCAN_IE_LEN]); ++ + if (tb[NL80211_ATTR_MAX_MATCH_SETS]) + capa->max_match_sets = + nla_get_u8(tb[NL80211_ATTR_MAX_MATCH_SETS]); +--- a/src/drivers/driver_nl80211_scan.c ++++ b/src/drivers/driver_nl80211_scan.c +@@ -222,7 +222,7 @@ nl80211_scan_common(struct i802_bss *bss + wpa_printf(MSG_DEBUG, "nl80211: Passive scan requested"); + } + +- if (params->extra_ies) { ++ if (params->extra_ies && drv->capa.max_scan_ie_len >= params->extra_ies_len) { + wpa_hexdump(MSG_MSGDUMP, "nl80211: Scan extra IEs", + params->extra_ies, params->extra_ies_len); + if (nla_put(msg, NL80211_ATTR_IE, params->extra_ies_len, diff --git a/package/network/services/hostapd/src/src/ap/ucode.c b/package/network/services/hostapd/src/src/ap/ucode.c index af97091be55e82..16d1b5153607b0 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 2beeb9a7ff6b6a..29c753c326905d 100644 --- a/package/network/services/hostapd/src/src/utils/ucode.c +++ b/package/network/services/hostapd/src/src/utils/ucode.c @@ -4,12 +4,71 @@ #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]; +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, +}; +#define UDEBUG_FLAG_RX_FRAME (1ULL << 0) +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), +}; +static struct udebug_ubus_ring udebug_rings[] = { + { + .buf = &ud_log, + .meta = &meta_log, + .default_entries = 1024, + .default_size = 64 * 1024 + }, + { + .buf = &ud_nl[0], + .meta = &meta_nl_rx, + .default_entries = 1024, + .default_size = 256 * 1024, + }, + { + .buf = &ud_nl[1], + .meta = &meta_nl_tx, + .default_entries = 1024, + .default_size = 64 * 1024, + }, + { + .buf = &ud_nl[2], + .meta = &meta_nl_ll, + .default_entries = 1024, + .default_size = 32 * 1024, + } +}; +char *udebug_service; +struct udebug_ubus ud_ubus; static void uc_gc_timer(struct uloop_timeout *timeout) { @@ -251,6 +310,114 @@ 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; + + if (!udebug_buf_valid(buf)) + return; + + udebug_entry_init(buf); + udebug_entry_append(buf, &hdr, sizeof(hdr)); + udebug_entry_append(buf, data, len); + udebug_entry_add(buf); +} + +static void +wpa_udebug_config(struct udebug_ubus *ctx, struct blob_attr *data, + bool enabled) +{ + udebug_ubus_apply_config(&ud, udebug_rings, ARRAY_SIZE(udebug_rings), + data, enabled); + + if (udebug_buf_valid(&ud_log)) { + wpa_printf_hook = udebug_printf_hook; + wpa_hexdump_hook = udebug_hexdump_hook; + } else { + wpa_printf_hook = NULL; + wpa_hexdump_hook = NULL; + } + + if (udebug_buf_valid(&ud_nl[0]) || + udebug_buf_valid(&ud_nl[1]) || + udebug_buf_valid(&ud_nl[2])) + wpa_netlink_hook = udebug_netlink_hook; + else + wpa_netlink_hook = NULL; +} + +uc_value_t *uc_wpa_udebug_set(uc_vm_t *vm, size_t nargs) +{ + uc_value_t *name = uc_fn_arg(0); + uc_value_t *ubus = uc_fn_arg(1); + static bool enabled = false; + struct ubus_context *ctx; + bool cur_en; + + cur_en = ucv_type(name) == UC_STRING; + ctx = ucv_resource_data(ubus, "ubus.connection"); + if (!ctx) + cur_en = false; + + if (enabled == cur_en) + return ucv_boolean_new(true); + + enabled = cur_en; + if (enabled) { + udebug_service = strdup(ucv_string_get(name)); + udebug_init(&ud); + udebug_auto_connect(&ud, NULL); + udebug_ubus_init(&ud_ubus, ctx, udebug_service, wpa_udebug_config); + } else { + udebug_ubus_free(&ud_ubus); + for (size_t i = 0; i < ARRAY_SIZE(udebug_rings); i++) + if (udebug_buf_valid(udebug_rings[i].buf)) + udebug_buf_free(udebug_rings[i].buf); + udebug_free(&ud); + free(udebug_service); + } + + 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 2c1886976ee5a2..c083241e079cf9 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 6cba73dcd53240..397f85bde7fe7a 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/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 0eadcc9a5d5b20..ba6358f7795a86 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_MIRROR_HASH:=e2e00e2bb6b7bacda5dcb713e4f9a4b1e316d75b140a4aa77145471bf6fe5c17 -PKG_SOURCE_DATE:=2023-06-24 -PKG_SOURCE_VERSION:=52112643308bb02a3b4fa2894dd7d4340ba4a237 +PKG_MIRROR_HASH:=9936331b64880260cf969cc5656e1e1a8b7dc0e0843d64621242c500a330b4d6 +PKG_SOURCE_DATE:=2023-10-24 +PKG_SOURCE_VERSION:=d8118f6e76e5519881f9a37137c3a06b3cb60fd2 PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 diff --git a/package/network/services/umdns/Makefile b/package/network/services/umdns/Makefile index b7564fa7c3e6d7..5689a6d78d24fa 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-01-16 -PKG_SOURCE_VERSION:=65b3308d13de7d7975444d34389651612e2a4d38 -PKG_MIRROR_HASH:=945fdf51a299b68982aab74e8fba5614f2553a7b4c49a3a53b3093ea8aac0279 +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 554b616633075e..032b498e680a4f 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/network/utils/bpftool/Makefile b/package/network/utils/bpftool/Makefile index cbbba2dba5964d..2782a307353ae9 100644 --- a/package/network/utils/bpftool/Makefile +++ b/package/network/utils/bpftool/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bpftools -PKG_VERSION:=7.2.0 +PKG_VERSION:=7.3.0 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://github.com/libbpf/bpftool +PKG_MIRROR_HASH:=c8fe336005019fee4d4fd416ce68a749fb479786dead69d6a0b3b04bcd903b98 PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=19ff0564980a7429e730f6987a0b0bf418b3c676 -PKG_MIRROR_HASH:=f9b9871f64986dd2e5dab7060bb919398256ba93964da49c62efaf0e6bc9bbc4 +PKG_SOURCE_VERSION:=v7.3.0 PKG_MAINTAINER:=Tony Ambardar diff --git a/package/network/utils/bpftool/patches/001-cflags.patch b/package/network/utils/bpftool/patches/001-cflags.patch index b06842a0be7f66..39cef10c72aac5 100644 --- a/package/network/utils/bpftool/patches/001-cflags.patch +++ b/package/network/utils/bpftool/patches/001-cflags.patch @@ -6,5 +6,5 @@ +CFLAGS = $(EXTRA_CFLAGS) CFLAGS ?= -g -O2 -Werror -Wall -std=gnu89 - ALL_CFLAGS += $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $(EXTRA_CFLAGS) - ALL_LDFLAGS += $(LDFLAGS) $(EXTRA_LDFLAGS) + ALL_CFLAGS += $(CFLAGS) \ + -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \ diff --git a/package/network/utils/ethtool/Makefile b/package/network/utils/ethtool/Makefile index 024fdf1e63febc..92ee2103c93212 100644 --- a/package/network/utils/ethtool/Makefile +++ b/package/network/utils/ethtool/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ethtool -PKG_VERSION:=6.4 +PKG_VERSION:=6.5 PKG_RELEASE:=1 PKG_MAINTAINER:=Felix Fietkau PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/network/ethtool -PKG_HASH:=5eaa083e8108e1dd3876b2c803a1942a2763942715b7f6eb916e189adbb44972 +PKG_HASH:=814171ea4b8026b081c0741dbbf32e6968311483ecf64711232faec2ac70a14c PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 194edcb35a9541..7f4556e7d38f41 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 -PKG_VERSION:=6.4.0 +PKG_VERSION:=6.5.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 -PKG_HASH:=4c51b8decbc7e4da159ffb066f590cfb93dbf9af7ff86b1647ce42b7c179a272 +PKG_HASH:=a70179085fa1b96d3c33b040c809b75e2b57563adc505a4ad05e2609df373463 PKG_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=iptables PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch b/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch index 2a3f9eb90f1d1f..ba6ca4c9b24880 100644 --- a/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch +++ b/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -65,9 +65,9 @@ WFLAGS += -Wmissing-declarations -Wold-s +@@ -67,9 +67,9 @@ WFLAGS += -Wmissing-declarations -Wold-s CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS) YACCFLAGS = -d -t -v diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile index 0d6d76fc080fca..45a2b49070e3da 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=iptables PKG_VERSION:=1.8.8 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=https://netfilter.org/projects/iptables/files PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 @@ -20,7 +20,7 @@ PKG_FIXUP:=autoreconf PKG_FLAGS:=nonshared PKG_INSTALL:=1 -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections no-lto PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0 PKG_CPE_ID:=cpe:/a:netfilter_core_team:iptables diff --git a/package/network/utils/iptables/patches/070-extensions-string-Review-parse_string-function.patch b/package/network/utils/iptables/patches/070-extensions-string-Review-parse_string-function.patch new file mode 100644 index 00000000000000..cfcb6c77f3864c --- /dev/null +++ b/package/network/utils/iptables/patches/070-extensions-string-Review-parse_string-function.patch @@ -0,0 +1,40 @@ +From da5b32fb4656ab69fe1156eb7e36c7c961839e8a Mon Sep 17 00:00:00 2001 +From: Phil Sutter +Date: Wed, 8 Jun 2022 13:45:13 +0200 +Subject: [PATCH] extensions: string: Review parse_string() function + +* Compare against sizeof(info->pattern) which is more clear than having + to know that this buffer is of size XT_STRING_MAX_PATTERN_SIZE + +* Invert the check and error early to reduce indenting + +* Pass info->patlen to memcpy() to avoid reading past end of 's' + +Signed-off-by: Phil Sutter +--- + extensions/libxt_string.c | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +--- a/extensions/libxt_string.c ++++ b/extensions/libxt_string.c +@@ -78,14 +78,13 @@ static void string_init(struct xt_entry_ + + static void + parse_string(const char *s, struct xt_string_info *info) +-{ ++{ + /* xt_string does not need \0 at the end of the pattern */ +- if (strlen(s) <= XT_STRING_MAX_PATTERN_SIZE) { +- memcpy(info->pattern, s, XT_STRING_MAX_PATTERN_SIZE); +- info->patlen = strnlen(s, XT_STRING_MAX_PATTERN_SIZE); +- return; +- } +- xtables_error(PARAMETER_PROBLEM, "STRING too long \"%s\"", s); ++ if (strlen(s) > sizeof(info->pattern)) ++ xtables_error(PARAMETER_PROBLEM, "STRING too long \"%s\"", s); ++ ++ info->patlen = strnlen(s, sizeof(info->pattern)); ++ memcpy(info->pattern, s, info->patlen); + } + + static void diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile index e5add395ff90b8..c6a14956fd1c95 100644 --- a/package/network/utils/iwinfo/Makefile +++ b/package/network/utils/iwinfo/Makefile @@ -17,6 +17,8 @@ PKG_MIRROR_HASH:=5eddf584a1c3ed5637162d6bfc573ed1ce3691fcb38bdd55bf9f1e11e82ccc4 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 +PKG_BUILD_FLAGS:=no-lto + IWINFO_ABI_VERSION:=20230701 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/utils/linux-atm/Makefile b/package/network/utils/linux-atm/Makefile index c74febcbbc39a3..43f4b6556b5818 100644 --- a/package/network/utils/linux-atm/Makefile +++ b/package/network/utils/linux-atm/Makefile @@ -21,6 +21,7 @@ PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ PKG_CPE_ID:=cpe:/a:linux-atm:linux-atm PKG_FIXUP:=autoreconf +PKG_FLAGS:=nonshared include $(INCLUDE_DIR)/package.mk @@ -98,6 +99,8 @@ endef $(foreach t,$(ATM_DEBUG_TOOLS),$(eval $(call GenAtmPlugin,atm-$(t),$(t)))) +TARGET_CFLAGS += -I$(LINUX_DIR)/user_headers/include + define Build/Configure $(call Build/Configure/Default) # prevent autoheader invocation diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile index 3078f5605ff318..38a8199d11dc09 100644 --- a/package/network/utils/nftables/Makefile +++ b/package/network/utils/nftables/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nftables -PKG_VERSION:=1.0.8 +PKG_VERSION:=1.0.9 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files -PKG_HASH:=9373740de41a82dbc98818e0a46a073faeb8a8d0689fa4fa1a74399c32bf3d50 +PKG_HASH:=a3c304cd9ba061239ee0474f9afb938a9bb99d89b960246f66f0c3a0a85e14cd PKG_MAINTAINER:= PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/uqmi/Makefile b/package/network/utils/uqmi/Makefile index 667171932161c3..26b588c7ef57fe 100644 --- a/package/network/utils/uqmi/Makefile +++ b/package/network/utils/uqmi/Makefile @@ -1,13 +1,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uqmi -PKG_RELEASE:=5 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/uqmi.git -PKG_SOURCE_DATE:=2022-05-04 -PKG_SOURCE_VERSION:=56cb2d4056fef132ccf78dfb6f3074ae5d109992 -PKG_MIRROR_HASH:=cc832b5318805df8c8387a3650f250dee72d5f1dbda4e4866b5503e186b2210c +PKG_SOURCE_DATE:=2023-10-29 +PKG_SOURCE_VERSION:=eea292401c388a4eb59c0caf5d00aa046c6059f4 +PKG_MIRROR_HASH:=744f7e2010bd16ca08b03551287a0e1d119e1e6e099f8abf935328d3d1344893 PKG_MAINTAINER:=Matti Laakso PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index eab7f1ea13d45d..f8e655455a54b5 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -38,6 +38,7 @@ proto_qmi_setup() { local ip4table ip6table local cid_4 pdh_4 cid_6 pdh_6 local ip_6 ip_prefix_length gateway_6 dns1_6 dns2_6 + local profile_pdptype json_get_vars device apn v6apn auth username password pincode delay modes json_get_vars pdptype profile v6profile dhcp dhcpv6 autoconnect plmn ip4table @@ -98,6 +99,37 @@ proto_qmi_setup() { fi done + # Check if UIM application is stuck in illegal state + local uim_state_timeout=0 + while true; do + json_load "$(uqmi -s -d "$device" --uim-get-sim-state)" + json_get_var card_application_state card_application_state + + # SIM card is either completely absent or state is labeled as illegal + # Try to power-cycle the SIM card to recover from this state + if [ -z "$card_application_state" -o "$card_application_state" = "illegal" ]; then + echo "SIM in illegal state - Power-cycling SIM" + + # Try to reset SIM application + uqmi -d "$device" --uim-power-off --uim-slot 1 + sleep 3 + uqmi -d "$device" --uim-power-on --uim-slot 1 + + if [ "$uim_state_timeout" -lt "$timeout" ] || [ "$timeout" = "0" ]; then + let uim_state_timeout++ + sleep 1 + continue + fi + + # Recovery failed + proto_notify_error "$interface" SIM_ILLEGAL_STATE + proto_block_restart "$interface" + return 1 + else + break + fi + done + if uqmi -s -d "$device" --uim-get-sim-state | grep -q '"Not supported"\|"Invalid QMI command"' && uqmi -s -d "$device" --get-pin-status | grep -q '"Not supported"\|"Invalid QMI command"' ; then [ -n "$pincode" ] && { @@ -185,15 +217,6 @@ proto_qmi_setup() { fi fi - if [ -n "$mcc" -a -n "$mnc" ]; then - uqmi -s -d "$device" --set-plmn --mcc "$mcc" --mnc "$mnc" > /dev/null 2>&1 || { - echo "Unable to set PLMN" - proto_notify_error "$interface" PLMN_FAILED - proto_block_restart "$interface" - return 1 - } - fi - # Cleanup current state if any uqmi -s -d "$device" --stop-network 0xffffffff --autoconnect > /dev/null 2>&1 uqmi -s -d "$device" --set-ip-family ipv6 --stop-network 0xffffffff --autoconnect > /dev/null 2>&1 @@ -221,8 +244,25 @@ proto_qmi_setup() { uqmi -s -d "$device" --network-register > /dev/null 2>&1 + # PLMN selection must happen after the call to network-register + if [ -n "$mcc" -a -n "$mnc" ]; then + uqmi -s -d "$device" --set-plmn --mcc "$mcc" --mnc "$mnc" > /dev/null 2>&1 || { + echo "Unable to set PLMN" + proto_notify_error "$interface" PLMN_FAILED + proto_block_restart "$interface" + return 1 + } + fi + + [ -n "$modes" ] && { + uqmi -s -d "$device" --set-network-modes "$modes" > /dev/null 2>&1 + sleep 3 + # Scan network to not rely on registration-timeout after RAT change + uqmi -s -d "$device" --network-scan > /dev/null 2>&1 + } + echo "Waiting for network registration" - sleep 1 + sleep 5 local registration_timeout=0 local registration_state="" while true; do @@ -247,11 +287,9 @@ proto_qmi_setup() { fi proto_notify_error "$interface" NETWORK_REGISTRATION_FAILED - proto_block_restart "$interface" return 1 done - [ -n "$modes" ] && uqmi -s -d "$device" --set-network-modes "$modes" > /dev/null 2>&1 echo "Starting network $interface" @@ -259,6 +297,13 @@ proto_qmi_setup() { [ "$pdptype" = "ip" -o "$pdptype" = "ipv6" -o "$pdptype" = "ipv4v6" ] || pdptype="ip" + # Configure PDP type and APN for profile 1. + # In case GGSN rejects IPv4v6 PDP, modem might not be able to + # establish a non-LTE data session. + profile_pdptype="$pdptype" + [ "$profile_pdptype" = "ip" ] && profile_pdptype="ipv4" + uqmi -s -d "$device" --modify-profile "3gpp,1" --apn "$apn" --pdp-type "$profile_pdptype" > /dev/null 2>&1 + if [ "$pdptype" = "ip" ]; then [ -z "$autoconnect" ] && autoconnect=1 [ "$autoconnect" = 0 ] && autoconnect="" diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index 379f5d8c9da3cc..7e3779e61e5ae6 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git -PKG_MIRROR_HASH:=4ec370a1cdc9fa69131f1403b064d2e05d54ee865411917410d7540454265319 -PKG_SOURCE_DATE:=2023-02-28 -PKG_SOURCE_VERSION:=bfe882d5ff4eeebb8f57c8a0f9b9e767a57870d8 +PKG_MIRROR_HASH:=e9953b038a2c2ed2c4783b66d1c0d0cea0deab2f2bfa6712929243e3197c3bdd +PKG_SOURCE_DATE:=2023-05-28 +PKG_SOURCE_VERSION:=3a07943e1e60699ba952e605f0cf23c82de356cb CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 7c829260d5ef89..0af90c7d4ade35 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=procd -PKG_RELEASE:=3 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_MIRROR_HASH:=a7e42525ae65eb1342e593a714e88bc59e46467cbb5a7fd7d7aca4a9815b7c0d -PKG_SOURCE_DATE:=2023-06-25 -PKG_SOURCE_VERSION:=2db836553e8fc318143b38dbc6e12b8625cf5c33 +PKG_MIRROR_HASH:=48e5d555b5beb15cf936e1d2433b8e614de64a4eaf25293f0211eeb9ac79d534 +PKG_SOURCE_DATE:=2023-11-28 +PKG_SOURCE_VERSION:=7e6c6efd6fbcc7955801c5e2ac915a90697e1fd9 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -40,7 +40,7 @@ CMAKE_OPTIONS += -DEARLY_PATH="$(TARGET_INIT_PATH)" define Package/procd/Default SECTION:=base CATEGORY:=Base system - DEPENDS:=+ubusd +ubus +libjson-script +ubox +libubox \ + DEPENDS:=+ubusd +ubus +libjson-script +ubox +libubox +libudebug \ +libubus +libblobmsg-json +libjson-c +jshn TITLE:=OpenWrt system process manager USERID:=:dialout=20 :audio=29 diff --git a/package/system/ubox/Makefile b/package/system/ubox/Makefile index e91763b074db35..ed55617cfa74e8 100644 --- a/package/system/ubox/Makefile +++ b/package/system/ubox/Makefile @@ -1,13 +1,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ubox -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubox.git -PKG_SOURCE_DATE:=2022-08-13 -PKG_SOURCE_VERSION:=4c7b720b9c63b826fb9404e454ae54f2ef5649d5 -PKG_MIRROR_HASH:=35178148034dfef36c5fda2bc8217617920bc1a3b86f72efbe87e85048a6a2a8 +PKG_SOURCE_DATE:=2023-11-30 +PKG_SOURCE_VERSION:=c08709cceb554cba02c935d1442f6a042fe6b2a8 +PKG_MIRROR_HASH:=719ae701546df7c5972352d778a980cbc9f48623dda86443398698837124818b CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -44,7 +44,7 @@ endef define Package/logd SECTION:=base CATEGORY:=Base system - DEPENDS:=+libubox +libubus +libblobmsg-json + DEPENDS:=+libubox +libubus +libblobmsg-json +libudebug TITLE:=OpenWrt system log implementation USERID:=logd=514:logd=514 endef @@ -63,10 +63,11 @@ define Package/ubox/install endef define Package/logd/install - $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d/ + $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d/ $(1)/usr/share/acl.d $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{logd,logread} $(1)/sbin/ $(INSTALL_BIN) ./files/log.init $(1)/etc/init.d/log + $(INSTALL_DATA) ./files/logd.json $(1)/usr/share/acl.d endef $(eval $(call BuildPackage,ubox)) diff --git a/package/system/ubox/files/logd.json b/package/system/ubox/files/logd.json new file mode 100644 index 00000000000000..f0b2fb1e12c322 --- /dev/null +++ b/package/system/ubox/files/logd.json @@ -0,0 +1,4 @@ +{ + "user": "logd", + "publish": [ "log" ] +} diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index 82c4dc601a235a..fdf16cfeeef2fa 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-28 +PKG_SOURCE_VERSION:=f84eb5998c6ea2d34989ca2d3254e56c66139313 +PKG_MIRROR_HASH:=d0c15a0275fa3d35accddb84611700bf601745ad68462bc18905bb65da931f21 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE)) CMAKE_INSTALL:=1 diff --git a/package/system/urandom-seed/Makefile b/package/system/urandom-seed/Makefile index 7c5524a9db89b9..8d5af88e79a8d2 100644 --- a/package/system/urandom-seed/Makefile +++ b/package/system/urandom-seed/Makefile @@ -18,6 +18,9 @@ define Build/Prepare mkdir -p $(PKG_BUILD_DIR) endef +define Build/Quilt +endef + define Build/Compile/Default endef Build/Compile = $(Build/Compile/Default) diff --git a/package/system/urngd/Makefile b/package/system/urngd/Makefile index 818f06b210db1f..477c5f24059dac 100644 --- a/package/system/urngd/Makefile +++ b/package/system/urngd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/urngd.git -PKG_SOURCE_DATE:=2023-07-25 -PKG_SOURCE_VERSION:=7aefb47be57df0467d97d539f7fe9e23e607a3b4 -PKG_MIRROR_HASH:=427d4228fd65cf4320b8c212e710b86bcbfcdd4239f4e67132b3b471f7437202 +PKG_SOURCE_DATE:=2023-11-01 +PKG_SOURCE_VERSION:=44365eb1e1165f2a44cb31f404b04cf85031718e +PKG_MIRROR_HASH:=743bdfacf1f1e779047a55fe8f388aaf31f6e55e8a4d0a00fcabffb68af2202e PKG_LICENSE:=GPL-2.0 BSD-3-Clause PKG_LICENSE_FILES:= diff --git a/package/utils/bsdiff/Makefile b/package/utils/bsdiff/Makefile index 32e59cea9c6965..d86be2dc0c6714 100644 --- a/package/utils/bsdiff/Makefile +++ b/package/utils/bsdiff/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bsdiff PKG_VERSION:=4.3 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.daemonology.net/bsdiff/ diff --git a/package/utils/bsdiff/patches/001-musl.patch b/package/utils/bsdiff/patches/001-musl.patch index 5232bc1fe78536..1eeb1140c007de 100644 --- a/package/utils/bsdiff/patches/001-musl.patch +++ b/package/utils/bsdiff/patches/001-musl.patch @@ -1,6 +1,6 @@ ---- a/bsdiff.c 2005-08-17 00:13:52.000000000 +0200 -+++ b/bsdiff.c 2016-02-21 01:39:31.157915765 +0100 -@@ -101,7 +101,7 @@ +--- a/bsdiff.c ++++ b/bsdiff.c +@@ -101,7 +101,7 @@ static void split(off_t *I,off_t *V,off_ if(start+len>kk) split(I,V,kk,start+len-kk,h); } @@ -9,7 +9,7 @@ { off_t buckets[256]; off_t i,h,len; -@@ -139,7 +139,7 @@ +@@ -139,7 +139,7 @@ static void qsufsort(off_t *I,off_t *V,u for(i=0;i #include @@ -71,7 +71,7 @@ { off_t y; -@@ -62,8 +62,8 @@ +@@ -62,8 +62,8 @@ int main(int argc,char * argv[]) int fd; ssize_t oldsize,newsize; ssize_t bzctrllen,bzdatalen; diff --git a/package/utils/bsdiff/patches/020-CVE-2014-9862.patch b/package/utils/bsdiff/patches/020-CVE-2014-9862.patch new file mode 100644 index 00000000000000..98a49312f3b473 --- /dev/null +++ b/package/utils/bsdiff/patches/020-CVE-2014-9862.patch @@ -0,0 +1,37 @@ +From: The FreeBSD Project +Bug: https://security-tracker.debian.org/tracker/CVE-2014-9862 +Subject: CVE-2014-9862 - check for a negative value on numbers of bytes + The implementation of bspatch does not check for a negative value on numbers + of bytes read from the diff and extra streams, allowing an attacker who + can control the patch file to write at arbitrary locations in the heap. + . + bspatch's main loop reads three numbers from the "control" stream in + the patch: X, Y and Z. The first two are the number of bytes to read + from "diff" and "extra" (and thus only non-negative), while the + third one could be positive or negative and moves the oldpos pointer + on the source image. These 3 values are 64bits signed ints (encoded + somehow on the file) that are later passed the function that reads + from the streams, but those values are not verified to be + non-negative. + . + Official report https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-9862 + The patch was downloaded from a link pointed by + https://security.freebsd.org/advisories/FreeBSD-SA-16:25.bsp + +--- + bspatch.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/bspatch.c ++++ b/bspatch.c +@@ -152,6 +152,10 @@ int main(int argc,char * argv[]) + }; + + /* Sanity-check */ ++ if ((ctrl[0] < 0) || (ctrl[1] < 0)) ++ errx(1,"Corrupt patch\n"); ++ ++ /* Sanity-check */ + if(newpos+ctrl[0]>newsize) + errx(1,"Corrupt patch\n"); + diff --git a/package/utils/bsdiff/patches/033-CVE-2020-14315.patch b/package/utils/bsdiff/patches/033-CVE-2020-14315.patch new file mode 100644 index 00000000000000..975cb181dcd9f9 --- /dev/null +++ b/package/utils/bsdiff/patches/033-CVE-2020-14315.patch @@ -0,0 +1,383 @@ +Description: patch for CVE-2020-14315 + A memory corruption vulnerability is present in bspatch as shipped in + Colin Percival’s bsdiff tools version 4.3. Insufficient checks when + handling external inputs allows an attacker to bypass the sanity checks + in place and write out of a dynamically allocated buffer boundaries. +Source: https://svnweb.freebsd.org/base/head/usr.bin/bsdiff/bspatch/bspatch.c?revision=352742&view=co +Author: tony mancill +Comment: The patch was created by comparing the Debian sources to the + "Confirmed Patched Version" [1] documented in the + X41 D-SEC GmbH Security Advisory: X41-2020-006 [2]. + References to FreeBSD capsicum have been dropped. Definitions for + TYPE_MINIMUM and TYPE_MAXIMUM have been borrowed from the Debian + coreutils package sources but originate in gnulib [3] and are used to + define OFF_MIN and OFF_MAX (limits of off_t). Whitespace changes from + the confirmed patched version are also included and keep the difference + between the Debian sources and the confirmed patched version minimal. + . + [1] https://svnweb.freebsd.org/base/head/usr.bin/bsdiff/bspatch/bspatch.c?revision=352742&view=co + [2] https://www.openwall.com/lists/oss-security/2020/07/09/2 + [3] https://www.gnu.org/software/gnulib/ +Last-Update: 2021-04-03 +Forwarded: not-needed +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=964796 + +--- a/bspatch.c ++++ b/bspatch.c +@@ -1,4 +1,6 @@ + /*- ++ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD ++ * + * Copyright 2003-2005 Colin Percival + * All rights reserved + * +@@ -25,55 +27,147 @@ + */ + + #if 0 +-__FBSDID("$FreeBSD: src/usr.bin/bsdiff/bspatch/bspatch.c,v 1.1 2005/08/06 01:59:06 cperciva Exp $"); ++__FBSDID("$FreeBSD$"); + #endif + + #include +-#include ++#include ++#include ++#include ++#include ++#include + #include ++#include + #include +-#include + #include +-#include ++ ++#ifndef O_BINARY ++#define O_BINARY 0 ++#endif ++#define HEADER_SIZE 32 ++ ++/* TYPE_MINIMUM and TYPE_MAXIMUM taken from coreutils */ ++#ifndef TYPE_MINIMUM ++#define TYPE_MINIMUM(t) \ ++ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) ++#endif ++#ifndef TYPE_MAXIMUM ++#define TYPE_MAXIMUM(t) \ ++ ((t) ((t) 0 < (t) -1 \ ++ ? (t) -1 \ ++ : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) ++#endif ++ ++#ifndef OFF_MAX ++#define OFF_MAX TYPE_MAXIMUM(off_t) ++#endif ++ ++#ifndef OFF_MIN ++#define OFF_MIN TYPE_MINIMUM(off_t) ++#endif ++ ++static char *newfile; ++static int dirfd = -1; ++ ++static void ++exit_cleanup(void) ++{ ++ ++ if (dirfd != -1 && newfile != NULL) ++ if (unlinkat(dirfd, newfile, 0)) ++ warn("unlinkat"); ++} ++ ++static inline off_t ++add_off_t(off_t a, off_t b) ++{ ++ off_t result; ++ ++#if __GNUC__ >= 5 || \ ++ (defined(__has_builtin) && __has_builtin(__builtin_add_overflow)) ++ if (__builtin_add_overflow(a, b, &result)) ++ errx(1, "Corrupt patch"); ++#else ++ if ((b > 0 && a > OFF_MAX - b) || (b < 0 && a < OFF_MIN - b)) ++ errx(1, "Corrupt patch"); ++ result = a + b; ++#endif ++ return result; ++} + + static off_t offtin(unsigned char *buf) + { + off_t y; + +- y=buf[7]&0x7F; +- y=y*256;y+=buf[6]; +- y=y*256;y+=buf[5]; +- y=y*256;y+=buf[4]; +- y=y*256;y+=buf[3]; +- y=y*256;y+=buf[2]; +- y=y*256;y+=buf[1]; +- y=y*256;y+=buf[0]; ++ y = buf[7] & 0x7F; ++ y = y * 256; y += buf[6]; ++ y = y * 256; y += buf[5]; ++ y = y * 256; y += buf[4]; ++ y = y * 256; y += buf[3]; ++ y = y * 256; y += buf[2]; ++ y = y * 256; y += buf[1]; ++ y = y * 256; y += buf[0]; + +- if(buf[7]&0x80) y=-y; ++ if (buf[7] & 0x80) ++ y = -y; + +- return y; ++ return (y); + } + +-int main(int argc,char * argv[]) ++static void ++usage(void) + { +- FILE * f, * cpf, * dpf, * epf; +- BZFILE * cpfbz2, * dpfbz2, * epfbz2; ++ ++ fprintf(stderr, "usage: bspatch oldfile newfile patchfile\n"); ++ exit(1); ++} ++ ++int main(int argc, char *argv[]) ++{ ++ FILE *f, *cpf, *dpf, *epf; ++ BZFILE *cpfbz2, *dpfbz2, *epfbz2; ++ char *directory, *namebuf; + int cbz2err, dbz2err, ebz2err; +- int fd; +- ssize_t oldsize,newsize; +- ssize_t bzctrllen,bzdatalen; +- unsigned char header[32],buf[8]; ++ int newfd, oldfd; ++ off_t oldsize, newsize; ++ off_t bzctrllen, bzdatalen; ++ unsigned char header[HEADER_SIZE], buf[8]; + unsigned char *old, *new; +- off_t oldpos,newpos; ++ off_t oldpos, newpos; + off_t ctrl[3]; +- off_t lenread; +- off_t i; ++ off_t i, lenread, offset; + +- if(argc!=4) errx(1,"usage: %s oldfile newfile patchfile\n",argv[0]); ++ if (argc != 4) ++ usage(); + + /* Open patch file */ +- if ((f = fopen(argv[3], "r")) == NULL) ++ if ((f = fopen(argv[3], "rb")) == NULL) ++ err(1, "fopen(%s)", argv[3]); ++ /* Open patch file for control block */ ++ if ((cpf = fopen(argv[3], "rb")) == NULL) ++ err(1, "fopen(%s)", argv[3]); ++ /* open patch file for diff block */ ++ if ((dpf = fopen(argv[3], "rb")) == NULL) + err(1, "fopen(%s)", argv[3]); ++ /* open patch file for extra block */ ++ if ((epf = fopen(argv[3], "rb")) == NULL) ++ err(1, "fopen(%s)", argv[3]); ++ /* open oldfile */ ++ if ((oldfd = open(argv[1], O_RDONLY | O_BINARY, 0)) < 0) ++ err(1, "open(%s)", argv[1]); ++ /* open directory where we'll write newfile */ ++ if ((namebuf = strdup(argv[2])) == NULL || ++ (directory = dirname(namebuf)) == NULL || ++ (dirfd = open(directory, O_DIRECTORY)) < 0) ++ err(1, "open %s", argv[2]); ++ free(namebuf); ++ if ((newfile = basename(argv[2])) == NULL) ++ err(1, "basename"); ++ /* open newfile */ ++ if ((newfd = openat(dirfd, newfile, ++ O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666)) < 0) ++ err(1, "open(%s)", argv[2]); ++ atexit(exit_cleanup); + + /* + File format: +@@ -90,104 +184,104 @@ int main(int argc,char * argv[]) + */ + + /* Read header */ +- if (fread(header, 1, 32, f) < 32) { ++ if (fread(header, 1, HEADER_SIZE, f) < HEADER_SIZE) { + if (feof(f)) +- errx(1, "Corrupt patch\n"); ++ errx(1, "Corrupt patch"); + err(1, "fread(%s)", argv[3]); + } + + /* Check for appropriate magic */ + if (memcmp(header, "BSDIFF40", 8) != 0) +- errx(1, "Corrupt patch\n"); ++ errx(1, "Corrupt patch"); + + /* Read lengths from header */ +- bzctrllen=offtin(header+8); +- bzdatalen=offtin(header+16); +- newsize=offtin(header+24); +- if((bzctrllen<0) || (bzdatalen<0) || (newsize<0)) +- errx(1,"Corrupt patch\n"); ++ bzctrllen = offtin(header + 8); ++ bzdatalen = offtin(header + 16); ++ newsize = offtin(header + 24); ++ if (bzctrllen < 0 || bzctrllen > OFF_MAX - HEADER_SIZE || ++ bzdatalen < 0 || bzctrllen + HEADER_SIZE > OFF_MAX - bzdatalen || ++ newsize < 0 || newsize > SSIZE_MAX) ++ errx(1, "Corrupt patch"); + + /* Close patch file and re-open it via libbzip2 at the right places */ + if (fclose(f)) + err(1, "fclose(%s)", argv[3]); +- if ((cpf = fopen(argv[3], "r")) == NULL) +- err(1, "fopen(%s)", argv[3]); +- if (fseeko(cpf, 32, SEEK_SET)) +- err(1, "fseeko(%s, %lld)", argv[3], +- (long long)32); ++ offset = HEADER_SIZE; ++ if (fseeko(cpf, offset, SEEK_SET)) ++ err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); + if ((cpfbz2 = BZ2_bzReadOpen(&cbz2err, cpf, 0, 0, NULL, 0)) == NULL) + errx(1, "BZ2_bzReadOpen, bz2err = %d", cbz2err); +- if ((dpf = fopen(argv[3], "r")) == NULL) +- err(1, "fopen(%s)", argv[3]); +- if (fseeko(dpf, 32 + bzctrllen, SEEK_SET)) +- err(1, "fseeko(%s, %lld)", argv[3], +- (long long)(32 + bzctrllen)); ++ offset = add_off_t(offset, bzctrllen); ++ if (fseeko(dpf, offset, SEEK_SET)) ++ err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); + if ((dpfbz2 = BZ2_bzReadOpen(&dbz2err, dpf, 0, 0, NULL, 0)) == NULL) + errx(1, "BZ2_bzReadOpen, bz2err = %d", dbz2err); +- if ((epf = fopen(argv[3], "r")) == NULL) +- err(1, "fopen(%s)", argv[3]); +- if (fseeko(epf, 32 + bzctrllen + bzdatalen, SEEK_SET)) +- err(1, "fseeko(%s, %lld)", argv[3], +- (long long)(32 + bzctrllen + bzdatalen)); ++ offset = add_off_t(offset, bzdatalen); ++ if (fseeko(epf, offset, SEEK_SET)) ++ err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); + if ((epfbz2 = BZ2_bzReadOpen(&ebz2err, epf, 0, 0, NULL, 0)) == NULL) + errx(1, "BZ2_bzReadOpen, bz2err = %d", ebz2err); + +- if(((fd=open(argv[1],O_RDONLY,0))<0) || +- ((oldsize=lseek(fd,0,SEEK_END))==-1) || +- ((old=malloc(oldsize+1))==NULL) || +- (lseek(fd,0,SEEK_SET)!=0) || +- (read(fd,old,oldsize)!=oldsize) || +- (close(fd)==-1)) err(1,"%s",argv[1]); +- if((new=malloc(newsize+1))==NULL) err(1,NULL); +- +- oldpos=0;newpos=0; +- while(newpos SSIZE_MAX || ++ (old = malloc(oldsize)) == NULL || ++ lseek(oldfd, 0, SEEK_SET) != 0 || ++ read(oldfd, old, oldsize) != oldsize || ++ close(oldfd) == -1) ++ err(1, "%s", argv[1]); ++ if ((new = malloc(newsize)) == NULL) ++ err(1, NULL); ++ ++ oldpos = 0; ++ newpos = 0; ++ while (newpos < newsize) { + /* Read control data */ +- for(i=0;i<=2;i++) { ++ for (i = 0; i <= 2; i++) { + lenread = BZ2_bzRead(&cbz2err, cpfbz2, buf, 8); + if ((lenread < 8) || ((cbz2err != BZ_OK) && + (cbz2err != BZ_STREAM_END))) +- errx(1, "Corrupt patch\n"); +- ctrl[i]=offtin(buf); +- }; ++ errx(1, "Corrupt patch"); ++ ctrl[i] = offtin(buf); ++ } + + /* Sanity-check */ +- if ((ctrl[0] < 0) || (ctrl[1] < 0)) +- errx(1,"Corrupt patch\n"); ++ if (ctrl[0] < 0 || ctrl[0] > INT_MAX || ++ ctrl[1] < 0 || ctrl[1] > INT_MAX) ++ errx(1, "Corrupt patch"); + + /* Sanity-check */ +- if(newpos+ctrl[0]>newsize) +- errx(1,"Corrupt patch\n"); ++ if (add_off_t(newpos, ctrl[0]) > newsize) ++ errx(1, "Corrupt patch"); + + /* Read diff string */ + lenread = BZ2_bzRead(&dbz2err, dpfbz2, new + newpos, ctrl[0]); + if ((lenread < ctrl[0]) || + ((dbz2err != BZ_OK) && (dbz2err != BZ_STREAM_END))) +- errx(1, "Corrupt patch\n"); ++ errx(1, "Corrupt patch"); + + /* Add old data to diff string */ +- for(i=0;i=0) && (oldpos+inewsize) +- errx(1,"Corrupt patch\n"); ++ if (add_off_t(newpos, ctrl[1]) > newsize) ++ errx(1, "Corrupt patch"); + + /* Read extra string */ + lenread = BZ2_bzRead(&ebz2err, epfbz2, new + newpos, ctrl[1]); + if ((lenread < ctrl[1]) || + ((ebz2err != BZ_OK) && (ebz2err != BZ_STREAM_END))) +- errx(1, "Corrupt patch\n"); ++ errx(1, "Corrupt patch"); + + /* Adjust pointers */ +- newpos+=ctrl[1]; +- oldpos+=ctrl[2]; +- }; ++ newpos = add_off_t(newpos, ctrl[1]); ++ oldpos = add_off_t(oldpos, ctrl[2]); ++ } + + /* Clean up the bzip2 reads */ + BZ2_bzReadClose(&cbz2err, cpfbz2); +@@ -197,12 +291,13 @@ int main(int argc,char * argv[]) + err(1, "fclose(%s)", argv[3]); + + /* Write the new file */ +- if(((fd=open(argv[2],O_CREAT|O_TRUNC|O_WRONLY,0666))<0) || +- (write(fd,new,newsize)!=newsize) || (close(fd)==-1)) +- err(1,"%s",argv[2]); ++ if (write(newfd, new, newsize) != newsize || close(newfd) == -1) ++ err(1, "%s", argv[2]); ++ /* Disable atexit cleanup */ ++ newfile = NULL; + + free(new); + free(old); + +- return 0; ++ return (0); + } diff --git a/package/utils/debugcc/Makefile b/package/utils/debugcc/Makefile new file mode 100644 index 00000000000000..2a72f1773064e8 --- /dev/null +++ b/package/utils/debugcc/Makefile @@ -0,0 +1,32 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=debugcc +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL=https://github.com/linux-msm/debugcc.git +PKG_SOURCE_DATE:=2023-11-10 +PKG_SOURCE_VERSION:=d15bea7c05f224a85dd1fcec24b0f153dbad9f6e +PKG_MIRROR_HASH:=b6bd181db4992cf429343cd7d0fdde0f937a8f1811f5fe9e7855a0d76b0d88a0 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +PKG_MAINTAINER:=Christian Marangi + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/meson.mk + +define Package/debugcc + SECTION:=utils + CATEGORY:=Utilities + TITLE:=QCOM debugcc utility + DEPENDS:=@KERNEL_DEVMEM @(TARGET_qualcommax||TARGET_ipq806x||TARGET_ipq40xx) +endef + +define Package/debugcc/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(MESON_BUILD_DIR)/debugcc $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,debugcc)) diff --git a/package/utils/dtc/Makefile b/package/utils/dtc/Makefile index dc10e9c5195b17..afec6fbae54085 100644 --- a/package/utils/dtc/Makefile +++ b/package/utils/dtc/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dtc PKG_VERSION:=1.7.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_HASH:=29edce3d302a15563d8663198bbc398c5a0554765c83830d0d4c0409d21a16c4 @@ -35,6 +35,17 @@ define Package/dtc/description format for booting kernels on embedded systems. endef +define Package/dtc/config + config DTC_STATIC_BUILD + depends on PACKAGE_dtc + bool "Build dtc as static binary" + default n + help + Builds dtc as a static binary. + This is usefull in order to export live DTS from a device running + various vendor modified OpenWrt versions. +endef + define Package/dtc/install $(INSTALL_DIR) $(1)/usr/bin $(CP) $(PKG_INSTALL_DIR)/usr/bin/dtc $(1)/usr/bin @@ -80,7 +91,8 @@ MESON_ARGS += \ -Dtools=true \ -Dyaml=disabled \ -Dvalgrind=disabled \ - -Dpython=disabled + -Dpython=disabled \ + -Dstatic-build=$(if $(CONFIG_DTC_STATIC_BUILD),true,false) define Build/InstallDev $(INSTALL_DIR) $(1)/usr/lib diff --git a/package/utils/f2fs-tools/Makefile b/package/utils/f2fs-tools/Makefile index 27a6fd2248ea0d..d5dc1a6d7824a1 100644 --- a/package/utils/f2fs-tools/Makefile +++ b/package/utils/f2fs-tools/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=f2fs-tools PKG_VERSION:=1.16.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/ @@ -133,10 +133,10 @@ Package/mkf2fs-selinux/install = $(Package/mkf2fs/install) define Package/f2fsck/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fsck.f2fs $(1)/usr/sbin - ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/defrag.f2fs - ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/dump.f2fs - ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/sload.f2fs - ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/resize.f2fs + $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/defrag.f2fs + $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/dump.f2fs + $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/sload.f2fs + $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/resize.f2fs endef Package/f2fsck-selinux/install = $(Package/f2fsck/install) diff --git a/package/utils/firmware-utils/Makefile b/package/utils/firmware-utils/Makefile index 1316fa5c6b1803..432d3797ac0181 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/package/utils/lua/Makefile b/package/utils/lua/Makefile index 9496ffb366be97..46e7bb0dcdb6c3 100644 --- a/package/utils/lua/Makefile +++ b/package/utils/lua/Makefile @@ -21,6 +21,8 @@ PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYRIGHT PKG_CPE_ID:=cpe:/a:lua:lua +PKG_BUILD_FLAGS:=no-lto + HOST_PATCH_DIR := ./patches-host include $(INCLUDE_DIR)/package.mk diff --git a/package/utils/mtd-utils/Makefile b/package/utils/mtd-utils/Makefile index bd53e071d5f6af..fd1cb75e51e48a 100644 --- a/package/utils/mtd-utils/Makefile +++ b/package/utils/mtd-utils/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mtd-utils -PKG_VERSION:=2.1.5 +PKG_VERSION:=2.1.6 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://infraroot.at/pub/mtd/ -PKG_HASH:=386e27fd121699b6b729bc2e8e04dda987b31cca6b16e12fb6cc6dcf26449f46 +PKG_HASH:=c1d853bc4adf83bcabd2792fc95af33bdd8643c97e8f7b3f0180af36af76f0e5 PKG_INSTALL:=1 PKG_FIXUP:=autoreconf diff --git a/package/utils/nvram/files/nvram-bcm53xx.init b/package/utils/nvram/files/nvram-bcm53xx.init index 2e9c9f3fce52d4..f47c944897cdf7 100755 --- a/package/utils/nvram/files/nvram-bcm53xx.init +++ b/package/utils/nvram/files/nvram-bcm53xx.init @@ -9,6 +9,7 @@ clear_partialboots() { # clear partialboots case $(board_name) in + linksys,ea9200|\ linksys,panamera) COMMIT=1 nvram set partialboots=0 diff --git a/package/utils/px5g-mbedtls/Makefile b/package/utils/px5g-mbedtls/Makefile index 6de5e55d0666c0..14c9f684a96d93 100644 --- a/package/utils/px5g-mbedtls/Makefile +++ b/package/utils/px5g-mbedtls/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=px5g-mbedtls -PKG_RELEASE:=9 +PKG_RELEASE:=10 PKG_LICENSE:=LGPL-2.1 PKG_BUILD_FLAGS:=no-mips16 diff --git a/package/utils/px5g-mbedtls/px5g-mbedtls.c b/package/utils/px5g-mbedtls/px5g-mbedtls.c index 4e0a73ab0a7034..85abe7dc73febf 100644 --- a/package/utils/px5g-mbedtls/px5g-mbedtls.c +++ b/package/utils/px5g-mbedtls/px5g-mbedtls.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -55,10 +56,13 @@ static int _urandom(void *ctx, unsigned char *out, size_t len) return 0; } -static void write_file(const char *path, int len, bool pem) +static void write_file(const char *path, size_t len, bool pem, bool cert) { - FILE *f = stdout; + mode_t mode = S_IRUSR | S_IWUSR; const char *buf_start = buf; + int fd = STDERR_FILENO; + ssize_t written; + int err; if (!pem) buf_start += sizeof(buf) - len; @@ -67,17 +71,30 @@ static void write_file(const char *path, int len, bool pem) fprintf(stderr, "No data to write\n"); exit(1); } + + if (cert) + mode |= S_IRGRP | S_IROTH; - if (!f) { + if (path) + fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, mode); + + if (fd < 0) { fprintf(stderr, "error: I/O error\n"); exit(1); } + written = write(fd, buf_start, len); + if (written != len) { + fprintf(stderr, "writing key failed with: %s\n", strerror(errno)); + exit(1); + } + err = fsync(fd); + if (err < 0) { + fprintf(stderr, "syncing key failed with: %s\n", strerror(errno)); + exit(1); + } if (path) - f = fopen(path, "w"); - - fwrite(buf_start, 1, len, f); - fclose(f); + close(fd); } static mbedtls_ecp_group_id ecp_curve(const char *name) @@ -110,7 +127,7 @@ static void write_key(mbedtls_pk_context *key, const char *path, bool pem) len = 0; } - write_file(path, len, pem); + write_file(path, len, pem, false); } static void gen_key(mbedtls_pk_context *key, bool rsa, int ksize, int exp, @@ -301,7 +318,7 @@ int selfsigned(char **arg) return 1; } } - write_file(certpath, len, pem); + write_file(certpath, len, pem, true); mbedtls_x509write_crt_free(&cert); mbedtls_mpi_free(&serial); diff --git a/package/utils/px5g-wolfssl/Makefile b/package/utils/px5g-wolfssl/Makefile index 843f03fcc11391..ba208f6ca590de 100644 --- a/package/utils/px5g-wolfssl/Makefile +++ b/package/utils/px5g-wolfssl/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=px5g-wolfssl -PKG_RELEASE:=8.2 +PKG_RELEASE:=9 PKG_LICENSE:=GPL-2.0-or-later PKG_BUILD_FLAGS:=no-mips16 diff --git a/package/utils/px5g-wolfssl/px5g-wolfssl.c b/package/utils/px5g-wolfssl/px5g-wolfssl.c index cd04a41dfb85a5..755d370ba2d3b6 100644 --- a/package/utils/px5g-wolfssl/px5g-wolfssl.c +++ b/package/utils/px5g-wolfssl/px5g-wolfssl.c @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include #include #include @@ -24,27 +26,38 @@ enum { RSA_KEY_TYPE = 1, }; -int write_file(byte *buf, int bufSz, char *path) { - int ret; - FILE *file; +int write_file(byte *buf, int bufSz, char *path, bool cert) { + mode_t mode = S_IRUSR | S_IWUSR; + ssize_t written; + int err; + int fd; + + if (cert) + mode |= S_IRGRP | S_IROTH; + if (path) { - file = fopen(path, "wb"); - if (file == NULL) { + fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, mode); + if (fd < 0) { perror("Error opening file"); exit(1); } } else { - file = stdout; + fd = STDERR_FILENO; } - ret = (int)fwrite(buf, 1, bufSz, file); - if (path) { - fclose(file); + written = write(fd, buf, bufSz); + if (written != bufSz) { + perror("Error write file"); + exit(1); } - if (ret > 0) { - /* ret > 0 indicates a successful file write, set to zero for return */ - ret = 0; + err = fsync(fd); + if (err < 0) { + perror("Error fsync file"); + exit(1); } - return ret; + if (path) { + close(fd); + } + return 0; } int write_key(ecc_key *ecKey, RsaKey *rsaKey, int type, int keySz, char *fName, @@ -73,9 +86,9 @@ int write_key(ecc_key *ecKey, RsaKey *rsaKey, int type, int keySz, char *fName, fprintf(stderr, "DER to PEM failed: %d\n", ret); } pemSz = ret; - ret = write_file(pem, pemSz, fName); + ret = write_file(pem, pemSz, fName, false); } else { - ret = write_file(der, derSz, fName); + ret = write_file(der, derSz, fName, false); } return ret; } @@ -281,7 +294,7 @@ int selfsigned(WC_RNG *rng, char **arg) { } pemSz = ret; - ret = write_file(pemBuf, pemSz, certpath); + ret = write_file(pemBuf, pemSz, certpath, true); if (ret != 0) { fprintf(stderr, "Write Cert failed: %d\n", ret); return ret; diff --git a/package/utils/ucode/Makefile b/package/utils/ucode/Makefile index e2fe4c8bad40da..670b9343760e90 100644 --- a/package/utils/ucode/Makefile +++ b/package/utils/ucode/Makefile @@ -12,21 +12,31 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=https://github.com/jow-/ucode.git -PKG_SOURCE_DATE:=2023-06-06 -PKG_SOURCE_VERSION:=c7d84aae09691a99ae3db427c0b2463732ef84f4 -PKG_MIRROR_HASH:=38826ae70d886d1d7ada3fc6591ac807169aa28107f60f7f2e617520083525fb +PKG_SOURCE_DATE:=2023-11-30 +PKG_SOURCE_VERSION:=6e89b89e95bbb140bbff5ab72b8c9632727bf6a6 +PKG_MIRROR_HASH:=20ba99f8c2591b581cdf0245dd40301e517659193cddaa3a3888125fcc85b2aa PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC -PKG_ABI_VERSION:=20220812 +PKG_ABI_VERSION:=20230711 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk CMAKE_OPTIONS += -DSOVERSION=$(PKG_ABI_VERSION) + +ifeq ($(HOST_OS),Darwin) + CMAKE_HOST_OPTIONS += \ + -DCMAKE_SKIP_RPATH=FALSE \ + -DCMAKE_MACOSX_RPATH=1 \ + -DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOSTPKG}/lib" +else + CMAKE_HOST_OPTIONS += \ + -DSOVERSION=$(PKG_ABI_VERSION) +endif + CMAKE_HOST_OPTIONS += \ - -DSOVERSION=$(PKG_ABI_VERSION) \ -DFS_SUPPORT=ON \ -DMATH_SUPPORT=ON \ -DNL80211_SUPPORT=OFF \ @@ -35,7 +45,9 @@ CMAKE_HOST_OPTIONS += \ -DSTRUCT_SUPPORT=ON \ -DUBUS_SUPPORT=OFF \ -DUCI_SUPPORT=OFF \ - -DULOOP_SUPPORT=OFF + -DULOOP_SUPPORT=OFF \ + -DDEBUG_SUPPORT=ON \ + -DLOG_SUPPORT=OFF define Package/ucode/default @@ -70,105 +82,29 @@ define Package/libucode/description The libucode package provides the shared runtime library for the ucode interpreter. endef +# 1: name +# 2: cmake symbol +# 3: depends +# 4: description +define UcodeModule + UCODE_MODULES += ucode-mod-$(strip $(1)) + CMAKE_OPTIONS += -D$(strip $(2))=$(if $(CONFIG_PACKAGE_ucode-mod-$(strip $(1))),ON,OFF) + PKG_CONFIG_DEPENDS += CONFIG_PACKAGE_ucode-mod-$(strip $(1)) -define Package/ucode-mod-fs - $(Package/ucode/default) - TITLE+= (filesystem module) - DEPENDS:=ucode -endef - -define Package/ucode-mod-fs/description - The filesystem plugin module allows interaction with the local file system. -endef - - -define Package/ucode-mod-math - $(Package/ucode/default) - TITLE+= (math module) - DEPENDS:=ucode -endef - -define Package/ucode-mod-math/description - The math plugin provides access to various procedures. -endef - - -define Package/ucode-mod-nl80211 - $(Package/ucode/default) - TITLE+= (nl80211 module) - DEPENDS:=ucode +libnl-tiny +libubox -endef - -define Package/ucode-mod-nl80211/description - The nl80211 plugin provides access to the Linux wireless 802.11 netlink API. -endef - - -define Package/ucode-mod-resolv - $(Package/ucode/default) - TITLE+= (resolv module) - DEPENDS:=ucode -endef - -define Package/ucode-mod-resolv/description - The resolv plugin implements simple DNS resolving. -endef - - -define Package/ucode-mod-rtnl - $(Package/ucode/default) - TITLE+= (rtnl module) - DEPENDS:=ucode +libnl-tiny +libubox -endef - -define Package/ucode-mod-rtnl/description - The rtnl plugin provides access to the Linux routing netlink API. -endef - - -define Package/ucode-mod-struct + define Package/ucode-mod-$(strip $(1)) $(Package/ucode/default) - TITLE+= (struct module) - DEPENDS:=ucode -endef - -define Package/ucode-mod-struct/description - The struct plugin implements Python 3 compatible struct.pack/unpack functionality. -endef - - -define Package/ucode-mod-ubus - $(Package/ucode/default) - TITLE+= (ubus module) - DEPENDS:=ucode +libubus +libblobmsg-json -endef - -define Package/ucode-mod-ubus/description - The ubus module allows ucode template scripts to enumerate and invoke ubus - procedures. -endef - - -define Package/ucode-mod-uci - $(Package/ucode/default) - TITLE+= (uci module) - DEPENDS:=ucode +libuci -endef - -define Package/ucode-mod-uci/description - The uci module allows templates to read and modify uci configuration. -endef - + TITLE+= ($(strip $(1)) module) + DEPENDS:=ucode $(3) + endef -define Package/ucode-mod-uloop - $(Package/ucode/default) - TITLE+= (uloop module) - DEPENDS:=ucode +libubox -endef + define Package/ucode-mod-$(strip $(1))/description + $(strip $(4)) + endef -define Package/ucode-mod-uloop/description - The uloop module allows ucode scripts to interact with OpenWrt uloop event - loop implementation. + define Package/ucode-mod-$(strip $(1))/install + $(INSTALL_DIR) $$(1)/usr/lib/ucode + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/$(strip $(1)).so $$(1)/usr/lib/ucode/ + endef endef @@ -189,60 +125,55 @@ define Package/libucode/install $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so.* $(1)/usr/lib/ endef -define Package/ucode-mod-fs/install - $(INSTALL_DIR) $(1)/usr/lib/ucode - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/fs.so $(1)/usr/lib/ucode/ -endef -define Package/ucode-mod-math/install - $(INSTALL_DIR) $(1)/usr/lib/ucode - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/math.so $(1)/usr/lib/ucode/ -endef +$(eval $(call UcodeModule, \ + debug, DEBUG_SUPPORT, +libubox +libucode, \ + The debug plugin module provides runtime debugging and introspection facilities.)) -define Package/ucode-mod-nl80211/install - $(INSTALL_DIR) $(1)/usr/lib/ucode - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/nl80211.so $(1)/usr/lib/ucode/ -endef +$(eval $(call UcodeModule, \ + fs, FS_SUPPORT, , \ + The filesystem plugin module allows interaction with the local file system.)) -define Package/ucode-mod-resolv/install - $(INSTALL_DIR) $(1)/usr/lib/ucode - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/resolv.so $(1)/usr/lib/ucode/ -endef +$(eval $(call UcodeModule, \ + log, LOG_SUPPORT, +libubox, \ + The log plugin module provides access to the syslog and libubox ulog APIs.)) -define Package/ucode-mod-rtnl/install - $(INSTALL_DIR) $(1)/usr/lib/ucode - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/rtnl.so $(1)/usr/lib/ucode/ -endef +$(eval $(call UcodeModule, \ + math, MATH_SUPPORT, , \ + The math plugin provides access to various procedures.)) -define Package/ucode-mod-struct/install - $(INSTALL_DIR) $(1)/usr/lib/ucode - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/struct.so $(1)/usr/lib/ucode/ -endef +$(eval $(call UcodeModule, \ + nl80211, NL80211_SUPPORT, +libnl-tiny +libubox, \ + The nl80211 plugin provides access to the Linux wireless 802.11 netlink API.)) -define Package/ucode-mod-ubus/install - $(INSTALL_DIR) $(1)/usr/lib/ucode - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/ubus.so $(1)/usr/lib/ucode/ -endef +$(eval $(call UcodeModule, \ + resolv, RESOLV_SUPPORT, , \ + The resolv plugin implements simple DNS resolving.)) -define Package/ucode-mod-uci/install - $(INSTALL_DIR) $(1)/usr/lib/ucode - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/uci.so $(1)/usr/lib/ucode/ -endef +$(eval $(call UcodeModule, \ + rtnl, RTNL_SUPPORT, +libnl-tiny +libubox, \ + The rtnl plugin provides access to the Linux routing netlink API.)) -define Package/ucode-mod-uloop/install - $(INSTALL_DIR) $(1)/usr/lib/ucode - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/uloop.so $(1)/usr/lib/ucode/ -endef +$(eval $(call UcodeModule, \ + struct, STRUCT_SUPPORT, , \ + The struct plugin implements Python 3 compatible struct.pack/unpack functionality.)) + +$(eval $(call UcodeModule, \ + ubus, UBUS_SUPPORT, +libubus +libblobmsg-json, \ + The ubus module allows ucode template scripts to enumerate and invoke ubus procedures.)) + +$(eval $(call UcodeModule, \ + uci, UCI_SUPPORT, +libuci, \ + The uci module allows templates to read and modify uci configuration.)) + +$(eval $(call UcodeModule, \ + uloop, ULOOP_SUPPORT, +libubox, \ + The uloop module allows ucode scripts to interact with OpenWrt uloop event loop implementation.)) $(eval $(call BuildPackage,libucode)) $(eval $(call BuildPackage,ucode)) -$(eval $(call BuildPackage,ucode-mod-fs)) -$(eval $(call BuildPackage,ucode-mod-math)) -$(eval $(call BuildPackage,ucode-mod-nl80211)) -$(eval $(call BuildPackage,ucode-mod-resolv)) -$(eval $(call BuildPackage,ucode-mod-rtnl)) -$(eval $(call BuildPackage,ucode-mod-struct)) -$(eval $(call BuildPackage,ucode-mod-ubus)) -$(eval $(call BuildPackage,ucode-mod-uci)) -$(eval $(call BuildPackage,ucode-mod-uloop)) + +$(foreach mod,$(UCODE_MODULES), \ + $(eval $(call BuildPackage,$(mod)))) + $(eval $(call HostBuild)) diff --git a/package/utils/util-linux/Makefile b/package/utils/util-linux/Makefile index 90724eb3f62475..2ab72a2d2c8c2c 100644 --- a/package/utils/util-linux/Makefile +++ b/package/utils/util-linux/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=util-linux -PKG_VERSION:=2.39 -PKG_RELEASE:=2 +PKG_VERSION:=2.39.2 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.39 -PKG_HASH:=32b30a336cda903182ed61feb3e9b908b762a5e66fe14e43efb88d37162075cb +PKG_HASH:=87abdfaa8e490f8be6dde976f7c80b9b5ff9f301e1b67e3899e1f05a59a1531f PKG_CPE_ID:=cpe:/a:kernel:util-linux PKG_LICENSE:=GPL-2.0-only diff --git a/package/utils/util-linux/patches/0001-test_enosys-add-support-for-mips.patch b/package/utils/util-linux/patches/0001-test_enosys-add-support-for-mips.patch deleted file mode 100644 index f8c8f851ec6103..00000000000000 --- a/package/utils/util-linux/patches/0001-test_enosys-add-support-for-mips.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 2558932c65524d953e4c86d7fda2282a582aa5ec Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= -Date: Wed, 17 May 2023 16:50:47 +0200 -Subject: [PATCH] test_enosys: add support for mips, powerpc and arc -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Thomas Weißschuh ---- - tests/helpers/test_enosys.c | 14 ++ - 1 file changed, 2 insertions(+) - ---- a/tests/helpers/test_enosys.c -+++ b/tests/helpers/test_enosys.c -@@ -53,6 +53,20 @@ - # else - # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_PPC64LE - # endif -+#elif __powerpc__ -+# define SECCOMP_ARCH_NATIVE AUDIT_ARCH_PPC -+#elif __mips__ -+# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -+# define SECCOMP_ARCH_NATIVE AUDIT_ARCH_MIPS -+# else -+# define SECCOMP_ARCH_NATIVE AUDIT_ARCH_MIPSEL -+# endif -+#elif __arc__ -+# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -+# define SECCOMP_ARCH_NATIVE AUDIT_ARCH_ARCV2BE -+# else -+# define SECCOMP_ARCH_NATIVE AUDIT_ARCH_ARCV2 -+# endif - #else - # error Unknown target architecture - #endif diff --git a/package/utils/util-linux/patches/001-meson-properly-handle-gettext-non-existence.patch b/package/utils/util-linux/patches/001-meson-properly-handle-gettext-non-existence.patch new file mode 100644 index 00000000000000..f3d49d8d2dea1d --- /dev/null +++ b/package/utils/util-linux/patches/001-meson-properly-handle-gettext-non-existence.patch @@ -0,0 +1,28 @@ +From b8bed37a1493b913bf5bda938487ae0c06c11ce7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= +Date: Sat, 5 Aug 2023 08:57:28 +0200 +Subject: [PATCH] meson: properly handle gettext non-existence +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit e91a49c9747f ("meson: don't build po if no gettext") +tried to add the possibility to build util-linux without gettext. + +Unfortunately by default the call to find_program() would abort the +build if the program is not found. +Avoid aborting the build. + +Signed-off-by: Thomas Weißschuh +--- + po/meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/po/meson.build ++++ b/po/meson.build +@@ -1,4 +1,4 @@ +-if not find_program('gettext').found() ++if not find_program('gettext', required : false).found() + subdir_done() + endif + diff --git a/package/utils/util-linux/patches/200-meson-no-po.patch b/package/utils/util-linux/patches/200-meson-no-po.patch deleted file mode 100644 index 4d94f6b89ab860..00000000000000 --- a/package/utils/util-linux/patches/200-meson-no-po.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/meson.build -+++ b/meson.build -@@ -874,7 +874,6 @@ subdir('disk-utils') - subdir('misc-utils') - subdir('text-utils') - subdir('term-utils') --subdir('po') - - includes = [dir_include, - dir_libblkid, diff --git a/rules.mk b/rules.mk index f298c8d794237c..6f05047f26d929 100644 --- a/rules.mk +++ b/rules.mk @@ -184,14 +184,14 @@ ifndef DUMP -include $(TOOLCHAIN_DIR)/info.mk export GCC_HONOUR_COPTS:=0 TARGET_CROSS:=$(if $(TARGET_CROSS),$(TARGET_CROSS),$(OPTIMIZE_FOR_CPU)-openwrt-linux$(if $(TARGET_SUFFIX),-$(TARGET_SUFFIX))-) + TOOLCHAIN_ROOT_DIR:=$(TOPDIR)/staging_dir/$(TOOLCHAIN_DIR_NAME) + TOOLCHAIN_BIN_DIRS:=$(TOOLCHAIN_ROOT_DIR)/bin + TOOLCHAIN_INC_DIRS:=$(TOOLCHAIN_ROOT_DIR)/usr/include $(TOOLCHAIN_ROOT_DIR)/include + TOOLCHAIN_LIB_DIRS:=$(TOOLCHAIN_ROOT_DIR)/usr/lib $(TOOLCHAIN_ROOT_DIR)/lib TARGET_CFLAGS+= -fhonour-copts - TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/usr/include ifeq ($(CONFIG_USE_MUSL),y) - TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/include/fortify + TOOLCHAIN_INC_DIRS+= $(TOOLCHAIN_DIR)/include/fortify endif - TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/include - TARGET_LDFLAGS+= -L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib - TARGET_PATH:=$(TOOLCHAIN_DIR)/bin:$(TARGET_PATH) else ifeq ($(CONFIG_NATIVE_TOOLCHAIN),) TARGET_CROSS:=$(call qstrip,$(CONFIG_TOOLCHAIN_PREFIX)) @@ -199,17 +199,17 @@ ifndef DUMP TOOLCHAIN_BIN_DIRS:=$(patsubst ./%,$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_BIN_PATH))) TOOLCHAIN_INC_DIRS:=$(patsubst ./%,$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_INC_PATH))) TOOLCHAIN_LIB_DIRS:=$(patsubst ./%,$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_LIB_PATH))) - ifneq ($(TOOLCHAIN_BIN_DIRS),) - TARGET_PATH:=$(subst $(space),:,$(TOOLCHAIN_BIN_DIRS)):$(TARGET_PATH) - endif - ifneq ($(TOOLCHAIN_INC_DIRS),) - TARGET_CPPFLAGS+= $(patsubst %,-I%,$(TOOLCHAIN_INC_DIRS)) - endif - ifneq ($(TOOLCHAIN_LIB_DIRS),) - TARGET_LDFLAGS+= $(patsubst %,-L%,$(TOOLCHAIN_LIB_DIRS)) - endif endif endif + ifneq ($(TOOLCHAIN_BIN_DIRS),) + TARGET_PATH:=$(subst $(space),:,$(TOOLCHAIN_BIN_DIRS)):$(TARGET_PATH) + endif + ifneq ($(TOOLCHAIN_INC_DIRS),) + TARGET_CPPFLAGS+= $(patsubst %,-I%,$(TOOLCHAIN_INC_DIRS)) + endif + ifneq ($(TOOLCHAIN_LIB_DIRS),) + TARGET_LDFLAGS+= $(patsubst %,-L%,$(TOOLCHAIN_LIB_DIRS)) + endif endif TARGET_LINKER?=bfd diff --git a/scripts/arm-magic.sh b/scripts/arm-magic.sh deleted file mode 100755 index b4b0fa94f574df..00000000000000 --- a/scripts/arm-magic.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# Empty/wrong machtype-workaround generator -# -# Copyright (C) 2006-2012 Imre Kaloz -# based on linux/arch/arm/boot/compressed/head-xscale.S -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -# NOTE: for now it's for only IXP4xx in big endian mode - -# list of supported boards, in "boardname machtypeid" format -for board in "avila 526" "gateway7001 731" "nslu2 597" "nas100d 865" "wg302v1 889" "wg302v2 890" "pronghorn 928" "pronghornmetro 1040" "compex 1273" "wrt300nv2 1077" "loft 849" "dsmg600 964" "fsg3 1091" "ap1000 1543" "tw2662 1658" "tw5334 1664" "ixdpg425 604" "cambria 1468" "sidewinder 1041" "ap42x 4418" -do - set -- $board - hexid=$(printf %x\\n $2) - if [ "$2" -lt "256" ]; then - # we have a low machtypeid, we just need a "mov" (e3a) - printf "\xe3\xa0\x10\x$hexid" > $BIN_DIR/$IMG_PREFIX-$1-zImage - else - # we have a high machtypeid, we need a "mov" (e3a) and an "orr" (e38) - if [ "$2" -lt "4096" ]; then - printf "\xe3\xa0\x10\x$(echo $hexid|cut -b "2 3")\xe3\x81\x1c\x$(echo $hexid|cut -b 1)" > $BIN_DIR/$IMG_PREFIX-$1-zImage - else - printf "\xe3\xa0\x10\x$(echo $hexid|cut -b "3 4")\xe3\x81\x1c\x$(echo $hexid|cut -b "1 2")" > $BIN_DIR/$IMG_PREFIX-$1-zImage - fi - fi - # generate the image - cat $BIN_DIR/$IMG_PREFIX-zImage >> $BIN_DIR/$IMG_PREFIX-$1-zImage -done diff --git a/scripts/dump-target-info.pl b/scripts/dump-target-info.pl index 0e4af17fe049b6..eec06ed6c494a5 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/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh index fe1024c18ec800..1fa2e952bb792e 100755 --- a/scripts/ext-toolchain.sh +++ b/scripts/ext-toolchain.sh @@ -27,6 +27,7 @@ CFLAGS="" TOOLCHAIN="." LIBC_TYPE="" +GCC_VERSION="" # Library specs @@ -199,6 +200,19 @@ find_bins() { return 1 } +find_gcc_version() { + if [ -f $TOOLCHAIN/info.mk ]; then + GCC_VERSION=$(grep GCC_VERSION $TOOLCHAIN/info.mk | sed 's/GCC_VERSION=//') + return 0 + fi + + echo "Warning! Can't find info.mk, trying to detect with alternative way." + + # Very fragile detection + GCC_VERSION=$(find $TOOLCHAIN/bin | grep -oE "gcc-[0-9]+\.[0-9]+\.[0-9]+$" | \ + head -1 | sed 's/gcc-//') +} + wrap_bin_cc() { local out="$1" @@ -383,6 +397,13 @@ print_config() { return 1 fi + if [ -n "$GCC_VERSION" ]; then + echo "CONFIG_EXTERNAL_GCC_VERSION=\"$GCC_VERSION\"" >> "$config" + else + echo "Can't detect GCC version. Aborting!" >&2 + return 1 + fi + local lib for lib in C RT PTHREAD GCC STDCPP SSP GFORTRAN GOMP; do local file @@ -564,6 +585,7 @@ while [ -n "$1" ]; do --config) if probe_cc; then probe_libc + find_gcc_version print_config "$1" exit $? fi diff --git a/scripts/feeds b/scripts/feeds index aee73e793f54ec..7d5b83e08135c4 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -162,7 +162,7 @@ my %update_method = ( 'update_force' => "git pull --ff-only || (git reset --hard HEAD; git pull --ff-only; exit 1)", 'post_update' => "git submodule update --init --recursive", 'controldir' => ".git", - 'revision' => "git rev-parse --short HEAD | tr -d '\n'"}, + 'revision' => "git rev-parse HEAD | tr -d '\n'"}, 'src-git-full' => { 'init' => "git clone '%s' '%s'", 'init_branch' => "git clone --branch '%s' '%s' '%s'", @@ -171,12 +171,12 @@ my %update_method = ( 'update_force' => "git pull --ff-only || (git reset --hard HEAD; git pull --ff-only; exit 1)", 'post_update' => "git submodule update --init --recursive", 'controldir' => ".git", - 'revision' => "git rev-parse --short HEAD | tr -d '\n'"}, + 'revision' => "git rev-parse HEAD | tr -d '\n'"}, 'src-gitsvn' => { 'init' => "git svn clone -r HEAD '%s' '%s'", 'update' => "git svn rebase", 'controldir' => ".git", - 'revision' => "git rev-parse --short HEAD | tr -d '\n'"}, + 'revision' => "git rev-parse HEAD | tr -d '\n'"}, 'src-bzr' => { 'init' => "bzr checkout --lightweight '%s' '%s'", 'update' => "bzr update", diff --git a/scripts/getver.sh b/scripts/getver.sh index 49260a22603fb0..61906040b18f97 100755 --- a/scripts/getver.sh +++ b/scripts/getver.sh @@ -21,7 +21,7 @@ try_git() { r*) GET_REV="$(echo $GET_REV | tr -d 'r')" BASE_REV="$(git rev-list ${REBOOT}..HEAD 2>/dev/null | wc -l | awk '{print $1}')" - REV="$(git rev-parse HEAD~$((BASE_REV - GET_REV)))" + [ $((BASE_REV - GET_REV)) -ge 0 ] && REV="$(git rev-parse HEAD~$((BASE_REV - GET_REV)))" ;; *) BRANCH="$(git rev-parse --abbrev-ref HEAD)" diff --git a/scripts/linksys-image.sh b/scripts/linksys-image.sh deleted file mode 100755 index d251b5da8ee84e..00000000000000 --- a/scripts/linksys-image.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2018 Oceanic Systems (UK) Ltd -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -# Maintained by: Ryan Pannell -# -# Write Linksys signature for factory image -# This is appended to the factory image and is tested by the Linksys Upgrader - as observed in civic. -# The footer is 256 bytes. The format is: -# .LINKSYS. This is detected by the Linksys upgrader before continuing with upgrade. (9 bytes) -# The version number of upgrade. Not checked so use arbitrary value (8 bytes) -# Model of target device, padded (0x20) to (15 bytes) -# CRC checksum of the image to flash (8 byte) -# Padding ('0' + 0x20 *7) (8 bytes) -# Signature of signer. Not checked so use arbitrary value (16 bytes) -# Padding (0x00) (192 bytes) - -## version history -# * version 1: initial commit - -set -e - -ME="${0##*/}" - -usage() { - echo "Usage: $ME " - [ "$IMG_OUT" ] && rm -f "$IMG_OUT" - exit 1 -} - -[ "$#" -lt 3 ] && usage - -TYPE=$1 - -tmpdir="$( mktemp -d 2> /dev/null )" -if [ -z "$tmpdir" ]; then - # try OSX signature - tmpdir="$( mktemp -t 'ubitmp' -d )" -fi - -if [ -z "$tmpdir" ]; then - exit 1 -fi - -trap "rm -rf $tmpdir" EXIT - -IMG_TMP_OUT="${tmpdir}/out" - -IMG_IN=$2 -IMG_OUT="${IMG_IN}.new" - -[ ! -f "$IMG_IN" ] && echo "$ME: Not a valid image: $IMG_IN" && usage - -dd if="${IMG_IN}" of="${IMG_TMP_OUT}" -CRC=$(printf "%08X" $(dd if="${IMG_IN}" bs=$(stat -c%s "${IMG_IN}") count=1|cksum| cut -d ' ' -f1)) - -printf ".LINKSYS.01000409%-15s%-8s%-8s%-16s" "${TYPE}" "${CRC}" "0" "K0000000F0246434" >> "${IMG_TMP_OUT}" - -dd if=/dev/zero bs=1 count=192 conv=notrunc >> "${IMG_TMP_OUT}" - -cp "${IMG_TMP_OUT}" "${IMG_OUT}" diff --git a/scripts/metadata.pm b/scripts/metadata.pm index ee5a2945ca71ff..587ce7207d2e69 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -2,7 +2,7 @@ package metadata; use base 'Exporter'; use strict; use warnings; -our @EXPORT = qw(%package %vpackage %srcpackage %category %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames); +our @EXPORT = qw(%package %vpackage %srcpackage %category %overrides clear_packages parse_package_metadata parse_package_manifest_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames); our %package; our %vpackage; @@ -256,6 +256,8 @@ sub parse_package_metadata($) { /^Source: \s*(.+)\s*$/ and $pkg->{source} = $1; /^License: \s*(.+)\s*$/ and $pkg->{license} = $1; /^LicenseFiles: \s*(.+)\s*$/ and $pkg->{licensefiles} = $1; + /^CPE-ID: \s*(.+)\s*$/ and $pkg->{cpe_id} = $1; + /^ABI-Version: \s*(.+)\s*$/ and $pkg->{abi_version} = $1; /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1; /^Provides: \s*(.+)\s*$/ and do { my @vpkg = split /\s+/, $1; @@ -315,4 +317,42 @@ sub parse_package_metadata($) { return 1; } +sub parse_package_manifest_metadata($) { + my $file = shift; + my $pkg; + my %pkgs; + + open FILE, "<$file" or do { + warn "Cannot open '$file': $!\n"; + return undef; + }; + + while () { + chomp; + /^Package:\s*(.+?)\s*$/ and do { + $pkg = {}; + $pkg->{name} = $1; + $pkg->{depends} = []; + $pkgs{$1} = $pkg; + }; + /^Version:\s*(.+)\s*$/ and $pkg->{version} = $1; + /^Depends:\s*(.+)\s*$/ and $pkg->{depends} = [ split /\s+/, $1 ]; + /^Source:\s*(.+)\s*$/ and $pkg->{source} = $1; + /^SourceName:\s*(.+)\s*$/ and $pkg->{sourcename} = $1; + /^License:\s*(.+)\s*$/ and $pkg->{license} = $1; + /^LicenseFiles:\s*(.+)\s*$/ and $pkg->{licensefiles} = $1; + /^Section:\s*(.+)\s*$/ and $pkg->{section} = $1; + /^SourceDateEpoch: \s*(.+)\s*$/ and $pkg->{sourcedateepoch} = $1; + /^CPE-ID:\s*(.+)\s*$/ and $pkg->{cpe_id} = $1; + /^Architecture:\s*(.+)\s*$/ and $pkg->{architecture} = $1; + /^Installed-Size:\s*(.+)\s*$/ and $pkg->{installedsize} = $1; + /^Filename:\s*(.+)\s*$/ and $pkg->{filename} = $1; + /^Size:\s*(\d+)\s*$/ and $pkg->{size} = $1; + /^SHA256sum:\s*(.*)\s*$/ and $pkg->{sha256sum} = $1; + } + + close FILE; + return %pkgs; +} + 1; diff --git a/scripts/noop.sh b/scripts/noop.sh new file mode 100755 index 00000000000000..96b71fe3bf46f3 --- /dev/null +++ b/scripts/noop.sh @@ -0,0 +1,2 @@ +#!/bin/sh +# This script does nothing, intentionally. diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index 8d8a9fd30659a3..9e0e6dd9e58934 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -4,6 +4,8 @@ use strict; use metadata; use Getopt::Long; +use Time::Piece; +use JSON::PP; my %board; @@ -611,6 +613,7 @@ () "version":"$pkg->{version}", "category":"$pkg->{category}", "license":"$pkg->{license}", +"cpe_id":"$pkg->{cpe_id}", "maintainer": [$pkg_maintainer], "depends":[$pkg_deps]}, END_JSON @@ -621,6 +624,173 @@ () print "[$json]"; } +sub image_manifest_packages($) +{ + my %packages; + my $imgmanifest = shift; + + open FILE, "<$imgmanifest" or return; + while () { + /^(.+?) - (.+)$/ and $packages{$1} = $2; + } + close FILE; + + return %packages; +} + +sub dump_cyclonedxsbom_json { + my (@components) = @_; + + my $uuid = sprintf( + "%04x%04x-%04x-%04x-%04x-%04x%04x%04x", + rand(0xffff), rand(0xffff), rand(0xffff), + rand(0x0fff) | 0x4000, + rand(0x3fff) | 0x8000, + rand(0xffff), rand(0xffff), rand(0xffff) + ); + + my $cyclonedx = { + bomFormat => "CycloneDX", + specVersion => "1.4", + serialNumber => "urn:uuid:$uuid", + version => 1, + metadata => { + timestamp => gmtime->datetime, + }, + "components" => [@components], + }; + + return encode_json($cyclonedx); +} + +sub gen_image_cyclonedxsbom() { + my $pkginfo = shift @ARGV; + my $imgmanifest = shift @ARGV; + my @components; + my %image_packages; + + %image_packages = image_manifest_packages($imgmanifest); + %image_packages or exit 1; + parse_package_metadata($pkginfo) or exit 1; + + $package{"kernel"} = { + license => "GPL-2.0", + cpe_id => "cpe:/o:linux:linux_kernel", + name => "kernel", + }; + + my %abimap; + my @abipkgs = grep { defined $package{$_}->{abi_version} } keys %package; + foreach my $name (@abipkgs) { + my $pkg = $package{$name}; + my $abipkg = $name . $pkg->{abi_version}; + $abimap{$abipkg} = $name; + } + + foreach my $name (sort {uc($a) cmp uc($b)} keys %image_packages) { + my $pkg = $package{$name}; + if (!$pkg) { + $pkg = $package{$abimap{$name}}; + next if !$pkg; + } + + my @licenses; + my @license = split(/\s+/, $pkg->{license}); + foreach my $lic (@license) { + push @licenses, ( + { "license" => { "name" => $lic } } + ); + } + my $type; + if ($pkg->{category}) { + my $category = $pkg->{category}; + my %cat_type = ( + "Firmware" => "firmware", + "Libraries" => "library" + ); + + if ($cat_type{$category}) { + $type = $cat_type{$category}; + } else { + $type = "application"; + } + } + + my $version = $pkg->{version}; + if ($image_packages{$name}) { + $version = $image_packages{$name}; + } + $version =~ s/-\d+$// if $version; + if ($name =~ /^(kernel|kmod-)/ and $version =~ /^(\d+\.\d+\.\d+)/) { + $version = $1; + } + + push @components, { + name => $pkg->{name}, + version => $version, + @licenses > 0 ? (licenses => [ @licenses ]) : (), + $pkg->{cpe_id} ? (cpe => $pkg->{cpe_id}.":".$version) : (), + $type ? (type => $type) : (), + $version ? (version => $version) : (), + }; + } + + print dump_cyclonedxsbom_json(@components); +} + +sub gen_package_cyclonedxsbom() { + my $pkgmanifest = shift @ARGV; + my @components; + my %mpkgs; + + %mpkgs = parse_package_manifest_metadata($pkgmanifest); + %mpkgs or exit 1; + + foreach my $name (sort {uc($a) cmp uc($b)} keys %mpkgs) { + my $pkg = $mpkgs{$name}; + + my @licenses; + my @license = split(/\s+/, $pkg->{license}); + foreach my $lic (@license) { + push @licenses, ( + { "license" => { "name" => $lic } } + ); + } + + my $type; + if ($pkg->{section}) { + my $section = $pkg->{section}; + my %section_type = ( + "firmware" => "firmware", + "libs" => "library" + ); + + if ($section_type{$section}) { + $type = $section_type{$section}; + } else { + $type = "application"; + } + } + + my $version = $pkg->{version}; + $version =~ s/-\d+$// if $version; + if ($name =~ /^(kernel|kmod-)/ and $version =~ /^(\d+\.\d+\.\d+)/) { + $version = $1; + } + + push @components, { + name => $name, + version => $version, + @licenses > 0 ? (licenses => [ @licenses ]) : (), + $pkg->{cpe_id} ? (cpe => $pkg->{cpe_id}.":".$version) : (), + $type ? (type => $type) : (), + $version ? (version => $version) : (), + }; + } + + print dump_cyclonedxsbom_json(@components); +} + sub parse_command() { GetOptions("ignore=s", \@ignore); my $cmd = shift @ARGV; @@ -631,6 +801,8 @@ () /^source$/ and return gen_package_source(); /^pkgaux$/ and return gen_package_auxiliary(); /^pkgmanifestjson$/ and return gen_package_manifest_json(); + /^imgcyclonedxsbom$/ and return gen_image_cyclonedxsbom(); + /^pkgcyclonedxsbom$/ and return gen_package_cyclonedxsbom(); /^license$/ and return gen_package_license(0); /^licensefull$/ and return gen_package_license(1); /^usergroup$/ and return gen_usergroup_list(); @@ -638,15 +810,17 @@ () } die < [manifest] Image package manifest in CycloneDX SBOM JSON format + $0 pkgcyclonedxsbom Package manifest in CycloneDX SBOM JSON format + $0 license [file] Package license information $0 licensefull [file] Package license information (full list) - $0 usergroup [file] Package usergroup allocation list + $0 usergroup [file] Package usergroup allocation list $0 version_filter [patchver] [list...] Filter list of version tagged strings Options: diff --git a/scripts/sercomm-pid.py b/scripts/sercomm-pid.py index 4d88a678396f1e..2c246fc298bd35 100755 --- a/scripts/sercomm-pid.py +++ b/scripts/sercomm-pid.py @@ -34,7 +34,7 @@ def get_pid(args): enc = args.hw_version.rjust(8, '0').encode('ascii') struct.pack_into('>8s', buf, 0x0, enc) - enc = binascii.hexlify(args.hw_id.encode()) + enc = binascii.hexlify(args.hw_id.encode()).upper() struct.pack_into('>6s', buf, 0x8, enc) enc = args.sw_version.rjust(4, '0').encode('ascii') diff --git a/target/linux/apm821xx/dts/netgear-wndr4700.dts b/target/linux/apm821xx/dts/netgear-wndr4700.dts index cbfe1235e95539..0788037981d857 100644 --- a/target/linux/apm821xx/dts/netgear-wndr4700.dts +++ b/target/linux/apm821xx/dts/netgear-wndr4700.dts @@ -267,23 +267,25 @@ reg = <0x07fc0000 0x00040000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_wifi_0: macaddr@0 { - reg = <0x0 0x6>; - }; - macaddr_wifi_c: macaddr@c { - reg = <0xc 0x6>; - }; + macaddr_wifi_0: macaddr@0 { + reg = <0x0 0x6>; + }; + macaddr_wifi_c: macaddr@c { + reg = <0xc 0x6>; + }; - calibration_wifi_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_wifi_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_wifi_5000: calibration@5000 { - reg = <0x5000 0x440>; + calibration_wifi_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; }; diff --git a/target/linux/apm821xx/image/nand.mk b/target/linux/apm821xx/image/nand.mk index 9ecc2320fd83f9..469bf58c1d107d 100644 --- a/target/linux/apm821xx/image/nand.mk +++ b/target/linux/apm821xx/image/nand.mk @@ -3,7 +3,12 @@ define Build/create-uImage-dtb -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) \ -O linux -T kernel -C none \ -n '$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION)' \ - -d "$@.dtb" "$@.dtb.uimage" + -d "$(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb" "$@.dtb.uimage" +endef + +define Build/prepend-dtb-uImage + cat "$@.dtb.uimage" "$@" > "$@.new" + mv "$@.new" "$@" endef define Build/meraki-header @@ -104,7 +109,7 @@ define Device/netgear_wndr4700 # append a fake/empty rootfs to fool netgear's uboot # CHECK_DNI_FIRMWARE_ROOTFS_INTEGRITY in do_chk_dniimg() KERNEL := kernel-bin | lzma -d16 | uImage lzma | pad-offset $$(BLOCKSIZE) 64 | \ - append-uImage-fakehdr filesystem | create-uImage-dtb | prepend-dtb + append-uImage-fakehdr filesystem | create-uImage-dtb | prepend-dtb-uImage KERNEL_INITRAMFS := kernel-bin | libdeflate-gzip | MuImage-initramfs gzip IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \ netgear-dni | check-size diff --git a/target/linux/armsr/armv8/config-6.1 b/target/linux/armsr/armv8/config-6.1 index 4eab79bba96459..0ead9730641b65 100644 --- a/target/linux/armsr/armv8/config-6.1 +++ b/target/linux/armsr/armv8/config-6.1 @@ -599,6 +599,10 @@ CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y CONFIG_RASPBERRYPI_FIRMWARE=y CONFIG_RASPBERRYPI_POWER=y +CONFIG_RANDOMIZE_BASE=y +CONFIG_RANDOMIZE_MODULE_REGION_FULL=y +CONFIG_RANDSTRUCT_NONE=y +CONFIG_RELOCATABLE=y # CONFIG_RAVB is not set CONFIG_RCAR_DMAC=y # CONFIG_RCAR_GEN3_THERMAL is not set diff --git a/target/linux/armsr/base-files.mk b/target/linux/armsr/base-files.mk new file mode 100644 index 00000000000000..e2b7d05f57379e --- /dev/null +++ b/target/linux/armsr/base-files.mk @@ -0,0 +1,8 @@ +GRUB_SERIAL:=$(call qstrip,$(CONFIG_TARGET_SERIAL)) +ifeq ($(GRUB_SERIAL),) +$(error This platform requires CONFIG_TARGET_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 51832eb77564f8..87d5460d323313 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/base-files/lib/preinit/79_move_config b/target/linux/armsr/base-files/lib/preinit/79_move_config new file mode 100644 index 00000000000000..864d4dfa644fc7 --- /dev/null +++ b/target/linux/armsr/base-files/lib/preinit/79_move_config @@ -0,0 +1,19 @@ +# SPDX-License-Identifier: GPL-2.0-only + +move_config() { + local partdev parttype=ext4 + + . /lib/upgrade/common.sh + + if export_bootdevice && export_partdevice partdev 1; then + part_magic_fat "/dev/$partdev" && parttype=vfat + if mount -t $parttype -o rw,noatime "/dev/$partdev" /mnt; then + if [ -f "/mnt/$BACKUP_FILE" ]; then + mv -f "/mnt/$BACKUP_FILE" / + fi + umount /mnt + fi + fi +} + +boot_hook_add preinit_mount_root move_config diff --git a/target/linux/armsr/base-files/lib/upgrade/platform.sh b/target/linux/armsr/base-files/lib/upgrade/platform.sh index 8263b9c7e3aa4d..e72c6955e5814a 100644 --- a/target/linux/armsr/base-files/lib/upgrade/platform.sh +++ b/target/linux/armsr/base-files/lib/upgrade/platform.sh @@ -36,7 +36,8 @@ platform_check_image() { platform_copy_config() { local partdev parttype=ext4 - if export_partdevice partdev 2; then + if export_partdevice partdev 1; then + part_magic_fat "/dev/$partdev" && parttype=vfat mount -t $parttype -o rw,noatime "/dev/$partdev" /mnt cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE" umount /mnt diff --git a/target/linux/armsr/image/Makefile b/target/linux/armsr/image/Makefile index 1df9657385dc62..ec566c5818f849 100644 --- a/target/linux/armsr/image/Makefile +++ b/target/linux/armsr/image/Makefile @@ -15,16 +15,12 @@ ifneq ($(CONFIG_GRUB_CONSOLE),) GRUB_TERMINALS += console endif -GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL)) +GRUB_SERIAL:=$(call qstrip,$(CONFIG_TARGET_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/armsr/modules.mk b/target/linux/armsr/modules.mk index 6e9ecda9990cc2..521a52fec15b2d 100644 --- a/target/linux/armsr/modules.mk +++ b/target/linux/armsr/modules.mk @@ -216,24 +216,6 @@ endef $(eval $(call KernelPackage,imx7-ulp-wdt)) -define KernelPackage/stmmac-core - SUBMENU=$(NETWORK_DEVICES_MENU) - TITLE:=Synopsis Ethernet Controller core (NXP,STMMicro,others) - DEPENDS:=@(TARGET_armsr_armv8) +kmod-pcs-xpcs +kmod-ptp \ - +kmod-of-mdio - KCONFIG:=CONFIG_STMMAC_ETH \ - CONFIG_STMMAC_SELFTESTS=n \ - CONFIG_STMMAC_PLATFORM \ - CONFIG_CONFIG_DWMAC_DWC_QOS_ETH=n \ - CONFIG_DWMAC_GENERIC - FILES=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/stmmac.ko \ - $(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/stmmac-platform.ko \ - $(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.ko - AUTOLOAD=$(call AutoLoad,40,stmmac stmmac-platform dwmac-generic) -endef - -$(eval $(call KernelPackage,stmmac-core)) - define KernelPackage/dwmac-imx SUBMENU=$(NETWORK_DEVICES_MENU) TITLE:=NXP i.MX8 Ethernet controller diff --git a/target/linux/ath79/dts/ar7161_aruba_ap-105.dts b/target/linux/ath79/dts/ar7161_aruba_ap-105.dts index 949d70ec07a10f..c8510a89441c4f 100644 --- a/target/linux/ath79/dts/ar7161_aruba_ap-105.dts +++ b/target/linux/ath79/dts/ar7161_aruba_ap-105.dts @@ -96,9 +96,8 @@ ath9k0: wifi@0,11 { /* 2.4 GHz */ compatible = "pci168c,0029"; - nvmem-cells = <&macaddr_hwinfo_1c>; + nvmem-cells = <&macaddr_hwinfo_1c 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; reg = <0x8800 0 0 0 0>; #gpio-cells = <2>; gpio-controller; @@ -106,9 +105,8 @@ ath9k1: wifi@0,12 { /* 5 GHz */ compatible = "pci168c,0029"; - nvmem-cells = <&macaddr_hwinfo_1c>; + nvmem-cells = <&macaddr_hwinfo_1c 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; reg = <0x9000 0 0 0 0>; #gpio-cells = <2>; gpio-controller; @@ -125,7 +123,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_hwinfo_1c>; + nvmem-cells = <&macaddr_hwinfo_1c 0>; nvmem-cell-names = "mac-address"; pll-data = <0x00110000 0x00001099 0x00991099>; @@ -160,9 +158,21 @@ }; hwinfo: partition@fe0000 { - label = "hwinfo"; reg = <0xfe0000 0x10000>; + label = "hwinfo"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_hwinfo_1c: mac-address@1c { + compatible = "mac-base"; + reg = <0x1c 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@ff0000 { @@ -173,13 +183,3 @@ }; }; }; - -&hwinfo { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_hwinfo_1c: macaddr@1c { - reg = <0x1c 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_aruba_ap-175.dts b/target/linux/ath79/dts/ar7161_aruba_ap-175.dts index dd29a687ba0e1d..96a76a3cfc603b 100644 --- a/target/linux/ath79/dts/ar7161_aruba_ap-175.dts +++ b/target/linux/ath79/dts/ar7161_aruba_ap-175.dts @@ -122,9 +122,8 @@ ath9k0: wifi@0,11 { compatible = "pci168c,0029"; - nvmem-cells = <&macaddr_hwinfo_1c>; + nvmem-cells = <&macaddr_hwinfo_1c 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; reg = <0x8800 0 0 0 0>; #gpio-cells = <2>; gpio-controller; @@ -132,9 +131,8 @@ ath9k1: wifi@0,12 { compatible = "pci168c,0029"; - nvmem-cells = <&macaddr_hwinfo_1c>; + nvmem-cells = <&macaddr_hwinfo_1c 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; reg = <0x9000 0 0 0 0>; #gpio-cells = <2>; gpio-controller; @@ -151,7 +149,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_hwinfo_1c>; + nvmem-cells = <&macaddr_hwinfo_1c 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; @@ -187,6 +185,18 @@ label = "hwinfo"; reg = <0xfe0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_hwinfo_1c: macaddr@1c { + compatible = "mac-base"; + reg = <0x1c 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@ff0000 { @@ -198,16 +208,6 @@ }; }; -&hwinfo { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_hwinfo_1c: macaddr@1c { - reg = <0x1c 0x6>; - }; -}; - &i2c0 { gpio_ext: gpio@21 { status = "okay"; diff --git a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi index 6e1ba2d47e4c5d..e3f48fee852cce 100644 --- a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi +++ b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi @@ -148,6 +148,22 @@ label = "art"; reg = <0x0050000 0x0010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_120c: macaddr@120c { + reg = <0x120c 0x6>; + }; + + macaddr_art_520c: macaddr@520c { + compatible = "mac-base"; + reg = <0x520c 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@60000 { @@ -240,23 +256,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_520c>; + nvmem-cells = <&macaddr_art_520c 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; phy-handle = <&phy4>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_120c: macaddr@120c { - reg = <0x120c 0x6>; - }; - - macaddr_art_520c: macaddr@520c { - reg = <0x520c 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts index bdb678298d73ee..b62111c110e68a 100644 --- a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts +++ b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts @@ -186,7 +186,6 @@ }; partition@660000 { - compatible = "nvmem-cells"; label = "caldata"; reg = <0x660000 0x010000>; read-only; diff --git a/target/linux/ath79/dts/ar7161_fortinet_fap-220-b.dts b/target/linux/ath79/dts/ar7161_fortinet_fap-220-b.dts new file mode 100644 index 00000000000000..ddcf68970d32c4 --- /dev/null +++ b/target/linux/ath79/dts/ar7161_fortinet_fap-220-b.dts @@ -0,0 +1,164 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7100.dtsi" +#include "arxxxx_fortinet_loader.dtsi" + +#include +#include + +/ { + compatible = "fortinet,fap-220-b", "qca,ar7161"; + model = "Fortinet FAP-220-B"; + + chosen { + bootargs = "console=ttyS0,9600"; + }; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = ð1; + }; + + keys { + compatible = "gpio-keys"; + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power-green { + label = "green:power"; + gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + status-green { + label = "green:status"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + status-yellow { + label = "yellow:status"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + panic-indicator; + }; + + mode-green { + label = "green:mode"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + }; + + mode-yellow { + label = "yellow:mode"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + + wlan2g-green { + label = "green:wlan2g"; + gpios = <&ath9k0 5 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wlan2g-yellow { + label = "yellow:wlan2g"; + gpios = <&ath9k0 3 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0assoc"; + }; + + wlan5g-green { + label = "green:wlan5g"; + gpios = <&ath9k1 5 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g-yellow { + label = "yellow:wlan5g"; + gpios = <&ath9k1 3 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1assoc"; + }; + }; + + virtual_flash { + devices = <&fwconcat0 &fwconcat1 &fwconcat2>; + }; +}; + +&pcie0 { + status = "okay"; + + ath9k0: wifi@0,11 { /* 2.4 GHz */ + compatible = "pci168c,0029"; + reg = <0x8800 0 0 0 0>; + ieee80211-freq-limit = <2402000 2482000>; + nvmem-cells = <&macaddr_uboot_3ff80 9>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; + #gpio-cells = <2>; + gpio-controller; + }; + + ath9k1: wifi@0,12 { /* 5 GHz */ + compatible = "pci168c,0029"; + reg = <0x9000 0 0 0 0>; + ieee80211-freq-limit = <2402000 2482000 4900000 5990000>; + nvmem-cells = <&macaddr_uboot_3ff80 2>, <&cal_art_5000>; + nvmem-cell-names = "mac-address", "calibration"; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0x0>; + }; +}; + +ð0 { + status = "okay"; + compatible = "syscon", "simple-mfd"; +}; + +ð1 { + status = "okay"; + nvmem-cells = <&macaddr_uboot_3ff80 0>; + nvmem-cell-names = "mac-address"; + + pll-data = <0x00110000 0x00001099 0x00991099>; + phy-handle = <&phy0>; + phy-mode = "rgmii"; +}; + +&usb1 { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&art { + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: calibration@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: calibration@5000 { + reg = <0x5000 0xeb8>; + }; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts b/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts index 7f2a118b8457d4..2d21a54fa92b8e 100644 --- a/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts +++ b/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts @@ -158,16 +158,19 @@ label = "Atheros Board Data"; reg = <0xff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_wan: macaddr@1000 { - reg = <0x1000 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_wan: macaddr@1000 { + reg = <0x1000 0x6>; + }; - macaddr_lan: macaddr@1006 { - reg = <0x1006 0x6>; + macaddr_lan: macaddr@1006 { + reg = <0x1006 0x6>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar7161_meraki_mr16.dts b/target/linux/ath79/dts/ar7161_meraki_mr16.dts index 7a19da82e36ee8..6b8574e880f929 100644 --- a/target/linux/ath79/dts/ar7161_meraki_mr16.dts +++ b/target/linux/ath79/dts/ar7161_meraki_mr16.dts @@ -74,9 +74,8 @@ compatible = "pci168c,0029"; reg = <0x8800 0 0 0 0>; qca,no-eeprom; - nvmem-cells = <&macaddr_config_66>; + nvmem-cells = <&macaddr_config_66 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; #gpio-cells = <2>; gpio-controller; }; @@ -85,9 +84,8 @@ compatible = "pci168c,0029"; reg = <0x9000 0 0 0 0>; qca,no-eeprom; - nvmem-cells = <&macaddr_config_66>; + nvmem-cells = <&macaddr_config_66 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; #gpio-cells = <2>; gpio-controller; }; @@ -103,7 +101,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_config_66>; + nvmem-cells = <&macaddr_config_66 0>; nvmem-cell-names = "mac-address"; pll-data = <0x00110000 0x00001099 0x00991099>; @@ -141,6 +139,18 @@ label = "config"; reg = <0x80000 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_66: macaddr@66 { + compatible = "mac-base"; + reg = <0x66 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@a0000 { @@ -157,13 +167,3 @@ }; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_66: macaddr@66 { - reg = <0x66 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndap360.dts b/target/linux/ath79/dts/ar7161_netgear_wndap360.dts index 21dc423c357632..9761234714c87b 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndap360.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndap360.dts @@ -112,28 +112,32 @@ reg = <0x7f0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_120c: macaddr@120c { - reg = <0x120c 0x6>; - }; - - macaddr_art_520c: macaddr@520c { - reg = <0x520c 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0xeb8>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0xeb8>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_120c: macaddr@120c { + reg = <0x120c 0x6>; + }; + + macaddr_art_520c: macaddr@520c { + compatible = "mac-base"; + reg = <0x520c 0x6>; + #nvmem-cell-cells = <1>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0xeb8>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0xeb8>; + }; }; }; }; @@ -155,9 +159,8 @@ ath9k1: wifi@0,12 { compatible = "pci168c,0029"; reg = <0x9000 0 0 0 0>; - nvmem-cells = <&macaddr_art_520c>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_520c 1>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <1>; #gpio-cells = <2>; gpio-controller; }; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts index 351d5e03647eea..5b44505ce2be3c 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts @@ -35,6 +35,32 @@ label = "art"; reg = <0xff0000 0x010000>; 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>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; + }; }; }; @@ -57,29 +83,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0xeb8>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0xeb8>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts index eedd375cc9f32b..6b89fcd0ff9bc5 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts @@ -35,6 +35,32 @@ label = "art"; reg = <0x7f0000 0x010000>; 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>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; + }; }; }; @@ -76,29 +102,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0xeb8>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0xeb8>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts index 487b00b0dd0c69..cf23786ae3124b 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts @@ -36,6 +36,32 @@ label = "art"; reg = <0xff0000 0x010000>; 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>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; + }; }; }; @@ -58,29 +84,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0xeb8>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0xeb8>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts index 0c2eadae5c18bc..72b169fc769341 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts @@ -36,6 +36,32 @@ label = "art"; reg = <0xff0000 0x010000>; 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>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; + }; }; }; @@ -58,29 +84,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0xeb8>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0xeb8>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts index 88c3170c6e8d7d..2e141d07e57380 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts @@ -35,6 +35,32 @@ label = "art"; reg = <0xff0000 0x010000>; 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>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; + }; }; }; @@ -57,29 +83,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0xeb8>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0xeb8>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts index 0536ecb0533201..83b8f216cc45c2 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts @@ -36,6 +36,32 @@ label = "art"; reg = <0xff0000 0x010000>; 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>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0xeb8>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0xeb8>; + }; + }; }; }; @@ -58,29 +84,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0xeb8>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0xeb8>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_ruckus_gd11.dtsi b/target/linux/ath79/dts/ar7161_ruckus_gd11.dtsi index e97e31e58ec656..065068571cd85c 100644 --- a/target/linux/ath79/dts/ar7161_ruckus_gd11.dtsi +++ b/target/linux/ath79/dts/ar7161_ruckus_gd11.dtsi @@ -223,21 +223,3 @@ &usb_phy { status = "okay"; }; - -&board_data { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdata_60: macaddr@60 { - reg = <0x60 0x6>; - }; - - macaddr_bdata_66: macaddr@66 { - reg = <0x66 0x6>; - }; - - macaddr_bdata_76: macaddr@76 { - reg = <0x76 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7161_ruckus_zf7341.dts b/target/linux/ath79/dts/ar7161_ruckus_zf7341.dts index 17735e596f54f7..eacda20c61a41e 100644 --- a/target/linux/ath79/dts/ar7161_ruckus_zf7341.dts +++ b/target/linux/ath79/dts/ar7161_ruckus_zf7341.dts @@ -6,3 +6,23 @@ model = "Ruckus ZoneFlex 7341[-U]"; compatible = "ruckus,zf7341", "qca,ar7161"; }; + +&board_data { + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdata_60: macaddr@60 { + reg = <0x60 0x6>; + }; + + macaddr_bdata_66: macaddr@66 { + reg = <0x66 0x6>; + }; + + macaddr_bdata_76: macaddr@76 { + reg = <0x76 0x6>; + }; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_ruckus_zf7351.dts b/target/linux/ath79/dts/ar7161_ruckus_zf7351.dts index 37ea305790083a..adaeb18eda16ca 100644 --- a/target/linux/ath79/dts/ar7161_ruckus_zf7351.dts +++ b/target/linux/ath79/dts/ar7161_ruckus_zf7351.dts @@ -113,3 +113,23 @@ gpio-hog; }; }; + +&board_data { + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdata_60: macaddr@60 { + reg = <0x60 0x6>; + }; + + macaddr_bdata_66: macaddr@66 { + reg = <0x66 0x6>; + }; + + macaddr_bdata_76: macaddr@76 { + reg = <0x76 0x6>; + }; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_ruckus_zf7363.dts b/target/linux/ath79/dts/ar7161_ruckus_zf7363.dts index 4ece56dd0a0422..723e4d9a3b12e9 100644 --- a/target/linux/ath79/dts/ar7161_ruckus_zf7363.dts +++ b/target/linux/ath79/dts/ar7161_ruckus_zf7363.dts @@ -33,7 +33,25 @@ }; &board_data { - macaddr_bdata_6c: macaddr@6c { - reg = <0x6c 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdata_60: macaddr@60 { + reg = <0x60 0x6>; + }; + + macaddr_bdata_66: macaddr@66 { + reg = <0x66 0x6>; + }; + + macaddr_bdata_6c: macaddr@6c { + reg = <0x6c 0x6>; + }; + + macaddr_bdata_76: macaddr@76 { + reg = <0x76 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts index cf51078bc32ba5..ad42e0a05fd210 100644 --- a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts +++ b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts @@ -147,22 +147,33 @@ reg = <0x3f0000 0x10000>; label = "art"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_120c: macaddr@120c { + compatible = "mac-base"; + reg = <0x120c 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; }; ð0 { - nvmem-cells = <&macaddr_art_120c>; + nvmem-cells = <&macaddr_art_120c 0>; nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_120c>; + nvmem-cells = <&macaddr_art_120c 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &pcie { @@ -172,7 +183,7 @@ compatible = "pci168c,002a"; reg = <0x0000 0 0 0 0>; qca,no-eeprom; - nvmem-cells = <&macaddr_art_120c>; + nvmem-cells = <&macaddr_art_120c 0>; nvmem-cell-names = "mac-address"; #gpio-cells = <2>; gpio-controller; @@ -184,13 +195,3 @@ pinctrl-single,bits = <0x0 0x0 0xf8>; }; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_120c: macaddr@120c { - reg = <0x120c 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts index 9a233c836b7c25..ec3a3718506d06 100644 --- a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts +++ b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts @@ -96,11 +96,13 @@ }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts index 91b72cf1db8961..32903c2e8ff42c 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts +++ b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts @@ -168,13 +168,29 @@ label = "art"; reg = <0x3f0000 0x10000>; read-only; + + 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 { + reg = <0x6 0x6>; + }; + }; }; }; }; }; ð0 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -191,25 +207,10 @@ ath9k: wifi@0,0 { compatible = "pci168c,002b"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; }; }; - -&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/ath79/dts/ar7240_netgear_wnr612-v2.dtsi b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi index 9bae95b5575d54..ac27874c68ab7b 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi +++ b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi @@ -101,13 +101,29 @@ reg = <0x3f0000 0x10000>; label = "art"; read-only; + + 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 { + reg = <0x6 0x6>; + }; + }; }; }; }; }; ð0 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -124,25 +140,10 @@ ath9k: wifi@0,0 { compatible = "pci168c,002b"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; }; }; - -&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/ath79/dts/ar7240_openmesh_om2p-v1.dts b/target/linux/ath79/dts/ar7240_openmesh_om2p-v1.dts index a66d91401509ef..17a57446618712 100644 --- a/target/linux/ath79/dts/ar7240_openmesh_om2p-v1.dts +++ b/target/linux/ath79/dts/ar7240_openmesh_om2p-v1.dts @@ -127,20 +127,22 @@ reg = <0xfc0000 0x040000>; 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>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; + 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>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts b/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts index 9e0671d638c0c7..f5d0a9e3b07441 100644 --- a/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts +++ b/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts @@ -150,6 +150,24 @@ reg = <0xfc0000 0x40000>; label = "board-data"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_board_data_60: macaddr@60 { + reg = <0x60 0x6>; + }; + + macaddr_board_data_66: macaddr@66 { + reg = <0x66 0x6>; + }; + + macaddr_board_data_6c: macaddr@6c { + reg = <0x6c 0x6>; + }; + }; }; }; }; @@ -176,21 +194,3 @@ nvmem-cell-names = "mac-address"; }; }; - -&board_data { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_board_data_60: macaddr@60 { - reg = <0x60 0x6>; - }; - - macaddr_board_data_66: macaddr@66 { - reg = <0x66 0x6>; - }; - - macaddr_board_data_6c: macaddr@6c { - reg = <0x6c 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7240_tplink.dtsi b/target/linux/ath79/dts/ar7240_tplink.dtsi index 60cd38c220cb4f..5bcfb54bfce298 100644 --- a/target/linux/ath79/dts/ar7240_tplink.dtsi +++ b/target/linux/ath79/dts/ar7240_tplink.dtsi @@ -77,6 +77,18 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -104,7 +116,7 @@ ath9k: wifi@0,0 { reg = <0x0000 0 0 0 0>; qca,no-eeprom; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; #gpio-cells = <2>; gpio-controller; @@ -116,13 +128,3 @@ pinctrl-single,bits = <0x0 0x0 0xf8>; }; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi b/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi index 9d896360dc12c2..6c090fb437e824 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi @@ -30,15 +30,13 @@ }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &ath9k { diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts index 290871d648e668..0a6936c5bfd575 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts @@ -171,6 +171,22 @@ label = "art"; reg = <0x3f0000 0x10000>; read-only; + + 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 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -179,7 +195,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -196,25 +212,10 @@ ath9k: wifi@0,0 { compatible = "pci168c,002e"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; }; }; - -&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/ath79/dts/ar7241_netgear_wnr2200-16m.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts index f5c060d78064f8..324207656fc79c 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts @@ -35,11 +35,27 @@ label = "art"; reg = <0xff0000 0x10000>; read-only; + + 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 { + reg = <0x6 0x6>; + }; + }; }; }; ð0 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -49,21 +65,6 @@ }; &ath9k { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&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/ath79/dts/ar7241_netgear_wnr2200-8m.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts index e47336e4d29b19..fbd3cb8ec8fff8 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts @@ -35,11 +35,27 @@ label = "art"; reg = <0x7f0000 0x10000>; read-only; + + 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 { + reg = <0x6 0x6>; + }; + }; }; }; ð0 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -49,21 +65,6 @@ }; &ath9k { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&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/ath79/dts/ar7241_tplink.dtsi b/target/linux/ath79/dts/ar7241_tplink.dtsi index 0861cc62322608..01eee39f1958bc 100644 --- a/target/linux/ath79/dts/ar7241_tplink.dtsi +++ b/target/linux/ath79/dts/ar7241_tplink.dtsi @@ -64,6 +64,18 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -89,7 +101,7 @@ #gpio-cells = <2>; gpio-controller; qca,no-eeprom; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; }; @@ -97,22 +109,11 @@ ð0 { /* WAN interface, initialized last as eth1 */ status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { /* LAN interface, initialized first as eth0 */ - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts index 6ee7d9ec4f9959..e7fe31f36d0db2 100644 --- a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts +++ b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts @@ -102,6 +102,18 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -128,7 +140,7 @@ #gpio-cells = <2>; gpio-controller; qca,no-eeprom; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; }; @@ -136,23 +148,11 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; }; diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts index 3f965ec9deaea0..e3c8f2a6099a17 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-outdoor-plus.dts @@ -87,20 +87,22 @@ reg = <0xff0000 0x10000>; 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>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0xeb8>; + 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>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0xeb8>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi index 02166a26eb8610..d9c7336f91135c 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi @@ -73,16 +73,18 @@ reg = <0x7f0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts b/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts index dde91295052f7a..c17a8df6fedbd4 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts +++ b/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts @@ -20,11 +20,13 @@ }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts index 4a2f749cc4547f..ac4c096961badf 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts +++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts @@ -138,16 +138,18 @@ label = "art"; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_120c: macaddr@120c { - reg = <0x120c 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0xeb8>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_120c: macaddr@120c { + reg = <0x120c 0x6>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0xeb8>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts index 84d029b5dce2ff..81290479b086c9 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts +++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts @@ -83,11 +83,13 @@ }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts index 7458685802b835..8e8deba933775d 100644 --- a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts +++ b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts @@ -63,7 +63,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy4>; @@ -78,9 +78,8 @@ ath9k: wifi@0,0,0 { compatible = "pci168c,002a"; reg = <0x0 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; @@ -88,11 +87,15 @@ }; &art { - 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_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts index f1f86019dd9bfe..69629335b3ca79 100644 --- a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts +++ b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts @@ -63,7 +63,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy4>; @@ -78,9 +78,8 @@ ath9k: wifi@0,0,0 { compatible = "pci168c,002a"; reg = <0x0 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; @@ -88,11 +87,15 @@ }; &art { - 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_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ath79/dts/ar7242_meraki_mr12.dts b/target/linux/ath79/dts/ar7242_meraki_mr12.dts index 42b4966e744b75..adea2778eac82c 100644 --- a/target/linux/ath79/dts/ar7242_meraki_mr12.dts +++ b/target/linux/ath79/dts/ar7242_meraki_mr12.dts @@ -74,9 +74,8 @@ compatible = "pci168c,002a"; reg = <0x0000 0 0 0 0>; qca,no-eeprom; - nvmem-cells = <&macaddr_config_66>; + nvmem-cells = <&macaddr_config_66 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; @@ -91,7 +90,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_config_66>; + nvmem-cells = <&macaddr_config_66 0>; nvmem-cell-names = "mac-address"; pll-data = <0x02000000 0x00000101 0x00001313>; @@ -107,7 +106,7 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_config_66>; + nvmem-cells = <&macaddr_config_66 0>; nvmem-cell-names = "mac-address"; }; @@ -140,6 +139,18 @@ label = "config"; reg = <0x80000 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_66: macaddr@66 { + compatible = "mac-base"; + reg = <0x66 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@a0000 { @@ -156,13 +167,3 @@ }; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_66: macaddr@66 { - reg = <0x66 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts index e250f2a5b45db8..8df1fdb4ddbe08 100644 --- a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts +++ b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts @@ -107,6 +107,16 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -119,6 +129,16 @@ label = "art"; reg = <0x7f0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + }; }; }; }; @@ -157,23 +177,3 @@ full-duplex; }; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; -}; diff --git a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts index b353e760288142..3d8f56a856dced 100644 --- a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts +++ b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts @@ -75,13 +75,3 @@ full-duplex; }; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts index 2ee7ab56c5a6c8..d5625fefce0aec 100644 --- a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts +++ b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts @@ -186,13 +186,3 @@ full-duplex; }; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi b/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi index 0268146b061503..9d4ab231ccf1bd 100644 --- a/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi +++ b/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi @@ -104,6 +104,20 @@ reg = <0x7f0000 0x010000>; label = "art"; 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>; + }; + }; }; }; }; @@ -127,13 +141,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi b/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi index 341d0bad0d6f70..d9b01e17e37088 100644 --- a/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi +++ b/target/linux/ath79/dts/ar724x_ubnt_xm.dtsi @@ -62,6 +62,20 @@ label = "art"; reg = <0x7f0000 0x010000>; 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>; + }; + }; }; }; }; @@ -89,17 +103,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&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/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi index ac3af134577fa2..0eb38b5712effa 100644 --- a/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi +++ b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi @@ -137,6 +137,16 @@ label = "art"; reg = <0x1fe0000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1120c: macaddr@1120c { + reg = <0x1120c 0x6>; + }; + }; }; }; }; @@ -250,13 +260,3 @@ &usb_phy { status = "okay"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_1120c: macaddr@1120c { - reg = <0x1120c 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts index fd4a6c7a4d34c7..476f3e18a3f45f 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts @@ -73,6 +73,16 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@1 { @@ -121,13 +131,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts index 6eb2a0acb5f872..a4d19ce970a1c9 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts @@ -99,6 +99,16 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -136,13 +146,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts index 106ca56e7ed696..41e53e1fc8d921 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts @@ -122,6 +122,16 @@ label = "u-boot"; reg = <0x000000 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -158,13 +168,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts index b31d0f961b3ef1..7401cd053a70a6 100644 --- a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts +++ b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts @@ -105,6 +105,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -138,13 +148,3 @@ nvmem-cells = <&macaddr_art_0>; nvmem-cell-names = "mac-address"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi b/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi index e010e5cad0c133..a7fd10bd732066 100644 --- a/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi +++ b/target/linux/ath79/dts/ar9330_openmesh_om2p.dtsi @@ -122,6 +122,20 @@ label = "ART"; reg = <0xfc0000 0x040000>; 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>; + }; + }; }; }; }; @@ -146,17 +160,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/ar9330_pqi_air-pen.dts b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts index 5383d6588477b3..a2665519f46224 100644 --- a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts +++ b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts @@ -86,6 +86,20 @@ label = "art"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_2: macaddr@2 { + reg = <0x2 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; + }; }; partition@60000 { @@ -136,17 +150,3 @@ nvmem-cells = <&macaddr_art_2>; nvmem-cell-names = "mac-address"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_2: macaddr@2 { - reg = <0x2 0x6>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9330_ziking_cpe46b.dts b/target/linux/ath79/dts/ar9330_ziking_cpe46b.dts index 5801044f4e8202..256fe5f6154cfa 100644 --- a/target/linux/ath79/dts/ar9330_ziking_cpe46b.dts +++ b/target/linux/ath79/dts/ar9330_ziking_cpe46b.dts @@ -78,6 +78,18 @@ label = "art"; reg = <0x7f0000 0x010000>; read-only; + + 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>; + }; + }; }; }; }; @@ -86,16 +98,15 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &wmac { @@ -103,13 +114,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_8dev_carambola2.dts b/target/linux/ath79/dts/ar9331_8dev_carambola2.dts index d99e0a422a7047..f786f425f05abf 100644 --- a/target/linux/ath79/dts/ar9331_8dev_carambola2.dts +++ b/target/linux/ath79/dts/ar9331_8dev_carambola2.dts @@ -92,6 +92,20 @@ label = "art"; reg = <0xff0000 0x010000>; 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>; + }; + }; }; }; }; @@ -124,17 +138,3 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/ar9331_alfa-network_ap121f.dtsi b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi index 2be7cdb05d59a1..98de255332d6f9 100644 --- a/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi +++ b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dtsi @@ -101,20 +101,22 @@ reg = <0x040000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts index de6b709b5cb65a..6286f203efc2ae 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/ar9331_etactica_eg200.dts b/target/linux/ath79/dts/ar9331_etactica_eg200.dts index 402fca80a1eacb..5a96d50940283f 100644 --- a/target/linux/ath79/dts/ar9331_etactica_eg200.dts +++ b/target/linux/ath79/dts/ar9331_etactica_eg200.dts @@ -109,6 +109,16 @@ art: art@ff0000 { reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -118,13 +128,3 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_glinet_6408.dts b/target/linux/ath79/dts/ar9331_glinet_6408.dts index 0d3b7d64101bb1..eae6be30047154 100644 --- a/target/linux/ath79/dts/ar9331_glinet_6408.dts +++ b/target/linux/ath79/dts/ar9331_glinet_6408.dts @@ -28,6 +28,16 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -61,13 +71,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_glinet_6416.dts b/target/linux/ath79/dts/ar9331_glinet_6416.dts index 91b7cc0c1c43fe..62d0acbf5d322b 100644 --- a/target/linux/ath79/dts/ar9331_glinet_6416.dts +++ b/target/linux/ath79/dts/ar9331_glinet_6416.dts @@ -28,6 +28,16 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -61,13 +71,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts b/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts index e5460b299df17b..211c565c247fa8 100644 --- a/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts +++ b/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts @@ -113,6 +113,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -144,13 +154,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts b/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts index 6f332dd99b3aed..541b73850a0599 100644 --- a/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts +++ b/target/linux/ath79/dts/ar9331_glinet_gl-usb150.dts @@ -108,6 +108,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -118,13 +128,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi b/target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi index 69d974eb538432..565f62a0ba8cf5 100644 --- a/target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi +++ b/target/linux/ath79/dts/ar9331_hak5_lan-turtle.dtsi @@ -24,9 +24,8 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; gmac-config { device = <&gmac>; @@ -39,9 +38,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &pinmux { @@ -68,6 +66,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -92,13 +102,3 @@ &usb_phy { status = "okay"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts b/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts index 0502d5d14ce26f..5701dff64c4c7e 100644 --- a/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts +++ b/target/linux/ath79/dts/ar9331_hak5_wifi-pineapple-nano.dts @@ -102,6 +102,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -120,13 +130,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_hiwifi_hc6361.dts b/target/linux/ath79/dts/ar9331_hiwifi_hc6361.dts index fa000ab90c7ced..3751374af679fb 100644 --- a/target/linux/ath79/dts/ar9331_hiwifi_hc6361.dts +++ b/target/linux/ath79/dts/ar9331_hiwifi_hc6361.dts @@ -77,7 +77,6 @@ }; bdinfo: partition@10000 { - compatible = "nvmem-cells"; reg = <0x10000 0x10000>; label = "bdinfo"; read-only; diff --git a/target/linux/ath79/dts/ar9331_onion_omega.dts b/target/linux/ath79/dts/ar9331_onion_omega.dts index 09e42341946e87..81fab872b5cc66 100644 --- a/target/linux/ath79/dts/ar9331_onion_omega.dts +++ b/target/linux/ath79/dts/ar9331_onion_omega.dts @@ -72,9 +72,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; gmac-config { device = <&gmac>; @@ -100,6 +99,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -122,16 +133,6 @@ mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts b/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts index 58ef4ab0910cd2..4868ba2fa0e4e9 100644 --- a/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts +++ b/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts @@ -55,6 +55,16 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; firmware: partition@20000 { @@ -106,13 +116,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts index f438567e52c83f..61cbb1aae28247 100644 --- a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts +++ b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts @@ -63,6 +63,16 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; firmware: partition@20000 { @@ -115,13 +125,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts b/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts index 26004c1cfd6724..69965f86a8bf90 100644 --- a/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts +++ b/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts @@ -109,15 +109,14 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 0>; nvmem-cell-names = "mac-address"; }; @@ -144,6 +143,18 @@ label = "config"; reg = <0x20000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; art: partition@30000 { @@ -190,17 +201,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; -}; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_0: macaddr@0 { - reg = <0x0 0x6>; - }; }; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts b/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts index c23e5dac5165d1..7a1a577ed7fed7 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts @@ -113,6 +113,16 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -162,13 +172,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts index b0f24bbfa705d4..b07f9a7820659c 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts @@ -108,6 +108,16 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -151,13 +161,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi index 5fda458fbc34e7..a8608a77e1949e 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi @@ -60,6 +60,16 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -114,13 +124,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi index 61ef9fb99f081a..d1336e96895609 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi @@ -25,6 +25,18 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -43,29 +55,18 @@ }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi index 4d3b1dba1d6ff9..613b357dc872d2 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi @@ -101,6 +101,18 @@ reg = <0x0 0x20000>; label = "u-boot"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; firmware: partition@20000 { @@ -121,9 +133,8 @@ ð0 { /* WAN interface, initialized last as eth1 */ status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; gmac-config { device = <&gmac>; @@ -136,7 +147,7 @@ ð1 { /* LAN interface, initialized first as eth0 */ status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -144,16 +155,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts b/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts index 4a993c9301209e..9ba89324223ba9 100644 --- a/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts +++ b/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts @@ -57,11 +57,13 @@ }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts index ec574ccf9f0e9e..eb304db8a380d8 100644 --- a/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts +++ b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts @@ -88,11 +88,13 @@ }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi b/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi index 2dfdff03d8271c..bb6af232fd2e69 100644 --- a/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi +++ b/target/linux/ath79/dts/ar9341_openmesh_om2p-hs.dtsi @@ -132,6 +132,20 @@ label = "ART"; reg = <0xfc0000 0x040000>; 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>; + }; + }; }; }; }; @@ -156,17 +170,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/ar9341_pcs_cr3000.dts b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts index 4e4daef1c8e65e..5ec17034d17b6d 100644 --- a/target/linux/ath79/dts/ar9341_pcs_cr3000.dts +++ b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts @@ -118,6 +118,18 @@ label = "art"; reg = <0x7f0000 0x010000>; read-only; + + 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>; + }; + }; }; }; }; @@ -133,16 +145,15 @@ status = "okay"; phy-handle = <&swphy0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { phy-handle = <&swphy4>; pll-data = <0x06000000 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; gmac-config { @@ -150,13 +161,3 @@ switch-phy-swap = <1>; }; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts b/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts index 23b5cf745044f8..496d6579e7671a 100644 --- a/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts +++ b/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts @@ -180,6 +180,16 @@ label = "art"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -214,13 +224,3 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts b/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts index 2ccd50d7836a03..3971df17f81fec 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts @@ -64,6 +64,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -90,29 +102,18 @@ }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi b/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi index 5d5b88c5f3b99e..71e2c7b8d819d0 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi @@ -32,6 +32,16 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -75,13 +85,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts index d86571c5319871..417461a59559f9 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts @@ -47,6 +47,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -65,29 +77,18 @@ }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts index 0fc34884453fe4..d0f4c2e1f5aab5 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts @@ -65,6 +65,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -91,31 +103,20 @@ }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; ð1 { phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wr941nd-v5.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wr941nd-v5.dts index a61f4a381eaeec..180504523c997b 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr941nd-v5.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr941nd-v5.dts @@ -57,6 +57,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -75,29 +87,18 @@ }; ð0 { // WAN port, initialized last as eth1 - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { // LAN ports, initialized first as eth0 - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts index cda96494e70138..f14e138026211e 100644 --- a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts +++ b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts @@ -52,6 +52,7 @@ partitions { compatible = "fixed-partitions"; + #address-cells = <1>; #size-cells = <1>; partition@0 { diff --git a/target/linux/ath79/dts/ar9342_ruckus_zf7321.dts b/target/linux/ath79/dts/ar9342_ruckus_zf7321.dts index 7bfc85d086808b..917dc297fe1237 100644 --- a/target/linux/ath79/dts/ar9342_ruckus_zf7321.dts +++ b/target/linux/ath79/dts/ar9342_ruckus_zf7321.dts @@ -49,6 +49,26 @@ }; }; +&board_data { + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_board_data_60: macaddr@60 { + reg = <0x60 0x6>; + }; + + macaddr_board_data_66: macaddr@66 { + reg = <0x66 0x6>; + }; + + cal_board_data_41000: cal@41000 { + reg = <0x41000 0x440>; + }; + }; +}; + ð0 { nvmem-cells = <&macaddr_board_data_66>; }; diff --git a/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts b/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts index 49cf39062a22a8..c3c20985e2b4cf 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts @@ -63,20 +63,22 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi index ba0f7ad23e5294..d85a07a8dcb180 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi @@ -70,6 +70,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -81,13 +91,3 @@ ieee80211-freq-limit = <2402000 2482000>; mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi index ce49c10e5ccb5b..899f1677488336 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi @@ -98,6 +98,16 @@ label = "art"; reg = <0x7f0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -113,13 +123,3 @@ nvmem-cells = <&macaddr_art_0>; nvmem-cell-names = "mac-address"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9342_zyxel_nwa11xx.dtsi b/target/linux/ath79/dts/ar9342_zyxel_nwa11xx.dtsi index a05cc2e2637630..b30d545fa312e2 100644 --- a/target/linux/ath79/dts/ar9342_zyxel_nwa11xx.dtsi +++ b/target/linux/ath79/dts/ar9342_zyxel_nwa11xx.dtsi @@ -92,8 +92,6 @@ reg = <0xfe0000 0x010000>; read-only; - compatible = "nvmem-cells"; - nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; @@ -118,16 +116,18 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - calibration_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts b/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts index a2ac53b9963785..2a2036201e6239 100644 --- a/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts +++ b/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts @@ -106,9 +106,8 @@ compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_hw_info_0>; + nvmem-cells = <&macaddr_hw_info_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; }; @@ -141,6 +140,18 @@ label = "hw-info"; reg = <0x90000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_hw_info_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@a0000 { @@ -161,9 +172,8 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_hw_info_0>; + nvmem-cells = <&macaddr_hw_info_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &nand { @@ -217,7 +227,7 @@ pll-data = <0x06000000 0x00000101 0x00001313>; - nvmem-cells = <&macaddr_hw_info_0>; + nvmem-cells = <&macaddr_hw_info_0 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; @@ -230,13 +240,3 @@ rxdv-delay = <1>; }; }; - -&hw_info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_hw_info_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts b/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts index ca762c3bca4074..789bd6df149083 100644 --- a/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts +++ b/target/linux/ath79/dts/ar9344_alfa-network_n5q.dts @@ -136,24 +136,26 @@ reg = <0x070000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_araknis_an-300-ap-i-n.dts b/target/linux/ath79/dts/ar9344_araknis_an-300-ap-i-n.dts index ac39a626790b51..a45aa444de4b85 100644 --- a/target/linux/ath79/dts/ar9344_araknis_an-300-ap-i-n.dts +++ b/target/linux/ath79/dts/ar9344_araknis_an-300-ap-i-n.dts @@ -72,7 +72,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; @@ -87,9 +87,8 @@ ath9k: wifi@0,0,0 { compatible = "pci168c,0030"; reg = <0x0 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 1>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <1>; ieee80211-freq-limit = <2402000 2482000>; #gpio-cells = <2>; gpio-controller; @@ -101,25 +100,28 @@ ieee80211-freq-limit = <4900000 5990000>; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 2>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <2>; }; &art { - 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_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_atheros_db120.dts b/target/linux/ath79/dts/ar9344_atheros_db120.dts index 8811d4f4576baa..9d5044141245c6 100644 --- a/target/linux/ath79/dts/ar9344_atheros_db120.dts +++ b/target/linux/ath79/dts/ar9344_atheros_db120.dts @@ -140,24 +140,26 @@ reg = <0x7f0000 0x010000>; 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>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + 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>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts b/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts index 94a82baddcdc0f..c53f03235fcbd0 100644 --- a/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts +++ b/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts @@ -100,6 +100,20 @@ label = "art"; reg = <0x010000 0x010000>; 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>; + }; + }; }; partition@20000 { @@ -139,17 +153,3 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/ar9344_compex_wpj344-16m.dts b/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts index e456f1f0e582a4..21329db2584241 100644 --- a/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts +++ b/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts @@ -78,6 +78,16 @@ label = "u-boot"; reg = <0x000000 0x030000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_2e010: macaddr@2e010 { + reg = <0x2e010 0x6>; + }; + }; }; partition@30000 { @@ -143,13 +153,3 @@ phy-mode = "rgmii"; phy-handle = <&phy0>; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_2e010: macaddr@2e010 { - reg = <0x2e010 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi b/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi index 1cec6625692672..df157f582cf8cf 100644 --- a/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi +++ b/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi @@ -116,6 +116,18 @@ label = "art"; reg = <0xff0000 0x10000>; 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>; + }; + }; }; }; }; @@ -130,9 +142,8 @@ pll-data = <0x02000000 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; phy-mode = "rgmii"; phy-handle = <&phy0>; @@ -169,13 +180,3 @@ >; }; }; - -&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_dlink_dir-8x5.dtsi b/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi index 8db1bf5e0c0ded..96235dbbc443e5 100644 --- a/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi +++ b/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi @@ -116,8 +116,6 @@ reg = <0xfe0000 0x010000>; read-only; - compatible = "nvmem-cells"; - nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; @@ -142,16 +140,18 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; - cal_art_5000: cal@5000 { - reg = <0x5000 0x440>; + cal_art_5000: cal@5000 { + reg = <0x5000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar9344_embeddedwireless_balin.dts b/target/linux/ath79/dts/ar9344_embeddedwireless_balin.dts index a84c273f8622c5..de138658180760 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/ar9344_engenius_eap600.dts b/target/linux/ath79/dts/ar9344_engenius_eap600.dts index 618660802c09e7..888e3f82ada1cc 100644 --- a/target/linux/ath79/dts/ar9344_engenius_eap600.dts +++ b/target/linux/ath79/dts/ar9344_engenius_eap600.dts @@ -29,38 +29,40 @@ }; ð0 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &pcie { wifi@0,0,0 { - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 0>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; }; }; &wmac { - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 (-1)>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-1)>; }; &art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_engenius_ecb600.dts b/target/linux/ath79/dts/ar9344_engenius_ecb600.dts index 5f6ffb130d79a8..ac9bbea5d4d734 100644 --- a/target/linux/ath79/dts/ar9344_engenius_ecb600.dts +++ b/target/linux/ath79/dts/ar9344_engenius_ecb600.dts @@ -24,38 +24,40 @@ }; ð0 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; &pcie { wifi@0,0,0 { - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 (-2)>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-2)>; }; }; &wmac { - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 (-1)>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-1)>; }; &art { - 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_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_fortinet_ap-dual.dtsi b/target/linux/ath79/dts/ar9344_fortinet_ap-dual.dtsi index d5275c496e341b..c8f12a1bfbdf21 100644 --- a/target/linux/ath79/dts/ar9344_fortinet_ap-dual.dtsi +++ b/target/linux/ath79/dts/ar9344_fortinet_ap-dual.dtsi @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT #include "ar9344.dtsi" -#include "ar934x_fortinet_loader.dtsi" +#include "arxxxx_fortinet_loader.dtsi" #include #include diff --git a/target/linux/ath79/dts/ar9344_fortinet_fap-221-b.dts b/target/linux/ath79/dts/ar9344_fortinet_fap-221-b.dts index b78a588f5ccd47..0cad9b76d15e6a 100644 --- a/target/linux/ath79/dts/ar9344_fortinet_fap-221-b.dts +++ b/target/linux/ath79/dts/ar9344_fortinet_fap-221-b.dts @@ -6,6 +6,10 @@ compatible = "fortinet,fap-221-b", "qca,ar9344"; model = "Fortinet FAP-221-B"; + aliases { + label-mac-device = <ð0>; + }; + leds { compatible = "gpio-leds"; @@ -51,25 +55,34 @@ &ath9k { ieee80211-freq-limit = <2402000 2482000>; - nvmem-cells = <&calibration_pcie>; - nvmem-cell-names = "calibration"; + nvmem-cells = <&calibration_pcie>, <&macaddr_uboot_3ff80 8>; + nvmem-cell-names = "calibration", "mac-address"; +}; + +ð0 { + nvmem-cells = <&macaddr_uboot_3ff80 0>; + nvmem-cell-names = "mac-address"; }; &wmac { ieee80211-freq-limit = <2402000 2482000 4900000 5990000>; - nvmem-cells = <&calibration_wmac>; - nvmem-cell-names = "calibration"; + nvmem-cells = <&calibration_wmac>, <&macaddr_uboot_3ff80 1>; + nvmem-cell-names = "calibration", "mac-address"; }; &art { - compatible = "nvmem-cells"; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - calibration_wmac: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_wmac: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_pcie: calibration@5000 { - reg = <0x5000 0x440>; + calibration_pcie: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_netgear_pgzng1.dts b/target/linux/ath79/dts/ar9344_netgear_pgzng1.dts index 5b91dd1e4d8400..b513a360352712 100644 --- a/target/linux/ath79/dts/ar9344_netgear_pgzng1.dts +++ b/target/linux/ath79/dts/ar9344_netgear_pgzng1.dts @@ -289,20 +289,22 @@ reg = <0xffe0000 0x20000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_caldata_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_caldata_6: macaddr@6 { - reg = <0x6 0x6>; - }; - - cal_caldata_1000: cal@1000 { - reg = <0x1000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_caldata_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_caldata_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + cal_caldata_1000: cal@1000 { + reg = <0x1000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar9344_netgear_r6100.dts b/target/linux/ath79/dts/ar9344_netgear_r6100.dts index 76bd77d4c65ef3..419fa51f6175b6 100644 --- a/target/linux/ath79/dts/ar9344_netgear_r6100.dts +++ b/target/linux/ath79/dts/ar9344_netgear_r6100.dts @@ -130,6 +130,32 @@ label = "caldata"; reg = <0x0020000 0x0040000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; + + cal_ath10k: calibration@5000 { + reg = <0x5000 0x844>; + }; + + macaddr_caldata_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_caldata_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_caldata_c: macaddr@c { + reg = <0xc 0x6>; + }; + }; }; partition@60000 { @@ -204,29 +230,3 @@ nvmem-cells = <&cal_ath9k>; nvmem-cell-names = "calibration"; }; - -&caldata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; - - cal_ath10k: calibration@5000 { - reg = <0x5000 0x844>; - }; - - macaddr_caldata_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_caldata_6: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_caldata_c: macaddr@c { - reg = <0xc 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi index 331a4c6fa32c86..d2a30000044e63 100644 --- a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi @@ -127,6 +127,28 @@ label = "caldata"; reg = <0x80000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_caldata_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_caldata_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0x440>; + }; + }; }; partition@c0000 { @@ -259,25 +281,3 @@ gpio-controller; }; }; - -&caldata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_caldata_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_caldata_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0x440>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts index 11205413f4ce43..39ba2ffc3aff4c 100644 --- a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts +++ b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts @@ -114,28 +114,30 @@ reg = <0xff0000 0x010000>; 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_c: macaddr@c { - reg = <0xc 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + 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_c: macaddr@c { + reg = <0xc 0x6>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi b/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi index b35d699bdc1675..7661789e2f6156 100644 --- a/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi +++ b/target/linux/ath79/dts/ar9344_openmesh_mr600.dtsi @@ -75,20 +75,24 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + 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>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; }; @@ -110,7 +114,7 @@ pll-data = <0x02000000 0x00000101 0x00001313>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; @@ -127,9 +131,8 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 1>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <1>; }; &pcie { @@ -138,9 +141,8 @@ ath9k: wifi@0,0 { compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 8>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <8>; gpio-controller; #gpio-cells = <2>; diff --git a/target/linux/ath79/dts/ar9344_openmesh_om5p-an.dts b/target/linux/ath79/dts/ar9344_openmesh_om5p-an.dts index 6fab2b3219b959..38153d9dc068c8 100644 --- a/target/linux/ath79/dts/ar9344_openmesh_om5p-an.dts +++ b/target/linux/ath79/dts/ar9344_openmesh_om5p-an.dts @@ -153,20 +153,24 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + 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>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; }; @@ -188,7 +192,7 @@ pll-data = <0x02000000 0x00000101 0x00001313>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; @@ -206,17 +210,15 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wmac { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 2>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <2>; }; &pcie { @@ -225,8 +227,7 @@ wifi@0,0 { compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 16>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <16>; }; }; diff --git a/target/linux/ath79/dts/ar9344_openmesh_om5p.dts b/target/linux/ath79/dts/ar9344_openmesh_om5p.dts index 3e60d05ed32f5c..e3aa19c82de6ff 100644 --- a/target/linux/ath79/dts/ar9344_openmesh_om5p.dts +++ b/target/linux/ath79/dts/ar9344_openmesh_om5p.dts @@ -135,6 +135,20 @@ label = "ART"; reg = <0xff0000 0x010000>; 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>; + }; + }; }; }; }; @@ -161,17 +175,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/ar9344_pcs_cap324.dts b/target/linux/ath79/dts/ar9344_pcs_cap324.dts index ea7077d2c8f707..aab04b080a89cb 100644 --- a/target/linux/ath79/dts/ar9344_pcs_cap324.dts +++ b/target/linux/ath79/dts/ar9344_pcs_cap324.dts @@ -107,6 +107,18 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + 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>; + }; + }; }; }; }; @@ -118,9 +130,8 @@ ath9k: wifi@0,0 { compatible = "168c,0030"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; mtd-cal-data = <&art 0x5000>; qca,no-eeprom; ieee80211-freq-limit = <2402000 2482000>; @@ -134,9 +145,8 @@ ieee80211-freq-limit = <4900000 5990000>; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &mdio0 { @@ -154,19 +164,9 @@ /* default for ar934x, except for 1000M */ pll-data = <0x06000000 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; phy-handle = <&phy0>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts index b5fef91eacc5f2..a5fc1160c2ce88 100644 --- a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts +++ b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts @@ -99,6 +99,20 @@ label = "art"; reg = <0x7f0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_5002: macaddr@5002 { + reg = <0x5002 0x6>; + }; + }; }; }; }; @@ -202,17 +216,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_5002: macaddr@5002 { - reg = <0x5002 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-16m.dts b/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-16m.dts index 7c2f90e72c3a78..33e2990284e226 100644 --- a/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-16m.dts +++ b/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-16m.dts @@ -24,15 +24,14 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 0>; nvmem-cell-names = "mac-address"; gmac-config { @@ -49,13 +48,3 @@ reg = <0x070000 0xf90000>; }; }; - -&pridata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_pridata_400: macaddr@400 { - reg = <0x400 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-8m.dts b/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-8m.dts index 042974610ca09c..b20d187941da86 100644 --- a/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-8m.dts +++ b/target/linux/ath79/dts/ar9344_qxwlan_e750a-v4-8m.dts @@ -24,15 +24,14 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 0>; nvmem-cell-names = "mac-address"; gmac-config { @@ -49,13 +48,3 @@ reg = <0x070000 0x790000>; }; }; - -&pridata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_pridata_400: macaddr@400 { - reg = <0x400 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-16m.dts b/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-16m.dts index ecc3d8b8cdd22b..ed9cd2000a2055 100644 --- a/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-16m.dts +++ b/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-16m.dts @@ -31,7 +31,7 @@ pll-data = <0x06000000 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; @@ -45,13 +45,3 @@ reg = <0x070000 0xf90000>; }; }; - -&pridata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_pridata_400: macaddr@400 { - reg = <0x400 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-8m.dts b/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-8m.dts index e2152ff464f9fe..5a7feba0b65262 100644 --- a/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-8m.dts +++ b/target/linux/ath79/dts/ar9344_qxwlan_e750g-v8-8m.dts @@ -31,7 +31,7 @@ pll-data = <0x06000000 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; @@ -45,13 +45,3 @@ reg = <0x070000 0x790000>; }; }; - -&pridata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_pridata_400: macaddr@400 { - reg = <0x400 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_qxwlan_e750x.dtsi b/target/linux/ath79/dts/ar9344_qxwlan_e750x.dtsi index a41e626ea4a11c..238a59cbe8d543 100644 --- a/target/linux/ath79/dts/ar9344_qxwlan_e750x.dtsi +++ b/target/linux/ath79/dts/ar9344_qxwlan_e750x.dtsi @@ -85,6 +85,18 @@ label = "pri-data"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_pridata_400: macaddr@400 { + compatible = "mac-base"; + reg = <0x400 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; art: partition@60000 { diff --git a/target/linux/ath79/dts/ar9344_ruckus_zf7372.dts b/target/linux/ath79/dts/ar9344_ruckus_zf7372.dts index 2cf7240931177c..dbccbef023b7f0 100644 --- a/target/linux/ath79/dts/ar9344_ruckus_zf7372.dts +++ b/target/linux/ath79/dts/ar9344_ruckus_zf7372.dts @@ -127,11 +127,29 @@ }; &board_data { - macaddr_board_data_6c: macaddr@6c { - reg = <0x6c 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_board_data_60: macaddr@60 { + reg = <0x60 0x6>; + }; + + macaddr_board_data_66: macaddr@66 { + reg = <0x66 0x6>; + }; - macaddr_board_data_76: macaddr@76 { - reg = <0x76 0x6>; + macaddr_board_data_6c: macaddr@6c { + reg = <0x6c 0x6>; + }; + + macaddr_board_data_76: macaddr@76 { + reg = <0x76 0x6>; + }; + + cal_board_data_41000: cal@41000 { + reg = <0x41000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_samsung_wam250.dts b/target/linux/ath79/dts/ar9344_samsung_wam250.dts index fd5bf9e81d46ac..0bbd5c92fe9e59 100644 --- a/target/linux/ath79/dts/ar9344_samsung_wam250.dts +++ b/target/linux/ath79/dts/ar9344_samsung_wam250.dts @@ -66,9 +66,8 @@ phy-handle = <&swphy0>; - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; gmac-config { device = <&gmac>; @@ -79,7 +78,7 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 0>; nvmem-cell-names = "mac-address"; }; @@ -137,6 +136,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>; + }; + }; }; }; }; @@ -156,13 +167,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_teltonika_rut955-h7v3c0.dts b/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts index 2cb8d4015c514a..b94b44cfc4c9a1 100644 --- a/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts +++ b/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts @@ -164,15 +164,14 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ath79/dts/ar9344_teltonika_rut955.dts b/target/linux/ath79/dts/ar9344_teltonika_rut955.dts index 7a1f05afccaca7..d8ce6a10927352 100644 --- a/target/linux/ath79/dts/ar9344_teltonika_rut955.dts +++ b/target/linux/ath79/dts/ar9344_teltonika_rut955.dts @@ -163,15 +163,14 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi b/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi index 937095959c9e0a..64959c9dc2998a 100644 --- a/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi +++ b/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi @@ -79,6 +79,18 @@ label = "config"; reg = <0x20000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; art: partition@30000 { @@ -144,9 +156,8 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &pinmux { @@ -169,13 +180,3 @@ <0x3c 0x000b0000 0x00ff0000>; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi index 9d8873ddaf1b32..f15c1c320acb9a 100644 --- a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi @@ -55,6 +55,16 @@ label = "info"; reg = <0x030000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@40000 { @@ -116,13 +126,3 @@ line-name = "tp-link:ext:lna1"; }; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts b/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts index 1600e12b644816..a66e1fefa25eed 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts @@ -49,16 +49,30 @@ status = "okay"; }; -&ath9k { - mac-address-increment = <1>; +&wmac { + status = "okay"; + nvmem-cells = <&macaddr_uboot_1fc00 0>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,0033"; + reg = <0x0000 0 0 0 0>; + #gpio-cells = <2>; + gpio-controller; + nvmem-cells = <&macaddr_uboot_1fc00 1>, <&cal_art_5000>; + nvmem-cell-names = "mac-address", "calibration"; + }; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; gmac-config { device = <&gmac>; @@ -72,7 +86,6 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi index d2791aee709d9c..7aa1989290bdd2 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi @@ -76,7 +76,22 @@ }; &wmac { - mac-address-increment = <(-1)>; + status = "okay"; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,0033"; + reg = <0x0000 0 0 0 0>; + #gpio-cells = <2>; + gpio-controller; + nvmem-cells = <&macaddr_uboot_1fc00 0>, <&cal_art_5000>; + nvmem-cell-names = "mac-address", "calibration"; + }; }; &mdio0 { @@ -104,7 +119,7 @@ /* default for ar934x, except for 1000M */ pll-data = <0x06000000 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii"; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi b/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi index a2649d19e9356e..7f49b9bde7a8b7 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi @@ -83,6 +83,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -95,50 +107,21 @@ label = "art"; reg = <0x7f0000 0x010000>; read-only; - }; - }; - }; -}; - -&pcie { - status = "okay"; - - ath9k: wifi@0,0 { - compatible = "pci168c,0033"; - reg = <0x0000 0 0 0 0>; - #gpio-cells = <2>; - gpio-controller; - nvmem-cells = <&macaddr_uboot_1fc00>, <&cal_art_5000>; - nvmem-cell-names = "mac-address", "calibration"; - }; -}; -&wmac { - status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>, <&cal_art_1000>; - nvmem-cell-names = "mac-address", "calibration"; -}; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; - cal_art_5000: cal@5000 { - reg = <0x5000 0x440>; + cal_art_5000: cal@5000 { + reg = <0x5000 0x440>; + }; + }; + }; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts b/target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts index 49526fb6d233ff..6649e2477b25bf 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts @@ -95,6 +95,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -133,7 +145,7 @@ mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -142,15 +154,14 @@ phy-handle = <&swphy0>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; gmac-config { @@ -158,13 +169,3 @@ switch-phy-swap = <1>; }; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts b/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts index 55626c42995a57..2aba2bd2c013c7 100644 --- a/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts +++ b/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts @@ -105,20 +105,22 @@ reg = <0xff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/ar9344_watchguard_ap100.dts b/target/linux/ath79/dts/ar9344_watchguard_ap100.dts index 0ab10c36ce2ab2..2fd9a6e51bf72b 100644 --- a/target/linux/ath79/dts/ar9344_watchguard_ap100.dts +++ b/target/linux/ath79/dts/ar9344_watchguard_ap100.dts @@ -56,9 +56,8 @@ }; ð0 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &pcie { @@ -73,25 +72,28 @@ &wmac { /delete-property/ ieee80211-freq-limit; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 (-2)>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-2)>; }; &art { - 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_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_watchguard_ap200.dts b/target/linux/ath79/dts/ar9344_watchguard_ap200.dts index 88c7637fc9b11f..9cf6819958feff 100644 --- a/target/linux/ath79/dts/ar9344_watchguard_ap200.dts +++ b/target/linux/ath79/dts/ar9344_watchguard_ap200.dts @@ -56,39 +56,40 @@ }; ð0 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &pcie { wifi@0,0,0 { - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 (-1)>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-1)>; }; }; &wmac { - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 (-2)>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-2)>; }; &art { - 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_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts b/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts index cbde191ac78352..4b692b6d9bb3ab 100644 --- a/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts +++ b/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts @@ -124,16 +124,18 @@ reg = <0xfe0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x440>; + }; }; }; @@ -142,12 +144,16 @@ reg = <0xff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_addr_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_addr_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; @@ -160,9 +166,8 @@ ath9k: wifi@0,0 { compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_addr_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_addr_0 0x10>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <0x10>; #gpio-cells = <2>; gpio-controller; }; @@ -179,7 +184,7 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_addr_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_addr_0 0>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; }; @@ -196,9 +201,8 @@ pll-data = <0xe000000 0x04000101 0x04001313>; - nvmem-cells = <&macaddr_addr_0>; + nvmem-cells = <&macaddr_addr_0 0x21>; nvmem-cell-names = "mac-address"; - mac-address-increment = <0x21>; phy-mode = "rgmii-rxid"; phy-handle = <&phy4>; diff --git a/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts b/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts index 8dc1ceb666608c..36802a5275702d 100644 --- a/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts +++ b/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts @@ -133,6 +133,20 @@ art: art@ff0000 { reg = <0xff0000 0x10000>; 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>; + }; + }; }; }; }; @@ -160,17 +174,3 @@ pinctrl-single,bits = <0x14 0x0 0xff00>; }; }; - -&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/ath79/dts/ar934x_ruckus_zf73xx.dtsi b/target/linux/ath79/dts/ar934x_ruckus_zf73xx.dtsi index a0348e7213a8a8..d494f9b1ed86f6 100644 --- a/target/linux/ath79/dts/ar934x_ruckus_zf73xx.dtsi +++ b/target/linux/ath79/dts/ar934x_ruckus_zf73xx.dtsi @@ -178,21 +178,3 @@ &usb_phy { status = "okay"; }; - -&board_data { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_board_data_60: macaddr@60 { - reg = <0x60 0x6>; - }; - - macaddr_board_data_66: macaddr@66 { - reg = <0x66 0x6>; - }; - - cal_board_data_41000: cal@41000 { - reg = <0x41000 0x440>; - }; -}; diff --git a/target/linux/ath79/dts/ar934x_fortinet_loader.dtsi b/target/linux/ath79/dts/arxxxx_fortinet_loader.dtsi similarity index 81% rename from target/linux/ath79/dts/ar934x_fortinet_loader.dtsi rename to target/linux/ath79/dts/arxxxx_fortinet_loader.dtsi index d7cbf2e73796a4..786626828f2cae 100644 --- a/target/linux/ath79/dts/ar934x_fortinet_loader.dtsi +++ b/target/linux/ath79/dts/arxxxx_fortinet_loader.dtsi @@ -36,10 +36,22 @@ #address-cells = <1>; #size-cells = <1>; - partition@0 { + uboot: partition@0 { label = "u-boot"; reg = <0x000000 0x040000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_3ff80: mac-address@3ff80 { + compatible = "mac-base"; + reg = <0x3ff80 0xc>; + #nvmem-cell-cells = <1>; + }; + }; }; fwconcat0: partition@40000 { diff --git a/target/linux/ath79/dts/qca9531_8dev_lima.dts b/target/linux/ath79/dts/qca9531_8dev_lima.dts index 5a21251d6d3e63..19097d71836014 100644 --- a/target/linux/ath79/dts/qca9531_8dev_lima.dts +++ b/target/linux/ath79/dts/qca9531_8dev_lima.dts @@ -67,6 +67,20 @@ label = "art"; reg = <0x080000 0x040000>; 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>; + }; + }; }; partition@c0000 { @@ -108,17 +122,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca9531_alcatel_hh40v.dts b/target/linux/ath79/dts/qca9531_alcatel_hh40v.dts index 7873f75528b92a..072a0fa27c2a5f 100644 --- a/target/linux/ath79/dts/qca9531_alcatel_hh40v.dts +++ b/target/linux/ath79/dts/qca9531_alcatel_hh40v.dts @@ -119,24 +119,26 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts b/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts index 8759198f532808..c9cd7038a5d90d 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts +++ b/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts @@ -106,15 +106,13 @@ }; ð0 { - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; ð1 { - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &pcie0 { diff --git a/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts b/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts index e9e19f9d3287e3..52a6b5431f3c86 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts +++ b/target/linux/ath79/dts/qca9531_alfa-network_pi-wifi4.dts @@ -45,9 +45,8 @@ }; ð0 { - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; ð1 { diff --git a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts index 6af8d3b8b526fe..943731e69eb8d3 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts +++ b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts @@ -50,9 +50,8 @@ }; ð0 { - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; ð1 { @@ -60,9 +59,8 @@ * (GMAC0 -> eth0, GMAC1 -> eth1, same as in old ar71xx target) */ compatible = "qca,qca9530-eth", "syscon", "simple-mfd"; - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &gpio_export { diff --git a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi index 406985d576f58d..13a2e28619c87e 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi +++ b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi @@ -87,16 +87,20 @@ reg = <0x070000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_1002: macaddr@1002 { + compatible = "mac-base"; + reg = <0x1002 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -120,6 +124,6 @@ &wmac { status = "okay"; - nvmem-cells = <&cal_art_1000>, <&macaddr_art_1002>; + nvmem-cells = <&cal_art_1000>, <&macaddr_art_1002 0>; nvmem-cell-names = "calibration", "mac-address"; }; diff --git a/target/linux/ath79/dts/qca9531_alfa-network_tube-2hq.dts b/target/linux/ath79/dts/qca9531_alfa-network_tube-2hq.dts index f81fe287dfecac..9b35e471e5922f 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_tube-2hq.dts +++ b/target/linux/ath79/dts/qca9531_alfa-network_tube-2hq.dts @@ -46,10 +46,8 @@ }; ð0 { - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 (-1)>; nvmem-cell-names = "mac-address"; - - mac-address-increment = <(-1)>; }; ð1 { diff --git a/target/linux/ath79/dts/qca9531_asus_rp-ac51.dts b/target/linux/ath79/dts/qca9531_asus_rp-ac51.dts index ec8b825ef2f512..b2777f6cc6fb9c 100644 --- a/target/linux/ath79/dts/qca9531_asus_rp-ac51.dts +++ b/target/linux/ath79/dts/qca9531_asus_rp-ac51.dts @@ -97,16 +97,18 @@ reg = <0x050000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts index 4a84e150ae6596..d0d2a07c2b46e7 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts @@ -94,6 +94,16 @@ label = "art"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; partition@20000 { @@ -134,13 +144,3 @@ nvmem-cell-names = "mac-address"; mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts index c187521351919c..d078a9dcce5bec 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts @@ -93,6 +93,20 @@ label = "art"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; + }; }; partition@20000 { @@ -143,17 +157,3 @@ reg = <0 0 0 0 0>; }; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts index 92881267885368..ff053d628e471e 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts @@ -108,6 +108,20 @@ label = "art"; reg = <0x010000 0x010000>; 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>; + }; + }; }; partition@20000 { @@ -149,17 +163,3 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca9531_comfast_cf-e5.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts index 17cbe1df142b4b..73d45f9b7cc0bf 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts @@ -92,6 +92,20 @@ label = "art"; reg = <0x010000 0x010000>; 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>; + }; + }; }; partition@20000 { @@ -134,17 +148,3 @@ pinctrl-single,bits = <0x4 0x0 0xff>; }; }; - -&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/ath79/dts/qca9531_comfast_cf-e560ac.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts index 75e30ff1b7bb03..a316c48c5b4804 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts @@ -103,6 +103,18 @@ label = "art"; reg = <0x010000 0x010000>; read-only; + + 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>; + }; + }; }; partition@20000 { @@ -143,13 +155,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -157,17 +168,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 10>; nvmem-cell-names = "mac-address"; - mac-address-increment = <10>; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; }; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts b/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts index e5024b39f94fda..f725ab1faa2928 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts @@ -87,6 +87,18 @@ label = "art"; reg = <0x010000 0x010000>; read-only; + + 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>; + }; + }; }; partition@20000 { @@ -109,13 +121,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -123,17 +134,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; }; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts b/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts index fc2f6de111410e..ba33ee9a92307e 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts @@ -87,6 +87,18 @@ label = "art"; reg = <0x010000 0x010000>; read-only; + + 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>; + }; + }; }; partition@20000 { @@ -109,7 +121,7 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -122,17 +134,6 @@ mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 10>; nvmem-cell-names = "mac-address"; - mac-address-increment = <10>; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; }; diff --git a/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts b/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts index 16a2794b9732b2..7a8f6edcee1cf3 100644 --- a/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts +++ b/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts @@ -83,6 +83,20 @@ label = "u-boot"; reg = <0x000000 0x030000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_2e010: macaddr@2e010 { + reg = <0x2e010 0x6>; + }; + + macaddr_uboot_2e018: macaddr@2e018 { + reg = <0x2e018 0x6>; + }; + }; }; partition@30000 { @@ -136,17 +150,3 @@ &usb0 { status = "okay"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_2e010: macaddr@2e010 { - reg = <0x2e010 0x6>; - }; - - macaddr_uboot_2e018: macaddr@2e018 { - reg = <0x2e018 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi index 667f779b171ff9..652ffb9c698b81 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi @@ -114,6 +114,18 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + 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>; + }; + }; }; }; }; @@ -154,14 +166,13 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; ð1 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wmac { @@ -169,16 +180,6 @@ mtd-cal-data = <&art 0x1000>; }; -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; - &pinmux { pinctrl-names = "default"; pinctrl-0 = <&enable_gpio17>; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts index 60bd2922a2d722..1c6dcee8bf8578 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts @@ -113,6 +113,18 @@ label = "art"; reg = <0x050000 0x010000>; read-only; + + 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>; + }; + }; }; partition@60000 { @@ -129,14 +141,13 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; ð1 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wmac { @@ -144,13 +155,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts index ca0784e6bf60f6..e0c65b7f1b886f 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts @@ -83,6 +83,16 @@ label = "art"; reg = <0x50000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; partition@60000 { @@ -133,13 +143,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-s200-nor-nand.dts b/target/linux/ath79/dts/qca9531_glinet_gl-s200-nor-nand.dts new file mode 100644 index 00000000000000..297093c09a120c --- /dev/null +++ b/target/linux/ath79/dts/qca9531_glinet_gl-s200-nor-nand.dts @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "qca9531_glinet_gl-s200.dtsi" + +/ { + compatible = "glinet,gl-s200-nor-nand", "qca,qca9531"; + model = "GL.iNet GL-S200 (NOR/NAND)"; +}; + +&nor_partitions { + partition@60000 { + label = "kernel"; + reg = <0x060000 0x400000>; + }; + parition@460000 { + label = "nor_reserved"; + reg = <0x460000 0xb80000>; + }; + parition@fe0000 { + label = "log"; + reg = <0xfe0000 0x020000>; + }; +}; + +&flash_nand { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-s200-nor.dts b/target/linux/ath79/dts/qca9531_glinet_gl-s200-nor.dts new file mode 100644 index 00000000000000..e1ca4eaf738ed4 --- /dev/null +++ b/target/linux/ath79/dts/qca9531_glinet_gl-s200-nor.dts @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "qca9531_glinet_gl-s200.dtsi" + +/ { + compatible = "glinet,gl-s200-nor", "qca,qca9531"; + model = "GL.iNet GL-S200 (NOR)"; +}; + +&nor_partitions { + partition@60000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x060000 0xf80000>; + }; + partition@fe0000 { + label = "log"; + reg = <0xfe0000 0x020000>; + }; +}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-s200.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-s200.dtsi new file mode 100644 index 00000000000000..114ad46135191d --- /dev/null +++ b/target/linux/ath79/dts/qca9531_glinet_gl-s200.dtsi @@ -0,0 +1,197 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + compatible = "glinet,gl-s200", "qca,qca9531"; + model = "GL.iNet GL-S200"; + + aliases { + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + reset { + label = "reset"; + linux,code = ; + linux,input-type = ; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + switch { + label = "switch"; + linux,code = ; + linux,input-type = ; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + blue_led { + label = "gl-s200:blue"; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + white_led { + label = "gl-s200:white"; + gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + orange_led { + label = "gl-s200:orange"; + gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + gpio_zigbee_reset { + gpio-export,name = "gpio1"; + gpio-export,output = <1>; + gpio-export,direction_may_change; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + }; + + gpio_zwave_reset { + gpio-export,name = "gpio2"; + gpio-export,output = <1>; + gpio-export,direction_may_change; + gpios = <&gpio 2 GPIO_ACTIVE_HIGH>; + }; + + gpio_zigbee_upgrade { + gpio-export,name = "gpio11"; + gpio-export,output = <1>; + gpio-export,direction_may_change; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + }; + + gpio_zwave_upgrade { + gpio-export,name = "gpio17"; + gpio-export,output = <1>; + gpio-export,direction_may_change; + gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&gpio { + ngpios = <17>; + gpio-line-names = + "","reset-zigbee","reset-zwave","reset", + "LED-orange","","","","","","", + "upgrade-zigbee","LED-white","LED-blue", + "switch","","","upgrade-zwave"; +}; + +&pcie0 { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + nor_partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + art: partition@50000 { + label = "art"; + reg = <0x050000 0x010000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_wan_lan: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + }; + }; + }; + }; + + flash_nand: flash@1 { + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <25000000>; + status = "disabled"; + + nand_partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + nand_ubi: partition@0 { + label = "ubi"; + reg = <0x000000 0x8000000>; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + nvmem-cells = <&macaddr_wan_lan 0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_wan_lan 1>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + status = "okay"; + nvmem-cells = <&calibration_art_1000>; + nvmem-cell-names = "calibration"; +}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dts index 5f5646b3e037e4..104ed3c72df44c 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-x300b.dts @@ -108,6 +108,18 @@ label = "art"; reg = <0x050000 0x010000>; read-only; + + 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>; + }; + }; }; partition@60000 { @@ -123,16 +135,15 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&swphy4>; }; ð1 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wmac { @@ -140,13 +151,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts index 0b2030bb49cecf..3f1ad22a764a41 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts @@ -95,6 +95,18 @@ label = "art"; reg = <0x050000 0x010000>; read-only; + + 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>; + }; + }; }; partition@60000 { @@ -111,14 +123,13 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; ð1 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wmac { @@ -126,13 +137,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts b/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts index 9212c0a7548b58..37830c4f7d0484 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts @@ -108,6 +108,18 @@ label = "art"; reg = <0x50000 0x10000>; read-only; + + 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>; + }; + }; }; partition@60000 { @@ -145,14 +157,13 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; ð1 { - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wmac { @@ -160,13 +171,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts b/target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts index 2838b9c82d63c6..3b01fa9e421b51 100644 --- a/target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts +++ b/target/linux/ath79/dts/qca9531_joyit_jt-or750i.dts @@ -94,6 +94,20 @@ label = "art"; reg = <0xff0000 0x10000>; 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>; + }; + }; }; }; }; @@ -122,17 +136,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca9531_letv_lba-047-ch.dts b/target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts index 586facc9e5be34..414db556cade37 100644 --- a/target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts +++ b/target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts @@ -119,20 +119,22 @@ reg = <0xff0000 0x10000>; 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>; - }; - - cal_art_1000: calibration@1000 { - reg = <0x1000 0x440>; + 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>; + }; + + cal_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi b/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi index ce515159b1501b..04becd63c1013c 100644 --- a/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi +++ b/target/linux/ath79/dts/qca9531_qxwlan_e600g.dtsi @@ -79,6 +79,18 @@ label = "pri-data"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_pridata_400: macaddr@400 { + compatible = "mac-base"; + reg = <0x400 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; art: partition@60000 { @@ -95,13 +107,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 0>; nvmem-cell-names = "mac-address"; }; @@ -110,13 +121,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&pridata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_pridata_400: macaddr@400 { - reg = <0x400 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_telco_t1.dts b/target/linux/ath79/dts/qca9531_telco_t1.dts index 540de60377e2ff..1748d9e1c9cf0b 100644 --- a/target/linux/ath79/dts/qca9531_telco_t1.dts +++ b/target/linux/ath79/dts/qca9531_telco_t1.dts @@ -96,6 +96,20 @@ label = "art"; reg = <0x010000 0x010000>; 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>; + }; + }; }; partition@20000 { @@ -138,17 +152,3 @@ pinctrl-single,bits = <0x4 0x0 0xff>; }; }; - -&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/ath79/dts/qca9531_teltonika_rut300.dts b/target/linux/ath79/dts/qca9531_teltonika_rut300.dts index f79be8dca54be4..f01bcafbad333c 100644 --- a/target/linux/ath79/dts/qca9531_teltonika_rut300.dts +++ b/target/linux/ath79/dts/qca9531_teltonika_rut300.dts @@ -84,6 +84,18 @@ label = "config"; reg = <0x020000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@30000 { @@ -118,28 +130,17 @@ status = "okay"; }; -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; - ð0 { status = "okay"; phy-handle = <&swphy0>; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 0>; nvmem-cell-names = "mac-address"; gmac-config { diff --git a/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts b/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts index 0fc2bd3df82756..fb594f78c06d71 100644 --- a/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts @@ -124,6 +124,18 @@ label = "romfile"; reg = <0x7d0000 0x010000>; 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@7e0000 { @@ -146,13 +158,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_romfile_f100>; + nvmem-cells = <&macaddr_romfile_f100 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_romfile_f100>; + nvmem-cells = <&macaddr_romfile_f100 0>; nvmem-cell-names = "mac-address"; }; @@ -160,7 +171,7 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_romfile_f100>; + nvmem-cells = <&macaddr_romfile_f100 0>; nvmem-cell-names = "mac-address"; }; @@ -180,13 +191,3 @@ &usb0 { status = "okay"; }; - -&romfile { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_romfile_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts b/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts index e6fb85259612bf..f288317c2c374f 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts @@ -149,6 +149,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -171,13 +183,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -185,7 +196,7 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -196,13 +207,3 @@ &usb_phy { status = "okay"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts b/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts index 5a990fff023009..76f12887386c42 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts @@ -106,6 +106,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -128,22 +140,20 @@ phy-handle = <&swphy0>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -154,13 +164,3 @@ &usb_phy { status = "okay"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts b/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts index 09f086b90ddda4..048099e2604d63 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts @@ -125,6 +125,18 @@ label = "info"; reg = <0x750000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@760000 { @@ -147,9 +159,8 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { @@ -160,7 +171,7 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; @@ -180,13 +191,3 @@ &usb0 { status = "okay"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_wallys_dr531.dts b/target/linux/ath79/dts/qca9531_wallys_dr531.dts index 9982914442d3b7..59f86170c98f19 100644 --- a/target/linux/ath79/dts/qca9531_wallys_dr531.dts +++ b/target/linux/ath79/dts/qca9531_wallys_dr531.dts @@ -116,6 +116,20 @@ env: partition@30000 { label = "u-boot-env"; reg = <0x030000 0x010000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_env_f810: macaddr@f810 { + reg = <0xf810 0x6>; + }; + + macaddr_env_f818: macaddr@f818 { + reg = <0xf818 0x6>; + }; + }; }; partition@40000 { @@ -152,17 +166,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&env { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_env_f810: macaddr@f810 { - reg = <0xf810 0x6>; - }; - - macaddr_env_f818: macaddr@f818 { - reg = <0xf818 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9531_yuncore_a770.dts b/target/linux/ath79/dts/qca9531_yuncore_a770.dts index a255342015af15..fa1f7dc5fca3c5 100644 --- a/target/linux/ath79/dts/qca9531_yuncore_a770.dts +++ b/target/linux/ath79/dts/qca9531_yuncore_a770.dts @@ -88,6 +88,20 @@ label = "art"; reg = <0xff0000 0x010000>; 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>; + }; + }; }; }; }; @@ -116,17 +130,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca9533_comfast_cf-e110n-v2.dts b/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts index 64df0cff7c5f86..f4422e2242903d 100644 --- a/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts +++ b/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts @@ -112,6 +112,24 @@ label = "art"; reg = <0x010000 0x010000>; 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>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; + }; }; partition@20000 { @@ -154,21 +172,3 @@ nvmem-cells = <&macaddr_art_6>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9533_kuwfi_c910.dts b/target/linux/ath79/dts/qca9533_kuwfi_c910.dts index a705aa8686bdc6..487bbf9d4c7081 100644 --- a/target/linux/ath79/dts/qca9533_kuwfi_c910.dts +++ b/target/linux/ath79/dts/qca9533_kuwfi_c910.dts @@ -140,16 +140,20 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - calibration_art_1000: macaddr@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: macaddr@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_1002: macaddr@1002 { + compatible = "mac-base"; + reg = <0x1002 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; @@ -169,15 +173,14 @@ phy-handle = <&swphy0>; - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 0>; nvmem-cell-names = "mac-address"; gmac-config { diff --git a/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi b/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi index 8a51d6b6d6597f..1f3bf68f69c593 100644 --- a/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi +++ b/target/linux/ath79/dts/qca9533_openmesh_om2p-v4.dtsi @@ -122,6 +122,22 @@ label = "ART"; reg = <0xfc0000 0x040000>; read-only; + + 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 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -132,7 +148,7 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -150,21 +166,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; -}; - -&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/ath79/dts/qca9533_plasmacloud_pa300.dtsi b/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi index 602365f45d8579..66ede5554d0839 100644 --- a/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi +++ b/target/linux/ath79/dts/qca9533_plasmacloud_pa300.dtsi @@ -104,6 +104,18 @@ label = "ART"; reg = <0xfc0000 0x040000>; read-only; + + 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>; + }; + }; }; }; }; @@ -114,7 +126,7 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -124,26 +136,14 @@ */ compatible = "qca,qca9530-eth", "syscon", "simple-mfd"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; }; diff --git a/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts b/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts index 05d87e3995990a..ce59e8a54b5c18 100644 --- a/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts +++ b/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts @@ -45,6 +45,20 @@ label = "art"; reg = <0xff0000 0x010000>; 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>; + }; + }; }; }; @@ -61,17 +75,3 @@ &wmac { mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca9533_qca_ap143-8m.dts b/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts index db6a92720ba3a3..f04885e47d1625 100644 --- a/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts +++ b/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts @@ -45,6 +45,20 @@ label = "art"; reg = <0x7f0000 0x010000>; 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>; + }; + }; }; }; @@ -61,17 +75,3 @@ &wmac { mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca9533_tplink_cpexxx.dtsi b/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi index 3f3fae1dfd70f5..e7044b60a4366f 100644 --- a/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi @@ -80,6 +80,16 @@ label = "info"; reg = <0x030000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@40000 { @@ -119,13 +129,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi index 43db72ec650895..5a05869a1c0367 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi @@ -80,6 +80,16 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -117,13 +127,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts index e7d837a5740b89..762197f255af11 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts @@ -128,6 +128,16 @@ label = "info"; reg = <0x3c0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@3d0000 { @@ -165,13 +175,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi index 4be1ced4b21552..b2d525acb704ce 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi @@ -51,6 +51,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -73,9 +85,8 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { @@ -86,16 +97,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi index c9c109ee392bfb..c0e23f6d62e4f1 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi @@ -86,6 +86,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -108,13 +120,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -122,16 +133,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841hp-v3.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr841hp-v3.dts index 07b706251a349b..c11f11ae185255 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr841hp-v3.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841hp-v3.dts @@ -108,6 +108,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -130,13 +142,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -144,16 +155,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts index 2d00159909b300..33234fcb9f7a79 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts @@ -119,6 +119,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -141,13 +153,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -155,16 +166,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts b/target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts index e854f3700cd0a1..c5d6e66c9a786f 100644 --- a/target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts +++ b/target/linux/ath79/dts/qca9533_ubnt_aircube-isp.dts @@ -66,6 +66,20 @@ label = "art"; reg = <0xff0000 0x010000>; 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>; + }; + }; }; }; }; @@ -93,17 +107,3 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca9533_yuncore_a930.dts b/target/linux/ath79/dts/qca9533_yuncore_a930.dts index 089eebaa9ccbc8..30b340768f7487 100644 --- a/target/linux/ath79/dts/qca9533_yuncore_a930.dts +++ b/target/linux/ath79/dts/qca9533_yuncore_a930.dts @@ -79,6 +79,20 @@ label = "art"; reg = <0xff0000 0x010000>; 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>; + }; + }; }; }; }; @@ -102,17 +116,3 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca953x_dlink_dap-2xxx.dtsi b/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi index 13d41f7bd57d56..ff08f90106c821 100644 --- a/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi +++ b/target/linux/ath79/dts/qca953x_dlink_dap-2xxx.dtsi @@ -47,12 +47,14 @@ reg = <0xff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - cal_ath9k: calibration@1000 { - reg = <0x1000 0x440>; + cal_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi b/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi index e49b8fc1ca051b..e3b35b810d6397 100644 --- a/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi +++ b/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi @@ -68,6 +68,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -90,13 +102,12 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -104,16 +115,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9550_airtight_c-75.dts b/target/linux/ath79/dts/qca9550_airtight_c-75.dts index 8dbf1c8bc465d8..d4bf64ab40bba8 100644 --- a/target/linux/ath79/dts/qca9550_airtight_c-75.dts +++ b/target/linux/ath79/dts/qca9550_airtight_c-75.dts @@ -156,6 +156,20 @@ label = "art"; reg = <0xff0000 0x010000>; 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>; + }; + }; }; }; }; @@ -191,17 +205,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&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/ath79/dts/qca9557_8dev_rambutan.dts b/target/linux/ath79/dts/qca9557_8dev_rambutan.dts index a81687469285ec..f01ac7fc91c132 100644 --- a/target/linux/ath79/dts/qca9557_8dev_rambutan.dts +++ b/target/linux/ath79/dts/qca9557_8dev_rambutan.dts @@ -45,6 +45,20 @@ label = "art"; reg = <0x500000 0x100000>; 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>; + }; + }; }; partition@600000 { @@ -119,17 +133,3 @@ &usb1 { 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/ath79/dts/qca9557_araknis_an-500-ap-i-ac.dts b/target/linux/ath79/dts/qca9557_araknis_an-500-ap-i-ac.dts index bd9f3e8da8a002..6d402df13f922b 100644 --- a/target/linux/ath79/dts/qca9557_araknis_an-500-ap-i-ac.dts +++ b/target/linux/ath79/dts/qca9557_araknis_an-500-ap-i-ac.dts @@ -59,6 +59,18 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + 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>; + }; + }; }; }; @@ -75,7 +87,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy5>; @@ -89,21 +101,10 @@ mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &pcie0 { status = "okay"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts b/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts index a4e2a615f6404a..f17af66cdf9df6 100644 --- a/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts +++ b/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts @@ -95,6 +95,20 @@ label = "art"; reg = <0xff0000 0x010000>; 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>; + }; + }; }; }; }; @@ -136,17 +150,3 @@ full-duplex; }; }; - -&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/ath79/dts/qca9557_dlink_dap-2660-a1.dts b/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts index 93e2fc0d974dad..b380fef5152ce4 100644 --- a/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts +++ b/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts @@ -90,7 +90,17 @@ }; &art { - cal_ath10k: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; + + cal_ath10k: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi index 498499c1466065..31d86b1cf07f93 100644 --- a/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi +++ b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi @@ -102,20 +102,24 @@ reg = <0x1f0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0x844>; + 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>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0x844>; + }; }; }; }; @@ -154,18 +158,16 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>; + nvmem-cells = <&macaddr_art_0 4>, <&cal_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <4>; }; }; &wmac { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&cal_art_1000>; + nvmem-cells = <&macaddr_art_0 3>, <&cal_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <3>; }; &usb_phy0 { @@ -196,9 +198,8 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; phy-handle = <&phy0>; pll-data = <0xa6000000 0x00000101 0x00001616>; diff --git a/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts b/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts index d20a0444753a13..da159caa20cc26 100644 --- a/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts +++ b/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts @@ -62,20 +62,24 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x844>; + 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>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; @@ -93,7 +97,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy5>; @@ -105,17 +109,15 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 1>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <1>; }; &ath10k_0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 2>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <2>; }; &pcie0 { diff --git a/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts index 12740b9bdf7d35..154744afd51767 100644 --- a/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts +++ b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts @@ -65,6 +65,18 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + 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>; + }; + }; }; }; @@ -88,7 +100,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy1>; @@ -100,9 +112,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; phy-handle = <&phy2>; @@ -114,13 +125,3 @@ &pcie0 { status = "okay"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts index c8b1d94c96572f..a6197fd25ae3d4 100644 --- a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts +++ b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts @@ -83,6 +83,18 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + 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>; + }; + }; }; }; @@ -90,21 +102,10 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &pcie0 { status = "okay"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts b/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts index 520ca60144b265..81a9e6ca086357 100644 --- a/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts +++ b/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts @@ -75,7 +75,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy5>; @@ -88,9 +88,8 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &pcie0 { @@ -98,11 +97,15 @@ }; &art { - 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_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9558_aruba_ap-115.dts b/target/linux/ath79/dts/qca9558_aruba_ap-115.dts index b8aed4c283a611..c15cb677b9f05e 100644 --- a/target/linux/ath79/dts/qca9558_aruba_ap-115.dts +++ b/target/linux/ath79/dts/qca9558_aruba_ap-115.dts @@ -97,10 +97,8 @@ reg = <0x0000 0 0 0 0>; qca,no-eeprom; - nvmem-cells = <&macaddr_oemdata_1d>; + nvmem-cells = <&macaddr_oemdata_1d 1>; nvmem-cell-names = "mac-address"; - - mac-address-increment = <1>; }; }; @@ -164,6 +162,18 @@ label = "oemdata"; reg = <0xfe0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_oemdata_1d: macaddr@1d { + compatible = "mac-base"; + reg = <0x1d 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@ff0000 { @@ -178,7 +188,7 @@ status = "okay"; qca,no-eeprom; - nvmem-cells = <&macaddr_oemdata_1d>; + nvmem-cells = <&macaddr_oemdata_1d 0>; nvmem-cell-names = "mac-address"; }; @@ -200,7 +210,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_oemdata_1d>; + nvmem-cells = <&macaddr_oemdata_1d 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; @@ -219,16 +229,6 @@ }; }; -&oemdata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_oemdata_1d: macaddr@1d { - reg = <0x1d 0x6>; - }; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi b/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi index 72e52129a4cf08..b20a36a031900f 100644 --- a/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi +++ b/target/linux/ath79/dts/qca9558_belkin_f9x-v2.dtsi @@ -151,6 +151,18 @@ art: partition@ff0000 { label = "art"; reg = <0xff0000 0x010000>; + + 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>; + }; + }; }; }; }; @@ -178,7 +190,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; pll-data = <0xa6000000 0x00000101 0x00001616>; @@ -192,9 +204,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; pll-data = <0x03000101 0x00000101 0x00001616>; fixed-link { @@ -217,13 +228,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-e380ac-v2.dts b/target/linux/ath79/dts/qca9558_comfast_cf-e380ac-v2.dts index b38e2e848f670a..8ce173f70dd0f4 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-e380ac-v2.dts +++ b/target/linux/ath79/dts/qca9558_comfast_cf-e380ac-v2.dts @@ -91,6 +91,18 @@ label = "art"; reg = <0x040000 0x010000>; read-only; + + 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>; + }; + }; }; partition@50000 { @@ -111,7 +123,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; pll-data = <0xbe000000 0xb0000101 0xb0001313>; @@ -134,17 +146,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 10>; nvmem-cell-names = "mac-address"; - mac-address-increment = <10>; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; }; diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts index ba145d6fb0fe1e..e0471c534870a7 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts @@ -30,6 +30,24 @@ label = "art"; reg = <0x020000 0x010000>; 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>; + }; + + macaddr_art_18: macaddr@18 { + reg = <0x18 0x6>; + }; + }; }; partition@30000 { @@ -63,21 +81,3 @@ nvmem-cells = <&macaddr_art_18>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_18: macaddr@18 { - reg = <0x18 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts index d0929f981c0120..9bbbf2a9b40db3 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts @@ -30,6 +30,24 @@ label = "art"; reg = <0x040000 0x010000>; 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>; + }; + + macaddr_art_18: macaddr@18 { + reg = <0x18 0x6>; + }; + }; }; partition@50000 { @@ -63,21 +81,3 @@ nvmem-cells = <&macaddr_art_18>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_18: macaddr@18 { - reg = <0x18 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_compex_wpj558-16m.dts b/target/linux/ath79/dts/qca9558_compex_wpj558-16m.dts index 61597c890956d9..d6ecc7728fad7a 100644 --- a/target/linux/ath79/dts/qca9558_compex_wpj558-16m.dts +++ b/target/linux/ath79/dts/qca9558_compex_wpj558-16m.dts @@ -76,6 +76,16 @@ label = "u-boot"; reg = <0x000000 0x030000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_2e010: macaddr@2e010 { + reg = <0x2e010 0x6>; + }; + }; }; firmware@30000 { @@ -131,13 +141,3 @@ &pcie0 { status = "okay"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_2e010: macaddr@2e010 { - reg = <0x2e010 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts index af305f8f07ae0c..d98600934ad60d 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts @@ -58,9 +58,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; phy-handle = <&phy1>; pll-data = <0x03000101 0x00000101 0x00001313>; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts index 6202ff37992a9b..c5209046173f01 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts @@ -93,9 +93,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; phy-handle = <&phy1>; pll-data = <0x03000101 0x00000101 0x00001313>; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi b/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi index b96b314fa54e23..9a2579dd941b3a 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi @@ -69,6 +69,18 @@ label = "art"; reg = <0x050000 0x010000>; read-only; + + 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>; + }; + }; }; partition@60000 { @@ -99,7 +111,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy4>; @@ -114,17 +126,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; }; diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts b/target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts index c398dd637f1173..d32329b3660dce 100644 --- a/target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts +++ b/target/linux/ath79/dts/qca9558_dlink_dap-2680-a1.dts @@ -90,7 +90,17 @@ }; &art { - precal_ath10k: pre-calibration@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; + + precal_ath10k: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts index 1985fa48d837cc..3ca641a550700c 100644 --- a/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts +++ b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts @@ -116,7 +116,17 @@ }; &art { - cal_ath10k: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; + + cal_ath10k: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts b/target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts index 27883f721cf55f..e72af99da24341 100644 --- a/target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts +++ b/target/linux/ath79/dts/qca9558_dlink_dap-3662-a1.dts @@ -104,7 +104,17 @@ }; &art { - cal_ath10k: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; + + cal_ath10k: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9558_dlink_dir-629-a1.dts b/target/linux/ath79/dts/qca9558_dlink_dir-629-a1.dts index d012ae4c5056e6..e5c2cbcb72c75a 100644 --- a/target/linux/ath79/dts/qca9558_dlink_dir-629-a1.dts +++ b/target/linux/ath79/dts/qca9558_dlink_dir-629-a1.dts @@ -114,8 +114,6 @@ reg = <0x048000 0x008000>; read-only; - compatible = "nvmem-cells"; - nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; @@ -152,12 +150,14 @@ reg = <0x080000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - cal_art_1000: calibration@1000 { - reg = <0x1000 0x440>; + cal_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts b/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts index 976ac551f72ff0..73f4ed0d1e1dd0 100644 --- a/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts +++ b/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts @@ -120,6 +120,24 @@ label = "art"; reg = <0xff0000 0x10000>; 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>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + }; }; }; }; @@ -193,21 +211,3 @@ nvmem-cells = <&macaddr_art_c>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_engenius_eap1750h.dts b/target/linux/ath79/dts/qca9558_engenius_eap1750h.dts index e17eda3840b1eb..56c08621a7465b 100644 --- a/target/linux/ath79/dts/qca9558_engenius_eap1750h.dts +++ b/target/linux/ath79/dts/qca9558_engenius_eap1750h.dts @@ -62,20 +62,24 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x844>; + 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>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; @@ -93,7 +97,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy5>; @@ -105,17 +109,15 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 1>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <1>; }; &ath10k_0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 2>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <2>; }; &pcie0 { diff --git a/target/linux/ath79/dts/qca9558_engenius_ews660ap.dts b/target/linux/ath79/dts/qca9558_engenius_ews660ap.dts index eca3a6091f71fb..9fa1927c1db84b 100644 --- a/target/linux/ath79/dts/qca9558_engenius_ews660ap.dts +++ b/target/linux/ath79/dts/qca9558_engenius_ews660ap.dts @@ -50,20 +50,24 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x844>; + 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>; + }; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; @@ -88,7 +92,7 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy1>; @@ -100,9 +104,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; phy-handle = <&phy2>; @@ -114,17 +117,15 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_0 2>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <2>; }; &ath10k_1 { status = "okay"; - nvmem-cells = <&macaddr_art_0>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_art_0 3>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <3>; }; &pcie1 { diff --git a/target/linux/ath79/dts/qca9558_jjplus_jwap230.dts b/target/linux/ath79/dts/qca9558_jjplus_jwap230.dts index 159013066f6296..6cd93f6b33d9d1 100644 --- a/target/linux/ath79/dts/qca9558_jjplus_jwap230.dts +++ b/target/linux/ath79/dts/qca9558_jjplus_jwap230.dts @@ -84,20 +84,22 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_lan: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_wan: macaddr@6 { - reg = <0x6 0x6>; - }; - - calibration_art_wlan: calibration@1000 { - reg = <0x1000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_lan: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_wan: macaddr@6 { + reg = <0x6 0x6>; + }; + + calibration_art_wlan: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts b/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts index b3447f8be368b1..5ee38b2e884c78 100644 --- a/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts +++ b/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts @@ -139,6 +139,24 @@ label = "art"; reg = <0xff0000 0x010000>; 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>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + }; }; }; }; @@ -193,21 +211,3 @@ nvmem-cells = <&macaddr_art_c>; nvmem-cell-names = "mac-address"; }; - -&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>; - }; - - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_linksys_ea4500-v3.dts b/target/linux/ath79/dts/qca9558_linksys_ea4500-v3.dts index 000dbce8e11a8e..6c799efe33a54e 100644 --- a/target/linux/ath79/dts/qca9558_linksys_ea4500-v3.dts +++ b/target/linux/ath79/dts/qca9558_linksys_ea4500-v3.dts @@ -90,20 +90,22 @@ reg = <0x140000 0x40000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_macaddr: macaddr@0 { - reg = <0x6 0x6>; - }; - - cal_ath9k_soc: cal_ath9k@1000 { - reg = <0x1000 0x440>; - }; - - cal_ath9k_pci: cal_ath9k@5000 { - reg = <0x5000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_macaddr: macaddr@0 { + reg = <0x6 0x6>; + }; + + cal_ath9k_soc: cal_ath9k@1000 { + reg = <0x1000 0x440>; + }; + + cal_ath9k_pci: cal_ath9k@5000 { + reg = <0x5000 0x440>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi index d668259b1b0025..82b8c2ae56f6fb 100644 --- a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi @@ -156,6 +156,7 @@ partitions { compatible = "fixed-partitions"; + #address-cells = <1>; #size-cells = <1>; partition@0 { diff --git a/target/linux/ath79/dts/qca9558_netgear_ex7300.dts b/target/linux/ath79/dts/qca9558_netgear_ex7300.dts index b94ccd30b7d9e7..81898e972f095f 100644 --- a/target/linux/ath79/dts/qca9558_netgear_ex7300.dts +++ b/target/linux/ath79/dts/qca9558_netgear_ex7300.dts @@ -159,6 +159,32 @@ label = "caldata"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_caldata_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_caldata_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_caldata_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_caldata_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + precal_caldata_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + }; }; partition@60000 { @@ -218,29 +244,3 @@ pll-data = <0x86000000 0x80000101 0x80001313>; }; - -&caldata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_caldata_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_caldata_6: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_caldata_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_caldata_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - precal_caldata_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_ocedo_koala.dts b/target/linux/ath79/dts/qca9558_ocedo_koala.dts index 85fd43699eec92..76305b2ecef2f5 100644 --- a/target/linux/ath79/dts/qca9558_ocedo_koala.dts +++ b/target/linux/ath79/dts/qca9558_ocedo_koala.dts @@ -106,6 +106,20 @@ label = "art"; reg = <0xff0000 0x010000>; 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>; + }; + }; }; }; }; @@ -140,17 +154,3 @@ pll-data = <0x8e000000 0x80000101 0x80001313>; }; - -&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/ath79/dts/qca9558_ocedo_ursus.dts b/target/linux/ath79/dts/qca9558_ocedo_ursus.dts index be958d19a08cc2..d2125c38ba302e 100644 --- a/target/linux/ath79/dts/qca9558_ocedo_ursus.dts +++ b/target/linux/ath79/dts/qca9558_ocedo_ursus.dts @@ -77,6 +77,24 @@ label = "art"; reg = <0xff0000 0x010000>; 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>; + }; + + macaddr_art_12: macaddr@12 { + reg = <0x12 0x6>; + }; + }; }; }; }; @@ -131,21 +149,3 @@ pll-data = <0x3000101 0x101 0x1313>; qca955x-sgmii-fixup; }; - -&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>; - }; - - macaddr_art_12: macaddr@12 { - reg = <0x12 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi b/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi index c2062a800a1144..32a176b542e483 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi +++ b/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi @@ -111,6 +111,22 @@ label = "ART"; reg = <0xff0000 0x010000>; read-only; + + 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 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -138,7 +154,7 @@ pll-data = <0x82000101 0x80000101 0x80001313>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; @@ -171,25 +187,10 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &pcie0 { 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/ath79/dts/qca9558_openmesh_mr.dtsi b/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi index 8e11760daf4b00..218d5eb944d51b 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi +++ b/target/linux/ath79/dts/qca9558_openmesh_mr.dtsi @@ -119,6 +119,18 @@ label = "ART"; reg = <0xff0000 0x010000>; read-only; + + 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>; + }; + }; }; }; }; @@ -139,7 +151,7 @@ pll-data = <0x82000000 0x80000101 0x80001313>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; @@ -155,21 +167,10 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &pcie0 { status = "okay"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts b/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts index 211255cddebc41..8ef3241ee0dcc9 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts +++ b/target/linux/ath79/dts/qca9558_openmesh_mr900-v1.dts @@ -19,8 +19,7 @@ wifi@0,0 { compatible = "pci168c,0033"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 16>; nvmem-cell-names = "mac-address"; - mac-address-increment = <16>; }; }; diff --git a/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts b/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts index 0d29c5cf06db31..cd3baacd158404 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts +++ b/target/linux/ath79/dts/qca9558_openmesh_mr900-v2.dts @@ -19,8 +19,7 @@ wifi@0,0 { compatible = "pci168c,0033"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 16>; nvmem-cell-names = "mac-address"; - mac-address-increment = <16>; }; }; diff --git a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v1.dts b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v1.dts index 147b98f92536e2..ee4b82ee8d9de4 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v1.dts +++ b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v1.dts @@ -130,6 +130,22 @@ label = "ART"; reg = <0xff0000 0x010000>; read-only; + + 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 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -157,7 +173,7 @@ pll-data = <0x82000101 0x80000101 0x80001313>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; @@ -190,25 +206,10 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &pcie1 { 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/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts index 1ce924b8a0b09a..d448ca4284500b 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts +++ b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts @@ -160,6 +160,22 @@ label = "ART"; reg = <0xff0000 0x010000>; read-only; + + 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 { + reg = <0x6 0x6>; + }; + }; }; }; }; @@ -191,7 +207,7 @@ pll-data = <0x82000101 0x80000101 0x80001313>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-mode = "rgmii-id"; @@ -224,21 +240,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; -}; - -&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/ath79/dts/qca9558_qxwlan_e558.dtsi b/target/linux/ath79/dts/qca9558_qxwlan_e558.dtsi index 5b28af5ca6efc8..716bc0d77b60c7 100644 --- a/target/linux/ath79/dts/qca9558_qxwlan_e558.dtsi +++ b/target/linux/ath79/dts/qca9558_qxwlan_e558.dtsi @@ -89,6 +89,18 @@ label = "pri-data"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_pridata_400: macaddr@400 { + compatible = "mac-base"; + reg = <0x400 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; art: partition@60000 { @@ -127,9 +139,8 @@ phy-handle = <&phy0>; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { @@ -137,7 +148,7 @@ pll-data = <0x03000101 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_pridata_400>; + nvmem-cells = <&macaddr_pridata_400 0>; nvmem-cell-names = "mac-address"; fixed-link { @@ -167,13 +178,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&pridata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_pridata_400: macaddr@400 { - reg = <0x400 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_sophos_ap.dtsi b/target/linux/ath79/dts/qca9558_sophos_ap.dtsi index 3d38ca79fe4e3d..8abd3e60b77600 100644 --- a/target/linux/ath79/dts/qca9558_sophos_ap.dtsi +++ b/target/linux/ath79/dts/qca9558_sophos_ap.dtsi @@ -107,6 +107,16 @@ label = "config"; reg = <0x060000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_201a: macaddr@201a { + reg = <0x201a 0x6>; + }; + }; }; partition@70000 { @@ -157,16 +167,6 @@ mtd-cal-data = <&art 0x1000>; }; -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_201a: macaddr@201a { - reg = <0x201a 0x6>; - }; -}; - &usb0 { vbus-supply = <®_usb_vbus>; }; diff --git a/target/linux/ath79/dts/qca9558_sophos_ap15.dts b/target/linux/ath79/dts/qca9558_sophos_ap15.dts index bb4b058a9a5a3e..490d3ae2276758 100644 --- a/target/linux/ath79/dts/qca9558_sophos_ap15.dts +++ b/target/linux/ath79/dts/qca9558_sophos_ap15.dts @@ -75,6 +75,16 @@ label = "config"; reg = <0x060000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_201a: macaddr@201a { + reg = <0x201a 0x6>; + }; + }; }; partition@70000 { @@ -126,13 +136,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_201a: macaddr@201a { - reg = <0x201a 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts b/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts index 85012d3aace036..d41b065c27e049 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts @@ -33,6 +33,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -49,29 +61,18 @@ }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts index e520a83d405a71..83e51b42cce510 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts @@ -33,6 +33,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -46,38 +58,29 @@ reg = <0x7f0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { - nvmem-cells = <&macaddr_uboot_1fc00>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_uboot_1fc00 0>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts index b7ac902003cacb..c722caeb5532d2 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts @@ -13,10 +13,11 @@ &keys { rfkill { + label = "rfkill"; gpios = <&gpio 23 GPIO_ACTIVE_LOW>; linux,code = ; linux,input-type = ; - debounce-interval = <60>; + debounce-interval = <1000>; }; }; @@ -33,6 +34,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -46,28 +59,29 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x844>; + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; @@ -78,23 +92,12 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <(-1)>; - nvmem-cells = <&macaddr_uboot_1fc00>, <&calibration_art_5000>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>, <&calibration_art_5000>; nvmem-cell-names = "mac-address", "calibration"; }; }; &wmac { - nvmem-cells = <&macaddr_uboot_1fc00>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_uboot_1fc00 0>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-d7-v1.dts b/target/linux/ath79/dts/qca9558_tplink_archer-d7-v1.dts index 4f822fbc7d1454..5869ee16e39ca2 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-d7-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-d7-v1.dts @@ -52,6 +52,18 @@ label = "romfs"; reg = <0xfd0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_romfs_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@fe0000 { @@ -70,28 +82,17 @@ }; ð0 { - nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cells = <&macaddr_romfs_f100 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cells = <&macaddr_romfs_f100 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cells = <&macaddr_romfs_f100 0>; nvmem-cell-names = "mac-address"; }; - -&romfs { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_romfs_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-d7b-v1.dts b/target/linux/ath79/dts/qca9558_tplink_archer-d7b-v1.dts index 9adaa7fa6d3037..7094077bc6f184 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-d7b-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-d7b-v1.dts @@ -46,6 +46,18 @@ label = "romfs"; reg = <0xfd0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_romfs_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@fe0000 { @@ -64,28 +76,17 @@ }; ð0 { - nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cells = <&macaddr_romfs_f100 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cells = <&macaddr_romfs_f100 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_romfs_f100>; + nvmem-cells = <&macaddr_romfs_f100 0>; nvmem-cell-names = "mac-address"; }; - -&romfs { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_romfs_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts b/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts index 0966f019089ba7..7c48326d576fb9 100644 --- a/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts @@ -152,6 +152,16 @@ label = "info"; reg = <0xda0000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@dc0000 { @@ -176,13 +186,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi b/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi index 31089f339daa4d..f90ebfea155738 100644 --- a/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi @@ -135,6 +135,18 @@ label = "info"; reg = <0x610000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@630000 { @@ -158,7 +170,7 @@ phy-handle = <&phy4>; pll-data = <0xa6000000 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; @@ -166,17 +178,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; -}; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts index c6b9b077da29cf..0edba24040e359 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts @@ -96,9 +96,8 @@ ath9k: wifi@0,0 { compatible = "pci168c,0033"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_uboot_1fc00>, <&cal_ath9k_pci>; + nvmem-cells = <&macaddr_uboot_1fc00 (-2)>, <&cal_ath9k_pci>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-2)>; #gpio-cells = <2>; gpio-controller; }; @@ -138,12 +137,16 @@ reg = <0x000000 0x020000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -158,16 +161,18 @@ reg = <0x7f0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - cal_ath9k_soc: cal_ath9k@1000 { - reg = <0x1000 0x440>; - }; + cal_ath9k_soc: cal_ath9k@1000 { + reg = <0x1000 0x440>; + }; - cal_ath9k_pci: cal_ath9k@5000 { - reg = <0x5000 0x440>; + cal_ath9k_pci: cal_ath9k@5000 { + reg = <0x5000 0x440>; + }; }; }; }; @@ -196,9 +201,8 @@ ð0 { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; phy-handle = <&phy0>; pll-data = <0x56000000 0x00000101 0x00001616>; @@ -211,7 +215,7 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; pll-data = <0x03000101 0x00000101 0x00001616>; @@ -224,7 +228,6 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_uboot_1fc00>, <&cal_ath9k_soc>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>, <&cal_ath9k_soc>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-1)>; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3.dts index 998ede85cb9f71..99a4273ad0db4a 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wdr7500-v3.dts @@ -33,6 +33,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -49,29 +61,18 @@ }; ð0 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi index 52996bba34767d..f4390f46568102 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi @@ -97,6 +97,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -138,9 +150,8 @@ pll-data = <0x56000000 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; phy-handle = <&phy0>; }; @@ -149,7 +160,7 @@ pll-data = <0x03000101 0x00000101 0x00001616>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; fixed-link { @@ -161,16 +172,6 @@ &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts index 27bf82d20df196..9d329000c9bd99 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wr941n-v7-cn.dts @@ -74,6 +74,16 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; }; partition@20000 { @@ -117,13 +127,3 @@ nvmem-cells = <&macaddr_uboot_1fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts b/target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts index 91675ff615322d..09e7e1bf8d9d35 100644 --- a/target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts +++ b/target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts @@ -98,13 +98,3 @@ phy-mode = "sgmii"; phy-handle = <&phy4>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_ubnt_powerbeam-5ac-500.dts b/target/linux/ath79/dts/qca9558_ubnt_powerbeam-5ac-500.dts index 3827a94b248b8e..48f06e3dcb8559 100644 --- a/target/linux/ath79/dts/qca9558_ubnt_powerbeam-5ac-500.dts +++ b/target/linux/ath79/dts/qca9558_ubnt_powerbeam-5ac-500.dts @@ -36,13 +36,3 @@ phy-mode = "sgmii"; phy-handle = <&phy4>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_ubnt_rocket-5ac-lite.dts b/target/linux/ath79/dts/qca9558_ubnt_rocket-5ac-lite.dts index 836211ccd58814..7df3759b628e9e 100644 --- a/target/linux/ath79/dts/qca9558_ubnt_rocket-5ac-lite.dts +++ b/target/linux/ath79/dts/qca9558_ubnt_rocket-5ac-lite.dts @@ -36,13 +36,3 @@ phy-mode = "sgmii"; phy-handle = <&phy4>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_watchguard_ap300.dts b/target/linux/ath79/dts/qca9558_watchguard_ap300.dts index 799883c350f2bf..5f5ef0f968719e 100644 --- a/target/linux/ath79/dts/qca9558_watchguard_ap300.dts +++ b/target/linux/ath79/dts/qca9558_watchguard_ap300.dts @@ -104,6 +104,18 @@ label = "art"; reg = <0x1ff0000 0x010000>; read-only; + + 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>; + }; + }; }; }; @@ -116,21 +128,10 @@ mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &pcie0 { status = "okay"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi b/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi index 3e254fa494eaaf..1e082ffd7f6f2d 100644 --- a/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi +++ b/target/linux/ath79/dts/qca955x_dlink_dap-2xxx.dtsi @@ -46,14 +46,6 @@ label = "art"; reg = <0xff0000 0x10000>; read-only; - - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; }; }; }; diff --git a/target/linux/ath79/dts/qca955x_senao_router-dual.dtsi b/target/linux/ath79/dts/qca955x_senao_router-dual.dtsi index e1b76bcbd1f81b..61446263c47983 100644 --- a/target/linux/ath79/dts/qca955x_senao_router-dual.dtsi +++ b/target/linux/ath79/dts/qca955x_senao_router-dual.dtsi @@ -103,14 +103,18 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - - calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_art_5000: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + calibration_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi b/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi index 0f803945db6328..519f831beabfe9 100644 --- a/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi +++ b/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi @@ -50,6 +50,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts index 4b371e0e8e8893..6179e621bf74f2 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts @@ -152,6 +152,18 @@ label = "info"; reg = <0x7e0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; art: partition@7f0000 { @@ -172,32 +184,21 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts index 180efada1270b6..a09e1fae6f4a2a 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts @@ -34,6 +34,18 @@ label = "info"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -58,29 +70,18 @@ }; ð0 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts index f05a290d2f8945..720a2b01a9c81d 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts @@ -51,6 +51,18 @@ label = "info"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -75,29 +87,18 @@ }; ð0 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts index 4be23ffbc02f7b..be6e6ade1c7e7d 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts @@ -57,6 +57,18 @@ label = "info"; reg = <0x030000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@40000 { @@ -81,29 +93,18 @@ }; ð0 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts index f5ab2e5977c9f2..eff85d6a586154 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts @@ -46,6 +46,18 @@ label = "info"; reg = <0x010000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -70,29 +82,18 @@ }; ð0 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts index 014222770f9aa9..18053d691c8e82 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts @@ -46,6 +46,18 @@ label = "info"; reg = <0x01fb00 0x000500>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -76,29 +88,18 @@ }; ð0 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts index a2f46ecd6045f1..068f9577591874 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts @@ -41,6 +41,18 @@ label = "info"; reg = <0x01fb00 0x000500>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -71,29 +83,18 @@ }; ð0 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; &wmac { mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts b/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts index 439549d14254d3..cf5f3a3a4e045d 100644 --- a/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts +++ b/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts @@ -63,9 +63,7 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <1>; - - nvmem-cells = <&macaddr_info_8>, <&precalibration_ath10k>; + nvmem-cells = <&macaddr_info_8 1>, <&precalibration_ath10k>; nvmem-cell-names = "mac-address", "pre-calibration"; }; }; @@ -99,6 +97,18 @@ label = "info"; reg = <0x030000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@40000 { @@ -132,16 +142,18 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - calibration_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; - precalibration_ath10k: pre-calibration@5000 { - reg = <0x5000 0x2f20>; + precalibration_ath10k: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; @@ -151,23 +163,13 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; - nvmem-cells = <&macaddr_info_8>, <&calibration_ath9k>; + nvmem-cells = <&macaddr_info_8 0>, <&calibration_ath9k>; nvmem-cell-names = "mac-address", "calibration"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9561_tplink_tl-wdr6500-v2.dts b/target/linux/ath79/dts/qca9561_tplink_tl-wdr6500-v2.dts index 15c586865975f9..04567e6b889eb3 100644 --- a/target/linux/ath79/dts/qca9561_tplink_tl-wdr6500-v2.dts +++ b/target/linux/ath79/dts/qca9561_tplink_tl-wdr6500-v2.dts @@ -81,12 +81,16 @@ reg = <0x000000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_0fc00: macaddr@0fc00 { - reg = <0x0fc00 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_0fc00: macaddr@0fc00 { + compatible = "mac-base"; + reg = <0x0fc00 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -101,16 +105,18 @@ reg = <0x7f0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - calibration_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_ath10k: calibration@5000 { - reg = <0x5000 0x844>; + calibration_ath10k: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; }; @@ -128,9 +134,8 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - nvmem-cells = <&macaddr_uboot_0fc00>, <&calibration_ath10k>; + nvmem-cells = <&macaddr_uboot_0fc00 (-2)>, <&calibration_ath10k>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-2)>; }; }; @@ -143,24 +148,22 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_0fc00>; + nvmem-cells = <&macaddr_uboot_0fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_uboot_0fc00>; + nvmem-cells = <&macaddr_uboot_0fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; - nvmem-cells = <&macaddr_uboot_0fc00>, <&calibration_ath9k>; + nvmem-cells = <&macaddr_uboot_0fc00 (-1)>, <&calibration_ath9k>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <(-1)>; }; &usb0 { diff --git a/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts index 6e45fbb20fc8dd..5f9f575b447325 100644 --- a/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts +++ b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts @@ -93,6 +93,22 @@ label = "art"; reg = <0x60000 0x10000>; read-only; + + 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 { + reg = <0x6 0x6>; + }; + }; }; partition@70000 { @@ -120,7 +136,7 @@ status = "okay"; phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; @@ -135,21 +151,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&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/ath79/dts/qca9563_asus_pl-ac56.dts b/target/linux/ath79/dts/qca9563_asus_pl-ac56.dts index c597b566aa0cf0..a31f188142ffad 100644 --- a/target/linux/ath79/dts/qca9563_asus_pl-ac56.dts +++ b/target/linux/ath79/dts/qca9563_asus_pl-ac56.dts @@ -91,12 +91,14 @@ reg = <0x050000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9563_asus_rp-ac66.dts b/target/linux/ath79/dts/qca9563_asus_rp-ac66.dts index ac3551d1156976..c4b9f347134815 100644 --- a/target/linux/ath79/dts/qca9563_asus_rp-ac66.dts +++ b/target/linux/ath79/dts/qca9563_asus_rp-ac66.dts @@ -113,12 +113,14 @@ reg = <0x050000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9563_comfast_cf-e375ac.dts b/target/linux/ath79/dts/qca9563_comfast_cf-e375ac.dts index 20c970095200eb..2f0a0992a9d45f 100644 --- a/target/linux/ath79/dts/qca9563_comfast_cf-e375ac.dts +++ b/target/linux/ath79/dts/qca9563_comfast_cf-e375ac.dts @@ -84,6 +84,18 @@ label = "art"; reg = <0x040000 0x010000>; read-only; + + 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>; + }; + }; }; partition@50000 { @@ -122,7 +134,7 @@ pll-data = <0x03000101 0x00000101 0x00001919>; phy-mode = "sgmii"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; }; @@ -131,17 +143,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 10>; nvmem-cell-names = "mac-address"; - mac-address-increment = <10>; -}; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; }; diff --git a/target/linux/ath79/dts/qca9563_compex_wpj563.dts b/target/linux/ath79/dts/qca9563_compex_wpj563.dts index ceac53f415a498..95ca9003983055 100644 --- a/target/linux/ath79/dts/qca9563_compex_wpj563.dts +++ b/target/linux/ath79/dts/qca9563_compex_wpj563.dts @@ -79,6 +79,16 @@ label = "u-boot"; reg = <0x000000 0x030000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_2e010: macaddr@2e010 { + reg = <0x2e010 0x6>; + }; + }; }; partition@30000 { @@ -130,18 +140,16 @@ status = "okay"; }; -&wmac { +&usb_phy1 { status = "okay"; +}; - mtd-cal-data = <&art 0x1000>; +&usb1 { + status = "okay"; }; -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; +&wmac { + status = "okay"; - macaddr_uboot_2e010: macaddr@2e010 { - reg = <0x2e010 0x6>; - }; + mtd-cal-data = <&art 0x1000>; }; 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 00000000000000..3047c6f4794544 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_dlink_covr-p2500-a1.dts @@ -0,0 +1,209 @@ +// 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; + + 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/dts/qca9563_dlink_dap-1720-a1.dts b/target/linux/ath79/dts/qca9563_dlink_dap-1720-a1.dts new file mode 100644 index 00000000000000..35f3913d9bfcc4 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_dlink_dap-1720-a1.dts @@ -0,0 +1,214 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" + +#include +#include +#include + +/ { + model = "D-Link DAP-1720 A1"; + compatible = "dlink,dap-1720-a1", "qca,qca9563"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_red; + + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + button-reset { + label = "reset"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + button-wps { + label = "wps"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_red: led-status-red { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + panic-indicator; + }; + + led_status_green: led-status-green { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + led-rssi-middle { + color = ; + function = "signal"; //LED_FUNCTION_SIGNAL; + function-enumerator = <2>; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led-rssi-top { + color = ; + function = "signal"; //LED_FUNCTION_SIGNAL; + function-enumerator = <3>; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + led-rssi-bottom-green { + color = ; + function = "signal"; //LED_FUNCTION_SIGNAL; + function-enumerator = <1>; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + + led-rssi-bottom-red { + color = ; + function = "signal"; //LED_FUNCTION_SIGNAL; + function-enumerator = <1>; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; // vendor calls it `bootloader` + reg = <0x000000 0x40000>; + read-only; + }; + + partition@40000 { + compatible = "u-boot,env"; + label = "u-boot-env"; // vendor calls it `bdcfg` + reg = <0x040000 0x10000>; + read-only; + }; + + partition@50000 { + label = "devdata"; + reg = <0x050000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_ath10k: macaddr@94 { + compatible = "mac-base"; + reg = <0x94 0x11>; + #nvmem-cell-cells = <1>; + }; + + macaddr_ath9k: macaddr@b0 { + compatible = "mac-base"; + reg = <0xb0 0x11>; + #nvmem-cell-cells = <1>; + }; + + macaddr_lan: macaddr@c9 { + compatible = "mac-base"; + reg = <0xc9 0x11>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@60000 { + label = "devconf"; + reg = <0x060000 0x10000>; + read-only; + }; + + partition@70000 { + compatible = "seama"; + label = "firmware"; + reg = <0x070000 0xf80000>; + }; + + partition@ff0000 { + label = "art"; // vendor calls it `radiocfg` + reg = <0xff0000 0x010000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_ath9k: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_ath10k: cal@5000 { + reg = <0x5000 0x844>; + }; + }; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&phy0>; + phy-mode = "sgmii"; + + nvmem-cells = <&macaddr_lan 0>; + nvmem-cell-names = "mac-address"; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0x0000 0 0 0 0>; + + nvmem-cells = <&cal_ath10k>, <&macaddr_ath10k 0>; + nvmem-cell-names = "calibration", "mac-address"; + }; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&cal_ath9k>, <&macaddr_ath9k 0>; + nvmem-cell-names = "calibration", "mac-address"; +}; diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi b/target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi index 616c29a4c1569f..70ec60219dfcc0 100644 --- a/target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi +++ b/target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi @@ -67,8 +67,6 @@ reg = <0x050000 0x010000>; read-only; - compatible = "nvmem-cells"; - nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; @@ -106,17 +104,19 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - calibration_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_ath10k: calibration@5000 { - reg = <0x5000 0x844>; - }; + calibration_ath10k: calibration@5000 { + reg = <0x5000 0x844>; + }; + }; }; }; }; diff --git a/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts b/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts index f7358891b04824..a69b9d54e8b843 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts @@ -45,20 +45,24 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_1002: macaddr@1002 { + compatible = "mac-base"; + reg = <0x1002 0x6>; + #nvmem-cell-cells = <1>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0x844>; + }; }; }; }; @@ -75,9 +79,8 @@ }; ð0 { - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &wmac { diff --git a/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts b/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts index 5ffff57b482313..51800820542359 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts @@ -39,24 +39,27 @@ reg = <0x7f0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + macaddr_art_1002: macaddr@1002 { + compatible = "mac-base"; + reg = <0x1002 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; ð0 { - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &wmac { diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi index d3562398bcbf27..09d2f48c2aa7ed 100644 --- a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi +++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi @@ -95,6 +95,16 @@ label = "art"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; /* Firmware / Kernel flash type specific */ @@ -174,13 +184,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-x1200.dtsi b/target/linux/ath79/dts/qca9563_glinet_gl-x1200.dtsi index 8980f772e7459c..ab1f8902b10a0f 100644 --- a/target/linux/ath79/dts/qca9563_glinet_gl-x1200.dtsi +++ b/target/linux/ath79/dts/qca9563_glinet_gl-x1200.dtsi @@ -95,28 +95,30 @@ reg = <0x050000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - calibration_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; - - calibration_ath10k: calibration@5000 { - reg = <0x5000 0x2f20>; - }; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; - - macaddr_art_5006: macaddr@5006 { - reg = <0x5006 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + calibration_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; + + calibration_ath10k: calibration@5000 { + reg = <0x5000 0x2f20>; + }; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; + + macaddr_art_5006: macaddr@5006 { + reg = <0x5006 0x6>; + }; }; }; diff --git a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi index 799297f4e15ffc..c4faec8ef140db 100644 --- a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi @@ -162,6 +162,28 @@ label = "caldata"; reg = <0x1f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_caldata_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_caldata_c: macaddr@c { + reg = <0xc 0x6>; + }; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_art_5000: cal@5000 { + reg = <0x5000 0x440>; + }; + }; }; }; }; @@ -261,25 +283,3 @@ &usb0 { status = "okay"; }; - -&caldata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_caldata_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_caldata_c: macaddr@c { - reg = <0xc 0x6>; - }; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - cal_art_5000: cal@5000 { - reg = <0x5000 0x440>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi b/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi index c6c610dbee2749..a4f7be3e1cd6ff 100644 --- a/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi +++ b/target/linux/ath79/dts/qca9563_qxwlan_e1700ac.dtsi @@ -82,6 +82,16 @@ label = "pri-data"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_pridata_400: macaddr@400 { + reg = <0x400 0x6>; + }; + }; }; art: partition@60000 { @@ -141,13 +151,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&pridata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_pridata_400: macaddr@400 { - reg = <0x400 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_rosinson_wr818.dts b/target/linux/ath79/dts/qca9563_rosinson_wr818.dts index c73d5a6e58305a..6e45a20aaed934 100644 --- a/target/linux/ath79/dts/qca9563_rosinson_wr818.dts +++ b/target/linux/ath79/dts/qca9563_rosinson_wr818.dts @@ -72,6 +72,16 @@ label = "factory"; reg = <0x050000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; partition@60000 { @@ -133,13 +143,3 @@ &usb1 { status = "okay"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts b/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts index 3bb6d685cc5625..339891f6da07ea 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts @@ -43,6 +43,16 @@ label = "info"; reg = <0xf40000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; config: partition@f60000 { @@ -75,13 +85,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts index 6d5a21c138f6b0..9925666f826911 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts @@ -127,6 +127,16 @@ label = "info"; reg = <0x7e0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; art: partition@7f0000 { @@ -173,13 +183,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2-us.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2-us.dts index e6fd689c999fd4..6857054f1cbbbd 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2-us.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2-us.dts @@ -99,6 +99,16 @@ label = "info"; reg = <0x020000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@30000 { @@ -139,13 +149,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts index c40fe0f2923814..e7d19c9fbd301f 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts @@ -99,6 +99,16 @@ label = "info"; reg = <0x020000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@30000 { @@ -133,13 +143,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts index 3c6b8c4fb9468a..ae6061c4cef4f7 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts @@ -198,6 +198,16 @@ label = "info"; reg = <0xf00000 0x0f0000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; art: partition@ff0000 { @@ -243,13 +253,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts index d2631e227cbab7..32b75cad7b4a97 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts @@ -49,6 +49,16 @@ label = "info"; reg = <0x060000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@80000 { @@ -81,13 +91,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_cpe710-v1.dts b/target/linux/ath79/dts/qca9563_tplink_cpe710-v1.dts index 9421ea225aef2f..491ffac1326a00 100644 --- a/target/linux/ath79/dts/qca9563_tplink_cpe710-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_cpe710-v1.dts @@ -81,6 +81,16 @@ label = "info"; reg = <0x060000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@70000 { @@ -138,13 +148,3 @@ device = <&gmac>; }; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_deco-m4r-v1.dts b/target/linux/ath79/dts/qca9563_tplink_deco-m4r-v1.dts index 8cd9004bd3fb37..63f42eba7600b8 100644 --- a/target/linux/ath79/dts/qca9563_tplink_deco-m4r-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_deco-m4r-v1.dts @@ -106,6 +106,16 @@ label = "config"; reg = <0xe85000 0x16b000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; art: partition@ff0000 { @@ -134,13 +144,3 @@ nvmem-cells = <&macaddr_config_8>; nvmem-cell-names = "mac-address"; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v1.dts b/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v1.dts index 79c45f1ea8a26f..9c1e82bf986c79 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v1.dts @@ -30,8 +30,20 @@ }; &art { - precalibration_ath10k: pre-calibration@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + + precalibration_ath10k: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -52,9 +64,7 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <1>; - - nvmem-cells = <&macaddr_info_8>, <&precalibration_ath10k>; + nvmem-cells = <&macaddr_info_8 1>, <&precalibration_ath10k>; nvmem-cell-names = "mac-address", "pre-calibration"; }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v3.dts b/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v3.dts index e5914c9a55069e..73700b626f3ff0 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_eap225-outdoor-v3.dts @@ -30,8 +30,20 @@ }; &art { - precalibration_ath10k: pre-calibration@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + + precalibration_ath10k: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -51,9 +63,7 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <1>; - - nvmem-cells = <&macaddr_info_8>, <&precalibration_ath10k>; + nvmem-cells = <&macaddr_info_8 1>, <&precalibration_ath10k>; nvmem-cell-names = "mac-address", "pre-calibration"; }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts b/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts index 8423daf6023100..1e100b31a72d6f 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts @@ -51,8 +51,20 @@ }; &art { - calibration_ath10k: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + + calibration_ath10k: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; @@ -73,9 +85,7 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <1>; - - nvmem-cells = <&macaddr_info_8>, <&calibration_ath10k>; + nvmem-cells = <&macaddr_info_8 1>, <&calibration_ath10k>; nvmem-cell-names = "mac-address", "calibration"; }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap225-v3.dts b/target/linux/ath79/dts/qca9563_tplink_eap225-v3.dts index 290172b0cc3493..32fba980519f75 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap225-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_eap225-v3.dts @@ -30,8 +30,20 @@ }; &art { - precalibration_ath10k: pre-calibration@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + + precalibration_ath10k: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -52,9 +64,7 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <1>; - - nvmem-cells = <&macaddr_info_8>, <&precalibration_ath10k>; + nvmem-cells = <&macaddr_info_8 1>, <&precalibration_ath10k>; nvmem-cell-names = "mac-address", "pre-calibration"; }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap225-v4.dts b/target/linux/ath79/dts/qca9563_tplink_eap225-v4.dts index ae27ff70684699..1c48775cdffbb5 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap225-v4.dts +++ b/target/linux/ath79/dts/qca9563_tplink_eap225-v4.dts @@ -30,8 +30,20 @@ }; &art { - precalibration_ath10k: pre-calibration@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + + precalibration_ath10k: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -51,9 +63,7 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <1>; - - nvmem-cells = <&macaddr_info_8>, <&precalibration_ath10k>; + nvmem-cells = <&macaddr_info_8 1>, <&precalibration_ath10k>; nvmem-cell-names = "mac-address", "pre-calibration"; }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap245-v1.dts b/target/linux/ath79/dts/qca9563_tplink_eap245-v1.dts index 236c9e7457b7af..e7f21fafa50858 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap245-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_eap245-v1.dts @@ -44,8 +44,20 @@ }; &art { - calibration_ath10k: calibration@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + + calibration_ath10k: calibration@5000 { + reg = <0x5000 0x844>; + }; }; }; @@ -66,9 +78,7 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <1>; - - nvmem-cells = <&macaddr_info_8>, <&calibration_ath10k>; + nvmem-cells = <&macaddr_info_8 1>, <&calibration_ath10k>; nvmem-cell-names = "mac-address", "calibration"; }; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts b/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts index ab5bc7b1a94d34..1e37db82bce497 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts @@ -51,9 +51,7 @@ compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - mac-address-increment = <1>; - - nvmem-cells = <&macaddr_info_8>, <&calibration_ath10k>; + nvmem-cells = <&macaddr_info_8 1>, <&calibration_ath10k>; nvmem-cell-names = "mac-address", "pre-calibration"; }; }; @@ -93,6 +91,18 @@ label = "info"; reg = <0x090000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@a0000 { @@ -100,16 +110,18 @@ reg = <0x0a0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - calibration_ath9k: calibration@1000 { - reg = <0x1000 0x440>; - }; + calibration_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; - calibration_ath10k: calibration@5000 { - reg = <0x5000 0x2f20>; + calibration_ath10k: calibration@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -166,23 +178,13 @@ phy-handle = <&phy0>; phy-mode = "sgmii"; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; - nvmem-cells = <&macaddr_info_8>, <&calibration_ath9k>; + nvmem-cells = <&macaddr_info_8 0>, <&calibration_ath9k>; nvmem-cell-names = "mac-address", "calibration"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi b/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi index f384031335b626..9e0b97fcbf3321 100644 --- a/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_eap2x5-1port.dtsi @@ -82,12 +82,14 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - calibration_ath9k: calibration@1000 { - reg = <0x1000 0x440>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + calibration_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; }; }; }; @@ -113,7 +115,7 @@ pll-data = <0x03000000 0x00000101 0x00001313>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; qca956x-serdes-fixup; @@ -126,16 +128,6 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_info_8>, <&calibration_ath9k>; + nvmem-cells = <&macaddr_info_8 0>, <&calibration_ath9k>; nvmem-cell-names = "mac-address", "calibration"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts b/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts index 73cf5323eea542..5eb1eafaf41c4a 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts +++ b/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts @@ -34,6 +34,16 @@ label = "info"; reg = <0x610000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@630000 { @@ -60,13 +70,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts b/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts index ffebcb9baea694..fdd982ae2e2447 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts @@ -22,6 +22,16 @@ label = "info"; reg = <0x020000 0x002000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@22000 { @@ -66,13 +76,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_re455-v1.dts b/target/linux/ath79/dts/qca9563_tplink_re455-v1.dts index bf4e5848af8d78..a976f4fa5a2bf6 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re455-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_re455-v1.dts @@ -22,6 +22,16 @@ label = "info"; reg = <0x020000 0x002000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@22000 { @@ -66,13 +76,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wa1201-v2.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wa1201-v2.dts index 71ab4f8aad593a..cf13fcd6b7ff5c 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wa1201-v2.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wa1201-v2.dts @@ -127,6 +127,16 @@ label = "info"; reg = <0x020000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@30000 { @@ -149,13 +159,3 @@ }; }; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts index 0ccfb42d9acb84..8c6c91f1070228 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts @@ -16,6 +16,16 @@ label = "u-boot"; reg = <0x000000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_fc00: macaddr@fc00 { + reg = <0xfc00 0x6>; + }; + }; }; partition@10000 { @@ -48,13 +58,3 @@ nvmem-cells = <&macaddr_uboot_fc00>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_fc00: macaddr@fc00 { - reg = <0xfc00 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-int.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-int.dts index 95ff6b03631adc..8786e309659e0e 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-int.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-int.dts @@ -46,6 +46,16 @@ label = "info"; reg = <0x7e0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; art: partition@7f0000 { @@ -66,13 +76,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.0-eu.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.0-eu.dts index 34efeb9450947d..3c688d67d636a4 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.0-eu.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.0-eu.dts @@ -40,6 +40,16 @@ label = "info"; reg = <0x630000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@640000 { @@ -66,13 +76,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.1-eu.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.1-eu.dts index a477b50417dc40..786cd3cc039e00 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.1-eu.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.1-eu.dts @@ -42,6 +42,16 @@ label = "info"; reg = <0x7e0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; art: partition@7f0000 { @@ -62,13 +72,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts index 6d7582451597f1..dac0da9fdc925b 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts @@ -46,6 +46,16 @@ label = "info"; reg = <0xf00000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@f20000 { @@ -86,13 +96,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts index 80a63f6efc0c6a..4aa0ef572f632b 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts @@ -51,6 +51,16 @@ label = "info"; reg = <0xf50000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@f70000 { @@ -108,13 +118,3 @@ nvmem-cells = <&macaddr_info_8>; nvmem-cell-names = "mac-address"; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi index 6704ec983b0bee..da01251f3bd6c4 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi @@ -90,6 +90,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -100,13 +110,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts b/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts index b6206b046d2ef2..2085644f766289 100644 --- a/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts +++ b/target/linux/ath79/dts/qca9563_xiaomi_aiot-ac2350.dts @@ -109,6 +109,16 @@ label = "art"; reg = <0x60000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; partition@70000 { @@ -174,13 +184,3 @@ &pcie { status = "okay"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi index 6f729a21fe8ba7..dff9428295067b 100644 --- a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi +++ b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi @@ -94,6 +94,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; }; }; @@ -104,13 +114,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/qca9563_zte_mf281.dts b/target/linux/ath79/dts/qca9563_zte_mf281.dts index 9205061e2432bf..8fcd093d66f494 100644 --- a/target/linux/ath79/dts/qca9563_zte_mf281.dts +++ b/target/linux/ath79/dts/qca9563_zte_mf281.dts @@ -49,16 +49,18 @@ reg = <0xa0000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_caldata_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - cal_caldata_5000: cal@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_caldata_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_caldata_5000: cal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -67,12 +69,16 @@ reg = <0x120000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_mac_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_mac_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -146,14 +152,13 @@ }; ð0 { - nvmem-cells = <&macaddr_mac_0>; + nvmem-cells = <&macaddr_mac_0 0>; nvmem-cell-names = "mac-address"; }; &wifi_ath10k { - nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_5000>; + nvmem-cells = <&macaddr_mac_0 1>, <&cal_caldata_5000>; nvmem-cell-names = "mac-address", "pre-calibration"; - mac-address-increment = <1>; }; &pinmux { @@ -163,6 +168,6 @@ }; &wmac { - nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_1000>; + nvmem-cells = <&macaddr_mac_0 0>, <&cal_caldata_1000>; nvmem-cell-names = "mac-address", "calibration"; }; diff --git a/target/linux/ath79/dts/qca9563_zte_mf282.dts b/target/linux/ath79/dts/qca9563_zte_mf282.dts index 1f3038dacedce8..439cc1af4af943 100644 --- a/target/linux/ath79/dts/qca9563_zte_mf282.dts +++ b/target/linux/ath79/dts/qca9563_zte_mf282.dts @@ -61,16 +61,18 @@ reg = <0x140000 0x140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_caldata_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - cal_caldata_5000: cal@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_caldata_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_caldata_5000: cal@5000 { + reg = <0x5000 0x844>; + }; }; }; @@ -79,12 +81,16 @@ reg = <0x280000 0x140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_mac_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_mac_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -113,17 +119,16 @@ }; ð0 { - nvmem-cells = <&macaddr_mac_0>; + nvmem-cells = <&macaddr_mac_0 0>; nvmem-cell-names = "mac-address"; }; &wifi_ath10k { - nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_5000>; + nvmem-cells = <&macaddr_mac_0 1>, <&cal_caldata_5000>; nvmem-cell-names = "mac-address", "calibration"; - mac-address-increment = <1>; }; &wmac { - nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_1000>; + nvmem-cells = <&macaddr_mac_0 0>, <&cal_caldata_1000>; nvmem-cell-names = "mac-address", "calibration"; }; diff --git a/target/linux/ath79/dts/qca9563_zte_mf286.dts b/target/linux/ath79/dts/qca9563_zte_mf286.dts index 877075c7699780..e64680e1121541 100644 --- a/target/linux/ath79/dts/qca9563_zte_mf286.dts +++ b/target/linux/ath79/dts/qca9563_zte_mf286.dts @@ -62,16 +62,18 @@ reg = <0x140000 0x140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_caldata_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - cal_caldata_5000: cal@5000 { - reg = <0x5000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_caldata_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_caldata_5000: cal@5000 { + reg = <0x5000 0x844>; + }; }; }; @@ -80,12 +82,16 @@ reg = <0x280000 0x140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_mac_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_mac_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -114,17 +120,16 @@ }; ð0 { - nvmem-cells = <&macaddr_mac_0>; + nvmem-cells = <&macaddr_mac_0 0>; nvmem-cell-names = "mac-address"; }; &wifi_ath10k { - nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_5000>, <&cal_caldata_5000>; + nvmem-cells = <&macaddr_mac_0 1>, <&cal_caldata_5000>, <&cal_caldata_5000>; nvmem-cell-names = "mac-address", "calibration", "pre-calibration"; - mac-address-increment = <1>; }; &wmac { - nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_1000>; + nvmem-cells = <&macaddr_mac_0 0>, <&cal_caldata_1000>; nvmem-cell-names = "mac-address", "calibration"; }; diff --git a/target/linux/ath79/dts/qca9563_zte_mf286ar.dtsi b/target/linux/ath79/dts/qca9563_zte_mf286ar.dtsi index 45ac3bc7ea5e16..89177ef2d35027 100644 --- a/target/linux/ath79/dts/qca9563_zte_mf286ar.dtsi +++ b/target/linux/ath79/dts/qca9563_zte_mf286ar.dtsi @@ -65,16 +65,18 @@ reg = <0xa0000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -83,12 +85,16 @@ reg = <0x120000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_mac_0: mac-address@0 { - reg = <0x0 0x6>; + macaddr_mac_0: mac-address@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -118,17 +124,16 @@ }; ð0 { - nvmem-cells = <&macaddr_mac_0>; + nvmem-cells = <&macaddr_mac_0 0>; nvmem-cell-names = "mac-address"; }; &wifi_ath10k { - nvmem-cells = <&macaddr_mac_0>, <&precal_art_5000>; + nvmem-cells = <&macaddr_mac_0 0x20000>, <&precal_art_5000>; nvmem-cell-names = "mac-address", "pre-calibration"; - mac-address-increment = <0x20000>; }; &wmac { - nvmem-cells = <&macaddr_mac_0>, <&cal_art_1000>; + nvmem-cells = <&macaddr_mac_0 0>, <&cal_art_1000>; nvmem-cell-names = "mac-address", "calibration"; }; diff --git a/target/linux/ath79/dts/qcn5502_asus.dtsi b/target/linux/ath79/dts/qcn5502_asus.dtsi index a2b4a76e92eb2e..ee3ef18d20b6e7 100644 --- a/target/linux/ath79/dts/qcn5502_asus.dtsi +++ b/target/linux/ath79/dts/qcn5502_asus.dtsi @@ -85,20 +85,22 @@ reg = <0x050000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_factory_1000: cal@1000 { - reg = <0x1000 0x440>; - }; - - macaddr_factory_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; - - precal_factory_5000: precal@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_factory_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_factory_1002: macaddr@1002 { + reg = <0x1002 0x6>; + }; + + precal_factory_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ath79/dts/qcn5502_netgear_ex7300-v2.dts b/target/linux/ath79/dts/qcn5502_netgear_ex7300-v2.dts index 4ebbdcc1054d24..32b97a4601371a 100644 --- a/target/linux/ath79/dts/qcn5502_netgear_ex7300-v2.dts +++ b/target/linux/ath79/dts/qcn5502_netgear_ex7300-v2.dts @@ -182,20 +182,22 @@ label = "artmtd"; reg = <0xfe0000 0x10000>; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_artmtd_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_artmtd_6: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_artmtd_c: macaddr@c { - reg = <0xc 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_artmtd_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_artmtd_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_artmtd_c: macaddr@c { + reg = <0xc 0x6>; + }; }; }; @@ -204,16 +206,18 @@ reg = <0xff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ath79/dts/qcn5502_tplink_archer-a9-v6.dts b/target/linux/ath79/dts/qcn5502_tplink_archer-a9-v6.dts index ef0ea321e07ed4..6266f5561be39c 100644 --- a/target/linux/ath79/dts/qcn5502_tplink_archer-a9-v6.dts +++ b/target/linux/ath79/dts/qcn5502_tplink_archer-a9-v6.dts @@ -88,7 +88,7 @@ phy-mode = "sgmii"; phy-handle = <&phy0>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; @@ -118,10 +118,8 @@ compatible = "pci168c,0046"; reg = <0 0 0 0 0>; - nvmem-cells = <&macaddr_info_8>, <&precal_art_5000>; + nvmem-cells = <&macaddr_info_8 (-1)>, <&precal_art_5000>; nvmem-cell-names = "mac-address", "pre-calibration"; - - mac-address-increment = <(-1)>; }; }; @@ -162,16 +160,18 @@ reg = <0x050000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - cal_art_1000: cal@1000 { - reg = <0x1000 0x440>; - }; + cal_art_1000: cal@1000 { + reg = <0x1000 0x440>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -180,12 +180,16 @@ reg = <0x060000 0x020000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -234,6 +238,6 @@ /* TODO: missing support in ath9k */ status = "disabled"; - nvmem-cells = <&cal_art_1000>, <&macaddr_info_8>; + nvmem-cells = <&cal_art_1000>, <&macaddr_info_8 0>; nvmem-cell-names = "calibration", "mac-address"; }; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi index b2c009c346878d..b38cd418176af3 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dtsi @@ -63,7 +63,6 @@ }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts index daf77793141bd1..f837dccff9af14 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts @@ -66,6 +66,6 @@ }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts index 409f288f07adc2..ccb3bb167090b1 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts @@ -30,6 +30,6 @@ }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts index d4638f1acf4007..61adc08289a985 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr941hp-v1.dts @@ -120,6 +120,18 @@ label = "config"; reg = <0x750000 0x0a0000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; art: partition@7f0000 { @@ -136,15 +148,14 @@ phy-handle = <&swphy0>; - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { status = "okay"; - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 0>; nvmem-cell-names = "mac-address"; }; @@ -152,16 +163,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 0>; nvmem-cell-names = "mac-address"; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi b/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi index 3a38b8025abdd9..89dff434056989 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi @@ -28,6 +28,18 @@ label = "u-boot"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -50,9 +62,8 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð1 { @@ -63,16 +74,6 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; - }; -}; diff --git a/target/linux/ath79/files/drivers/mfd/rb4xx-cpld.c b/target/linux/ath79/files/drivers/mfd/rb4xx-cpld.c index da18424c63383c..148157aa7b71ba 100644 --- a/target/linux/ath79/files/drivers/mfd/rb4xx-cpld.c +++ b/target/linux/ath79/files/drivers/mfd/rb4xx-cpld.c @@ -151,11 +151,6 @@ static int rb4xx_cpld_probe(struct spi_device *spi) NULL, 0, NULL); } -static int rb4xx_cpld_remove(struct spi_device *spi) -{ - return 0; -} - static const struct of_device_id rb4xx_cpld_dt_match[] = { { .compatible = "mikrotik,rb4xx-cpld", }, { }, @@ -164,7 +159,6 @@ MODULE_DEVICE_TABLE(of, rb4xx_cpld_dt_match); static struct spi_driver rb4xx_cpld_driver = { .probe = rb4xx_cpld_probe, - .remove = rb4xx_cpld_remove, .driver = { .name = "rb4xx-cpld", .bus = &spi_bus_type, 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 4ee347c14157e2..615abe4b3b39b6 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" @@ -238,6 +241,13 @@ dlink,dap-1365-a1) ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "green:rssimediumhigh" "wlan0" "51" "100" ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "green:rssihigh" "wlan0" "76" "100" ;; +dlink,dap-1720-a1) + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "RSSI LOW" "red:signal-1" "wlan0" "1" "40" + ucidef_set_led_rssi "rssimediumlow" "RSSI MEDIUM-LOW" "green:signal-1" "wlan0" "21" "100" + ucidef_set_led_rssi "rssimediumhigh" "RSSI MEDIUM-HIGH" "green:signal-2" "wlan0" "61" "100" + ucidef_set_led_rssi "rssihigh" "RSSI HIGH" "green:signal-3" "wlan0" "81" "100" + ;; dlink,dir-859-a1) ucidef_set_led_switch "internet" "WAN" "green:internet" "switch0" "0x20" ;; 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 1b19d90a05ea4e..b74a7ff6b43e94 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 @@ -34,6 +34,7 @@ ath79_setup_interfaces() devolo,dvl1750x|\ dlink,dap-1330-a1|\ dlink,dap-1365-a1|\ + dlink,dap-1720-a1|\ dlink,dap-2230-a1|\ dlink,dap-2660-a1|\ dlink,dap-2680-a1|\ @@ -47,6 +48,7 @@ ath79_setup_interfaces() engenius,ecb600|\ enterasys,ws-ap3705i|\ extreme-networks,ws-ap3805i|\ + fortinet,fap-220-b|\ fortinet,fap-221-b|\ glinet,gl-ar300m-lite|\ glinet,gl-usb150|\ @@ -285,6 +287,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" @@ -633,6 +639,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) @@ -713,10 +726,6 @@ ath79_setup_macs() enterasys,ws-ap3705i) label_mac=$(mtd_get_mac_ascii u-boot-env0 ethaddr) ;; - fortinet,fap-221-b) - lan_mac=$(mtd_get_mac_text u-boot 0x3ff80 12) - label_mac=$lan_mac - ;; hak5,lan-turtle|\ hak5,packet-squirrel) label_mac=$(mtd_get_mac_binary u-boot 0x1fc00) 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 5d74208a5d8eea..42b69d2ca0c4dd 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) @@ -41,9 +47,6 @@ case "$board" in engenius,esr900) macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" "$PHYNBR" > /sys${DEVPATH}/macaddress ;; - fortinet,fap-221-b) - macaddr_add "$(mtd_get_mac_text u-boot 0x3ff80 12)" $((PHYNBR*7+1)) > /sys${DEVPATH}/macaddress - ;; iodata,wn-ac1600dgr) # There is no eeprom data for 5 GHz wlan in "art" partition # which would allow to patch the macaddress diff --git a/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum b/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum index 0ea81a8dc3ac53..4ec8c13eb75745 100644 --- a/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum +++ b/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum @@ -21,6 +21,7 @@ dlink,dap-3320-a1|\ dlink,dap-3662-a1) fixwrgg ;; +dlink,dap-1720-a1|\ dlink,dir-629-a1|\ dlink,dir-859-a1|\ dlink,dir-859-a3|\ diff --git a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh index 8b39a17eb0cd9d..76f4b93a3560f2 100644 --- a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh @@ -25,9 +25,6 @@ preinit_set_mac_address() { siemens,ws-ap3610) ip link set dev eth0 address $(mtd_get_mac_ascii cfg1 ethaddr) ;; - fortinet,fap-221-b) - ip link set dev eth0 address $(mtd_get_mac_text u-boot 0x3ff80 12) - ;; moxa,awk-1137c) ip link set dev eth0 address $(mtd_get_mac_ascii u-boot-env mac_addr) ;; diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index 67a3635075b8a1..a2b717ef34c715 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -55,6 +55,7 @@ platform_do_upgrade() { ROOTFS_FILE="root.squashfs" platform_do_upgrade_failsafe_datachk "$1" ;; + fortinet,fap-220-b|\ fortinet,fap-221-b) SKIP_HASH="1" ENV_SCRIPT="/dev/null" diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 59cc3c5a2b3b84..68c41055615130 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))) @@ -74,7 +85,7 @@ define Build/mkmylofw_16m let \ size="$$(stat -c%s $@)" \ - pad="$(subst k,* 1024,$(BLOCKSIZE))" \ + pad="$(call exp_units,$(BLOCKSIZE))" \ pad="(pad - (size % pad)) % pad" \ newsize='size + pad' ; \ [ $$newsize -lt $$((0x660000)) ] && newsize=0x660000 ; \ @@ -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 @@ -1022,6 +1053,22 @@ define Device/dlink_dap-1365-a1 endef TARGET_DEVICES += dlink_dap-1365-a1 +define Device/dlink_dap-1720-a1 + $(Device/seama) + SOC := qca9563 + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DAP-1720 + DEVICE_VARIANT := A1 + DEVICE_PACKAGES := rssileds -swconfig \ + kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct + SEAMA_SIGNATURE := wapac28_dlink.2015_dap1720 + IMAGE_SIZE := 15872k + IMAGES += recovery.bin + IMAGE/recovery.bin := $$(IMAGE/default) | pad-rootfs -x 64 | seama | \ + seama-seal | check-size +endef +TARGET_DEVICES += dlink_dap-1720-a1 + define Device/dlink_dap-2xxx IMAGES += factory.img IMAGE/factory.img := append-kernel | pad-offset 6144k 160 | \ @@ -1532,12 +1579,9 @@ define Device/extreme-networks_ws-ap3805i endef TARGET_DEVICES += extreme-networks_ws-ap3805i -define Device/fortinet_fap-221-b +define Device/fortinet_fap_common $(Device/senao_loader_okli) - SOC := ar9344 DEVICE_VENDOR := Fortinet - DEVICE_MODEL := FAP-221-B - FACTORY_IMG_NAME := FP221B-9.99-AP-build999-999999-patch99 IMAGE_SIZE := 9216k LOADER_FLASH_OFFS := 0x040000 IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ @@ -1546,6 +1590,23 @@ define Device/fortinet_fap-221-b append-loader-okli-uimage $(1) | pad-to 10944k | \ gzip-filename $$$$(FACTORY_IMG_NAME) endef + +define Device/fortinet_fap-220-b + $(Device/fortinet_fap_common) + SOC := ar7161 + DEVICE_MODEL := FAP-220-B + FACTORY_IMG_NAME := FAP22B-9.99-AP-build999-999999-patch99 + DEVICE_PACKAGES := -uboot-envtools kmod-usb-ohci kmod-usb2 \ + kmod-owl-loader +endef +TARGET_DEVICES += fortinet_fap-220-b + +define Device/fortinet_fap-221-b + $(Device/fortinet_fap_common) + SOC := ar9344 + DEVICE_MODEL := FAP-221-B + FACTORY_IMG_NAME := FP221B-9.99-AP-build999-999999-patch99 +endef TARGET_DEVICES += fortinet_fap-221-b define Device/glinet_6408 diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index e4ee5554512cae..bf2b1a1f8ab15e 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -32,7 +32,7 @@ endef define Build/zyxel-factory let \ - maxsize="$(subst k,* 1024,$(RAS_ROOTFS_SIZE))"; \ + maxsize="$(call exp_units,$(RAS_ROOTFS_SIZE))"; \ let size="$$(stat -c%s $@)"; \ if [ $$size -lt $$maxsize ]; then \ $(STAGING_DIR_HOST)/bin/mkrasimage \ @@ -203,12 +203,41 @@ define Device/glinet_gl-e750 endef TARGET_DEVICES += glinet_gl-e750 +define Device/glinet_gl-s200-common + SOC := qca9531 + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-S200 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-serial-ch341 + SUPPORTED_DEVICES += gl-s200 glinet,gl-s200 +endef + +define Device/glinet_gl-s200-nor + $(Device/glinet_gl-s200-common) + DEVICE_VARIANT := NOR + IMAGE_SIZE := 16000k +endef +TARGET_DEVICES += glinet_gl-s200-nor + +define Device/glinet_gl-s200-nor-nand + $(Device/glinet_gl-s200-common) + DEVICE_VARIANT := NOR/NAND + KERNEL_SIZE := 4096k + BLOCKSIZE := 128k + PAGESIZE := 2048 + VID_HDR_OFFSET := 2048 + IMAGES += factory.img + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + SUPPORTED_DEVICES += gl-s200 glinet,gl-s200 +endef +TARGET_DEVICES += glinet_gl-s200-nor-nand + define Device/glinet_gl-xe300 SOC := qca9531 DEVICE_VENDOR := GL.iNet DEVICE_MODEL := GL-XE300 DEVICE_PACKAGES := kmod-usb2 block-mount kmod-usb-serial-ch341 \ - kmod-usb-net-qmi-wwan uqmi + kmod-usb-serial-option kmod-usb-net-qmi-wwan uqmi KERNEL_SIZE := 4096k IMAGE_SIZE := 131072k PAGESIZE := 2048 diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network index 60f085d3783c90..f5dda414c2ffa9 100644 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -40,6 +40,8 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "6@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0" ;; + glinet,gl-s200-nor|\ + glinet,gl-s200-nor-nand|\ netgear,pgzng1) ucidef_set_interfaces_lan_wan "eth1" "eth0" ;; diff --git a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh index 5a4f76ba51645c..117b2f900a29f8 100644 --- a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh @@ -20,6 +20,8 @@ platform_do_upgrade() { ;; glinet,gl-ar750s-nor|\ glinet,gl-ar750s-nor-nand|\ + glinet,gl-s200-nor|\ + glinet,gl-s200-nor-nand|\ glinet,gl-x1200-nor|\ glinet,gl-x1200-nor-nand) nand_nor_do_upgrade "$1" diff --git a/target/linux/ath79/patches-5.15/400-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/ath79/patches-5.15/400-mtd-nor-support-mtd-name-from-device-tree.patch index 7db6346c37e418..36f5331bd017f9 100644 --- a/target/linux/ath79/patches-5.15/400-mtd-nor-support-mtd-name-from-device-tree.patch +++ b/target/linux/ath79/patches-5.15/400-mtd-nor-support-mtd-name-from-device-tree.patch @@ -34,7 +34,7 @@ Signed-off-by: Abhimanyu Vishwakarma mtd->type = MTD_NORFLASH; --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c -@@ -847,6 +847,17 @@ out_error: +@@ -870,6 +870,17 @@ out_error: */ static void mtd_set_dev_defaults(struct mtd_info *mtd) { diff --git a/target/linux/ath79/patches-5.15/800-leds-add-reset-controller-based-driver.patch b/target/linux/ath79/patches-5.15/800-leds-add-reset-controller-based-driver.patch index 7122756c526687..9daea4c95ab4b5 100644 --- a/target/linux/ath79/patches-5.15/800-leds-add-reset-controller-based-driver.patch +++ b/target/linux/ath79/patches-5.15/800-leds-add-reset-controller-based-driver.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig -@@ -876,6 +876,17 @@ source "drivers/leds/blink/Kconfig" +@@ -877,6 +877,17 @@ source "drivers/leds/blink/Kconfig" comment "Flash and Torch LED drivers" source "drivers/leds/flash/Kconfig" diff --git a/target/linux/ath79/patches-5.15/900-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.15/900-unaligned_access_hacks.patch index 53f5b1472d9c5a..84723add3b8aaf 100644 --- a/target/linux/ath79/patches-5.15/900-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-5.15/900-unaligned_access_hacks.patch @@ -349,7 +349,7 @@ SVN-Revision: 35130 list_for_each_entry(p, head, list) { --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c -@@ -610,48 +610,53 @@ static void tcp_options_write(__be32 *pt +@@ -609,48 +609,53 @@ static void tcp_options_write(__be32 *pt u16 options = opts->options; /* mungable copy */ if (unlikely(OPTION_MD5 & options)) { @@ -426,7 +426,7 @@ SVN-Revision: 35130 } if (unlikely(opts->num_sack_blocks)) { -@@ -659,16 +664,17 @@ static void tcp_options_write(__be32 *pt +@@ -658,16 +663,17 @@ static void tcp_options_write(__be32 *pt tp->duplicate_sack : tp->selective_acks; int this_sack; @@ -450,7 +450,7 @@ SVN-Revision: 35130 } tp->rx_opt.dsack = 0; -@@ -681,13 +687,14 @@ static void tcp_options_write(__be32 *pt +@@ -680,13 +686,14 @@ static void tcp_options_write(__be32 *pt if (foc->exp) { len = TCPOLEN_EXP_FASTOPEN_BASE + foc->len; @@ -750,7 +750,7 @@ SVN-Revision: 35130 EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -4157,14 +4157,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -4171,14 +4171,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/ath79/patches-6.1/400-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/ath79/patches-6.1/400-mtd-nor-support-mtd-name-from-device-tree.patch index 3546696a23a5d6..119868eddb33bb 100644 --- a/target/linux/ath79/patches-6.1/400-mtd-nor-support-mtd-name-from-device-tree.patch +++ b/target/linux/ath79/patches-6.1/400-mtd-nor-support-mtd-name-from-device-tree.patch @@ -33,7 +33,7 @@ Signed-off-by: Abhimanyu Vishwakarma mtd->flags = MTD_CAP_NORFLASH; --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c -@@ -840,6 +840,17 @@ out_error: +@@ -863,6 +863,17 @@ out_error: */ static void mtd_set_dev_defaults(struct mtd_info *mtd) { diff --git a/target/linux/ath79/patches-6.1/800-leds-add-reset-controller-based-driver.patch b/target/linux/ath79/patches-6.1/800-leds-add-reset-controller-based-driver.patch index 18d5e149923741..e9349b4f8c7ee3 100644 --- a/target/linux/ath79/patches-6.1/800-leds-add-reset-controller-based-driver.patch +++ b/target/linux/ath79/patches-6.1/800-leds-add-reset-controller-based-driver.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig -@@ -872,6 +872,17 @@ source "drivers/leds/flash/Kconfig" +@@ -873,6 +873,17 @@ source "drivers/leds/flash/Kconfig" comment "RGB LED drivers" source "drivers/leds/rgb/Kconfig" diff --git a/target/linux/ath79/patches-6.1/900-unaligned_access_hacks.patch b/target/linux/ath79/patches-6.1/900-unaligned_access_hacks.patch index 943aa1a132f75b..5bd7d0ba635b63 100644 --- a/target/linux/ath79/patches-6.1/900-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-6.1/900-unaligned_access_hacks.patch @@ -336,7 +336,7 @@ SVN-Revision: 35130 #endif /* _LINUX_TYPES_H */ --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c -@@ -1488,8 +1488,8 @@ struct sk_buff *inet_gro_receive(struct +@@ -1494,8 +1494,8 @@ struct sk_buff *inet_gro_receive(struct if (unlikely(ip_fast_csum((u8 *)iph, 5))) goto out; @@ -349,7 +349,7 @@ SVN-Revision: 35130 list_for_each_entry(p, head, list) { --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c -@@ -611,48 +611,53 @@ static void tcp_options_write(struct tcp +@@ -612,48 +612,53 @@ static void tcp_options_write(struct tcp u16 options = opts->options; /* mungable copy */ if (unlikely(OPTION_MD5 & options)) { @@ -426,7 +426,7 @@ SVN-Revision: 35130 } if (unlikely(opts->num_sack_blocks)) { -@@ -660,16 +665,17 @@ static void tcp_options_write(struct tcp +@@ -661,16 +666,17 @@ static void tcp_options_write(struct tcp tp->duplicate_sack : tp->selective_acks; int this_sack; @@ -450,7 +450,7 @@ SVN-Revision: 35130 } tp->rx_opt.dsack = 0; -@@ -682,13 +688,14 @@ static void tcp_options_write(struct tcp +@@ -683,13 +689,14 @@ static void tcp_options_write(struct tcp if (foc->exp) { len = TCPOLEN_EXP_FASTOPEN_BASE + foc->len; @@ -750,7 +750,7 @@ SVN-Revision: 35130 EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -4165,14 +4165,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -4179,14 +4179,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/bcm27xx/patches-6.1/950-0005-drm-atomic-Don-t-fixup-modes-that-haven-t-been-reset.patch b/target/linux/bcm27xx/patches-6.1/950-0005-drm-atomic-Don-t-fixup-modes-that-haven-t-been-reset.patch index 0de0b474f327ac..0682961157839f 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0005-drm-atomic-Don-t-fixup-modes-that-haven-t-been-reset.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0005-drm-atomic-Don-t-fixup-modes-that-haven-t-been-reset.patch @@ -10,7 +10,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c -@@ -438,6 +438,11 @@ mode_fixup(struct drm_atomic_state *stat +@@ -443,6 +443,11 @@ mode_fixup(struct drm_atomic_state *stat new_crtc_state = drm_atomic_get_new_crtc_state(state, new_conn_state->crtc); diff --git a/target/linux/bcm27xx/patches-6.1/950-0045-drm-atomic-helpers-remove-legacy_cursor_update-hacks.patch b/target/linux/bcm27xx/patches-6.1/950-0045-drm-atomic-helpers-remove-legacy_cursor_update-hacks.patch index 9d4b5571e2cb16..178d0c514e02f5 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0045-drm-atomic-helpers-remove-legacy_cursor_update-hacks.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0045-drm-atomic-helpers-remove-legacy_cursor_update-hacks.patch @@ -59,7 +59,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c -@@ -1617,13 +1617,6 @@ drm_atomic_helper_wait_for_vblanks(struc +@@ -1626,13 +1626,6 @@ drm_atomic_helper_wait_for_vblanks(struc int i, ret; unsigned int crtc_mask = 0; @@ -73,7 +73,7 @@ Signed-off-by: Maxime Ripard for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { if (!new_crtc_state->active) continue; -@@ -2273,12 +2266,6 @@ int drm_atomic_helper_setup_commit(struc +@@ -2282,12 +2275,6 @@ int drm_atomic_helper_setup_commit(struc complete_all(&commit->flip_done); continue; } diff --git a/target/linux/bcm27xx/patches-6.1/950-0081-smsx95xx-fix-crimes-against-truesize.patch b/target/linux/bcm27xx/patches-6.1/950-0081-smsx95xx-fix-crimes-against-truesize.patch index 388a5f25e64507..98a6ed86b1a5ba 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0081-smsx95xx-fix-crimes-against-truesize.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0081-smsx95xx-fix-crimes-against-truesize.patch @@ -25,7 +25,7 @@ Signed-off-by: Steve Glendinning static int __must_check smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data) { -@@ -1868,7 +1872,8 @@ static int smsc95xx_rx_fixup(struct usbn +@@ -1870,7 +1874,8 @@ static int smsc95xx_rx_fixup(struct usbn if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(skb); skb_trim(skb, skb->len - 4); /* remove fcs */ @@ -35,7 +35,7 @@ Signed-off-by: Steve Glendinning return 1; } -@@ -1886,7 +1891,8 @@ static int smsc95xx_rx_fixup(struct usbn +@@ -1888,7 +1893,8 @@ static int smsc95xx_rx_fixup(struct usbn if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(ax_skb); skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */ diff --git a/target/linux/bcm27xx/patches-6.1/950-0082-smsc95xx-Experimental-Enable-turbo_mode-and-packetsi.patch b/target/linux/bcm27xx/patches-6.1/950-0082-smsc95xx-Experimental-Enable-turbo_mode-and-packetsi.patch index 1bb5ae2b18ed7d..c55f194b23abc1 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0082-smsc95xx-Experimental-Enable-turbo_mode-and-packetsi.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0082-smsc95xx-Experimental-Enable-turbo_mode-and-packetsi.patch @@ -22,7 +22,7 @@ See: http://forum.kodi.tv/showthread.php?tid=285288 static int __must_check smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data) { -@@ -934,13 +938,13 @@ static int smsc95xx_reset(struct usbnet +@@ -936,13 +940,13 @@ static int smsc95xx_reset(struct usbnet if (!turbo_mode) { burst_cap = 0; diff --git a/target/linux/bcm27xx/patches-6.1/950-0083-Allow-mac-address-to-be-set-in-smsc95xx.patch b/target/linux/bcm27xx/patches-6.1/950-0083-Allow-mac-address-to-be-set-in-smsc95xx.patch index e8d14ac99fed5d..a47a858e1669f3 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0083-Allow-mac-address-to-be-set-in-smsc95xx.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0083-Allow-mac-address-to-be-set-in-smsc95xx.patch @@ -33,7 +33,7 @@ Signed-off-by: Phil Elwell static int __must_check smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data) { -@@ -807,6 +811,52 @@ static int smsc95xx_ioctl(struct net_dev +@@ -809,6 +813,52 @@ static int smsc95xx_ioctl(struct net_dev return phy_mii_ioctl(netdev->phydev, rq, cmd); } @@ -86,7 +86,7 @@ Signed-off-by: Phil Elwell static void smsc95xx_init_mac_address(struct usbnet *dev) { u8 addr[ETH_ALEN]; -@@ -830,6 +880,10 @@ static void smsc95xx_init_mac_address(st +@@ -832,6 +882,10 @@ static void smsc95xx_init_mac_address(st } } diff --git a/target/linux/bcm27xx/patches-6.1/950-0106-Add-dwc_otg-driver.patch b/target/linux/bcm27xx/patches-6.1/950-0106-Add-dwc_otg-driver.patch index 7eadf3f50962cb..635e864f99b5c6 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0106-Add-dwc_otg-driver.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0106-Add-dwc_otg-driver.patch @@ -1185,7 +1185,7 @@ Signed-off-by: Jonathan Bell } --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -5636,7 +5636,7 @@ static void port_event(struct usb_hub *h +@@ -5655,7 +5655,7 @@ static void port_event(struct usb_hub *h port_dev->over_current_count++; port_over_current_notify(port_dev); diff --git a/target/linux/bcm27xx/patches-6.1/950-0111-MMC-added-alternative-MMC-driver.patch b/target/linux/bcm27xx/patches-6.1/950-0111-MMC-added-alternative-MMC-driver.patch index b1a5dbfe2df673..b7940da9e4fd54 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0111-MMC-added-alternative-MMC-driver.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0111-MMC-added-alternative-MMC-driver.patch @@ -266,7 +266,7 @@ Signed-off-by: Phil Elwell static inline int mmc_blk_part_switch(struct mmc_card *card, unsigned int part_type); static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, -@@ -2970,6 +2977,8 @@ static int mmc_blk_probe(struct mmc_card +@@ -2996,6 +3003,8 @@ static int mmc_blk_probe(struct mmc_card { struct mmc_blk_data *md; int ret = 0; @@ -275,7 +275,7 @@ Signed-off-by: Phil Elwell /* * Check that the card supports the command class(es) we need. -@@ -2977,7 +2986,16 @@ static int mmc_blk_probe(struct mmc_card +@@ -3003,7 +3012,16 @@ static int mmc_blk_probe(struct mmc_card if (!(card->csd.cmdclass & CCC_BLOCK_READ)) return -ENODEV; @@ -293,7 +293,7 @@ Signed-off-by: Phil Elwell card->complete_wq = alloc_workqueue("mmc_complete", WQ_MEM_RECLAIM | WQ_HIGHPRI, 0); -@@ -2992,6 +3010,17 @@ static int mmc_blk_probe(struct mmc_card +@@ -3018,6 +3036,17 @@ static int mmc_blk_probe(struct mmc_card goto out_free; } @@ -325,7 +325,7 @@ Signed-off-by: Phil Elwell } --- a/drivers/mmc/core/quirks.h +++ b/drivers/mmc/core/quirks.h -@@ -129,6 +129,14 @@ static const struct mmc_fixup __maybe_un +@@ -130,6 +130,14 @@ static const struct mmc_fixup __maybe_un MMC_FIXUP(CID_NAME_ANY, CID_MANFID_SANDISK_SD, 0x5344, add_quirk_sd, MMC_QUIRK_BROKEN_SD_DISCARD), @@ -2007,12 +2007,12 @@ Signed-off-by: Phil Elwell sdhci_dumpregs(host); --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h -@@ -296,6 +296,8 @@ struct mmc_card { - #define MMC_QUIRK_BROKEN_SD_DISCARD (1<<14) /* Disable broken SD discard support */ +@@ -297,6 +297,8 @@ struct mmc_card { #define MMC_QUIRK_BROKEN_SD_CACHE (1<<15) /* Disable broken SD cache support */ + #define MMC_QUIRK_BROKEN_CACHE_FLUSH (1<<16) /* Don't flush cache until the write has occurred */ +#define MMC_QUIRK_ERASE_BROKEN (1<<31) /* Skip erase */ + + bool written_flag; /* Indicates eMMC has been written since power on */ bool reenable_cmdq; /* Re-enable Command Queue */ - unsigned int erase_size; /* erase size in sectors */ diff --git a/target/linux/bcm27xx/patches-6.1/950-0124-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch b/target/linux/bcm27xx/patches-6.1/950-0124-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch index 79c281ade2ebb8..c5e90fc8601b99 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0124-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0124-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch @@ -17615,12 +17615,12 @@ Signed-off-by: Ashish Vara * For devices with more than one control interface, we assume the --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c -@@ -2171,6 +2171,8 @@ static const struct usb_audio_quirk_flag +@@ -2175,6 +2175,8 @@ static const struct usb_audio_quirk_flag QUIRK_FLAG_FIXED_RATE), DEVICE_FLG(0x0ecb, 0x2069, /* JBL Quantum810 Wireless */ QUIRK_FLAG_FIXED_RATE), + DEVICE_FLG(0x09da, 0x2695, /* A4Tech FHD 1080p webcam */ + QUIRK_FLAG_DISABLE_AUTOSUSPEND | QUIRK_FLAG_GET_SAMPLE_RATE), + DEVICE_FLG(0x1bcf, 0x2283, /* NexiGo N930AF FHD Webcam */ + QUIRK_FLAG_GET_SAMPLE_RATE), - /* Vendor matches */ - VENDOR_FLG(0x045e, /* MS Lifecam */ diff --git a/target/linux/bcm27xx/patches-6.1/950-0188-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-6.1/950-0188-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch index f237c581be90bf..f8bdac6654711b 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0188-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0188-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch @@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell #define USB_VENDOR_ID_BELKIN 0x050d #define USB_DEVICE_ID_FLIP_KVM 0x3201 -@@ -1368,6 +1371,9 @@ +@@ -1369,6 +1372,9 @@ #define USB_VENDOR_ID_XIAOMI 0x2717 #define USB_DEVICE_ID_MI_SILENT_MOUSE 0x5014 @@ -53,7 +53,7 @@ Signed-off-by: Jonathan Bell { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH), HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE2), HID_QUIRK_ALWAYS_POLL }, -@@ -198,6 +199,7 @@ static const struct hid_device_id hid_qu +@@ -199,6 +200,7 @@ static const struct hid_device_id hid_qu { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE), HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_GROUP_AUDIO), HID_QUIRK_NOGET }, diff --git a/target/linux/bcm27xx/patches-6.1/950-0332-drm-panel-simple-Add-a-timing-for-the-Raspberry-Pi-7.patch b/target/linux/bcm27xx/patches-6.1/950-0332-drm-panel-simple-Add-a-timing-for-the-Raspberry-Pi-7.patch index 5046dff024e475..3b663351e2f5eb 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0332-drm-panel-simple-Add-a-timing-for-the-Raspberry-Pi-7.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0332-drm-panel-simple-Add-a-timing-for-the-Raspberry-Pi-7.patch @@ -15,7 +15,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c -@@ -3192,6 +3192,31 @@ static const struct panel_desc qishenglo +@@ -3193,6 +3193,31 @@ static const struct panel_desc qishenglo .connector_type = DRM_MODE_CONNECTOR_DPI, }; @@ -47,7 +47,7 @@ Signed-off-by: Dave Stevenson static const struct display_timing rocktech_rk070er9427_timing = { .pixelclock = { 26400000, 33300000, 46800000 }, .hactive = { 800, 800, 800 }, -@@ -4223,6 +4248,9 @@ static const struct of_device_id platfor +@@ -4224,6 +4249,9 @@ static const struct of_device_id platfor .compatible = "qishenglong,gopher2b-lcd", .data = &qishenglong_gopher2b_lcd, }, { diff --git a/target/linux/bcm27xx/patches-6.1/950-0383-drm-panel-simple-add-Geekworm-MZP280-Panel.patch b/target/linux/bcm27xx/patches-6.1/950-0383-drm-panel-simple-add-Geekworm-MZP280-Panel.patch index 83ba935113213e..aa446c3346d880 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0383-drm-panel-simple-add-Geekworm-MZP280-Panel.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0383-drm-panel-simple-add-Geekworm-MZP280-Panel.patch @@ -46,7 +46,7 @@ Acked-by: Maxime Ripard static const struct drm_display_mode giantplus_gpg482739qs5_mode = { .clock = 9000, .hdisplay = 480, -@@ -4107,6 +4133,9 @@ static const struct of_device_id platfor +@@ -4108,6 +4134,9 @@ static const struct of_device_id platfor .compatible = "friendlyarm,hd702e", .data = &friendlyarm_hd702e, }, { diff --git a/target/linux/bcm27xx/patches-6.1/950-0401-mm-page_alloc-cma-introduce-a-customisable-threshold.patch b/target/linux/bcm27xx/patches-6.1/950-0401-mm-page_alloc-cma-introduce-a-customisable-threshold.patch index 34f1cea30e0b00..fed130ca854a36 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0401-mm-page_alloc-cma-introduce-a-customisable-threshold.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0401-mm-page_alloc-cma-introduce-a-customisable-threshold.patch @@ -20,7 +20,7 @@ Signed-off-by: David Plowman --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -273,6 +273,27 @@ EXPORT_SYMBOL(init_on_alloc); +@@ -253,6 +253,27 @@ EXPORT_SYMBOL(init_on_alloc); DEFINE_STATIC_KEY_MAYBE(CONFIG_INIT_ON_FREE_DEFAULT_ON, init_on_free); EXPORT_SYMBOL(init_on_free); @@ -48,7 +48,7 @@ Signed-off-by: David Plowman static bool _init_on_alloc_enabled_early __read_mostly = IS_ENABLED(CONFIG_INIT_ON_ALLOC_DEFAULT_ON); static int __init early_init_on_alloc(char *buf) -@@ -3093,12 +3114,13 @@ __rmqueue(struct zone *zone, unsigned in +@@ -3073,12 +3094,13 @@ __rmqueue(struct zone *zone, unsigned in if (IS_ENABLED(CONFIG_CMA)) { /* * Balance movable allocations between regular and CMA areas by diff --git a/target/linux/bcm27xx/patches-6.1/950-0418-mmc-block-Don-t-do-single-sector-reads-during-recove.patch b/target/linux/bcm27xx/patches-6.1/950-0418-mmc-block-Don-t-do-single-sector-reads-during-recove.patch index 09eff7b97a53fc..6b486eb7ee935e 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0418-mmc-block-Don-t-do-single-sector-reads-during-recove.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0418-mmc-block-Don-t-do-single-sector-reads-during-recove.patch @@ -23,7 +23,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c -@@ -1902,7 +1902,7 @@ static void mmc_blk_mq_rw_recovery(struc +@@ -1926,7 +1926,7 @@ static void mmc_blk_mq_rw_recovery(struc return; } diff --git a/target/linux/bcm27xx/patches-6.1/950-0521-drm-panel-simple-Add-Innolux-AT056tN53V1-5.6-VGA.patch b/target/linux/bcm27xx/patches-6.1/950-0521-drm-panel-simple-Add-Innolux-AT056tN53V1-5.6-VGA.patch index 09324871aaff52..505121f4cfdb33 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0521-drm-panel-simple-Add-Innolux-AT056tN53V1-5.6-VGA.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0521-drm-panel-simple-Add-Innolux-AT056tN53V1-5.6-VGA.patch @@ -165,7 +165,7 @@ Signed-off-by: Phil Elwell static const struct drm_display_mode innolux_at070tn92_mode = { .clock = 33333, .hdisplay = 800, -@@ -4143,6 +4175,9 @@ static const struct of_device_id platfor +@@ -4144,6 +4176,9 @@ static const struct of_device_id platfor .compatible = "innolux,at043tn24", .data = &innolux_at043tn24, }, { diff --git a/target/linux/bcm27xx/patches-6.1/950-0606-hwrng-bcm2835-sleep-more-intelligently.patch b/target/linux/bcm27xx/patches-6.1/950-0606-hwrng-bcm2835-sleep-more-intelligently.patch index 40c1091106a6dc..db806313ccd132 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0606-hwrng-bcm2835-sleep-more-intelligently.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0606-hwrng-bcm2835-sleep-more-intelligently.patch @@ -50,10 +50,10 @@ Signed-off-by: Phil Elwell + while (!num_words) { + if (!wait || !retries) return 0; -- hwrng_msleep(rng, 1000); +- hwrng_yield(rng); + retries--; + usleep_range((u32)RNG_US_PER_WORD, -+ (u32)RNG_US_PER_WORD * RNG_FIFO_WORDS); ++ (u32)RNG_US_PER_WORD * RNG_FIFO_WORDS); + num_words = rng_readl(priv, RNG_STATUS) >> 24; } diff --git a/target/linux/bcm27xx/patches-6.1/950-0689-input-goodix-Add-option-to-poll-instead-of-relying-o.patch b/target/linux/bcm27xx/patches-6.1/950-0689-input-goodix-Add-option-to-poll-instead-of-relying-o.patch index 008bdf36da70ab..23877809ff0d4a 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0689-input-goodix-Add-option-to-poll-instead-of-relying-o.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0689-input-goodix-Add-option-to-poll-instead-of-relying-o.patch @@ -96,7 +96,7 @@ Signed-off-by: Dave Stevenson } static int goodix_check_cfg_8(struct goodix_ts_data *ts, const u8 *cfg, int len) -@@ -1406,6 +1459,11 @@ static void goodix_ts_remove(struct i2c_ +@@ -1425,6 +1478,11 @@ static void goodix_ts_remove(struct i2c_ { struct goodix_ts_data *ts = i2c_get_clientdata(client); @@ -108,7 +108,7 @@ Signed-off-by: Dave Stevenson if (ts->load_cfg_from_disk) wait_for_completion(&ts->firmware_loading_complete); } -@@ -1421,7 +1479,7 @@ static int __maybe_unused goodix_suspend +@@ -1440,7 +1498,7 @@ static int __maybe_unused goodix_suspend /* We need gpio pins to suspend/resume */ if (ts->irq_pin_access_method == IRQ_PIN_ACCESS_NONE) { @@ -117,7 +117,7 @@ Signed-off-by: Dave Stevenson return 0; } -@@ -1465,7 +1523,7 @@ static int __maybe_unused goodix_resume( +@@ -1484,7 +1542,7 @@ static int __maybe_unused goodix_resume( int error; if (ts->irq_pin_access_method == IRQ_PIN_ACCESS_NONE) { diff --git a/target/linux/bcm27xx/patches-6.1/950-0699-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch b/target/linux/bcm27xx/patches-6.1/950-0699-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch index 7bb65c28d487b5..d4c5a0183e46af 100644 --- a/target/linux/bcm27xx/patches-6.1/950-0699-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch +++ b/target/linux/bcm27xx/patches-6.1/950-0699-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch @@ -20,7 +20,7 @@ Signed-off-by: Phil Elwell --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c -@@ -4635,6 +4635,7 @@ static const struct { +@@ -4630,6 +4630,7 @@ static const struct { */ static int hci_dev_setup_sync(struct hci_dev *hdev) { @@ -28,7 +28,7 @@ Signed-off-by: Phil Elwell int ret = 0; bool invalid_bdaddr; size_t i; -@@ -4663,7 +4664,9 @@ static int hci_dev_setup_sync(struct hci +@@ -4658,7 +4659,9 @@ static int hci_dev_setup_sync(struct hci if (!ret) { if (test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks) && diff --git a/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch b/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch index ce14834fa71b63..30b6d97a8582dd 100644 --- a/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch +++ b/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch @@ -14,15 +14,15 @@ Signed-off-by: Florian Fainelli --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -3033,6 +3033,7 @@ int brcmnand_probe(struct platform_devic +@@ -3059,6 +3059,7 @@ int brcmnand_probe(struct platform_devic dev_set_drvdata(dev, ctrl); ctrl->dev = dev; + ctrl->soc = soc; - init_completion(&ctrl->done); - init_completion(&ctrl->dma_done); -@@ -3173,8 +3174,6 @@ int brcmnand_probe(struct platform_devic + /* Enable the static key if the soc provides I/O operations indicating + * that a non-memory mapped IO access path must be used +@@ -3205,8 +3206,6 @@ int brcmnand_probe(struct platform_devic * interesting ways */ if (soc) { diff --git a/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch b/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch deleted file mode 100644 index 60671658fedf85..00000000000000 --- a/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch +++ /dev/null @@ -1,150 +0,0 @@ -From: Florian Fainelli -Subject: [PATCH v3 2/9] mtd: rawnand: brcmnand: Allow SoC to provide I/O operations -Date: Fri, 07 Jan 2022 10:46:07 -0800 -Content-Type: text/plain; charset="utf-8" - -Allow a brcmnand_soc instance to provide a custom set of I/O operations -which we will require when using this driver on a BCMA bus which is not -directly memory mapped I/O. Update the nand_{read,write}_reg accordingly -to use the SoC operations if provided. - -To minimize the penalty on other SoCs which do support standard MMIO -accesses, we use a static key which is disabled by default and gets -enabled if a soc implementation does provide I/O operations. - -Signed-off-by: Florian Fainelli ---- - drivers/mtd/nand/raw/brcmnand/brcmnand.c | 28 +++++++++++++++++++++-- - drivers/mtd/nand/raw/brcmnand/brcmnand.h | 29 ++++++++++++++++++++++++ - 2 files changed, 55 insertions(+), 2 deletions(-) - ---- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c -+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -25,6 +25,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -207,6 +208,8 @@ enum { - - struct brcmnand_host; - -+static DEFINE_STATIC_KEY_FALSE(brcmnand_soc_has_ops_key); -+ - struct brcmnand_controller { - struct device *dev; - struct nand_controller controller; -@@ -592,15 +595,25 @@ enum { - INTFC_CTLR_READY = BIT(31), - }; - -+static inline bool brcmnand_non_mmio_ops(struct brcmnand_controller *ctrl) -+{ -+ return static_branch_unlikely(&brcmnand_soc_has_ops_key); -+} -+ - static inline u32 nand_readreg(struct brcmnand_controller *ctrl, u32 offs) - { -+ if (brcmnand_non_mmio_ops(ctrl)) -+ return brcmnand_soc_read(ctrl->soc, offs); - return brcmnand_readl(ctrl->nand_base + offs); - } - - static inline void nand_writereg(struct brcmnand_controller *ctrl, u32 offs, - u32 val) - { -- brcmnand_writel(val, ctrl->nand_base + offs); -+ if (brcmnand_non_mmio_ops(ctrl)) -+ brcmnand_soc_write(ctrl->soc, val, offs); -+ else -+ brcmnand_writel(val, ctrl->nand_base + offs); - } - - static int brcmnand_revision_init(struct brcmnand_controller *ctrl) -@@ -766,13 +779,18 @@ static inline void brcmnand_rmw_reg(stru - - static inline u32 brcmnand_read_fc(struct brcmnand_controller *ctrl, int word) - { -+ if (brcmnand_non_mmio_ops(ctrl)) -+ return brcmnand_soc_read(ctrl->soc, BRCMNAND_NON_MMIO_FC_ADDR); - return __raw_readl(ctrl->nand_fc + word * 4); - } - - static inline void brcmnand_write_fc(struct brcmnand_controller *ctrl, - int word, u32 val) - { -- __raw_writel(val, ctrl->nand_fc + word * 4); -+ if (brcmnand_non_mmio_ops(ctrl)) -+ brcmnand_soc_write(ctrl->soc, val, BRCMNAND_NON_MMIO_FC_ADDR); -+ else -+ __raw_writel(val, ctrl->nand_fc + word * 4); - } - - static inline void edu_writel(struct brcmnand_controller *ctrl, -@@ -3035,6 +3053,12 @@ int brcmnand_probe(struct platform_devic - ctrl->dev = dev; - ctrl->soc = soc; - -+ /* Enable the static key if the soc provides I/O operations indicating -+ * that a non-memory mapped IO access path must be used -+ */ -+ if (brcmnand_soc_has_ops(ctrl->soc)) -+ static_branch_enable(&brcmnand_soc_has_ops_key); -+ - init_completion(&ctrl->done); - init_completion(&ctrl->dma_done); - init_completion(&ctrl->edu_done); ---- a/drivers/mtd/nand/raw/brcmnand/brcmnand.h -+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.h -@@ -11,12 +11,25 @@ - - struct platform_device; - struct dev_pm_ops; -+struct brcmnand_io_ops; -+ -+/* Special register offset constant to intercept a non-MMIO access -+ * to the flash cache register space. This is intentionally large -+ * not to overlap with an existing offset. -+ */ -+#define BRCMNAND_NON_MMIO_FC_ADDR 0xffffffff - - struct brcmnand_soc { - bool (*ctlrdy_ack)(struct brcmnand_soc *soc); - void (*ctlrdy_set_enabled)(struct brcmnand_soc *soc, bool en); - void (*prepare_data_bus)(struct brcmnand_soc *soc, bool prepare, - bool is_param); -+ const struct brcmnand_io_ops *ops; -+}; -+ -+struct brcmnand_io_ops { -+ u32 (*read_reg)(struct brcmnand_soc *soc, u32 offset); -+ void (*write_reg)(struct brcmnand_soc *soc, u32 val, u32 offset); - }; - - static inline void brcmnand_soc_data_bus_prepare(struct brcmnand_soc *soc, -@@ -58,6 +71,22 @@ static inline void brcmnand_writel(u32 v - writel_relaxed(val, addr); - } - -+static inline bool brcmnand_soc_has_ops(struct brcmnand_soc *soc) -+{ -+ return soc && soc->ops && soc->ops->read_reg && soc->ops->write_reg; -+} -+ -+static inline u32 brcmnand_soc_read(struct brcmnand_soc *soc, u32 offset) -+{ -+ return soc->ops->read_reg(soc, offset); -+} -+ -+static inline void brcmnand_soc_write(struct brcmnand_soc *soc, u32 val, -+ u32 offset) -+{ -+ soc->ops->write_reg(soc, val, offset); -+} -+ - int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc); - int brcmnand_remove(struct platform_device *pdev); - diff --git a/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch b/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch index d514998fd72ace..46cd377406ecfc 100644 --- a/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch +++ b/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch @@ -16,7 +16,7 @@ Signed-off-by: Florian Fainelli --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -2806,7 +2806,7 @@ static const struct nand_controller_ops +@@ -2814,7 +2814,7 @@ static const struct nand_controller_ops static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn) { struct brcmnand_controller *ctrl = host->ctrl; @@ -25,7 +25,7 @@ Signed-off-by: Florian Fainelli struct mtd_info *mtd; struct nand_chip *chip; int ret; -@@ -2814,7 +2814,7 @@ static int brcmnand_init_cs(struct brcmn +@@ -2822,7 +2822,7 @@ static int brcmnand_init_cs(struct brcmn ret = of_property_read_u32(dn, "reg", &host->cs); if (ret) { @@ -34,7 +34,7 @@ Signed-off-by: Florian Fainelli return -ENXIO; } -@@ -2823,13 +2823,13 @@ static int brcmnand_init_cs(struct brcmn +@@ -2831,13 +2831,13 @@ static int brcmnand_init_cs(struct brcmn nand_set_flash_node(chip, dn); nand_set_controller_data(chip, host); diff --git a/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch b/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch index 2e2c05a43244ad..6a17ea7182ab8e 100644 --- a/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch +++ b/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch @@ -17,7 +17,7 @@ Signed-off-by: Florian Fainelli --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -2803,7 +2803,7 @@ static const struct nand_controller_ops +@@ -2811,7 +2811,7 @@ static const struct nand_controller_ops .attach_chip = brcmnand_attach_chip, }; @@ -26,7 +26,7 @@ Signed-off-by: Florian Fainelli { struct brcmnand_controller *ctrl = host->ctrl; struct device *dev = ctrl->dev; -@@ -2812,16 +2812,9 @@ static int brcmnand_init_cs(struct brcmn +@@ -2820,16 +2820,9 @@ static int brcmnand_init_cs(struct brcmn int ret; u16 cfg_offs; @@ -43,7 +43,7 @@ Signed-off-by: Florian Fainelli nand_set_controller_data(chip, host); mtd->name = devm_kasprintf(dev, GFP_KERNEL, "brcmnand.%d", host->cs); -@@ -3228,7 +3221,16 @@ int brcmnand_probe(struct platform_devic +@@ -3236,7 +3229,16 @@ int brcmnand_probe(struct platform_devic host->pdev = pdev; host->ctrl = ctrl; diff --git a/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch b/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch index 0845a7bfa329aa..ecc3e954ce65bc 100644 --- a/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch +++ b/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch @@ -23,7 +23,7 @@ Signed-off-by: Florian Fainelli unsigned int dma_irq; int nand_version; -@@ -1642,7 +1642,7 @@ static bool brcmstb_nand_wait_for_comple +@@ -1650,7 +1650,7 @@ static bool brcmstb_nand_wait_for_comple bool err = false; int sts; @@ -32,7 +32,7 @@ Signed-off-by: Florian Fainelli /* switch to interrupt polling and PIO mode */ disable_ctrl_irqs(ctrl); sts = bcmnand_ctrl_poll_status(ctrl, NAND_CTRL_RDY, -@@ -3179,33 +3179,29 @@ int brcmnand_probe(struct platform_devic +@@ -3187,33 +3187,29 @@ int brcmnand_probe(struct platform_devic } /* IRQ */ diff --git a/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch b/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch index bf9b410102a38c..b9ad82ecf96465 100644 --- a/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch +++ b/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch @@ -23,7 +23,7 @@ Signed-off-by: Florian Fainelli #include #include #include -@@ -2803,7 +2804,8 @@ static const struct nand_controller_ops +@@ -2811,7 +2812,8 @@ static const struct nand_controller_ops .attach_chip = brcmnand_attach_chip, }; @@ -33,7 +33,7 @@ Signed-off-by: Florian Fainelli { struct brcmnand_controller *ctrl = host->ctrl; struct device *dev = ctrl->dev; -@@ -2856,7 +2858,7 @@ static int brcmnand_init_cs(struct brcmn +@@ -2864,7 +2866,7 @@ static int brcmnand_init_cs(struct brcmn if (ret) return ret; @@ -42,7 +42,7 @@ Signed-off-by: Florian Fainelli if (ret) nand_cleanup(chip); -@@ -3025,17 +3027,15 @@ static int brcmnand_edu_setup(struct pla +@@ -3033,17 +3035,15 @@ static int brcmnand_edu_setup(struct pla int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc) { @@ -63,7 +63,7 @@ Signed-off-by: Florian Fainelli return -ENODEV; ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL); -@@ -3062,7 +3062,7 @@ int brcmnand_probe(struct platform_devic +@@ -3070,7 +3070,7 @@ int brcmnand_probe(struct platform_devic /* NAND register range */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ctrl->nand_base = devm_ioremap_resource(dev, res); @@ -72,7 +72,7 @@ Signed-off-by: Florian Fainelli return PTR_ERR(ctrl->nand_base); /* Enable clock before using NAND registers */ -@@ -3206,7 +3206,6 @@ int brcmnand_probe(struct platform_devic +@@ -3214,7 +3214,6 @@ int brcmnand_probe(struct platform_devic for_each_available_child_of_node(dn, child) { if (of_device_is_compatible(child, "brcm,nandcs")) { @@ -80,7 +80,7 @@ Signed-off-by: Florian Fainelli host = devm_kzalloc(dev, sizeof(*host), GFP_KERNEL); if (!host) { -@@ -3226,7 +3225,7 @@ int brcmnand_probe(struct platform_devic +@@ -3234,7 +3233,7 @@ int brcmnand_probe(struct platform_devic nand_set_flash_node(&host->chip, child); @@ -89,7 +89,7 @@ Signed-off-by: Florian Fainelli if (ret) { devm_kfree(dev, host); continue; /* Try all chip-selects */ -@@ -3236,6 +3235,32 @@ int brcmnand_probe(struct platform_devic +@@ -3244,6 +3243,32 @@ int brcmnand_probe(struct platform_devic } } diff --git a/target/linux/bcm47xx/patches-5.15/107-v5.18-mtd-rawnand-brcmnand-BCMA-controller-uses-command-shift-of-0.patch b/target/linux/bcm47xx/patches-5.15/107-v5.18-mtd-rawnand-brcmnand-BCMA-controller-uses-command-shift-of-0.patch index 188d59b7d1665d..50cc4a6b22a6a2 100644 --- a/target/linux/bcm47xx/patches-5.15/107-v5.18-mtd-rawnand-brcmnand-BCMA-controller-uses-command-shift-of-0.patch +++ b/target/linux/bcm47xx/patches-5.15/107-v5.18-mtd-rawnand-brcmnand-BCMA-controller-uses-command-shift-of-0.patch @@ -14,7 +14,7 @@ Signed-off-by: Florian Fainelli --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -916,6 +916,12 @@ static void brcmnand_wr_corr_thresh(stru +@@ -951,6 +951,12 @@ static void brcmnand_wr_corr_thresh(stru static inline int brcmnand_cmd_shift(struct brcmnand_controller *ctrl) { diff --git a/target/linux/bcm47xx/patches-5.15/108-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch b/target/linux/bcm47xx/patches-5.15/108-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch index baa48ef5a0d7a5..38fd3a30a6573d 100644 --- a/target/linux/bcm47xx/patches-5.15/108-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch +++ b/target/linux/bcm47xx/patches-5.15/108-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch @@ -187,7 +187,7 @@ Signed-off-by: Florian Fainelli +MODULE_DESCRIPTION("NAND controller driver glue for BCMA chips"); --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -598,7 +598,11 @@ enum { +@@ -627,7 +627,11 @@ enum { static inline bool brcmnand_non_mmio_ops(struct brcmnand_controller *ctrl) { diff --git a/target/linux/bcm4908/patches-5.15/070-v5.17-net-dsa-bcm_sf2-refactor-LED-regs-access.patch b/target/linux/bcm4908/patches-5.15/070-v5.17-net-dsa-bcm_sf2-refactor-LED-regs-access.patch index fd0b13c17ba952..e01c1e4728bd34 100644 --- a/target/linux/bcm4908/patches-5.15/070-v5.17-net-dsa-bcm_sf2-refactor-LED-regs-access.patch +++ b/target/linux/bcm4908/patches-5.15/070-v5.17-net-dsa-bcm_sf2-refactor-LED-regs-access.patch @@ -82,7 +82,7 @@ Signed-off-by: Jakub Kicinski } } -@@ -1241,9 +1278,14 @@ static const u16 bcm_sf2_4908_reg_offset +@@ -1247,9 +1284,14 @@ static const u16 bcm_sf2_4908_reg_offset [REG_SPHY_CNTRL] = 0x24, [REG_CROSSBAR] = 0xc8, [REG_RGMII_11_CNTRL] = 0x014c, diff --git a/target/linux/bcm4908/patches-5.15/400-mtd-rawnand-brcmnand-disable-WP-on-BCM4908.patch b/target/linux/bcm4908/patches-5.15/400-mtd-rawnand-brcmnand-disable-WP-on-BCM4908.patch index 74dddb7f489503..65066236db929b 100644 --- a/target/linux/bcm4908/patches-5.15/400-mtd-rawnand-brcmnand-disable-WP-on-BCM4908.patch +++ b/target/linux/bcm4908/patches-5.15/400-mtd-rawnand-brcmnand-disable-WP-on-BCM4908.patch @@ -20,7 +20,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -37,7 +37,11 @@ +@@ -38,7 +38,11 @@ * 1: NAND_WP is set by default, cleared for erase/write operations * 2: NAND_WP is always cleared */ diff --git a/target/linux/bcm4908/patches-5.15/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch b/target/linux/bcm4908/patches-5.15/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch index ba09c562aebae6..165b02da0fa32a 100644 --- a/target/linux/bcm4908/patches-5.15/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch +++ b/target/linux/bcm4908/patches-5.15/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch @@ -29,7 +29,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c -@@ -1542,10 +1542,14 @@ static int bcm_sf2_sw_probe(struct platf +@@ -1548,10 +1548,14 @@ static int bcm_sf2_sw_probe(struct platf rev = reg_readl(priv, REG_PHY_REVISION); priv->hw_params.gphy_rev = rev & PHY_REVISION_MASK; diff --git a/target/linux/bcm4908/patches-5.15/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch b/target/linux/bcm4908/patches-5.15/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch index b5baa8717e4aab..ea0adca26f6c78 100644 --- a/target/linux/bcm4908/patches-5.15/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch +++ b/target/linux/bcm4908/patches-5.15/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch @@ -15,7 +15,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c -@@ -1556,6 +1556,12 @@ static int bcm_sf2_sw_probe(struct platf +@@ -1562,6 +1562,12 @@ static int bcm_sf2_sw_probe(struct platf priv->hw_params.core_rev >> 8, priv->hw_params.core_rev & 0xff, priv->irq0, priv->irq1); diff --git a/target/linux/bcm4908/patches-6.1/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch b/target/linux/bcm4908/patches-6.1/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch index 954b28b63b57b1..cf089fec6157a0 100644 --- a/target/linux/bcm4908/patches-6.1/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch +++ b/target/linux/bcm4908/patches-6.1/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch @@ -29,7 +29,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c -@@ -1516,10 +1516,14 @@ static int bcm_sf2_sw_probe(struct platf +@@ -1522,10 +1522,14 @@ static int bcm_sf2_sw_probe(struct platf rev = reg_readl(priv, REG_PHY_REVISION); priv->hw_params.gphy_rev = rev & PHY_REVISION_MASK; diff --git a/target/linux/bcm4908/patches-6.1/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch b/target/linux/bcm4908/patches-6.1/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch index 24e6234600bd86..865eac729a21b8 100644 --- a/target/linux/bcm4908/patches-6.1/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch +++ b/target/linux/bcm4908/patches-6.1/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch @@ -15,7 +15,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c -@@ -1530,6 +1530,12 @@ static int bcm_sf2_sw_probe(struct platf +@@ -1536,6 +1536,12 @@ static int bcm_sf2_sw_probe(struct platf priv->hw_params.core_rev >> 8, priv->hw_params.core_rev & 0xff, priv->irq0, priv->irq1); diff --git a/target/linux/bcm53xx/base-files/etc/board.d/02_network b/target/linux/bcm53xx/base-files/etc/board.d/02_network index 13e7311e797571..6d84442da441c7 100644 --- a/target/linux/bcm53xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm53xx/base-files/etc/board.d/02_network @@ -50,6 +50,7 @@ bcm53xx_setup_macs() offset=1 ;; dlink,dir-885l | \ + linksys,ea9200 | \ linksys,panamera | \ netgear,r7900 | \ netgear,r8000 | \ diff --git a/target/linux/bcm53xx/config-6.1 b/target/linux/bcm53xx/config-6.1 index d96beb687df0d7..fba523175a8ed4 100644 --- a/target/linux/bcm53xx/config-6.1 +++ b/target/linux/bcm53xx/config-6.1 @@ -3,7 +3,6 @@ CONFIG_ARCH_32BIT_OFF_T=y CONFIG_ARCH_BCM=y CONFIG_ARCH_BCM_5301X=y CONFIG_ARCH_BCM_53573=y -# CONFIG_ARCH_BCM_HR2 is not set CONFIG_ARCH_BCM_IPROC=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_KEEP_MEMBLOCK=y @@ -23,14 +22,13 @@ CONFIG_ARM_APPENDED_DTB=y CONFIG_ARM_ARCH_TIMER=y CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y # CONFIG_ARM_ATAG_DTB_COMPAT is not set -CONFIG_ARM_CRYPTO=y CONFIG_ARM_ERRATA_754322=y CONFIG_ARM_ERRATA_764369=y CONFIG_ARM_ERRATA_775420=y CONFIG_ARM_GIC=y CONFIG_ARM_GLOBAL_TIMER=y CONFIG_ARM_GT_INITIAL_PRESCALER_VAL=1 -CONFIG_ARM_HAS_SG_CHAIN=y +CONFIG_ARM_HAS_GROUP_RELOCS=y CONFIG_ARM_HEAVY_MB=y CONFIG_ARM_L1_CACHE_SHIFT=6 CONFIG_ARM_L1_CACHE_SHIFT_6=y @@ -70,6 +68,9 @@ CONFIG_BLK_MQ_PCI=y CONFIG_BOUNCE=y CONFIG_BROADCOM_PHY=y CONFIG_CACHE_L2X0=y +CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y +CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" +CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK=y CONFIG_CLKSRC_MMIO=y # CONFIG_CLK_BCM_NS2 is not set @@ -78,7 +79,10 @@ CONFIG_CLK_BCM_NSP=y CONFIG_CLONE_BACKWARDS=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_IPROC=y +CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CONTEXT_TRACKING=y +CONFIG_CONTEXT_TRACKING_IDLE=y CONFIG_CPU_32v6K=y CONFIG_CPU_32v7=y CONFIG_CPU_ABRT_EV7=y @@ -88,6 +92,7 @@ CONFIG_CPU_COPY_V6=y CONFIG_CPU_CP15=y CONFIG_CPU_CP15_MMU=y CONFIG_CPU_HAS_ASID=y +CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_CPU_PABRT_V7=y CONFIG_CPU_RMAP=y CONFIG_CPU_SPECTRE=y @@ -98,11 +103,15 @@ CONFIG_CRC16=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_HASH_INFO=y CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_LIB_SHA1=y +CONFIG_CRYPTO_LIB_UTILS=y CONFIG_CRYPTO_LZO=y CONFIG_CRYPTO_RNG2=y CONFIG_CRYPTO_ZSTD=y +CONFIG_CURRENT_POINTER_IN_TPIDRURO=y CONFIG_DCACHE_WORD_ACCESS=y CONFIG_DEBUG_BCM_5301X=y +CONFIG_DEBUG_INFO=y CONFIG_DEBUG_LL=y CONFIG_DEBUG_LL_INCLUDE="debug/8250.S" CONFIG_DEBUG_MISC=y @@ -110,20 +119,21 @@ CONFIG_DEBUG_UART_8250=y CONFIG_DEBUG_UART_8250_SHIFT=0 CONFIG_DEBUG_UART_PHYS=0x18000300 CONFIG_DEBUG_UART_VIRT=0xf1000300 -CONFIG_DEBUG_UNCOMPRESS=y CONFIG_DEBUG_USER=y CONFIG_DMA_OPS=y -CONFIG_DMA_REMAP=y CONFIG_DTC=y CONFIG_EARLY_PRINTK=y CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y +CONFIG_EXCLUSIVE_SYSTEM_RAM=y CONFIG_EXTCON=y CONFIG_FIXED_PHY=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_FW_LOADER_SYSFS=y # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set +CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y CONFIG_GENERIC_BUG=y @@ -156,7 +166,6 @@ CONFIG_GPIO_BCM_XGS_IPROC=y CONFIG_GPIO_CDEV=y CONFIG_GPIO_GENERIC=y CONFIG_GRO_CELLS=y -CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y @@ -171,6 +180,7 @@ CONFIG_HZ_FIXED=0 CONFIG_HZ_PERIODIC=y CONFIG_INITRAMFS_SOURCE="" CONFIG_IRQCHIP=y +CONFIG_IRQSTACKS=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_IRQ_FORCED_THREADING=y @@ -241,6 +251,9 @@ CONFIG_OUTER_CACHE=y CONFIG_OUTER_CACHE_SYNC=y CONFIG_PADATA=y CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PAGE_POOL=y +CONFIG_PAGE_SIZE_LESS_THAN_256KB=y +CONFIG_PAGE_SIZE_LESS_THAN_64KB=y CONFIG_PCI=y CONFIG_PCIE_IPROC=y CONFIG_PCIE_IPROC_BCMA=y @@ -261,10 +274,12 @@ CONFIG_PINCTRL=y # CONFIG_PINCTRL_IPROC_GPIO is not set CONFIG_PINCTRL_NS=y # CONFIG_PINCTRL_NS2_MUX is not set +CONFIG_PREEMPT_NONE_BUILD=y CONFIG_PTP_1588_CLOCK_OPTIONAL=y CONFIG_PWM=y CONFIG_PWM_BCM_IPROC=y CONFIG_PWM_SYSFS=y +CONFIG_RANDSTRUCT_NONE=y CONFIG_RATIONAL=y CONFIG_REGMAP=y CONFIG_REGMAP_MMIO=y @@ -278,6 +293,7 @@ CONFIG_SGL_ALLOC=y CONFIG_SMP=y CONFIG_SMP_ON_UP=y CONFIG_SOCK_RX_QUEUE_MAPPING=y +CONFIG_SOFTIRQ_ON_OWN_STACK=y CONFIG_SPARSE_IRQ=y CONFIG_SPI=y CONFIG_SPI_BCM_QSPI=y @@ -294,6 +310,7 @@ CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 CONFIG_THERMAL_GOV_STEP_WISE=y CONFIG_THERMAL_OF=y +CONFIG_THREAD_INFO_IN_TASK=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TIMER_OF=y CONFIG_TIMER_PROBE=y @@ -314,5 +331,6 @@ CONFIG_ZBOOT_ROM_BSS=0x0 CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y +CONFIG_ZSTD_COMMON=y CONFIG_ZSTD_COMPRESS=y CONFIG_ZSTD_DECOMPRESS=y diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index 39b7efbef789f8..8799f5005799b8 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -143,6 +143,7 @@ USB2_PACKAGES += kmod-usb-ledtrig-usbport USB3_PACKAGES := $(USB2_PACKAGES) kmod-usb3 kmod-phy-bcm-ns-usb3 define Device/Default + PROFILES = Generic $$(DEVICE_NAME) # .dtb files are prefixed by SoC type, e.g. bcm4708- which is not included in device/image names # extract the full dtb name based on the device info DEVICE_DTS := $(patsubst %.dtb,%,$(notdir $(wildcard $(if $(IB),$(KDIR),$(DTS_DIR))/*-$(subst _,-,$(1)).dtb))) diff --git a/target/linux/bcm53xx/patches-5.15/038-v6.7-0001-ARM-dts-BCM5301X-Set-MACs-for-D-Link-DIR-885L.patch b/target/linux/bcm53xx/patches-5.15/038-v6.7-0001-ARM-dts-BCM5301X-Set-MACs-for-D-Link-DIR-885L.patch new file mode 100644 index 00000000000000..78b8975f1fd89d --- /dev/null +++ b/target/linux/bcm53xx/patches-5.15/038-v6.7-0001-ARM-dts-BCM5301X-Set-MACs-for-D-Link-DIR-885L.patch @@ -0,0 +1,56 @@ +From 5cbee5828219c4f7b33e96b5d8ce5e467b2857c8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 1 Sep 2023 12:55:49 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Set MACs for D-Link DIR-885L +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Specify NVRAM access and use its "et2macaddr" NVMEM cell. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20230901105549.7076-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + .../dts/broadcom/bcm47094-dlink-dir-885l.dts | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +--- a/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts +@@ -25,6 +25,15 @@ + <0x88000000 0x08000000>; + }; + ++ nvram@1e3f0000 { ++ compatible = "brcm,nvram"; ++ reg = <0x1e3f0000 0x10000>; ++ ++ et2macaddr: et2macaddr { ++ #nvmem-cell-cells = <1>; ++ }; ++ }; ++ + nand_controller: nand-controller@18028000 { + nand@0 { + partitions { +@@ -112,6 +121,11 @@ + vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>; + }; + ++&gmac0 { ++ nvmem-cells = <&et2macaddr 0>; ++ nvmem-cell-names = "mac-address"; ++}; ++ + &spi_nor { + status = "okay"; + }; +@@ -142,6 +156,8 @@ + + port@4 { + label = "wan"; ++ nvmem-cells = <&et2macaddr 3>; ++ nvmem-cell-names = "mac-address"; + }; + + port@8 { diff --git a/target/linux/bcm53xx/patches-5.15/038-v6.7-0002-ARM-dts-BCM5301X-Set-MAC-address-for-Asus-RT-AC87U.patch b/target/linux/bcm53xx/patches-5.15/038-v6.7-0002-ARM-dts-BCM5301X-Set-MAC-address-for-Asus-RT-AC87U.patch new file mode 100644 index 00000000000000..11ce7acb5361b5 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.15/038-v6.7-0002-ARM-dts-BCM5301X-Set-MAC-address-for-Asus-RT-AC87U.patch @@ -0,0 +1,44 @@ +From a9e79863b62aaaefcdf469fc331bf482ae00db0d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 1 Sep 2023 14:43:11 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Set MAC address for Asus RT-AC87U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Specify NVRAM access and use its "et1macaddr" NVMEM cell. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20230901124311.31156-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/broadcom/bcm4709-asus-rt-ac87u.dts | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts ++++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +@@ -25,6 +25,12 @@ + <0x88000000 0x08000000>; + }; + ++ nvram@1c080000 { ++ et1macaddr: et1macaddr { ++ #nvmem-cell-cells = <1>; ++ }; ++ }; ++ + leds { + compatible = "gpio-leds"; + +@@ -62,6 +68,11 @@ + }; + }; + ++&gmac0 { ++ nvmem-cells = <&et1macaddr 0>; ++ nvmem-cell-names = "mac-address"; ++}; ++ + &usb3_phy { + status = "okay"; + }; diff --git a/target/linux/bcm53xx/patches-5.15/038-v6.7-0003-ARM-dts-BCM5301X-Relicense-Felix-s-code-to-the-GPL-2.patch b/target/linux/bcm53xx/patches-5.15/038-v6.7-0003-ARM-dts-BCM5301X-Relicense-Felix-s-code-to-the-GPL-2.patch new file mode 100644 index 00000000000000..6df1e555e99c05 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.15/038-v6.7-0003-ARM-dts-BCM5301X-Relicense-Felix-s-code-to-the-GPL-2.patch @@ -0,0 +1,57 @@ +From 81ea360a16978a4df61df9db56b171909bd659c0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sat, 16 Sep 2023 10:30:57 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Relicense Felix's code to the GPL 2.0+ / + MIT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Move code added by Felix to the bcm-ns.dtsi which uses dual licensing. +That syncs more Northstar code to be based on the same licensing schema. + +This code was added in the commit 1ff80363524c ("ARM: BCM5301X: Add +profiling support"). + +Cc: Felix Fietkau +Signed-off-by: Rafał Miłecki +Acked-by: Felix Fietkau +Link: https://lore.kernel.org/r/20230916083057.10458-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/broadcom/bcm-ns.dtsi | 7 +++++++ + arch/arm/boot/dts/broadcom/bcm5301x.dtsi | 7 ------- + 2 files changed, 7 insertions(+), 7 deletions(-) + +--- a/arch/arm/boot/dts/bcm-ns.dtsi ++++ b/arch/arm/boot/dts/bcm-ns.dtsi +@@ -14,6 +14,13 @@ + #address-cells = <1>; + #size-cells = <1>; + ++ pmu { ++ compatible = "arm,cortex-a9-pmu"; ++ interrupts = ++ , ++ ; ++ }; ++ + chipcommon-a-bus@18000000 { + compatible = "simple-bus"; + ranges = <0x00000000 0x18000000 0x00001000>; +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -26,13 +26,6 @@ + }; + }; + +- pmu { +- compatible = "arm,cortex-a9-pmu"; +- interrupts = +- , +- ; +- }; +- + clocks { + #address-cells = <1>; + #size-cells = <1>; diff --git a/target/linux/bcm53xx/patches-5.15/038-v6.7-0004-ARM-dts-BCM5301X-Relicense-Vivek-s-code-to-the-GPL-2.patch b/target/linux/bcm53xx/patches-5.15/038-v6.7-0004-ARM-dts-BCM5301X-Relicense-Vivek-s-code-to-the-GPL-2.patch new file mode 100644 index 00000000000000..66db4a291fb924 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.15/038-v6.7-0004-ARM-dts-BCM5301X-Relicense-Vivek-s-code-to-the-GPL-2.patch @@ -0,0 +1,104 @@ +From b8d4f7c1be04d66c37c119c501c87bccc4197694 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sat, 16 Sep 2023 10:58:55 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Relicense Vivek's code to the GPL 2.0+ / + MIT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Move code added by Vivek to the bcm-ns.dtsi which uses dual licensing. +That syncs more Northstar code to be based on the same licensing schema. + +This code was added in the commit 37f6130ec39f ("ARM: dts: BCM5301X: +Make USB 3.0 PHY use MDIO PHY driver"). + +Cc: Vivek Unune +Signed-off-by: Rafał Miłecki +Acked-by: Vivek Unune +Link: https://lore.kernel.org/r/20230916085855.28375-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/broadcom/bcm-ns.dtsi | 27 ++++++++++++++++++++++++ + arch/arm/boot/dts/broadcom/bcm5301x.dtsi | 27 ------------------------ + 2 files changed, 27 insertions(+), 27 deletions(-) + +--- a/arch/arm/boot/dts/bcm-ns.dtsi ++++ b/arch/arm/boot/dts/bcm-ns.dtsi +@@ -327,6 +327,29 @@ + #address-cells = <1>; + }; + ++ mdio-mux@18003000 { ++ compatible = "mdio-mux-mmioreg", "mdio-mux"; ++ mdio-parent-bus = <&mdio>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x18003000 0x4>; ++ mux-mask = <0x200>; ++ ++ mdio@0 { ++ reg = <0x0>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ usb3_phy: usb3-phy@10 { ++ compatible = "brcm,ns-ax-usb3-phy"; ++ reg = <0x10>; ++ usb3-dmp-syscon = <&usb3_dmp>; ++ #phy-cells = <0>; ++ status = "disabled"; ++ }; ++ }; ++ }; ++ + rng: rng@18004000 { + compatible = "brcm,bcm5301x-rng"; + reg = <0x18004000 0x14>; +@@ -467,6 +490,10 @@ + brcm,nand-has-wp; + }; + ++ usb3_dmp: syscon@18105000 { ++ reg = <0x18105000 0x1000>; ++ }; ++ + thermal-zones { + cpu_thermal: cpu-thermal { + polling-delay-passive = <0>; +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -62,33 +62,6 @@ + }; + }; + +- mdio-mux@18003000 { +- compatible = "mdio-mux-mmioreg", "mdio-mux"; +- mdio-parent-bus = <&mdio>; +- #address-cells = <1>; +- #size-cells = <0>; +- reg = <0x18003000 0x4>; +- mux-mask = <0x200>; +- +- mdio@0 { +- reg = <0x0>; +- #address-cells = <1>; +- #size-cells = <0>; +- +- usb3_phy: usb3-phy@10 { +- compatible = "brcm,ns-ax-usb3-phy"; +- reg = <0x10>; +- usb3-dmp-syscon = <&usb3_dmp>; +- #phy-cells = <0>; +- status = "disabled"; +- }; +- }; +- }; +- +- usb3_dmp: syscon@18105000 { +- reg = <0x18105000 0x1000>; +- }; +- + i2c0: i2c@18009000 { + compatible = "brcm,iproc-i2c"; + reg = <0x18009000 0x50>; diff --git a/target/linux/bcm53xx/patches-5.15/038-v6.7-0005-ARM-dts-BCM5301X-Explicitly-disable-unused-switch-CP.patch b/target/linux/bcm53xx/patches-5.15/038-v6.7-0005-ARM-dts-BCM5301X-Explicitly-disable-unused-switch-CP.patch new file mode 100644 index 00000000000000..72e5c6b061412e --- /dev/null +++ b/target/linux/bcm53xx/patches-5.15/038-v6.7-0005-ARM-dts-BCM5301X-Explicitly-disable-unused-switch-CP.patch @@ -0,0 +1,377 @@ +From 473baeab929444295b0530f8766e4becb6a08973 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 13 Oct 2023 12:33:13 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Explicitly disable unused switch CPU + ports +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When redescribing ports I assumed that missing "label" (like "cpu") +means switch port isn't used. That was incorrect and I realized my +change made Linux always use the first (5) CPU port (there are 3 of +them). + +While above should technically be possible it often isn't correct: +1. Non-default switch ports are often connected to Ethernet interfaces + not fully covered by vendor setup (they may miss MACs) +2. On some devices non-default ports require specifying fixed link + +This fixes network connectivity for some devices. It was reported & +tested for Netgear R8000. It also affects Linksys EA9200 with its +downstream DTS. + +Fixes: ba4aebce23b2 ("ARM: dts: BCM5301X: Describe switch ports in the main DTS") +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20231013103314.10306-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + .../dts/broadcom/bcm4708-buffalo-wzr-1166dhp-common.dtsi | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm4708-luxul-xap-1510.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm4708-luxul-xwc-1000.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm4708-netgear-r6250.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm4708-smartrg-sr400ac.dts | 8 ++++++++ + .../boot/dts/broadcom/bcm47081-buffalo-wzr-600dhp2.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47081-luxul-xap-1410.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47081-luxul-xwr-1200.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm4709-netgear-r8000.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-885l.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-890l.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-abr-4500.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-xap-1610.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-xbr-4500.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-xwc-2000.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3100.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3150-v1.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm53015-meraki-mr26.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm53016-meraki-mr32.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm953012er.dts | 8 ++++++++ + 20 files changed, 160 insertions(+) + +--- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi ++++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi +@@ -181,5 +181,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts ++++ b/arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts +@@ -85,5 +85,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts ++++ b/arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts +@@ -88,5 +88,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm4708-netgear-r6250.dts ++++ b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts +@@ -122,5 +122,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts ++++ b/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts +@@ -145,6 +145,14 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; + +--- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts ++++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts +@@ -145,5 +145,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts ++++ b/arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts +@@ -81,5 +81,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts ++++ b/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts +@@ -148,5 +148,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts +@@ -227,6 +227,14 @@ + label = "wan"; + }; + ++ port@5 { ++ status = "disabled"; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ + port@8 { + label = "cpu"; + }; +--- a/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts +@@ -160,6 +160,14 @@ + nvmem-cell-names = "mac-address"; + }; + ++ port@5 { ++ status = "disabled"; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ + port@8 { + label = "cpu"; + }; +--- a/arch/arm/boot/dts/bcm47094-dlink-dir-890l.dts ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-890l.dts +@@ -192,6 +192,14 @@ + label = "wan"; + }; + ++ port@5 { ++ status = "disabled"; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ + port@8 { + label = "cpu"; + phy-mode = "rgmii"; +--- a/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts +@@ -107,5 +107,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47094-luxul-xap-1610.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xap-1610.dts +@@ -120,5 +120,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts +@@ -107,5 +107,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts +@@ -75,5 +75,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts +@@ -147,5 +147,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts +@@ -158,5 +158,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm53015-meraki-mr26.dts ++++ b/arch/arm/boot/dts/bcm53015-meraki-mr26.dts +@@ -124,6 +124,14 @@ + full-duplex; + }; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; + +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -185,6 +185,14 @@ + full-duplex; + }; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; + +--- a/arch/arm/boot/dts/bcm953012er.dts ++++ b/arch/arm/boot/dts/bcm953012er.dts +@@ -84,6 +84,14 @@ + label = "cpu"; + ethernet = <&gmac0>; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; + diff --git a/target/linux/bcm53xx/patches-5.15/038-v6.7-0006-ARM-dts-BCM5301X-Set-fixed-link-for-extra-Netgear-R8.patch b/target/linux/bcm53xx/patches-5.15/038-v6.7-0006-ARM-dts-BCM5301X-Set-fixed-link-for-extra-Netgear-R8.patch new file mode 100644 index 00000000000000..0b2b7b36a3fc29 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.15/038-v6.7-0006-ARM-dts-BCM5301X-Set-fixed-link-for-extra-Netgear-R8.patch @@ -0,0 +1,47 @@ +From d313b0e9070a7100ca55e64fe3b081d176d8806d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 13 Oct 2023 12:33:14 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Set fixed-link for extra Netgear R8000 + CPU ports +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Ports 5 and 7 are disabled by default because the standard use case is +for port 8 to manage all CPU directed traffic. For experimentation +purposes however it is desirable to provide adequate properties such +that people can experiment with using different ports without having to +figure out their configuration. Some of the use cases include but are +not limited to doubling or tripling the bandwidth by leveraging the +additional ports/Ethernet MAC combinations. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20231013103314.10306-2-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/broadcom/bcm4709-netgear-r8000.dts | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts +@@ -229,10 +229,20 @@ + + port@5 { + status = "disabled"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; + }; + + port@7 { + status = "disabled"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; + }; + + port@8 { diff --git a/target/linux/bcm53xx/patches-5.15/038-v6.7-0007-ARM-dts-BCM5301X-Set-switch-ports-for-Linksys-EA9200.patch b/target/linux/bcm53xx/patches-5.15/038-v6.7-0007-ARM-dts-BCM5301X-Set-switch-ports-for-Linksys-EA9200.patch new file mode 100644 index 00000000000000..4528c95a5aa960 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.15/038-v6.7-0007-ARM-dts-BCM5301X-Set-switch-ports-for-Linksys-EA9200.patch @@ -0,0 +1,63 @@ +From 253358f373492608348136e569366d73cb969f6a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 24 Oct 2023 09:26:05 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Set switch ports for Linksys EA9200 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This patch was developed as OpenWrt downstream change and was recently +confirmed to work as expected. + +Tested-by: Rani Hod +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20231024072605.32517-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + .../dts/broadcom/bcm4709-linksys-ea9200.dts | 38 +++++++++++++++++++ + 1 file changed, 38 insertions(+) + +--- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts ++++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts +@@ -47,3 +47,41 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ label = "wan"; ++ }; ++ ++ port@5 { ++ status = "disabled"; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ label = "cpu"; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch b/target/linux/bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch index 17013c75bad8c9..49277ab251f647 100644 --- a/target/linux/bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch +++ b/target/linux/bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch @@ -90,41 +90,23 @@ it on BCM4708 family. /* * Reset a halted HC. * -@@ -611,10 +654,20 @@ static int xhci_init(struct usb_hcd *hcd - - static int xhci_run_finished(struct xhci_hcd *xhci) - { -- if (xhci_start(xhci)) { -- xhci_halt(xhci); -- return -ENODEV; -+ int err; -+ -+ err = xhci_start(xhci); -+ if (err) { -+ err = -ENODEV; -+ goto err_halt; +@@ -634,6 +677,16 @@ static int xhci_run_finished(struct xhci + spin_unlock_irqrestore(&xhci->lock, flags); + return -ENODEV; } + + if (xhci->quirks & XHCI_FAKE_DOORBELL) { -+ err = xhci_fake_doorbell(xhci, 1); -+ if (err) -+ goto err_halt; ++ int err = xhci_fake_doorbell(xhci, 1); ++ if (err) { ++ xhci_halt(xhci); ++ spin_unlock_irqrestore(&xhci->lock, flags); ++ return err; ++ } + } + xhci->shared_hcd->state = HC_STATE_RUNNING; xhci->cmd_ring_state = CMD_RING_STATE_RUNNING; -@@ -624,6 +677,10 @@ static int xhci_run_finished(struct xhci - xhci_dbg_trace(xhci, trace_xhci_dbg_init, - "Finished xhci_run for USB3 roothub"); - return 0; -+ -+err_halt: -+ xhci_halt(xhci); -+ return err; - } - - /* --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1908,6 +1908,7 @@ struct xhci_hcd { diff --git a/target/linux/bcm53xx/patches-5.15/181-nvmem-brcm_nvram-store-a-copy-of-NVRAM-content.patch b/target/linux/bcm53xx/patches-5.15/181-nvmem-brcm_nvram-store-a-copy-of-NVRAM-content.patch new file mode 100644 index 00000000000000..cceb3635ac5dc8 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.15/181-nvmem-brcm_nvram-store-a-copy-of-NVRAM-content.patch @@ -0,0 +1,256 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 14 Sep 2023 07:59:09 +0200 +Subject: [PATCH] nvmem: brcm_nvram: store a copy of NVRAM content +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This driver uses MMIO access for reading NVRAM from a flash device. +Underneath there is a flash controller that reads data and provides +mapping window. + +Using MMIO interface affects controller configuration and may break real +controller driver. It was reported by multiple users of devices with +NVRAM stored on NAND. + +Modify driver to read & cache NVRAM content during init and use that +copy to provide NVMEM data when requested. On NAND flashes due to their +alignment NVRAM partitions can be quite big (1 MiB and more) while +actual NVRAM content stays quite small (usually 16 to 32 KiB). To avoid +allocating so much memory check for actual data length. + +Link: https://lore.kernel.org/linux-mtd/CACna6rwf3_9QVjYcM+847biTX=K0EoWXuXcSMkJO1Vy_5vmVqA@mail.gmail.com/ +Fixes: 3fef9ed0627a ("nvmem: brcm_nvram: new driver exposing Broadcom's NVRAM") +Cc: Arınç ÜNAL +Cc: Florian Fainelli +Cc: Scott Branden +Signed-off-by: Rafał Miłecki +Acked-by: Arınç ÜNAL +--- + drivers/nvmem/brcm_nvram.c | 134 ++++++++++++++++++++++++++----------- + 1 file changed, 94 insertions(+), 40 deletions(-) + +--- a/drivers/nvmem/brcm_nvram.c ++++ b/drivers/nvmem/brcm_nvram.c +@@ -17,9 +17,23 @@ + + #define NVRAM_MAGIC "FLSH" + ++/** ++ * struct brcm_nvram - driver state internal struct ++ * ++ * @dev: NVMEM device pointer ++ * @nvmem_size: Size of the whole space available for NVRAM ++ * @data: NVRAM data copy stored to avoid poking underlaying flash controller ++ * @data_len: NVRAM data size ++ * @padding_byte: Padding value used to fill remaining space ++ * @cells: Array of discovered NVMEM cells ++ * @ncells: Number of elements in cells ++ */ + struct brcm_nvram { + struct device *dev; +- void __iomem *base; ++ size_t nvmem_size; ++ uint8_t *data; ++ size_t data_len; ++ uint8_t padding_byte; + struct nvmem_cell_info *cells; + int ncells; + }; +@@ -36,10 +50,47 @@ static int brcm_nvram_read(void *context + size_t bytes) + { + struct brcm_nvram *priv = context; +- u8 *dst = val; ++ size_t to_copy; ++ ++ if (offset + bytes > priv->data_len) ++ to_copy = max_t(ssize_t, (ssize_t)priv->data_len - offset, 0); ++ else ++ to_copy = bytes; ++ ++ memcpy(val, priv->data + offset, to_copy); ++ ++ memset((uint8_t *)val + to_copy, priv->padding_byte, bytes - to_copy); ++ ++ return 0; ++} ++ ++static int brcm_nvram_copy_data(struct brcm_nvram *priv, struct platform_device *pdev) ++{ ++ struct resource *res; ++ void __iomem *base; ++ ++ base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); ++ if (IS_ERR(base)) ++ return PTR_ERR(base); ++ ++ priv->nvmem_size = resource_size(res); ++ ++ priv->padding_byte = readb(base + priv->nvmem_size - 1); ++ for (priv->data_len = priv->nvmem_size; ++ priv->data_len; ++ priv->data_len--) { ++ if (readb(base + priv->data_len - 1) != priv->padding_byte) ++ break; ++ } ++ WARN(priv->data_len > SZ_128K, "Unexpected (big) NVRAM size: %zu B\n", priv->data_len); + +- while (bytes--) +- *dst++ = readb(priv->base + offset++); ++ priv->data = devm_kzalloc(priv->dev, priv->data_len, GFP_KERNEL); ++ if (!priv->data) ++ return -ENOMEM; ++ ++ memcpy_fromio(priv->data, base, priv->data_len); ++ ++ bcm47xx_nvram_init_from_iomem(base, priv->data_len); + + return 0; + } +@@ -67,8 +118,13 @@ static int brcm_nvram_add_cells(struct b + size_t len) + { + struct device *dev = priv->dev; +- char *var, *value, *eq; ++ char *var, *value; ++ uint8_t tmp; + int idx; ++ int err = 0; ++ ++ tmp = priv->data[len - 1]; ++ priv->data[len - 1] = '\0'; + + priv->ncells = 0; + for (var = data + sizeof(struct brcm_nvram_header); +@@ -78,67 +134,68 @@ static int brcm_nvram_add_cells(struct b + } + + priv->cells = devm_kcalloc(dev, priv->ncells, sizeof(*priv->cells), GFP_KERNEL); +- if (!priv->cells) +- return -ENOMEM; ++ if (!priv->cells) { ++ err = -ENOMEM; ++ goto out; ++ } + + for (var = data + sizeof(struct brcm_nvram_header), idx = 0; + var < (char *)data + len && *var; + var = value + strlen(value) + 1, idx++) { ++ char *eq, *name; ++ + eq = strchr(var, '='); + if (!eq) + break; + *eq = '\0'; ++ name = devm_kstrdup(dev, var, GFP_KERNEL); ++ *eq = '='; ++ if (!name) { ++ err = -ENOMEM; ++ goto out; ++ } + value = eq + 1; + +- priv->cells[idx].name = devm_kstrdup(dev, var, GFP_KERNEL); +- if (!priv->cells[idx].name) +- return -ENOMEM; ++ priv->cells[idx].name = name; + priv->cells[idx].offset = value - (char *)data; + priv->cells[idx].bytes = strlen(value); + priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name); +- if (!strcmp(var, "et0macaddr") || +- !strcmp(var, "et1macaddr") || +- !strcmp(var, "et2macaddr")) { ++ if (!strcmp(name, "et0macaddr") || ++ !strcmp(name, "et1macaddr") || ++ !strcmp(name, "et2macaddr")) { + priv->cells[idx].raw_len = strlen(value); + priv->cells[idx].bytes = ETH_ALEN; + priv->cells[idx].read_post_process = brcm_nvram_read_post_process_macaddr; + } + } + +- return 0; ++out: ++ priv->data[len - 1] = tmp; ++ return err; + } + + static int brcm_nvram_parse(struct brcm_nvram *priv) + { ++ struct brcm_nvram_header *header = (struct brcm_nvram_header *)priv->data; + struct device *dev = priv->dev; +- struct brcm_nvram_header header; +- uint8_t *data; + size_t len; + int err; + +- memcpy_fromio(&header, priv->base, sizeof(header)); +- +- if (memcmp(header.magic, NVRAM_MAGIC, 4)) { ++ if (memcmp(header->magic, NVRAM_MAGIC, 4)) { + dev_err(dev, "Invalid NVRAM magic\n"); + return -EINVAL; + } + +- len = le32_to_cpu(header.len); +- +- data = kzalloc(len, GFP_KERNEL); +- if (!data) +- return -ENOMEM; +- +- memcpy_fromio(data, priv->base, len); +- data[len - 1] = '\0'; +- +- err = brcm_nvram_add_cells(priv, data, len); +- if (err) { +- dev_err(dev, "Failed to add cells: %d\n", err); +- return err; ++ len = le32_to_cpu(header->len); ++ if (len > priv->nvmem_size) { ++ dev_err(dev, "NVRAM length (%zd) exceeds mapped size (%zd)\n", len, ++ priv->nvmem_size); ++ return -EINVAL; + } + +- kfree(data); ++ err = brcm_nvram_add_cells(priv, priv->data, len); ++ if (err) ++ dev_err(dev, "Failed to add cells: %d\n", err); + + return 0; + } +@@ -150,7 +207,6 @@ static int brcm_nvram_probe(struct platf + .reg_read = brcm_nvram_read, + }; + struct device *dev = &pdev->dev; +- struct resource *res; + struct brcm_nvram *priv; + int err; + +@@ -159,21 +215,19 @@ static int brcm_nvram_probe(struct platf + return -ENOMEM; + priv->dev = dev; + +- priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); +- if (IS_ERR(priv->base)) +- return PTR_ERR(priv->base); ++ err = brcm_nvram_copy_data(priv, pdev); ++ if (err) ++ return err; + + err = brcm_nvram_parse(priv); + if (err) + return err; + +- bcm47xx_nvram_init_from_iomem(priv->base, resource_size(res)); +- + config.dev = dev; + config.cells = priv->cells; + config.ncells = priv->ncells; + config.priv = priv; +- config.size = resource_size(res); ++ config.size = priv->nvmem_size; + + return PTR_ERR_OR_ZERO(devm_nvmem_register(dev, &config)); + } diff --git a/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch b/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch index e0832524f4ca7b..8039831a7874b5 100644 --- a/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch +++ b/target/linux/bcm53xx/patches-5.15/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch @@ -10,7 +10,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts +++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts -@@ -92,3 +92,40 @@ +@@ -92,3 +92,41 @@ &usb3_phy { status = "okay"; }; @@ -20,40 +20,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts +++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts -@@ -83,3 +83,40 @@ +@@ -83,3 +83,41 @@ &usb3_phy { status = "okay"; }; @@ -63,40 +64,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts +++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts -@@ -149,3 +149,40 @@ +@@ -149,3 +149,41 @@ &usb3_phy { status = "okay"; }; @@ -106,40 +108,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts +++ b/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts -@@ -46,3 +46,40 @@ +@@ -46,3 +46,41 @@ &usb3_phy { status = "okay"; }; @@ -149,40 +152,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts +++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts -@@ -43,3 +43,40 @@ +@@ -43,3 +43,41 @@ &usb3_phy { status = "okay"; }; @@ -192,40 +196,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts +++ b/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts -@@ -86,3 +86,40 @@ +@@ -86,3 +86,41 @@ &usb3_phy { status = "okay"; }; @@ -235,40 +240,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts +++ b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts -@@ -77,3 +77,40 @@ +@@ -77,3 +77,41 @@ &usb3_phy { status = "okay"; }; @@ -278,40 +284,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts -@@ -66,6 +66,38 @@ +@@ -77,6 +77,40 @@ status = "okay"; }; @@ -320,29 +327,31 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + ++ port@5 { ++ status = "disabled"; ++ }; ++ + port@7 { -+ reg = <7>; + label = "cpu"; -+ ethernet = <&gmac1>; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; @@ -352,7 +361,7 @@ Signed-off-by: Rafał Miłecki compatible = "fixed-partitions"; --- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts +++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts -@@ -130,3 +130,40 @@ +@@ -130,3 +130,41 @@ &usb3_phy { status = "okay"; }; @@ -362,88 +371,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; + }; -+ }; -+}; ---- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts -+++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts -@@ -47,3 +47,45 @@ - &usb3_phy { - status = "okay"; - }; + -+&srab { -+ status = "okay"; -+ -+ ports { -+ port@0 { -+ reg = <0>; -+ label = "lan1"; -+ }; -+ -+ port@1 { -+ reg = <1>; -+ label = "lan2"; -+ }; -+ -+ port@2 { -+ reg = <2>; -+ label = "lan3"; -+ }; -+ -+ port@3 { -+ reg = <3>; -+ label = "lan4"; -+ }; -+ -+ port@4 { -+ reg = <4>; -+ label = "wan"; ++ port@7 { ++ status = "disabled"; + }; + + port@8 { -+ reg = <8>; -+ label = "cpu"; -+ ethernet = <&gmac2>; -+ -+ fixed-link { -+ speed = <1000>; -+ full-duplex; -+ }; ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts +++ b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts -@@ -104,3 +104,40 @@ +@@ -104,3 +104,41 @@ &usb3_phy { status = "okay"; }; @@ -453,40 +415,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm47094-netgear-r8500.dts +++ b/arch/arm/boot/dts/bcm47094-netgear-r8500.dts -@@ -94,3 +94,45 @@ +@@ -94,3 +94,41 @@ &usb3_phy { status = "okay"; }; @@ -496,45 +459,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + ++ port@5 { ++ status = "disabled"; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ + port@8 { -+ reg = <8>; + label = "cpu"; -+ ethernet = <&gmac2>; -+ -+ fixed-link { -+ speed = <1000>; -+ full-duplex; -+ }; + }; + }; +}; --- a/arch/arm/boot/dts/bcm47094-phicomm-k3.dts +++ b/arch/arm/boot/dts/bcm47094-phicomm-k3.dts -@@ -38,6 +38,38 @@ +@@ -38,6 +38,40 @@ status = "okay"; }; @@ -543,29 +502,31 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; @@ -575,7 +536,7 @@ Signed-off-by: Rafał Miłecki compatible = "fixed-partitions"; --- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts +++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts -@@ -91,6 +91,43 @@ +@@ -91,6 +91,44 @@ }; }; @@ -584,34 +545,35 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; @@ -621,7 +583,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts +++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts -@@ -100,6 +100,43 @@ +@@ -100,6 +100,44 @@ vcc-gpio = <&chipcommon 12 GPIO_ACTIVE_HIGH>; }; @@ -630,34 +592,35 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; @@ -667,7 +630,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts +++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts -@@ -107,3 +107,41 @@ +@@ -107,3 +107,42 @@ &usb3_phy { status = "okay"; }; @@ -677,34 +640,35 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; diff --git a/target/linux/bcm53xx/patches-5.15/800-nvmem-brcm_nvram-store-a-copy-of-NVRAM-content.patch b/target/linux/bcm53xx/patches-5.15/800-nvmem-brcm_nvram-store-a-copy-of-NVRAM-content.patch deleted file mode 100644 index 901bb6dd3cfaf6..00000000000000 --- a/target/linux/bcm53xx/patches-5.15/800-nvmem-brcm_nvram-store-a-copy-of-NVRAM-content.patch +++ /dev/null @@ -1,128 +0,0 @@ -From a18378409fee1cac0f0c58a4770ff557b498c778 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Fri, 1 Sep 2023 10:44:26 +0200 -Subject: [PATCH] nvmem: brcm_nvram: store a copy of NVRAM content -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Rafał Miłecki ---- - drivers/nvmem/brcm_nvram.c | 54 +++++++++++++++++++------------------- - 1 file changed, 27 insertions(+), 27 deletions(-) - ---- a/drivers/nvmem/brcm_nvram.c -+++ b/drivers/nvmem/brcm_nvram.c -@@ -19,7 +19,7 @@ - - struct brcm_nvram { - struct device *dev; -- void __iomem *base; -+ uint8_t *data; - struct nvmem_cell_info *cells; - int ncells; - }; -@@ -36,10 +36,8 @@ static int brcm_nvram_read(void *context - size_t bytes) - { - struct brcm_nvram *priv = context; -- u8 *dst = val; - -- while (bytes--) -- *dst++ = readb(priv->base + offset++); -+ memcpy(val, priv->data + offset, bytes); - - return 0; - } -@@ -110,35 +108,27 @@ static int brcm_nvram_add_cells(struct b - - static int brcm_nvram_parse(struct brcm_nvram *priv) - { -+ struct brcm_nvram_header *header = (struct brcm_nvram_header *)priv->data; - struct device *dev = priv->dev; -- struct brcm_nvram_header header; -- uint8_t *data; -+ uint8_t tmp; - size_t len; - int err; - -- memcpy_fromio(&header, priv->base, sizeof(header)); -- -- if (memcmp(header.magic, NVRAM_MAGIC, 4)) { -+ if (memcmp(header->magic, NVRAM_MAGIC, 4)) { - dev_err(dev, "Invalid NVRAM magic\n"); - return -EINVAL; - } - -- len = le32_to_cpu(header.len); -+ len = le32_to_cpu(header->len); - -- data = kzalloc(len, GFP_KERNEL); -- if (!data) -- return -ENOMEM; -- -- memcpy_fromio(data, priv->base, len); -- data[len - 1] = '\0'; -+ tmp = priv->data[len - 1]; -+ priv->data[len - 1] = '\0'; - -- err = brcm_nvram_add_cells(priv, data, len); -- if (err) { -+ err = brcm_nvram_add_cells(priv, priv->data, len); -+ if (err) - dev_err(dev, "Failed to add cells: %d\n", err); -- return err; -- } - -- kfree(data); -+ priv->data[len - 1] = tmp; - - return 0; - } -@@ -150,8 +140,10 @@ static int brcm_nvram_probe(struct platf - .reg_read = brcm_nvram_read, - }; - struct device *dev = &pdev->dev; -- struct resource *res; - struct brcm_nvram *priv; -+ struct resource *res; -+ void __iomem *base; -+ size_t size; - int err; - - priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); -@@ -159,21 +151,29 @@ static int brcm_nvram_probe(struct platf - return -ENOMEM; - priv->dev = dev; - -- priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); -- if (IS_ERR(priv->base)) -- return PTR_ERR(priv->base); -+ base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); -+ if (IS_ERR(base)) -+ return PTR_ERR(base); -+ -+ size = resource_size(res); -+ -+ priv->data = kzalloc(size, GFP_KERNEL); -+ if (!priv->data) -+ return -ENOMEM; -+ -+ memcpy_fromio(priv->data, base, size); - - err = brcm_nvram_parse(priv); - if (err) - return err; - -- bcm47xx_nvram_init_from_iomem(priv->base, resource_size(res)); -+ bcm47xx_nvram_init_from_iomem(base, size); - - config.dev = dev; - config.cells = priv->cells; - config.ncells = priv->ncells; - config.priv = priv; -- config.size = resource_size(res); -+ config.size = size; - - return PTR_ERR_OR_ZERO(devm_nvmem_register(dev, &config)); - } diff --git a/target/linux/bcm53xx/patches-6.1/032-v6.6-0008-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch b/target/linux/bcm53xx/patches-6.1/032-v6.6-0008-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch deleted file mode 100644 index 854fbfafa4fc66..00000000000000 --- a/target/linux/bcm53xx/patches-6.1/032-v6.6-0008-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 91994e59079dcb455783d3f9ea338eea6f671af3 Mon Sep 17 00:00:00 2001 -From: Aleksey Nasibulin -Date: Wed, 12 Jul 2023 03:40:17 +0200 -Subject: [PATCH] ARM: dts: BCM5301X: Extend RAM to full 256MB for Linksys - EA6500 V2 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Linksys ea6500-v2 have 256MB of ram. Currently we only use 128MB. -Expand the definition to use all the available RAM. - -Fixes: 03e96644d7a8 ("ARM: dts: BCM5301X: Add basic DT for Linksys EA6500 V2") -Signed-off-by: Aleksey Nasibulin -Signed-off-by: Christian Marangi -Cc: stable@vger.kernel.org -Acked-by: Rafał Miłecki -Link: https://lore.kernel.org/r/20230712014017.28123-1-ansuelsmth@gmail.com -Signed-off-by: Florian Fainelli ---- - arch/arm/boot/dts/broadcom/bcm4708-linksys-ea6500-v2.dts | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts -+++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts -@@ -19,7 +19,8 @@ - - memory@0 { - device_type = "memory"; -- reg = <0x00000000 0x08000000>; -+ reg = <0x00000000 0x08000000>, -+ <0x88000000 0x08000000>; - }; - - gpio-keys { diff --git a/target/linux/bcm53xx/patches-6.1/033-v6.7-0001-ARM-dts-BCM5301X-Set-MACs-for-D-Link-DIR-885L.patch b/target/linux/bcm53xx/patches-6.1/033-v6.7-0001-ARM-dts-BCM5301X-Set-MACs-for-D-Link-DIR-885L.patch new file mode 100644 index 00000000000000..78b8975f1fd89d --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/033-v6.7-0001-ARM-dts-BCM5301X-Set-MACs-for-D-Link-DIR-885L.patch @@ -0,0 +1,56 @@ +From 5cbee5828219c4f7b33e96b5d8ce5e467b2857c8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 1 Sep 2023 12:55:49 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Set MACs for D-Link DIR-885L +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Specify NVRAM access and use its "et2macaddr" NVMEM cell. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20230901105549.7076-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + .../dts/broadcom/bcm47094-dlink-dir-885l.dts | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +--- a/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts +@@ -25,6 +25,15 @@ + <0x88000000 0x08000000>; + }; + ++ nvram@1e3f0000 { ++ compatible = "brcm,nvram"; ++ reg = <0x1e3f0000 0x10000>; ++ ++ et2macaddr: et2macaddr { ++ #nvmem-cell-cells = <1>; ++ }; ++ }; ++ + nand_controller: nand-controller@18028000 { + nand@0 { + partitions { +@@ -112,6 +121,11 @@ + vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>; + }; + ++&gmac0 { ++ nvmem-cells = <&et2macaddr 0>; ++ nvmem-cell-names = "mac-address"; ++}; ++ + &spi_nor { + status = "okay"; + }; +@@ -142,6 +156,8 @@ + + port@4 { + label = "wan"; ++ nvmem-cells = <&et2macaddr 3>; ++ nvmem-cell-names = "mac-address"; + }; + + port@8 { diff --git a/target/linux/bcm53xx/patches-6.1/033-v6.7-0002-ARM-dts-BCM5301X-Set-MAC-address-for-Asus-RT-AC87U.patch b/target/linux/bcm53xx/patches-6.1/033-v6.7-0002-ARM-dts-BCM5301X-Set-MAC-address-for-Asus-RT-AC87U.patch new file mode 100644 index 00000000000000..11ce7acb5361b5 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/033-v6.7-0002-ARM-dts-BCM5301X-Set-MAC-address-for-Asus-RT-AC87U.patch @@ -0,0 +1,44 @@ +From a9e79863b62aaaefcdf469fc331bf482ae00db0d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 1 Sep 2023 14:43:11 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Set MAC address for Asus RT-AC87U +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Specify NVRAM access and use its "et1macaddr" NVMEM cell. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20230901124311.31156-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/broadcom/bcm4709-asus-rt-ac87u.dts | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts ++++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +@@ -25,6 +25,12 @@ + <0x88000000 0x08000000>; + }; + ++ nvram@1c080000 { ++ et1macaddr: et1macaddr { ++ #nvmem-cell-cells = <1>; ++ }; ++ }; ++ + leds { + compatible = "gpio-leds"; + +@@ -62,6 +68,11 @@ + }; + }; + ++&gmac0 { ++ nvmem-cells = <&et1macaddr 0>; ++ nvmem-cell-names = "mac-address"; ++}; ++ + &usb3_phy { + status = "okay"; + }; diff --git a/target/linux/bcm53xx/patches-6.1/033-v6.7-0003-ARM-dts-BCM5301X-Relicense-Felix-s-code-to-the-GPL-2.patch b/target/linux/bcm53xx/patches-6.1/033-v6.7-0003-ARM-dts-BCM5301X-Relicense-Felix-s-code-to-the-GPL-2.patch new file mode 100644 index 00000000000000..6df1e555e99c05 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/033-v6.7-0003-ARM-dts-BCM5301X-Relicense-Felix-s-code-to-the-GPL-2.patch @@ -0,0 +1,57 @@ +From 81ea360a16978a4df61df9db56b171909bd659c0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sat, 16 Sep 2023 10:30:57 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Relicense Felix's code to the GPL 2.0+ / + MIT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Move code added by Felix to the bcm-ns.dtsi which uses dual licensing. +That syncs more Northstar code to be based on the same licensing schema. + +This code was added in the commit 1ff80363524c ("ARM: BCM5301X: Add +profiling support"). + +Cc: Felix Fietkau +Signed-off-by: Rafał Miłecki +Acked-by: Felix Fietkau +Link: https://lore.kernel.org/r/20230916083057.10458-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/broadcom/bcm-ns.dtsi | 7 +++++++ + arch/arm/boot/dts/broadcom/bcm5301x.dtsi | 7 ------- + 2 files changed, 7 insertions(+), 7 deletions(-) + +--- a/arch/arm/boot/dts/bcm-ns.dtsi ++++ b/arch/arm/boot/dts/bcm-ns.dtsi +@@ -14,6 +14,13 @@ + #address-cells = <1>; + #size-cells = <1>; + ++ pmu { ++ compatible = "arm,cortex-a9-pmu"; ++ interrupts = ++ , ++ ; ++ }; ++ + chipcommon-a-bus@18000000 { + compatible = "simple-bus"; + ranges = <0x00000000 0x18000000 0x00001000>; +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -26,13 +26,6 @@ + }; + }; + +- pmu { +- compatible = "arm,cortex-a9-pmu"; +- interrupts = +- , +- ; +- }; +- + clocks { + #address-cells = <1>; + #size-cells = <1>; diff --git a/target/linux/bcm53xx/patches-6.1/033-v6.7-0004-ARM-dts-BCM5301X-Relicense-Vivek-s-code-to-the-GPL-2.patch b/target/linux/bcm53xx/patches-6.1/033-v6.7-0004-ARM-dts-BCM5301X-Relicense-Vivek-s-code-to-the-GPL-2.patch new file mode 100644 index 00000000000000..66db4a291fb924 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/033-v6.7-0004-ARM-dts-BCM5301X-Relicense-Vivek-s-code-to-the-GPL-2.patch @@ -0,0 +1,104 @@ +From b8d4f7c1be04d66c37c119c501c87bccc4197694 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sat, 16 Sep 2023 10:58:55 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Relicense Vivek's code to the GPL 2.0+ / + MIT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Move code added by Vivek to the bcm-ns.dtsi which uses dual licensing. +That syncs more Northstar code to be based on the same licensing schema. + +This code was added in the commit 37f6130ec39f ("ARM: dts: BCM5301X: +Make USB 3.0 PHY use MDIO PHY driver"). + +Cc: Vivek Unune +Signed-off-by: Rafał Miłecki +Acked-by: Vivek Unune +Link: https://lore.kernel.org/r/20230916085855.28375-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/broadcom/bcm-ns.dtsi | 27 ++++++++++++++++++++++++ + arch/arm/boot/dts/broadcom/bcm5301x.dtsi | 27 ------------------------ + 2 files changed, 27 insertions(+), 27 deletions(-) + +--- a/arch/arm/boot/dts/bcm-ns.dtsi ++++ b/arch/arm/boot/dts/bcm-ns.dtsi +@@ -327,6 +327,29 @@ + #address-cells = <1>; + }; + ++ mdio-mux@18003000 { ++ compatible = "mdio-mux-mmioreg", "mdio-mux"; ++ mdio-parent-bus = <&mdio>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x18003000 0x4>; ++ mux-mask = <0x200>; ++ ++ mdio@0 { ++ reg = <0x0>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ usb3_phy: usb3-phy@10 { ++ compatible = "brcm,ns-ax-usb3-phy"; ++ reg = <0x10>; ++ usb3-dmp-syscon = <&usb3_dmp>; ++ #phy-cells = <0>; ++ status = "disabled"; ++ }; ++ }; ++ }; ++ + rng: rng@18004000 { + compatible = "brcm,bcm5301x-rng"; + reg = <0x18004000 0x14>; +@@ -467,6 +490,10 @@ + brcm,nand-has-wp; + }; + ++ usb3_dmp: syscon@18105000 { ++ reg = <0x18105000 0x1000>; ++ }; ++ + thermal-zones { + cpu_thermal: cpu-thermal { + polling-delay-passive = <0>; +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -62,33 +62,6 @@ + }; + }; + +- mdio-mux@18003000 { +- compatible = "mdio-mux-mmioreg", "mdio-mux"; +- mdio-parent-bus = <&mdio>; +- #address-cells = <1>; +- #size-cells = <0>; +- reg = <0x18003000 0x4>; +- mux-mask = <0x200>; +- +- mdio@0 { +- reg = <0x0>; +- #address-cells = <1>; +- #size-cells = <0>; +- +- usb3_phy: usb3-phy@10 { +- compatible = "brcm,ns-ax-usb3-phy"; +- reg = <0x10>; +- usb3-dmp-syscon = <&usb3_dmp>; +- #phy-cells = <0>; +- status = "disabled"; +- }; +- }; +- }; +- +- usb3_dmp: syscon@18105000 { +- reg = <0x18105000 0x1000>; +- }; +- + i2c0: i2c@18009000 { + compatible = "brcm,iproc-i2c"; + reg = <0x18009000 0x50>; diff --git a/target/linux/bcm53xx/patches-6.1/033-v6.7-0005-ARM-dts-BCM5301X-Explicitly-disable-unused-switch-CP.patch b/target/linux/bcm53xx/patches-6.1/033-v6.7-0005-ARM-dts-BCM5301X-Explicitly-disable-unused-switch-CP.patch new file mode 100644 index 00000000000000..72e5c6b061412e --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/033-v6.7-0005-ARM-dts-BCM5301X-Explicitly-disable-unused-switch-CP.patch @@ -0,0 +1,377 @@ +From 473baeab929444295b0530f8766e4becb6a08973 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 13 Oct 2023 12:33:13 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Explicitly disable unused switch CPU + ports +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When redescribing ports I assumed that missing "label" (like "cpu") +means switch port isn't used. That was incorrect and I realized my +change made Linux always use the first (5) CPU port (there are 3 of +them). + +While above should technically be possible it often isn't correct: +1. Non-default switch ports are often connected to Ethernet interfaces + not fully covered by vendor setup (they may miss MACs) +2. On some devices non-default ports require specifying fixed link + +This fixes network connectivity for some devices. It was reported & +tested for Netgear R8000. It also affects Linksys EA9200 with its +downstream DTS. + +Fixes: ba4aebce23b2 ("ARM: dts: BCM5301X: Describe switch ports in the main DTS") +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20231013103314.10306-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + .../dts/broadcom/bcm4708-buffalo-wzr-1166dhp-common.dtsi | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm4708-luxul-xap-1510.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm4708-luxul-xwc-1000.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm4708-netgear-r6250.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm4708-smartrg-sr400ac.dts | 8 ++++++++ + .../boot/dts/broadcom/bcm47081-buffalo-wzr-600dhp2.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47081-luxul-xap-1410.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47081-luxul-xwr-1200.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm4709-netgear-r8000.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-885l.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-dlink-dir-890l.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-abr-4500.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-xap-1610.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-xbr-4500.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-xwc-2000.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3100.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm47094-luxul-xwr-3150-v1.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm53015-meraki-mr26.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm53016-meraki-mr32.dts | 8 ++++++++ + arch/arm/boot/dts/broadcom/bcm953012er.dts | 8 ++++++++ + 20 files changed, 160 insertions(+) + +--- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi ++++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi +@@ -181,5 +181,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts ++++ b/arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts +@@ -85,5 +85,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts ++++ b/arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts +@@ -88,5 +88,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm4708-netgear-r6250.dts ++++ b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts +@@ -122,5 +122,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts ++++ b/arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts +@@ -145,6 +145,14 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; + +--- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts ++++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts +@@ -145,5 +145,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts ++++ b/arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts +@@ -81,5 +81,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts ++++ b/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts +@@ -148,5 +148,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts +@@ -227,6 +227,14 @@ + label = "wan"; + }; + ++ port@5 { ++ status = "disabled"; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ + port@8 { + label = "cpu"; + }; +--- a/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts +@@ -160,6 +160,14 @@ + nvmem-cell-names = "mac-address"; + }; + ++ port@5 { ++ status = "disabled"; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ + port@8 { + label = "cpu"; + }; +--- a/arch/arm/boot/dts/bcm47094-dlink-dir-890l.dts ++++ b/arch/arm/boot/dts/bcm47094-dlink-dir-890l.dts +@@ -192,6 +192,14 @@ + label = "wan"; + }; + ++ port@5 { ++ status = "disabled"; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ + port@8 { + label = "cpu"; + phy-mode = "rgmii"; +--- a/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts +@@ -107,5 +107,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47094-luxul-xap-1610.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xap-1610.dts +@@ -120,5 +120,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts +@@ -107,5 +107,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts +@@ -75,5 +75,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts +@@ -147,5 +147,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts ++++ b/arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts +@@ -158,5 +158,13 @@ + port@5 { + label = "cpu"; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; +--- a/arch/arm/boot/dts/bcm53015-meraki-mr26.dts ++++ b/arch/arm/boot/dts/bcm53015-meraki-mr26.dts +@@ -124,6 +124,14 @@ + full-duplex; + }; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; + +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -185,6 +185,14 @@ + full-duplex; + }; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; + +--- a/arch/arm/boot/dts/bcm953012er.dts ++++ b/arch/arm/boot/dts/bcm953012er.dts +@@ -84,6 +84,14 @@ + label = "cpu"; + ethernet = <&gmac0>; + }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; ++ }; + }; + }; + diff --git a/target/linux/bcm53xx/patches-6.1/033-v6.7-0006-ARM-dts-BCM5301X-Set-fixed-link-for-extra-Netgear-R8.patch b/target/linux/bcm53xx/patches-6.1/033-v6.7-0006-ARM-dts-BCM5301X-Set-fixed-link-for-extra-Netgear-R8.patch new file mode 100644 index 00000000000000..0b2b7b36a3fc29 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/033-v6.7-0006-ARM-dts-BCM5301X-Set-fixed-link-for-extra-Netgear-R8.patch @@ -0,0 +1,47 @@ +From d313b0e9070a7100ca55e64fe3b081d176d8806d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 13 Oct 2023 12:33:14 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Set fixed-link for extra Netgear R8000 + CPU ports +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Ports 5 and 7 are disabled by default because the standard use case is +for port 8 to manage all CPU directed traffic. For experimentation +purposes however it is desirable to provide adequate properties such +that people can experiment with using different ports without having to +figure out their configuration. Some of the use cases include but are +not limited to doubling or tripling the bandwidth by leveraging the +additional ports/Ethernet MAC combinations. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20231013103314.10306-2-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/broadcom/bcm4709-netgear-r8000.dts | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/arch/arm/boot/dts/bcm4709-netgear-r8000.dts ++++ b/arch/arm/boot/dts/bcm4709-netgear-r8000.dts +@@ -229,10 +229,20 @@ + + port@5 { + status = "disabled"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; + }; + + port@7 { + status = "disabled"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; + }; + + port@8 { diff --git a/target/linux/bcm53xx/patches-6.1/033-v6.7-0007-ARM-dts-BCM5301X-Set-switch-ports-for-Linksys-EA9200.patch b/target/linux/bcm53xx/patches-6.1/033-v6.7-0007-ARM-dts-BCM5301X-Set-switch-ports-for-Linksys-EA9200.patch new file mode 100644 index 00000000000000..4528c95a5aa960 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/033-v6.7-0007-ARM-dts-BCM5301X-Set-switch-ports-for-Linksys-EA9200.patch @@ -0,0 +1,63 @@ +From 253358f373492608348136e569366d73cb969f6a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 24 Oct 2023 09:26:05 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Set switch ports for Linksys EA9200 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This patch was developed as OpenWrt downstream change and was recently +confirmed to work as expected. + +Tested-by: Rani Hod +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20231024072605.32517-1-zajec5@gmail.com +Signed-off-by: Florian Fainelli +--- + .../dts/broadcom/bcm4709-linksys-ea9200.dts | 38 +++++++++++++++++++ + 1 file changed, 38 insertions(+) + +--- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts ++++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts +@@ -47,3 +47,41 @@ + &usb3_phy { + status = "okay"; + }; ++ ++&srab { ++ status = "okay"; ++ ++ ports { ++ port@0 { ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ label = "lan4"; ++ }; ++ ++ port@4 { ++ label = "wan"; ++ }; ++ ++ port@5 { ++ status = "disabled"; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ label = "cpu"; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-6.1/180-usb-xhci-add-support-for-performing-fake-doorbell.patch b/target/linux/bcm53xx/patches-6.1/180-usb-xhci-add-support-for-performing-fake-doorbell.patch index 37bf49c98ca4fb..049b8c98d12f6f 100644 --- a/target/linux/bcm53xx/patches-6.1/180-usb-xhci-add-support-for-performing-fake-doorbell.patch +++ b/target/linux/bcm53xx/patches-6.1/180-usb-xhci-add-support-for-performing-fake-doorbell.patch @@ -90,7 +90,7 @@ it on BCM4708 family. /* * Reset a halted HC. * -@@ -641,6 +684,14 @@ static int xhci_run_finished(struct xhci +@@ -641,6 +684,15 @@ static int xhci_run_finished(struct xhci return -ENODEV; } @@ -98,6 +98,7 @@ it on BCM4708 family. + int err = xhci_fake_doorbell(xhci, 1); + if (err) { + xhci_halt(xhci); ++ spin_unlock_irqrestore(&xhci->lock, flags); + return err; + } + } diff --git a/target/linux/bcm53xx/patches-6.1/181-nvmem-brcm_nvram-store-a-copy-of-NVRAM-content.patch b/target/linux/bcm53xx/patches-6.1/181-nvmem-brcm_nvram-store-a-copy-of-NVRAM-content.patch new file mode 100644 index 00000000000000..cceb3635ac5dc8 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.1/181-nvmem-brcm_nvram-store-a-copy-of-NVRAM-content.patch @@ -0,0 +1,256 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 14 Sep 2023 07:59:09 +0200 +Subject: [PATCH] nvmem: brcm_nvram: store a copy of NVRAM content +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This driver uses MMIO access for reading NVRAM from a flash device. +Underneath there is a flash controller that reads data and provides +mapping window. + +Using MMIO interface affects controller configuration and may break real +controller driver. It was reported by multiple users of devices with +NVRAM stored on NAND. + +Modify driver to read & cache NVRAM content during init and use that +copy to provide NVMEM data when requested. On NAND flashes due to their +alignment NVRAM partitions can be quite big (1 MiB and more) while +actual NVRAM content stays quite small (usually 16 to 32 KiB). To avoid +allocating so much memory check for actual data length. + +Link: https://lore.kernel.org/linux-mtd/CACna6rwf3_9QVjYcM+847biTX=K0EoWXuXcSMkJO1Vy_5vmVqA@mail.gmail.com/ +Fixes: 3fef9ed0627a ("nvmem: brcm_nvram: new driver exposing Broadcom's NVRAM") +Cc: Arınç ÜNAL +Cc: Florian Fainelli +Cc: Scott Branden +Signed-off-by: Rafał Miłecki +Acked-by: Arınç ÜNAL +--- + drivers/nvmem/brcm_nvram.c | 134 ++++++++++++++++++++++++++----------- + 1 file changed, 94 insertions(+), 40 deletions(-) + +--- a/drivers/nvmem/brcm_nvram.c ++++ b/drivers/nvmem/brcm_nvram.c +@@ -17,9 +17,23 @@ + + #define NVRAM_MAGIC "FLSH" + ++/** ++ * struct brcm_nvram - driver state internal struct ++ * ++ * @dev: NVMEM device pointer ++ * @nvmem_size: Size of the whole space available for NVRAM ++ * @data: NVRAM data copy stored to avoid poking underlaying flash controller ++ * @data_len: NVRAM data size ++ * @padding_byte: Padding value used to fill remaining space ++ * @cells: Array of discovered NVMEM cells ++ * @ncells: Number of elements in cells ++ */ + struct brcm_nvram { + struct device *dev; +- void __iomem *base; ++ size_t nvmem_size; ++ uint8_t *data; ++ size_t data_len; ++ uint8_t padding_byte; + struct nvmem_cell_info *cells; + int ncells; + }; +@@ -36,10 +50,47 @@ static int brcm_nvram_read(void *context + size_t bytes) + { + struct brcm_nvram *priv = context; +- u8 *dst = val; ++ size_t to_copy; ++ ++ if (offset + bytes > priv->data_len) ++ to_copy = max_t(ssize_t, (ssize_t)priv->data_len - offset, 0); ++ else ++ to_copy = bytes; ++ ++ memcpy(val, priv->data + offset, to_copy); ++ ++ memset((uint8_t *)val + to_copy, priv->padding_byte, bytes - to_copy); ++ ++ return 0; ++} ++ ++static int brcm_nvram_copy_data(struct brcm_nvram *priv, struct platform_device *pdev) ++{ ++ struct resource *res; ++ void __iomem *base; ++ ++ base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); ++ if (IS_ERR(base)) ++ return PTR_ERR(base); ++ ++ priv->nvmem_size = resource_size(res); ++ ++ priv->padding_byte = readb(base + priv->nvmem_size - 1); ++ for (priv->data_len = priv->nvmem_size; ++ priv->data_len; ++ priv->data_len--) { ++ if (readb(base + priv->data_len - 1) != priv->padding_byte) ++ break; ++ } ++ WARN(priv->data_len > SZ_128K, "Unexpected (big) NVRAM size: %zu B\n", priv->data_len); + +- while (bytes--) +- *dst++ = readb(priv->base + offset++); ++ priv->data = devm_kzalloc(priv->dev, priv->data_len, GFP_KERNEL); ++ if (!priv->data) ++ return -ENOMEM; ++ ++ memcpy_fromio(priv->data, base, priv->data_len); ++ ++ bcm47xx_nvram_init_from_iomem(base, priv->data_len); + + return 0; + } +@@ -67,8 +118,13 @@ static int brcm_nvram_add_cells(struct b + size_t len) + { + struct device *dev = priv->dev; +- char *var, *value, *eq; ++ char *var, *value; ++ uint8_t tmp; + int idx; ++ int err = 0; ++ ++ tmp = priv->data[len - 1]; ++ priv->data[len - 1] = '\0'; + + priv->ncells = 0; + for (var = data + sizeof(struct brcm_nvram_header); +@@ -78,67 +134,68 @@ static int brcm_nvram_add_cells(struct b + } + + priv->cells = devm_kcalloc(dev, priv->ncells, sizeof(*priv->cells), GFP_KERNEL); +- if (!priv->cells) +- return -ENOMEM; ++ if (!priv->cells) { ++ err = -ENOMEM; ++ goto out; ++ } + + for (var = data + sizeof(struct brcm_nvram_header), idx = 0; + var < (char *)data + len && *var; + var = value + strlen(value) + 1, idx++) { ++ char *eq, *name; ++ + eq = strchr(var, '='); + if (!eq) + break; + *eq = '\0'; ++ name = devm_kstrdup(dev, var, GFP_KERNEL); ++ *eq = '='; ++ if (!name) { ++ err = -ENOMEM; ++ goto out; ++ } + value = eq + 1; + +- priv->cells[idx].name = devm_kstrdup(dev, var, GFP_KERNEL); +- if (!priv->cells[idx].name) +- return -ENOMEM; ++ priv->cells[idx].name = name; + priv->cells[idx].offset = value - (char *)data; + priv->cells[idx].bytes = strlen(value); + priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name); +- if (!strcmp(var, "et0macaddr") || +- !strcmp(var, "et1macaddr") || +- !strcmp(var, "et2macaddr")) { ++ if (!strcmp(name, "et0macaddr") || ++ !strcmp(name, "et1macaddr") || ++ !strcmp(name, "et2macaddr")) { + priv->cells[idx].raw_len = strlen(value); + priv->cells[idx].bytes = ETH_ALEN; + priv->cells[idx].read_post_process = brcm_nvram_read_post_process_macaddr; + } + } + +- return 0; ++out: ++ priv->data[len - 1] = tmp; ++ return err; + } + + static int brcm_nvram_parse(struct brcm_nvram *priv) + { ++ struct brcm_nvram_header *header = (struct brcm_nvram_header *)priv->data; + struct device *dev = priv->dev; +- struct brcm_nvram_header header; +- uint8_t *data; + size_t len; + int err; + +- memcpy_fromio(&header, priv->base, sizeof(header)); +- +- if (memcmp(header.magic, NVRAM_MAGIC, 4)) { ++ if (memcmp(header->magic, NVRAM_MAGIC, 4)) { + dev_err(dev, "Invalid NVRAM magic\n"); + return -EINVAL; + } + +- len = le32_to_cpu(header.len); +- +- data = kzalloc(len, GFP_KERNEL); +- if (!data) +- return -ENOMEM; +- +- memcpy_fromio(data, priv->base, len); +- data[len - 1] = '\0'; +- +- err = brcm_nvram_add_cells(priv, data, len); +- if (err) { +- dev_err(dev, "Failed to add cells: %d\n", err); +- return err; ++ len = le32_to_cpu(header->len); ++ if (len > priv->nvmem_size) { ++ dev_err(dev, "NVRAM length (%zd) exceeds mapped size (%zd)\n", len, ++ priv->nvmem_size); ++ return -EINVAL; + } + +- kfree(data); ++ err = brcm_nvram_add_cells(priv, priv->data, len); ++ if (err) ++ dev_err(dev, "Failed to add cells: %d\n", err); + + return 0; + } +@@ -150,7 +207,6 @@ static int brcm_nvram_probe(struct platf + .reg_read = brcm_nvram_read, + }; + struct device *dev = &pdev->dev; +- struct resource *res; + struct brcm_nvram *priv; + int err; + +@@ -159,21 +215,19 @@ static int brcm_nvram_probe(struct platf + return -ENOMEM; + priv->dev = dev; + +- priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); +- if (IS_ERR(priv->base)) +- return PTR_ERR(priv->base); ++ err = brcm_nvram_copy_data(priv, pdev); ++ if (err) ++ return err; + + err = brcm_nvram_parse(priv); + if (err) + return err; + +- bcm47xx_nvram_init_from_iomem(priv->base, resource_size(res)); +- + config.dev = dev; + config.cells = priv->cells; + config.ncells = priv->ncells; + config.priv = priv; +- config.size = resource_size(res); ++ config.size = priv->nvmem_size; + + return PTR_ERR_OR_ZERO(devm_nvmem_register(dev, &config)); + } diff --git a/target/linux/bcm53xx/patches-6.1/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch b/target/linux/bcm53xx/patches-6.1/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch index e0832524f4ca7b..8039831a7874b5 100644 --- a/target/linux/bcm53xx/patches-6.1/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch +++ b/target/linux/bcm53xx/patches-6.1/304-ARM-dts-BCM5301X-Specify-switch-ports-for-remaining-.patch @@ -10,7 +10,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts +++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts -@@ -92,3 +92,40 @@ +@@ -92,3 +92,41 @@ &usb3_phy { status = "okay"; }; @@ -20,40 +20,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts +++ b/arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts -@@ -83,3 +83,40 @@ +@@ -83,3 +83,41 @@ &usb3_phy { status = "okay"; }; @@ -63,40 +64,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts +++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts -@@ -149,3 +149,40 @@ +@@ -149,3 +149,41 @@ &usb3_phy { status = "okay"; }; @@ -106,40 +108,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts +++ b/arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts -@@ -46,3 +46,40 @@ +@@ -46,3 +46,41 @@ &usb3_phy { status = "okay"; }; @@ -149,40 +152,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts +++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts -@@ -43,3 +43,40 @@ +@@ -43,3 +43,41 @@ &usb3_phy { status = "okay"; }; @@ -192,40 +196,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts +++ b/arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts -@@ -86,3 +86,40 @@ +@@ -86,3 +86,41 @@ &usb3_phy { status = "okay"; }; @@ -235,40 +240,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts +++ b/arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts -@@ -77,3 +77,40 @@ +@@ -77,3 +77,41 @@ &usb3_phy { status = "okay"; }; @@ -278,40 +284,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts +++ b/arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts -@@ -66,6 +66,38 @@ +@@ -77,6 +77,40 @@ status = "okay"; }; @@ -320,29 +327,31 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + ++ port@5 { ++ status = "disabled"; ++ }; ++ + port@7 { -+ reg = <7>; + label = "cpu"; -+ ethernet = <&gmac1>; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; @@ -352,7 +361,7 @@ Signed-off-by: Rafał Miłecki compatible = "fixed-partitions"; --- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts +++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts -@@ -130,3 +130,40 @@ +@@ -130,3 +130,41 @@ &usb3_phy { status = "okay"; }; @@ -362,88 +371,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; + }; -+ }; -+}; ---- a/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts -+++ b/arch/arm/boot/dts/bcm4709-linksys-ea9200.dts -@@ -47,3 +47,45 @@ - &usb3_phy { - status = "okay"; - }; + -+&srab { -+ status = "okay"; -+ -+ ports { -+ port@0 { -+ reg = <0>; -+ label = "lan1"; -+ }; -+ -+ port@1 { -+ reg = <1>; -+ label = "lan2"; -+ }; -+ -+ port@2 { -+ reg = <2>; -+ label = "lan3"; -+ }; -+ -+ port@3 { -+ reg = <3>; -+ label = "lan4"; -+ }; -+ -+ port@4 { -+ reg = <4>; -+ label = "wan"; ++ port@7 { ++ status = "disabled"; + }; + + port@8 { -+ reg = <8>; -+ label = "cpu"; -+ ethernet = <&gmac2>; -+ -+ fixed-link { -+ speed = <1000>; -+ full-duplex; -+ }; ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm4709-netgear-r7000.dts +++ b/arch/arm/boot/dts/bcm4709-netgear-r7000.dts -@@ -104,3 +104,40 @@ +@@ -104,3 +104,41 @@ &usb3_phy { status = "okay"; }; @@ -453,40 +415,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; --- a/arch/arm/boot/dts/bcm47094-netgear-r8500.dts +++ b/arch/arm/boot/dts/bcm47094-netgear-r8500.dts -@@ -94,3 +94,45 @@ +@@ -94,3 +94,41 @@ &usb3_phy { status = "okay"; }; @@ -496,45 +459,41 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + ++ port@5 { ++ status = "disabled"; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ + port@8 { -+ reg = <8>; + label = "cpu"; -+ ethernet = <&gmac2>; -+ -+ fixed-link { -+ speed = <1000>; -+ full-duplex; -+ }; + }; + }; +}; --- a/arch/arm/boot/dts/bcm47094-phicomm-k3.dts +++ b/arch/arm/boot/dts/bcm47094-phicomm-k3.dts -@@ -38,6 +38,38 @@ +@@ -38,6 +38,40 @@ status = "okay"; }; @@ -543,29 +502,31 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; @@ -575,7 +536,7 @@ Signed-off-by: Rafał Miłecki compatible = "fixed-partitions"; --- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts +++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts -@@ -91,6 +91,43 @@ +@@ -91,6 +91,44 @@ }; }; @@ -584,34 +545,35 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; @@ -621,7 +583,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts +++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts -@@ -100,6 +100,43 @@ +@@ -100,6 +100,44 @@ vcc-gpio = <&chipcommon 12 GPIO_ACTIVE_HIGH>; }; @@ -630,34 +592,35 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "wan"; + }; + + port@1 { -+ reg = <1>; + label = "lan1"; + }; + + port@2 { -+ reg = <2>; + label = "lan2"; + }; + + port@3 { -+ reg = <3>; + label = "lan3"; + }; + + port@4 { -+ reg = <4>; + label = "lan4"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; @@ -667,7 +630,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts +++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts -@@ -107,3 +107,41 @@ +@@ -107,3 +107,42 @@ &usb3_phy { status = "okay"; }; @@ -677,34 +640,35 @@ Signed-off-by: Rafał Miłecki + + ports { + port@0 { -+ reg = <0>; + label = "lan1"; + }; + + port@1 { -+ reg = <1>; + label = "lan2"; + }; + + port@2 { -+ reg = <2>; + label = "lan3"; + }; + + port@3 { -+ reg = <3>; + label = "lan4"; + }; + + port@4 { -+ reg = <4>; + label = "wan"; + }; + + port@5 { -+ reg = <5>; + label = "cpu"; -+ ethernet = <&gmac0>; ++ }; ++ ++ port@7 { ++ status = "disabled"; ++ }; ++ ++ port@8 { ++ status = "disabled"; + }; + }; +}; diff --git a/target/linux/bcm53xx/patches-6.1/800-nvmem-brcm_nvram-store-a-copy-of-NVRAM-content.patch b/target/linux/bcm53xx/patches-6.1/800-nvmem-brcm_nvram-store-a-copy-of-NVRAM-content.patch deleted file mode 100644 index 901bb6dd3cfaf6..00000000000000 --- a/target/linux/bcm53xx/patches-6.1/800-nvmem-brcm_nvram-store-a-copy-of-NVRAM-content.patch +++ /dev/null @@ -1,128 +0,0 @@ -From a18378409fee1cac0f0c58a4770ff557b498c778 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Fri, 1 Sep 2023 10:44:26 +0200 -Subject: [PATCH] nvmem: brcm_nvram: store a copy of NVRAM content -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Rafał Miłecki ---- - drivers/nvmem/brcm_nvram.c | 54 +++++++++++++++++++------------------- - 1 file changed, 27 insertions(+), 27 deletions(-) - ---- a/drivers/nvmem/brcm_nvram.c -+++ b/drivers/nvmem/brcm_nvram.c -@@ -19,7 +19,7 @@ - - struct brcm_nvram { - struct device *dev; -- void __iomem *base; -+ uint8_t *data; - struct nvmem_cell_info *cells; - int ncells; - }; -@@ -36,10 +36,8 @@ static int brcm_nvram_read(void *context - size_t bytes) - { - struct brcm_nvram *priv = context; -- u8 *dst = val; - -- while (bytes--) -- *dst++ = readb(priv->base + offset++); -+ memcpy(val, priv->data + offset, bytes); - - return 0; - } -@@ -110,35 +108,27 @@ static int brcm_nvram_add_cells(struct b - - static int brcm_nvram_parse(struct brcm_nvram *priv) - { -+ struct brcm_nvram_header *header = (struct brcm_nvram_header *)priv->data; - struct device *dev = priv->dev; -- struct brcm_nvram_header header; -- uint8_t *data; -+ uint8_t tmp; - size_t len; - int err; - -- memcpy_fromio(&header, priv->base, sizeof(header)); -- -- if (memcmp(header.magic, NVRAM_MAGIC, 4)) { -+ if (memcmp(header->magic, NVRAM_MAGIC, 4)) { - dev_err(dev, "Invalid NVRAM magic\n"); - return -EINVAL; - } - -- len = le32_to_cpu(header.len); -+ len = le32_to_cpu(header->len); - -- data = kzalloc(len, GFP_KERNEL); -- if (!data) -- return -ENOMEM; -- -- memcpy_fromio(data, priv->base, len); -- data[len - 1] = '\0'; -+ tmp = priv->data[len - 1]; -+ priv->data[len - 1] = '\0'; - -- err = brcm_nvram_add_cells(priv, data, len); -- if (err) { -+ err = brcm_nvram_add_cells(priv, priv->data, len); -+ if (err) - dev_err(dev, "Failed to add cells: %d\n", err); -- return err; -- } - -- kfree(data); -+ priv->data[len - 1] = tmp; - - return 0; - } -@@ -150,8 +140,10 @@ static int brcm_nvram_probe(struct platf - .reg_read = brcm_nvram_read, - }; - struct device *dev = &pdev->dev; -- struct resource *res; - struct brcm_nvram *priv; -+ struct resource *res; -+ void __iomem *base; -+ size_t size; - int err; - - priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); -@@ -159,21 +151,29 @@ static int brcm_nvram_probe(struct platf - return -ENOMEM; - priv->dev = dev; - -- priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); -- if (IS_ERR(priv->base)) -- return PTR_ERR(priv->base); -+ base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); -+ if (IS_ERR(base)) -+ return PTR_ERR(base); -+ -+ size = resource_size(res); -+ -+ priv->data = kzalloc(size, GFP_KERNEL); -+ if (!priv->data) -+ return -ENOMEM; -+ -+ memcpy_fromio(priv->data, base, size); - - err = brcm_nvram_parse(priv); - if (err) - return err; - -- bcm47xx_nvram_init_from_iomem(priv->base, resource_size(res)); -+ bcm47xx_nvram_init_from_iomem(base, size); - - config.dev = dev; - config.cells = priv->cells; - config.ncells = priv->ncells; - config.priv = priv; -- config.size = resource_size(res); -+ config.size = size; - - return PTR_ERR_OR_ZERO(devm_nvmem_register(dev, &config)); - } diff --git a/target/linux/bcm53xx/patches-6.1/905-BCM53573-minor-hacks.patch b/target/linux/bcm53xx/patches-6.1/905-BCM53573-minor-hacks.patch index 0d4962462b4c3f..0a52ca98eeb7bd 100644 --- a/target/linux/bcm53xx/patches-6.1/905-BCM53573-minor-hacks.patch +++ b/target/linux/bcm53xx/patches-6.1/905-BCM53573-minor-hacks.patch @@ -61,7 +61,7 @@ Signed-off-by: Rafał Miłecki #include #include #include -@@ -1028,6 +1029,16 @@ static void __init arch_timer_of_configu +@@ -1029,6 +1030,16 @@ static void __init arch_timer_of_configu if (of_property_read_u32(np, "clock-frequency", &arch_timer_rate)) arch_timer_rate = rate; diff --git a/target/linux/bmips/dts/bcm63167-sercomm-h500-s.dtsi b/target/linux/bmips/dts/bcm63167-sercomm-h500-s.dtsi index 95f330d6c53520..4e4431f27cec71 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 5196f90afa8fa6..d4520661a58289 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 7b0ebf2aefc35d..bfa9835b26e12e 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 bf96673af8af8d..be7f90fbd93942 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 45ed6e2a3b7123..3321bbd0045997 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 cc50f5754994d1..779f1da1b9f6f2 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 7499e7090ff49e..fc7462810c9553 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 a0d1c117f74755..ba15a6426540a6 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 826b2a61e25c5e..b9cbae7af8ecc8 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 5d182668188700..aefa72235f1a22 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 d5f162846d24b5..c30612191eb448 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 f562bcd9b2b24a..47be99133d35bc 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 a335218be07d3d..53a1c0c01fc7c3 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 ff115afb8fbd1a..c5e2e7f67f56b9 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 e67db8b6bde631..eecf3806f2ce29 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 3256783e0e88db..fb86adb8991033 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 c878dd2cffa2b1..97836e92e03eaa 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 14fbd856f8ffc2..8d6135fbdd1c09 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 517a894cf506a4..53d20ecba32de8 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 460c88f755c2cb..db7f9b0e5b6d58 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/bmips/patches-5.15/700-leds-add-support-for-Sercomm-MSP430-LED-controller.patch b/target/linux/bmips/patches-5.15/700-leds-add-support-for-Sercomm-MSP430-LED-controller.patch index 8b91cac173281d..c6d2df9f8c133b 100644 --- a/target/linux/bmips/patches-5.15/700-leds-add-support-for-Sercomm-MSP430-LED-controller.patch +++ b/target/linux/bmips/patches-5.15/700-leds-add-support-for-Sercomm-MSP430-LED-controller.patch @@ -17,7 +17,7 @@ Signed-off-by: Álvaro Fernández Rojas --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig -@@ -288,6 +288,15 @@ config LEDS_COBALT_RAQ +@@ -289,6 +289,15 @@ config LEDS_COBALT_RAQ help This option enables support for the Cobalt Raq series LEDs. diff --git a/target/linux/bmips/patches-6.1/700-leds-add-support-for-Sercomm-MSP430-LED-controller.patch b/target/linux/bmips/patches-6.1/700-leds-add-support-for-Sercomm-MSP430-LED-controller.patch index ca3c5c74891f4d..adcb01ec295f91 100644 --- a/target/linux/bmips/patches-6.1/700-leds-add-support-for-Sercomm-MSP430-LED-controller.patch +++ b/target/linux/bmips/patches-6.1/700-leds-add-support-for-Sercomm-MSP430-LED-controller.patch @@ -17,7 +17,7 @@ Signed-off-by: Álvaro Fernández Rojas --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig -@@ -281,6 +281,15 @@ config LEDS_COBALT_RAQ +@@ -282,6 +282,15 @@ config LEDS_COBALT_RAQ help This option enables support for the Cobalt Raq series LEDs. diff --git a/target/linux/gemini/Makefile b/target/linux/gemini/Makefile index 284d1247cb23f4..b7f1962c9a5904 100644 --- a/target/linux/gemini/Makefile +++ b/target/linux/gemini/Makefile @@ -11,8 +11,7 @@ FEATURES:=squashfs pci rtc usb dt gpio display ext4 rootfs-part boot-part CPU_TYPE:=fa526 SUBTARGETS:=generic -KERNEL_PATCHVER:=5.15 -KERNEL_TESTING_PATCHVER:=6.1 +KERNEL_PATCHVER:=6.1 define Target/Description Build firmware images for the StorLink/Cortina Gemini CS351x ARM FA526 CPU diff --git a/target/linux/gemini/config-5.15 b/target/linux/gemini/config-5.15 deleted file mode 100644 index b0c3afbf9db6f0..00000000000000 --- a/target/linux/gemini/config-5.15 +++ /dev/null @@ -1,420 +0,0 @@ -CONFIG_ALIGNMENT_TRAP=y -CONFIG_AMBA_PL08X=y -CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_GEMINI=y -CONFIG_ARCH_KEEP_MEMBLOCK=y -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -# CONFIG_ARCH_MOXART is not set -CONFIG_ARCH_MULTIPLATFORM=y -CONFIG_ARCH_MULTI_V4=y -# CONFIG_ARCH_MULTI_V4T is not set -CONFIG_ARCH_MULTI_V4_V5=y -# CONFIG_ARCH_MULTI_V5 is not set -CONFIG_ARCH_NR_GPIO=0 -CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y -CONFIG_ARCH_SELECT_MEMORY_MODEL=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_ARM=y -CONFIG_ARM_AMBA=y -CONFIG_ARM_APPENDED_DTB=y -# CONFIG_ARM_ATAG_DTB_COMPAT is not set -CONFIG_ARM_CRYPTO=y -CONFIG_ARM_HAS_SG_CHAIN=y -CONFIG_ARM_L1_CACHE_SHIFT=5 -CONFIG_ARM_PATCH_PHYS_VIRT=y -# CONFIG_ARM_SMMU is not set -CONFIG_ARM_UNWIND=y -CONFIG_ATA=y -CONFIG_ATAGS=y -CONFIG_ATA_FORCE=y -CONFIG_ATA_VERBOSE_ERROR=y -CONFIG_AUTO_ZRELADDR=y -CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y -CONFIG_BLK_DEV_SD=y -CONFIG_BLK_MQ_PCI=y -CONFIG_BLK_PM=y -CONFIG_BOUNCE=y -CONFIG_CLKSRC_MMIO=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_CMA=y -CONFIG_CMA_ALIGNMENT=8 -CONFIG_CMA_AREAS=7 -# CONFIG_CMA_DEBUG is not set -# CONFIG_CMA_DEBUGFS is not set -CONFIG_CMA_SIZE_PERCENTAGE=10 -# CONFIG_CMA_SIZE_SEL_MAX is not set -# CONFIG_CMA_SIZE_SEL_MBYTES is not set -# CONFIG_CMA_SIZE_SEL_MIN is not set -CONFIG_CMA_SIZE_SEL_PERCENTAGE=y -# CONFIG_CMA_SYSFS is not set -CONFIG_COMMON_CLK=y -CONFIG_COMMON_CLK_GEMINI=y -CONFIG_COMPAT_32BIT_TIME=y -CONFIG_CONSOLE_TRANSLATIONS=y -CONFIG_CONTIG_ALLOC=y -CONFIG_COREDUMP=y -CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y -CONFIG_CPU_32v4=y -CONFIG_CPU_ABRT_EV4=y -CONFIG_CPU_CACHE_FA=y -CONFIG_CPU_CACHE_VIVT=y -CONFIG_CPU_COPY_FA=y -CONFIG_CPU_CP15=y -CONFIG_CPU_CP15_MMU=y -# CONFIG_CPU_DCACHE_WRITETHROUGH is not set -CONFIG_CPU_FA526=y -CONFIG_CPU_NO_EFFICIENT_FFS=y -CONFIG_CPU_PABRT_LEGACY=y -CONFIG_CPU_THERMAL=y -CONFIG_CPU_TLB_FA=y -CONFIG_CPU_USE_DOMAINS=y -CONFIG_CRASH_CORE=y -CONFIG_CRC16=y -# CONFIG_CRC32_SARWATE is not set -CONFIG_CRC32_SLICEBY8=y -CONFIG_CRC_CCITT=y -CONFIG_CRC_ITU_T=y -CONFIG_CROSS_MEMORY_ATTACH=y -CONFIG_CRYPTO_CMAC=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_DES=y -CONFIG_CRYPTO_DEV_SL3516=y -# CONFIG_CRYPTO_DEV_SL3516_DEBUG is not set -CONFIG_CRYPTO_DRBG=y -CONFIG_CRYPTO_DRBG_HMAC=y -CONFIG_CRYPTO_DRBG_MENU=y -CONFIG_CRYPTO_ECB=y -CONFIG_CRYPTO_ECHAINIV=y -CONFIG_CRYPTO_ENGINE=y -CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_HW=y -CONFIG_CRYPTO_JITTERENTROPY=y -CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y -CONFIG_CRYPTO_LIB_DES=y -CONFIG_CRYPTO_LIB_SHA256=y -CONFIG_CRYPTO_MD4=y -CONFIG_CRYPTO_MD5=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_RNG_DEFAULT=y -CONFIG_CRYPTO_SEQIV=y -CONFIG_CRYPTO_SHA256=y -CONFIG_CRYPTO_SHA512=y -CONFIG_DEBUG_BUGVERBOSE=y -CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" -CONFIG_DEBUG_MEMORY_INIT=y -CONFIG_DECOMPRESS_BZIP2=y -CONFIG_DECOMPRESS_GZIP=y -CONFIG_DECOMPRESS_LZ4=y -CONFIG_DECOMPRESS_LZMA=y -CONFIG_DECOMPRESS_LZO=y -CONFIG_DECOMPRESS_XZ=y -CONFIG_DMADEVICES=y -CONFIG_DMATEST=y -CONFIG_DMA_CMA=y -CONFIG_DMA_ENGINE=y -CONFIG_DMA_ENGINE_RAID=y -CONFIG_DMA_OF=y -CONFIG_DMA_OPS=y -CONFIG_DMA_REMAP=y -CONFIG_DMA_SHARED_BUFFER=y -CONFIG_DMA_VIRTUAL_CHANNELS=y -CONFIG_DRM=y -CONFIG_DRM_BRIDGE=y -CONFIG_DRM_FBDEV_EMULATION=y -CONFIG_DRM_FBDEV_OVERALLOC=100 -CONFIG_DRM_GEM_CMA_HELPER=y -CONFIG_DRM_KMS_CMA_HELPER=y -CONFIG_DRM_KMS_HELPER=y -CONFIG_DRM_PANEL=y -CONFIG_DRM_PANEL_BRIDGE=y -CONFIG_DRM_PANEL_ILITEK_IL9322=y -CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y -CONFIG_DRM_TVE200=y -CONFIG_DTC=y -CONFIG_DUMMY_CONSOLE=y -CONFIG_EDAC_ATOMIC_SCRUB=y -CONFIG_EDAC_SUPPORT=y -CONFIG_EEPROM_93CX6=y -CONFIG_ELF_CORE=y -# CONFIG_EMBEDDED is not set -# CONFIG_EXPERT is not set -CONFIG_EXT4_FS=y -CONFIG_FARADAY_FTINTC010=y -CONFIG_FB=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_IMAGEBLIT=y -CONFIG_FB_CMDLINE=y -CONFIG_FB_DEFERRED_IO=y -CONFIG_FB_SYS_COPYAREA=y -CONFIG_FB_SYS_FILLRECT=y -CONFIG_FB_SYS_FOPS=y -CONFIG_FB_SYS_IMAGEBLIT=y -CONFIG_FHANDLE=y -CONFIG_FIXED_PHY=y -CONFIG_FIX_EARLYCON_MEM=y -CONFIG_FONT_8x16=y -CONFIG_FONT_8x8=y -CONFIG_FONT_SUPPORT=y -CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y -# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set -CONFIG_FS_IOMAP=y -CONFIG_FS_MBCACHE=y -CONFIG_FS_POSIX_ACL=y -CONFIG_FTTMR010_TIMER=y -CONFIG_FTWDT010_WATCHDOG=y -CONFIG_FWNODE_MDIO=y -CONFIG_FW_LOADER_PAGED_BUF=y -# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set -CONFIG_GEMINI_ETHERNET=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_GENERIC_ATOMIC64=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CPU_AUTOPROBE=y -CONFIG_GENERIC_EARLY_IOREMAP=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_GENERIC_IRQ_MULTI_HANDLER=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_PINCONF=y -CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GLOB=y -CONFIG_GPIOLIB_IRQCHIP=y -CONFIG_GPIO_CDEV=y -CONFIG_GPIO_FTGPIO010=y -CONFIG_GPIO_GENERIC=y -CONFIG_GRO_CELLS=y -CONFIG_HANDLE_DOMAIN_IRQ=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT_MAP=y -CONFIG_HDMI=y -CONFIG_HIGHMEM=y -CONFIG_HIGHPTE=y -CONFIG_HWMON=y -CONFIG_HW_CONSOLE=y -CONFIG_HW_RANDOM=y -CONFIG_HZ_FIXED=0 -CONFIG_I2C=y -CONFIG_I2C_ALGOBIT=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_COMPAT=y -CONFIG_I2C_GPIO=y -CONFIG_I2C_HELPER_AUTO=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_INPUT=y -CONFIG_INPUT_KEYBOARD=y -# CONFIG_IOMMU_DEBUGFS is not set -# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set -# CONFIG_IOMMU_IO_PGTABLE_LPAE is not set -CONFIG_IOMMU_SUPPORT=y -CONFIG_IPC_NS=y -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_IRQ_WORK=y -# CONFIG_ISDN is not set -CONFIG_JBD2=y -CONFIG_KALLSYMS=y -CONFIG_KCMP=y -CONFIG_KERNEL_LZMA=y -# CONFIG_KERNEL_XZ is not set -CONFIG_KEXEC=y -CONFIG_KEXEC_CORE=y -CONFIG_KEYBOARD_DLINK_DIR685=y -CONFIG_KMAP_LOCAL=y -CONFIG_KMAP_LOCAL_NON_LINEAR_PTE_ARRAY=y -# CONFIG_LDM_DEBUG is not set -CONFIG_LDM_PARTITION=y -CONFIG_LEDS_TRIGGER_DISK=y -CONFIG_LIBFDT=y -CONFIG_LOCK_DEBUGGING_SUPPORT=y -CONFIG_LOGO=y -CONFIG_LOGO_LINUX_CLUT224=y -# CONFIG_LOGO_LINUX_MONO is not set -CONFIG_LOGO_LINUX_VGA16=y -CONFIG_LZ4_DECOMPRESS=y -CONFIG_LZO_DECOMPRESS=y -CONFIG_MARVELL_PHY=y -CONFIG_MDIO_BITBANG=y -CONFIG_MDIO_BUS=y -CONFIG_MDIO_DEVICE=y -CONFIG_MDIO_DEVRES=y -CONFIG_MDIO_GPIO=y -CONFIG_MEMFD_CREATE=y -CONFIG_MEMORY_ISOLATION=y -CONFIG_MFD_SYSCON=y -CONFIG_MIGRATION=y -CONFIG_MODULES_USE_ELF_REL=y -# CONFIG_MODULE_UNLOAD is not set -CONFIG_MQ_IOSCHED_DEADLINE=y -CONFIG_MQ_IOSCHED_KYBER=y -CONFIG_MTD_CFI_STAA=y -CONFIG_MTD_JEDECPROBE=y -CONFIG_MTD_PHYSMAP=y -CONFIG_MTD_PHYSMAP_GEMINI=y -CONFIG_MTD_REDBOOT_PARTS=y -CONFIG_MTD_SPLIT_FIRMWARE=y -CONFIG_MTD_SPLIT_WRGG_FW=y -CONFIG_NAMESPACES=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_NEED_KUSER_HELPERS=y -CONFIG_NEED_PER_CPU_KM=y -CONFIG_NET_DEVLINK=y -CONFIG_NET_DSA=y -CONFIG_NET_DSA_REALTEK_SMI=y -CONFIG_NET_DSA_TAG_RTL4_A=y -CONFIG_NET_NS=y -CONFIG_NET_SELFTESTS=y -CONFIG_NET_SWITCHDEV=y -CONFIG_NLS=y -CONFIG_NO_HZ_COMMON=y -CONFIG_NO_HZ_IDLE=y -CONFIG_NVMEM=y -CONFIG_OF=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_FLATTREE=y -CONFIG_OF_GPIO=y -CONFIG_OF_IRQ=y -CONFIG_OF_KOBJ=y -CONFIG_OF_MDIO=y -CONFIG_OLD_SIGACTION=y -CONFIG_OLD_SIGSUSPEND3=y -CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_PANIC_ON_OOPS is not set -CONFIG_PANIC_ON_OOPS_VALUE=0 -CONFIG_PANIC_TIMEOUT=0 -CONFIG_PATA_FTIDE010=y -CONFIG_PCI=y -CONFIG_PCIEASPM=y -CONFIG_PCIEASPM_DEFAULT=y -# CONFIG_PCIEASPM_PERFORMANCE is not set -# CONFIG_PCIEASPM_POWERSAVE is not set -# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set -CONFIG_PCI_DOMAINS=y -CONFIG_PCI_DOMAINS_GENERIC=y -CONFIG_PCI_FTPCI100=y -CONFIG_PERF_USE_VMALLOC=y -CONFIG_PGTABLE_LEVELS=2 -CONFIG_PHYLIB=y -CONFIG_PHYLINK=y -CONFIG_PID_NS=y -CONFIG_PINCTRL=y -CONFIG_PINCTRL_GEMINI=y -# CONFIG_PINCTRL_SINGLE is not set -CONFIG_PM=y -CONFIG_PM_CLK=y -CONFIG_POWER_RESET=y -CONFIG_POWER_RESET_GEMINI_POWEROFF=y -CONFIG_POWER_RESET_SYSCON=y -CONFIG_PREEMPT=y -CONFIG_PREEMPTION=y -CONFIG_PREEMPT_COUNT=y -# CONFIG_PREEMPT_NONE is not set -CONFIG_PREEMPT_RCU=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_PTP_1588_CLOCK_OPTIONAL=y -CONFIG_RATIONAL=y -CONFIG_RD_BZIP2=y -CONFIG_RD_GZIP=y -CONFIG_RD_LZ4=y -CONFIG_RD_LZMA=y -CONFIG_RD_LZO=y -CONFIG_RD_XZ=y -CONFIG_REALTEK_PHY=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_MMIO=y -CONFIG_REGULATOR=y -CONFIG_REGULATOR_FIXED_VOLTAGE=y -CONFIG_RELAY=y -CONFIG_RESET_CONTROLLER=y -CONFIG_RSEQ=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_DRV_FTRTC010=y -CONFIG_RTC_I2C_AND_SPI=y -CONFIG_RTC_MC146818_LIB=y -CONFIG_RTC_NVMEM=y -CONFIG_SATA_GEMINI=y -CONFIG_SATA_HOST=y -CONFIG_SATA_PMP=y -CONFIG_SCSI=y -CONFIG_SCSI_COMMON=y -# CONFIG_SCSI_LOWLEVEL is not set -# CONFIG_SCSI_PROC_FS is not set -CONFIG_SENSORS_DRIVETEMP=y -CONFIG_SENSORS_GPIO_FAN=y -CONFIG_SENSORS_LM75=y -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y -CONFIG_SERIAL_8250_EXAR=y -CONFIG_SERIAL_8250_FSL=y -CONFIG_SERIAL_8250_NR_UARTS=1 -CONFIG_SERIAL_8250_PCI=y -CONFIG_SERIAL_8250_RUNTIME_UARTS=1 -CONFIG_SERIAL_MCTRL_GPIO=y -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_SERIO=y -CONFIG_SERIO_LIBPS2=y -CONFIG_SERIO_SERPORT=y -CONFIG_SG_POOL=y -CONFIG_SLUB_DEBUG=y -CONFIG_SPARSE_IRQ=y -CONFIG_SPI=y -CONFIG_SPI_BITBANG=y -CONFIG_SPI_GPIO=y -CONFIG_SPI_MASTER=y -CONFIG_SPLIT_PTLOCK_CPUS=999999 -CONFIG_SRCU=y -# CONFIG_STRIP_ASM_SYMS is not set -CONFIG_SWPHY=y -CONFIG_SYNC_FILE=y -CONFIG_SYSFS_SYSCALL=y -CONFIG_SYS_SUPPORTS_APM_EMULATION=y -CONFIG_THERMAL=y -CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 -CONFIG_THERMAL_GOV_STEP_WISE=y -CONFIG_THERMAL_HWMON=y -CONFIG_THERMAL_OF=y -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TIMER_OF=y -CONFIG_TIMER_PROBE=y -CONFIG_TMPFS_POSIX_ACL=y -CONFIG_TREE_RCU=y -CONFIG_TREE_SRCU=y -CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_UNWINDER_ARM=y -CONFIG_USB_SUPPORT=y -CONFIG_USER_NS=y -CONFIG_USE_OF=y -CONFIG_UTS_NS=y -CONFIG_VGA_ARB=y -CONFIG_VGA_ARB_MAX_GPUS=16 -CONFIG_VITESSE_PHY=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_VT=y -CONFIG_VT_CONSOLE=y -CONFIG_VT_HW_CONSOLE_BINDING=y -CONFIG_WATCHDOG_CORE=y -# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set -CONFIG_XZ_DEC_ARM=y -CONFIG_XZ_DEC_ARMTHUMB=y -CONFIG_XZ_DEC_BCJ=y -CONFIG_XZ_DEC_IA64=y -CONFIG_XZ_DEC_POWERPC=y -CONFIG_XZ_DEC_SPARC=y -CONFIG_XZ_DEC_X86=y -CONFIG_ZBOOT_ROM_BSS=0 -CONFIG_ZBOOT_ROM_TEXT=0 -CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/gemini/config-6.1 b/target/linux/gemini/config-6.1 index 09b7b97d16592b..ae0922f5dc868e 100644 --- a/target/linux/gemini/config-6.1 +++ b/target/linux/gemini/config-6.1 @@ -18,8 +18,7 @@ CONFIG_ARM=y CONFIG_ARM_AMBA=y CONFIG_ARM_APPENDED_DTB=y # CONFIG_ARM_ATAG_DTB_COMPAT is not set -CONFIG_ARM_CRYPTO=y -CONFIG_ARM_HAS_SG_CHAIN=y +CONFIG_ARM_HAS_GROUP_RELOCS=y CONFIG_ARM_L1_CACHE_SHIFT=5 CONFIG_ARM_PATCH_PHYS_VIRT=y # CONFIG_ARM_SMMU is not set @@ -34,6 +33,9 @@ CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_PM=y CONFIG_BOUNCE=y +CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y +CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" +CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLKSRC_MMIO=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMA=y @@ -49,8 +51,11 @@ CONFIG_CMA_SIZE_SEL_PERCENTAGE=y # CONFIG_CMA_SYSFS is not set CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_GEMINI=y +CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 CONFIG_COMPAT_32BIT_TIME=y CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_CONTEXT_TRACKING=y +CONFIG_CONTEXT_TRACKING_IDLE=y CONFIG_CONTIG_ALLOC=y CONFIG_COREDUMP=y CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y @@ -63,6 +68,7 @@ CONFIG_CPU_CP15=y CONFIG_CPU_CP15_MMU=y # CONFIG_CPU_DCACHE_WRITETHROUGH is not set CONFIG_CPU_FA526=y +CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_CPU_NO_EFFICIENT_FFS=y CONFIG_CPU_PABRT_LEGACY=y CONFIG_CPU_THERMAL=y @@ -91,7 +97,9 @@ CONFIG_CRYPTO_HW=y CONFIG_CRYPTO_JITTERENTROPY=y CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y CONFIG_CRYPTO_LIB_DES=y +CONFIG_CRYPTO_LIB_SHA1=y CONFIG_CRYPTO_LIB_SHA256=y +CONFIG_CRYPTO_LIB_UTILS=y CONFIG_CRYPTO_MD4=y CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_RNG=y @@ -101,6 +109,7 @@ CONFIG_CRYPTO_SEQIV=y CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" CONFIG_DEBUG_MEMORY_INIT=y CONFIG_DECOMPRESS_BZIP2=y @@ -116,16 +125,15 @@ CONFIG_DMA_ENGINE=y CONFIG_DMA_ENGINE_RAID=y CONFIG_DMA_OF=y CONFIG_DMA_OPS=y -CONFIG_DMA_REMAP=y CONFIG_DMA_SHARED_BUFFER=y CONFIG_DMA_VIRTUAL_CHANNELS=y CONFIG_DRM=y CONFIG_DRM_BRIDGE=y CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_FBDEV_OVERALLOC=100 -CONFIG_DRM_GEM_CMA_HELPER=y -CONFIG_DRM_KMS_CMA_HELPER=y +CONFIG_DRM_GEM_DMA_HELPER=y CONFIG_DRM_KMS_HELPER=y +CONFIG_DRM_NOMODESET=y CONFIG_DRM_PANEL=y CONFIG_DRM_PANEL_BRIDGE=y CONFIG_DRM_PANEL_ILITEK_IL9322=y @@ -138,8 +146,10 @@ CONFIG_EDAC_SUPPORT=y CONFIG_EEPROM_93CX6=y CONFIG_ELF_CORE=y # CONFIG_EMBEDDED is not set +CONFIG_EXCLUSIVE_SYSTEM_RAM=y # CONFIG_EXPERT is not set CONFIG_EXT4_FS=y +CONFIG_EXTCON=y CONFIG_FARADAY_FTINTC010=y CONFIG_FB=y CONFIG_FB_CFB_COPYAREA=y @@ -167,7 +177,9 @@ CONFIG_FTTMR010_TIMER=y CONFIG_FTWDT010_WATCHDOG=y CONFIG_FWNODE_MDIO=y CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_FW_LOADER_SYSFS=y # CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set +CONFIG_GCC11_NO_ARRAY_BOUNDS=y CONFIG_GEMINI_ETHERNET=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y @@ -192,7 +204,6 @@ CONFIG_GPIO_CDEV=y CONFIG_GPIO_FTGPIO010=y CONFIG_GPIO_GENERIC=y CONFIG_GRO_CELLS=y -CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y @@ -217,8 +228,10 @@ CONFIG_INPUT_KEYBOARD=y # CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set # CONFIG_IOMMU_IO_PGTABLE_LPAE is not set CONFIG_IOMMU_SUPPORT=y +CONFIG_IO_URING=y CONFIG_IPC_NS=y CONFIG_IRQCHIP=y +CONFIG_IRQSTACKS=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_WORK=y @@ -295,6 +308,9 @@ CONFIG_OF_MDIO=y CONFIG_OLD_SIGACTION=y CONFIG_OLD_SIGSUSPEND3=y CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PAGE_POOL=y +CONFIG_PAGE_SIZE_LESS_THAN_256KB=y +CONFIG_PAGE_SIZE_LESS_THAN_64KB=y # CONFIG_PANIC_ON_OOPS is not set CONFIG_PANIC_ON_OOPS_VALUE=0 CONFIG_PANIC_TIMEOUT=0 @@ -323,11 +339,13 @@ CONFIG_POWER_RESET_GEMINI_POWEROFF=y CONFIG_POWER_RESET_SYSCON=y CONFIG_PREEMPT=y CONFIG_PREEMPTION=y +CONFIG_PREEMPT_BUILD=y CONFIG_PREEMPT_COUNT=y # CONFIG_PREEMPT_NONE is not set CONFIG_PREEMPT_RCU=y CONFIG_PROC_PAGE_MONITOR=y CONFIG_PTP_1588_CLOCK_OPTIONAL=y +CONFIG_RANDSTRUCT_NONE=y CONFIG_RATIONAL=y CONFIG_RD_BZIP2=y CONFIG_RD_GZIP=y @@ -372,6 +390,7 @@ CONFIG_SERIO_LIBPS2=y CONFIG_SERIO_SERPORT=y CONFIG_SG_POOL=y CONFIG_SLUB_DEBUG=y +CONFIG_SOFTIRQ_ON_OWN_STACK=y CONFIG_SPARSE_IRQ=y CONFIG_SPI=y CONFIG_SPI_BITBANG=y @@ -379,6 +398,8 @@ CONFIG_SPI_GPIO=y CONFIG_SPI_MASTER=y CONFIG_SPLIT_PTLOCK_CPUS=999999 CONFIG_SRCU=y +CONFIG_STACKDEPOT=y +CONFIG_STACKTRACE=y # CONFIG_STRIP_ASM_SYMS is not set CONFIG_SWPHY=y CONFIG_SYNC_FILE=y @@ -390,6 +411,7 @@ CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 CONFIG_THERMAL_GOV_STEP_WISE=y CONFIG_THERMAL_HWMON=y CONFIG_THERMAL_OF=y +CONFIG_THREAD_INFO_IN_TASK=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TIMER_OF=y CONFIG_TIMER_PROBE=y @@ -398,13 +420,12 @@ CONFIG_TREE_RCU=y CONFIG_TREE_SRCU=y CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_UNUSED_BOARD_FILES=n CONFIG_UNWINDER_ARM=y -CONFIG_USB_FOTG210=m -CONFIG_USB_FOTG210_HCD=y -CONFIG_USB_FOTG210_UDC=y +CONFIG_USB_COMMON=y +# CONFIG_USB_FOTG210 is not set CONFIG_USB_GADGET=y CONFIG_USB_GPIO_VBUS=y +CONFIG_USB_PHY=y CONFIG_USB_SUPPORT=y CONFIG_USER_NS=y CONFIG_USE_OF=y diff --git a/target/linux/gemini/modules.mk b/target/linux/gemini/modules.mk index 104ad902799e31..5f544d12c786c0 100644 --- a/target/linux/gemini/modules.mk +++ b/target/linux/gemini/modules.mk @@ -1,13 +1,12 @@ define KernelPackage/usb-fotg210 TITLE:=Support for FOTG210 USB host and device controllers - DEPENDS:=@USB_SUPPORT @TARGET_gemini - KCONFIG:=CONFIG_USB_FOTG210 \ - CONFIG_USB_FOTG210_HCD - FILES:=$(if $(CONFIG_USB_FOTG210_HCD),$(LINUX_DIR)/drivers/usb/host/fotg210-hcd.ko@lt6.1) \ - $(if $(CONFIG_USB_FOTG210),$(LINUX_DIR)/drivers/usb/fotg210/fotg210.ko@ge6.1) - AUTOLOAD:=$(call AutoLoad,50, \ - $(if $(CONFIG_USB_FOTG210_HCD),fotg210-hcd@lt6.1) \ - $(if $(CONFIG_USB_FOTG210),fotg210@ge6.1),1) + DEPENDS:=@TARGET_gemini + KCONFIG:= \ + CONFIG_USB_FOTG210 \ + CONFIG_USB_FOTG210_HCD=y \ + CONFIG_USB_FOTG210_UDC=y + FILES:=$(LINUX_DIR)/drivers/usb/fotg210/fotg210.ko + AUTOLOAD:=$(call AutoLoad,50,fotg210,1) $(call AddDepends/usb) endef diff --git a/target/linux/gemini/patches-5.15/0001-usb-host-fotg2-add-Gemini-specific-handling.patch b/target/linux/gemini/patches-5.15/0001-usb-host-fotg2-add-Gemini-specific-handling.patch deleted file mode 100644 index 6fb59efd1a3397..00000000000000 --- a/target/linux/gemini/patches-5.15/0001-usb-host-fotg2-add-Gemini-specific-handling.patch +++ /dev/null @@ -1,131 +0,0 @@ -From ff887de2f7af17d6264eb946f6b336e6e1521222 Mon Sep 17 00:00:00 2001 -From: Linus Walleij -Date: Fri, 21 Apr 2017 22:19:00 +0200 -Subject: [PATCH 1/2] usb: host: fotg2: add Gemini-specific handling - -The Cortina Systems Gemini has bolted on a PHY inside the -silicon that can be handled by six bits in a MISC register in -the system controller. - -If we are running on Gemini, look up a syscon regmap through -a phandle and enable VBUS and optionally the Mini-B connector. - -If the device is flagged as "wakeup-source" using the standard -DT bindings, we also enable this in the global controller for -respective port. - -Signed-off-by: Linus Walleij ---- - drivers/usb/host/Kconfig | 1 + - drivers/usb/host/fotg210-hcd.c | 76 ++++++++++++++++++++++++++++++++++ - 2 files changed, 77 insertions(+) - ---- a/drivers/usb/host/Kconfig -+++ b/drivers/usb/host/Kconfig -@@ -381,6 +381,7 @@ config USB_ISP1362_HCD - config USB_FOTG210_HCD - tristate "FOTG210 HCD support" - depends on USB && HAS_DMA && HAS_IOMEM -+ select MFD_SYSCON - help - Faraday FOTG210 is an OTG controller which can be configured as - an USB2.0 host. It is designed to meet USB2.0 EHCI specification ---- a/drivers/usb/host/fotg210-hcd.c -+++ b/drivers/usb/host/fotg210-hcd.c -@@ -34,6 +34,10 @@ - #include - #include - #include -+#include -+/* For Cortina Gemini */ -+#include -+#include - - #include - #include -@@ -5557,6 +5561,72 @@ static void fotg210_init(struct fotg210_ - } - - /* -+ * Gemini-specific initialization function, only executed on the -+ * Gemini SoC using the global misc control register. -+ */ -+#define GEMINI_GLOBAL_MISC_CTRL 0x30 -+#define GEMINI_MISC_USB0_WAKEUP BIT(14) -+#define GEMINI_MISC_USB1_WAKEUP BIT(15) -+#define GEMINI_MISC_USB0_VBUS_ON BIT(22) -+#define GEMINI_MISC_USB1_VBUS_ON BIT(23) -+#define GEMINI_MISC_USB0_MINI_B BIT(29) -+#define GEMINI_MISC_USB1_MINI_B BIT(30) -+ -+static int fotg210_gemini_init(struct device *dev, struct usb_hcd *hcd) -+{ -+ struct device_node *np = dev->of_node; -+ struct regmap *map; -+ bool mini_b; -+ bool wakeup; -+ u32 mask, val; -+ int ret; -+ -+ map = syscon_regmap_lookup_by_phandle(np, "syscon"); -+ if (IS_ERR(map)) { -+ dev_err(dev, "no syscon\n"); -+ return PTR_ERR(map); -+ } -+ mini_b = of_property_read_bool(np, "cortina,gemini-mini-b"); -+ wakeup = of_property_read_bool(np, "wakeup-source"); -+ -+ /* -+ * Figure out if this is USB0 or USB1 by simply checking the -+ * physical base address. -+ */ -+ mask = 0; -+ if (hcd->rsrc_start == 0x69000000) { -+ val = GEMINI_MISC_USB1_VBUS_ON; -+ if (mini_b) -+ val |= GEMINI_MISC_USB1_MINI_B; -+ else -+ mask |= GEMINI_MISC_USB1_MINI_B; -+ if (wakeup) -+ val |= GEMINI_MISC_USB1_WAKEUP; -+ else -+ mask |= GEMINI_MISC_USB1_WAKEUP; -+ } else { -+ val = GEMINI_MISC_USB0_VBUS_ON; -+ if (mini_b) -+ val |= GEMINI_MISC_USB0_MINI_B; -+ else -+ mask |= GEMINI_MISC_USB0_MINI_B; -+ if (wakeup) -+ val |= GEMINI_MISC_USB0_WAKEUP; -+ else -+ mask |= GEMINI_MISC_USB0_WAKEUP; -+ } -+ -+ ret = regmap_update_bits(map, GEMINI_GLOBAL_MISC_CTRL, mask, val); -+ if (ret) { -+ dev_err(dev, "failed to initialize Gemini PHY\n"); -+ return ret; -+ } -+ -+ dev_info(dev, "initialized Gemini PHY\n"); -+ return 0; -+} -+ -+/** - * fotg210_hcd_probe - initialize faraday FOTG210 HCDs - * - * Allocates basic resources for this USB host controller, and -@@ -5633,6 +5703,12 @@ static int fotg210_hcd_probe(struct plat - - fotg210_init(fotg210); - -+ if (of_device_is_compatible(dev->of_node, "cortina,gemini-usb")) { -+ retval = fotg210_gemini_init(dev, hcd); -+ if (retval) -+ goto failed_dis_clk; -+ } -+ - retval = usb_add_hcd(hcd, irq, IRQF_SHARED); - if (retval) { - dev_err(dev, "failed to add hcd with err %d\n", retval); diff --git a/target/linux/gemini/patches-5.15/0002-ARM-dts-Augment-DIR-685-partition-table-for-OpenWrt.patch b/target/linux/gemini/patches-5.15/0002-ARM-dts-Augment-DIR-685-partition-table-for-OpenWrt.patch deleted file mode 100644 index 78a163afd87b91..00000000000000 --- a/target/linux/gemini/patches-5.15/0002-ARM-dts-Augment-DIR-685-partition-table-for-OpenWrt.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 36ee838bf83c01cff7cb47c7b07be278d2950ac0 Mon Sep 17 00:00:00 2001 -From: Linus Walleij -Date: Mon, 11 Mar 2019 15:44:29 +0100 -Subject: [PATCH 2/2] ARM: dts: Augment DIR-685 partition table for OpenWrt - -Rename the firmware partition so that the firmware MTD -splitter will do its job, drop the rootfs arguments as -the MTD splitter will set this up automatically. - -Signed-off-by: Linus Walleij ---- - arch/arm/boot/dts/gemini-dlink-dir-685.dts | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/arch/arm/boot/dts/gemini-dlink-dir-685.dts -+++ b/arch/arm/boot/dts/gemini-dlink-dir-685.dts -@@ -20,7 +20,7 @@ - }; - - chosen { -- bootargs = "console=ttyS0,19200n8 root=/dev/sda1 rw rootwait consoleblank=300"; -+ bootargs = "console=ttyS0,19200n8 consoleblank=300"; - stdout-path = "uart0:19200n8"; - }; - -@@ -317,9 +317,9 @@ - * this is called "upgrade" on the vendor system. - */ - partition@40000 { -- label = "upgrade"; -+ compatible = "wrg"; -+ label = "firmware"; - reg = <0x00040000 0x01f40000>; -- read-only; - }; - /* RGDB, Residental Gateway Database? */ - partition@1f80000 { diff --git a/target/linux/generic/backport-5.15/020-v6.1-05-mm-multi-gen-LRU-groundwork.patch b/target/linux/generic/backport-5.15/020-v6.1-05-mm-multi-gen-LRU-groundwork.patch index 25457926a48973..769384f500f301 100644 --- a/target/linux/generic/backport-5.15/020-v6.1-05-mm-multi-gen-LRU-groundwork.patch +++ b/target/linux/generic/backport-5.15/020-v6.1-05-mm-multi-gen-LRU-groundwork.patch @@ -594,7 +594,7 @@ Signed-off-by: Andrew Morton VM_BUG_ON_PAGE(tail > 2 && page_tail->mapping != TAIL_MAPPING, --- a/mm/memcontrol.c +++ b/mm/memcontrol.c -@@ -5178,6 +5178,7 @@ static void __mem_cgroup_free(struct mem +@@ -5179,6 +5179,7 @@ static void __mem_cgroup_free(struct mem static void mem_cgroup_free(struct mem_cgroup *memcg) { @@ -602,7 +602,7 @@ Signed-off-by: Andrew Morton memcg_wb_domain_exit(memcg); __mem_cgroup_free(memcg); } -@@ -5241,6 +5242,7 @@ static struct mem_cgroup *mem_cgroup_all +@@ -5242,6 +5243,7 @@ static struct mem_cgroup *mem_cgroup_all memcg->deferred_split_queue.split_queue_len = 0; #endif idr_replace(&mem_cgroup_idr, memcg, memcg->id.id); diff --git a/target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch b/target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch index c89d3c2542814b..234dfd916f0887 100644 --- a/target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch +++ b/target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch @@ -382,7 +382,7 @@ Signed-off-by: Andrew Morton } --- a/kernel/fork.c +++ b/kernel/fork.c -@@ -1083,6 +1083,7 @@ static struct mm_struct *mm_init(struct +@@ -1091,6 +1091,7 @@ static struct mm_struct *mm_init(struct goto fail_nocontext; mm->user_ns = get_user_ns(user_ns); @@ -390,7 +390,7 @@ Signed-off-by: Andrew Morton return mm; fail_nocontext: -@@ -1125,6 +1126,7 @@ static inline void __mmput(struct mm_str +@@ -1133,6 +1134,7 @@ static inline void __mmput(struct mm_str } if (mm->binfmt) module_put(mm->binfmt->module); @@ -398,7 +398,7 @@ Signed-off-by: Andrew Morton mmdrop(mm); } -@@ -2617,6 +2619,13 @@ pid_t kernel_clone(struct kernel_clone_a +@@ -2625,6 +2627,13 @@ pid_t kernel_clone(struct kernel_clone_a get_task_struct(p); } @@ -414,7 +414,7 @@ Signed-off-by: Andrew Morton /* forking complete and child started to run, tell ptracer */ --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -5010,6 +5010,7 @@ context_switch(struct rq *rq, struct tas +@@ -5014,6 +5014,7 @@ context_switch(struct rq *rq, struct tas * finish_task_switch()'s mmdrop(). */ switch_mm_irqs_off(prev->active_mm, next->mm, next); @@ -424,7 +424,7 @@ Signed-off-by: Andrew Morton /* will mmdrop() in finish_task_switch(). */ --- a/mm/memcontrol.c +++ b/mm/memcontrol.c -@@ -6212,6 +6212,30 @@ static void mem_cgroup_move_task(void) +@@ -6213,6 +6213,30 @@ static void mem_cgroup_move_task(void) } #endif @@ -455,7 +455,7 @@ Signed-off-by: Andrew Morton static int seq_puts_memcg_tunable(struct seq_file *m, unsigned long value) { if (value == PAGE_COUNTER_MAX) -@@ -6555,6 +6579,7 @@ struct cgroup_subsys memory_cgrp_subsys +@@ -6556,6 +6580,7 @@ struct cgroup_subsys memory_cgrp_subsys .css_reset = mem_cgroup_css_reset, .css_rstat_flush = mem_cgroup_css_rstat_flush, .can_attach = mem_cgroup_can_attach, diff --git a/target/linux/generic/backport-5.15/020-v6.1-10-mm-multi-gen-LRU-kill-switch.patch b/target/linux/generic/backport-5.15/020-v6.1-10-mm-multi-gen-LRU-kill-switch.patch index cf5b8f0e9f78db..8ee032fb0f0c35 100644 --- a/target/linux/generic/backport-5.15/020-v6.1-10-mm-multi-gen-LRU-kill-switch.patch +++ b/target/linux/generic/backport-5.15/020-v6.1-10-mm-multi-gen-LRU-kill-switch.patch @@ -116,7 +116,7 @@ Signed-off-by: Andrew Morton extern spinlock_t css_set_lock; #define task_css_set_check(task, __c) \ rcu_dereference_check((task)->cgroups, \ -@@ -708,6 +719,8 @@ struct cgroup; +@@ -709,6 +720,8 @@ struct cgroup; static inline u64 cgroup_id(const struct cgroup *cgrp) { return 1; } static inline void css_get(struct cgroup_subsys_state *css) {} static inline void css_put(struct cgroup_subsys_state *css) {} diff --git a/target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch b/target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch index 6010e617b863e4..8cc9abd84f09e2 100644 --- a/target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch +++ b/target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch @@ -318,7 +318,7 @@ Signed-off-by: Andrew Morton mctz = soft_limit_tree_from_page(page); if (!mctz) return; -@@ -3433,6 +3443,9 @@ unsigned long mem_cgroup_soft_limit_recl +@@ -3434,6 +3444,9 @@ unsigned long mem_cgroup_soft_limit_recl unsigned long excess; unsigned long nr_scanned; @@ -328,7 +328,7 @@ Signed-off-by: Andrew Morton if (order > 0) return 0; -@@ -5321,6 +5334,7 @@ static int mem_cgroup_css_online(struct +@@ -5322,6 +5335,7 @@ static int mem_cgroup_css_online(struct if (unlikely(mem_cgroup_is_root(memcg))) queue_delayed_work(system_unbound_wq, &stats_flush_dwork, 2UL*HZ); @@ -336,7 +336,7 @@ Signed-off-by: Andrew Morton return 0; } -@@ -5347,6 +5361,7 @@ static void mem_cgroup_css_offline(struc +@@ -5348,6 +5362,7 @@ static void mem_cgroup_css_offline(struc memcg_offline_kmem(memcg); reparent_shrinker_deferred(memcg); wb_memcg_offline(memcg); @@ -344,7 +344,7 @@ Signed-off-by: Andrew Morton drain_all_stock(memcg); -@@ -5358,6 +5373,7 @@ static void mem_cgroup_css_released(stru +@@ -5359,6 +5374,7 @@ static void mem_cgroup_css_released(stru struct mem_cgroup *memcg = mem_cgroup_from_css(css); invalidate_reclaim_iterators(memcg); diff --git a/target/linux/generic/backport-5.15/350-v5.18-regmap-add-configurable-downshift-for-addresses.patch b/target/linux/generic/backport-5.15/350-v5.18-regmap-add-configurable-downshift-for-addresses.patch index 99cd89ea002f43..7bb328f3a6de9a 100644 --- a/target/linux/generic/backport-5.15/350-v5.18-regmap-add-configurable-downshift-for-addresses.patch +++ b/target/linux/generic/backport-5.15/350-v5.18-regmap-add-configurable-downshift-for-addresses.patch @@ -37,7 +37,7 @@ Signed-off-by: Mark Brown map->format.val_bytes = DIV_ROUND_UP(config->val_bits, 8); map->format.buf_size = DIV_ROUND_UP(config->reg_bits + config->val_bits + config->pad_bits, 8); -@@ -1735,6 +1736,7 @@ static int _regmap_raw_write_impl(struct +@@ -1737,6 +1738,7 @@ static int _regmap_raw_write_impl(struct return ret; } @@ -45,7 +45,7 @@ Signed-off-by: Mark Brown map->format.format_reg(map->work_buf, reg, map->reg_shift); regmap_set_work_buf_flag_mask(map, map->format.reg_bytes, map->write_flag_mask); -@@ -1905,6 +1907,7 @@ static int _regmap_bus_formatted_write(v +@@ -1907,6 +1909,7 @@ static int _regmap_bus_formatted_write(v return ret; } @@ -53,7 +53,7 @@ Signed-off-by: Mark Brown map->format.format_write(map, reg, val); trace_regmap_hw_write_start(map, reg, 1); -@@ -2346,6 +2349,7 @@ static int _regmap_raw_multi_reg_write(s +@@ -2348,6 +2351,7 @@ static int _regmap_raw_multi_reg_write(s unsigned int reg = regs[i].reg; unsigned int val = regs[i].def; trace_regmap_hw_write_start(map, reg, 1); @@ -61,7 +61,7 @@ Signed-off-by: Mark Brown map->format.format_reg(u8, reg, map->reg_shift); u8 += reg_bytes + pad_bytes; map->format.format_val(u8, val, 0); -@@ -2673,6 +2677,7 @@ static int _regmap_raw_read(struct regma +@@ -2675,6 +2679,7 @@ static int _regmap_raw_read(struct regma return ret; } diff --git a/target/linux/generic/backport-5.15/351-v5.18-regmap-allow-a-defined-reg_base-to-be-added-to-every.patch b/target/linux/generic/backport-5.15/351-v5.18-regmap-allow-a-defined-reg_base-to-be-added-to-every.patch index 0f32288fcab5b3..841f8d45286fe0 100644 --- a/target/linux/generic/backport-5.15/351-v5.18-regmap-allow-a-defined-reg_base-to-be-added-to-every.patch +++ b/target/linux/generic/backport-5.15/351-v5.18-regmap-allow-a-defined-reg_base-to-be-added-to-every.patch @@ -42,7 +42,7 @@ Signed-off-by: Mark Brown map->format.reg_bytes = DIV_ROUND_UP(config->reg_bits, 8); map->format.pad_bytes = config->pad_bits / 8; map->format.reg_downshift = config->reg_downshift; -@@ -1736,6 +1738,7 @@ static int _regmap_raw_write_impl(struct +@@ -1738,6 +1740,7 @@ static int _regmap_raw_write_impl(struct return ret; } @@ -50,7 +50,7 @@ Signed-off-by: Mark Brown reg >>= map->format.reg_downshift; map->format.format_reg(map->work_buf, reg, map->reg_shift); regmap_set_work_buf_flag_mask(map, map->format.reg_bytes, -@@ -1907,6 +1910,7 @@ static int _regmap_bus_formatted_write(v +@@ -1909,6 +1912,7 @@ static int _regmap_bus_formatted_write(v return ret; } @@ -58,7 +58,7 @@ Signed-off-by: Mark Brown reg >>= map->format.reg_downshift; map->format.format_write(map, reg, val); -@@ -2349,6 +2353,7 @@ static int _regmap_raw_multi_reg_write(s +@@ -2351,6 +2355,7 @@ static int _regmap_raw_multi_reg_write(s unsigned int reg = regs[i].reg; unsigned int val = regs[i].def; trace_regmap_hw_write_start(map, reg, 1); @@ -66,7 +66,7 @@ Signed-off-by: Mark Brown reg >>= map->format.reg_downshift; map->format.format_reg(u8, reg, map->reg_shift); u8 += reg_bytes + pad_bytes; -@@ -2677,6 +2682,7 @@ static int _regmap_raw_read(struct regma +@@ -2679,6 +2684,7 @@ static int _regmap_raw_read(struct regma return ret; } diff --git a/target/linux/generic/backport-5.15/352-v6.3-regmap-apply-reg_base-and-reg_downshift-for-single-r.patch b/target/linux/generic/backport-5.15/352-v6.3-regmap-apply-reg_base-and-reg_downshift-for-single-r.patch index 804f68d23c50a5..bc3865c75b92af 100644 --- a/target/linux/generic/backport-5.15/352-v6.3-regmap-apply-reg_base-and-reg_downshift-for-single-r.patch +++ b/target/linux/generic/backport-5.15/352-v6.3-regmap-apply-reg_base-and-reg_downshift-for-single-r.patch @@ -28,7 +28,7 @@ Signed-off-by: Mark Brown --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c -@@ -1929,6 +1929,8 @@ static int _regmap_bus_reg_write(void *c +@@ -1931,6 +1931,8 @@ static int _regmap_bus_reg_write(void *c { struct regmap *map = context; @@ -37,7 +37,7 @@ Signed-off-by: Mark Brown return map->bus->reg_write(map->bus_context, reg, val); } -@@ -2703,6 +2705,8 @@ static int _regmap_bus_reg_read(void *co +@@ -2705,6 +2707,8 @@ static int _regmap_bus_reg_read(void *co { struct regmap *map = context; @@ -46,7 +46,7 @@ Signed-off-by: Mark Brown return map->bus->reg_read(map->bus_context, reg, val); } -@@ -3078,6 +3082,8 @@ static int _regmap_update_bits(struct re +@@ -3080,6 +3084,8 @@ static int _regmap_update_bits(struct re *change = false; if (regmap_volatile(map, reg) && map->reg_update_bits) { diff --git a/target/linux/generic/backport-5.15/702-v5.19-03-net-ethernet-mtk_eth_soc-implement-flow-offloading-t.patch b/target/linux/generic/backport-5.15/702-v5.19-03-net-ethernet-mtk_eth_soc-implement-flow-offloading-t.patch index ef2f53aa3847d7..69113c2ffafc6f 100644 --- a/target/linux/generic/backport-5.15/702-v5.19-03-net-ethernet-mtk_eth_soc-implement-flow-offloading-t.patch +++ b/target/linux/generic/backport-5.15/702-v5.19-03-net-ethernet-mtk_eth_soc-implement-flow-offloading-t.patch @@ -256,7 +256,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -763,6 +763,10 @@ int dev_fill_forward_path(const struct n +@@ -769,6 +769,10 @@ int dev_fill_forward_path(const struct n if (WARN_ON_ONCE(last_dev == ctx.dev)) return -1; } diff --git a/target/linux/generic/backport-5.15/703-00-v5.16-net-convert-users-of-bitmap_foo-to-linkmode_foo.patch b/target/linux/generic/backport-5.15/703-00-v5.16-net-convert-users-of-bitmap_foo-to-linkmode_foo.patch index 2f8128b3f30551..006181495c03e4 100644 --- a/target/linux/generic/backport-5.15/703-00-v5.16-net-convert-users-of-bitmap_foo-to-linkmode_foo.patch +++ b/target/linux/generic/backport-5.15/703-00-v5.16-net-convert-users-of-bitmap_foo-to-linkmode_foo.patch @@ -304,7 +304,7 @@ Signed-off-by: David S. Miller } --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c -@@ -686,7 +686,7 @@ static void bcm_sf2_sw_validate(struct d +@@ -692,7 +692,7 @@ static void bcm_sf2_sw_validate(struct d state->interface != PHY_INTERFACE_MODE_GMII && state->interface != PHY_INTERFACE_MODE_INTERNAL && state->interface != PHY_INTERFACE_MODE_MOCA) { @@ -313,7 +313,7 @@ Signed-off-by: David S. Miller if (port != core_readl(priv, CORE_IMP0_PRT_ID)) dev_err(ds->dev, "Unsupported interface: %d for port %d\n", -@@ -714,10 +714,8 @@ static void bcm_sf2_sw_validate(struct d +@@ -720,10 +720,8 @@ static void bcm_sf2_sw_validate(struct d phylink_set(mask, 100baseT_Half); phylink_set(mask, 100baseT_Full); @@ -554,7 +554,7 @@ Signed-off-by: David S. Miller static void xrs700x_mac_link_up(struct dsa_switch *ds, int port, --- a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c -@@ -369,9 +369,8 @@ static int xgbe_set_link_ksettings(struc +@@ -374,9 +374,8 @@ static int xgbe_set_link_ksettings(struc __ETHTOOL_LINK_MODE_MASK_NBITS, cmd->link_modes.advertising, __ETHTOOL_LINK_MODE_MASK_NBITS, lks->link_modes.supported); @@ -566,7 +566,7 @@ Signed-off-by: David S. Miller if ((cmd->base.autoneg == AUTONEG_ENABLE) && bitmap_empty(advertising, __ETHTOOL_LINK_MODE_MASK_NBITS)) { -@@ -384,8 +383,7 @@ static int xgbe_set_link_ksettings(struc +@@ -389,8 +388,7 @@ static int xgbe_set_link_ksettings(struc pdata->phy.autoneg = cmd->base.autoneg; pdata->phy.speed = speed; pdata->phy.duplex = cmd->base.duplex; diff --git a/target/linux/generic/backport-5.15/703-08-v5.17-net-phylink-add-mac_select_pcs-method-to-phylink_mac.patch b/target/linux/generic/backport-5.15/703-08-v5.17-net-phylink-add-mac_select_pcs-method-to-phylink_mac.patch index d826877e7dc693..5d5ac4b0094887 100644 --- a/target/linux/generic/backport-5.15/703-08-v5.17-net-phylink-add-mac_select_pcs-method-to-phylink_mac.patch +++ b/target/linux/generic/backport-5.15/703-08-v5.17-net-phylink-add-mac_select_pcs-method-to-phylink_mac.patch @@ -125,7 +125,7 @@ Signed-off-by: David S. Miller pl = kzalloc(sizeof(*pl), GFP_KERNEL); if (!pl) return ERR_PTR(-ENOMEM); -@@ -946,9 +987,10 @@ EXPORT_SYMBOL_GPL(phylink_create); +@@ -947,9 +988,10 @@ EXPORT_SYMBOL_GPL(phylink_create); * @pl: a pointer to a &struct phylink returned from phylink_create() * @pcs: a pointer to the &struct phylink_pcs * @@ -139,7 +139,7 @@ Signed-off-by: David S. Miller * * Please note that there are behavioural changes with the mac_config() * callback if a PCS is present (denoting a newer setup) so removing a PCS -@@ -959,6 +1001,14 @@ void phylink_set_pcs(struct phylink *pl, +@@ -960,6 +1002,14 @@ void phylink_set_pcs(struct phylink *pl, { pl->pcs = pcs; pl->pcs_ops = pcs->ops; diff --git a/target/linux/generic/backport-5.15/703-15-v5.18-net-phy-phylink-fix-DSA-mac_select_pcs-introduction.patch b/target/linux/generic/backport-5.15/703-15-v5.18-net-phy-phylink-fix-DSA-mac_select_pcs-introduction.patch index 9e5061aaed832b..924d0e954a9079 100644 --- a/target/linux/generic/backport-5.15/703-15-v5.18-net-phy-phylink-fix-DSA-mac_select_pcs-introduction.patch +++ b/target/linux/generic/backport-5.15/703-15-v5.18-net-phy-phylink-fix-DSA-mac_select_pcs-introduction.patch @@ -66,7 +66,7 @@ Signed-off-by: Jakub Kicinski phy_interface_empty(config->supported_interfaces)) { dev_err(config->dev, "phylink: error: empty supported_interfaces but mac_select_pcs() method present\n"); -@@ -1220,6 +1227,7 @@ struct phylink *phylink_create(struct ph +@@ -1221,6 +1228,7 @@ struct phylink *phylink_create(struct ph return ERR_PTR(-EINVAL); } diff --git a/target/linux/generic/backport-5.15/792-03-v6.6-net-phylink-add-pcs_enable-pcs_disable-methods.patch b/target/linux/generic/backport-5.15/792-03-v6.6-net-phylink-add-pcs_enable-pcs_disable-methods.patch index ceec58466e19bf..c8176c90f526c1 100644 --- a/target/linux/generic/backport-5.15/792-03-v6.6-net-phylink-add-pcs_enable-pcs_disable-methods.patch +++ b/target/linux/generic/backport-5.15/792-03-v6.6-net-phylink-add-pcs_enable-pcs_disable-methods.patch @@ -75,7 +75,7 @@ Signed-off-by: David S. Miller if (pl->pcs_ops) { err = pl->pcs_ops->pcs_config(pl->pcs, pl->cur_link_an_mode, state->interface, -@@ -1260,6 +1285,7 @@ struct phylink *phylink_create(struct ph +@@ -1261,6 +1286,7 @@ struct phylink *phylink_create(struct ph pl->link_config.speed = SPEED_UNKNOWN; pl->link_config.duplex = DUPLEX_UNKNOWN; pl->link_config.an_enabled = true; @@ -83,7 +83,7 @@ Signed-off-by: David S. Miller pl->mac_ops = mac_ops; __set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state); timer_setup(&pl->link_poll, phylink_fixed_poll, 0); -@@ -1651,6 +1677,8 @@ void phylink_start(struct phylink *pl) +@@ -1652,6 +1678,8 @@ void phylink_start(struct phylink *pl) if (pl->netdev) netif_carrier_off(pl->netdev); @@ -92,7 +92,7 @@ Signed-off-by: David S. Miller /* Apply the link configuration to the MAC when starting. This allows * a fixed-link to start with the correct parameters, and also * ensures that we set the appropriate advertisement for Serdes links. -@@ -1661,6 +1689,8 @@ void phylink_start(struct phylink *pl) +@@ -1662,6 +1690,8 @@ void phylink_start(struct phylink *pl) */ phylink_mac_initial_config(pl, true); @@ -101,7 +101,7 @@ Signed-off-by: David S. Miller clear_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state); phylink_run_resolve(pl); -@@ -1680,16 +1710,9 @@ void phylink_start(struct phylink *pl) +@@ -1681,16 +1711,9 @@ void phylink_start(struct phylink *pl) poll = true; } @@ -120,7 +120,7 @@ Signed-off-by: David S. Miller if (poll) mod_timer(&pl->link_poll, jiffies + HZ); if (pl->phydev) -@@ -1726,6 +1749,10 @@ void phylink_stop(struct phylink *pl) +@@ -1727,6 +1750,10 @@ void phylink_stop(struct phylink *pl) } phylink_run_resolve_and_disable(pl, PHYLINK_DISABLE_STOPPED); diff --git a/target/linux/generic/backport-5.15/794-v6.2-net-core-Allow-live-renaming-when-an-interface-is-up.patch b/target/linux/generic/backport-5.15/794-v6.2-net-core-Allow-live-renaming-when-an-interface-is-up.patch index bd58db2e7787e1..582e1ce2efdd48 100644 --- a/target/linux/generic/backport-5.15/794-v6.2-net-core-Allow-live-renaming-when-an-interface-is-up.patch +++ b/target/linux/generic/backport-5.15/794-v6.2-net-core-Allow-live-renaming-when-an-interface-is-up.patch @@ -73,7 +73,7 @@ Signed-off-by: David S. Miller /* Specifies the type of the struct net_device::ml_priv pointer */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -1222,22 +1222,6 @@ int dev_change_name(struct net_device *d +@@ -1242,22 +1242,6 @@ int dev_change_name(struct net_device *d net = dev_net(dev); @@ -96,7 +96,7 @@ Signed-off-by: David S. Miller down_write(&devnet_rename_sem); if (strncmp(newname, dev->name, IFNAMSIZ) == 0) { -@@ -1254,7 +1238,8 @@ int dev_change_name(struct net_device *d +@@ -1274,7 +1258,8 @@ int dev_change_name(struct net_device *d } if (oldname[0] && !strchr(oldname, '%')) diff --git a/target/linux/generic/backport-5.15/795-v6.3-01-r8152-add-USB-device-driver-for-config-selection.patch b/target/linux/generic/backport-5.15/795-v6.3-01-r8152-add-USB-device-driver-for-config-selection.patch new file mode 100644 index 00000000000000..38ddcb5714cbe5 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.3-01-r8152-add-USB-device-driver-for-config-selection.patch @@ -0,0 +1,229 @@ +From ec51fbd1b8a2bca2948dede99c14ec63dc57ff6b Mon Sep 17 00:00:00 2001 +From: Bjørn Mork +Date: Fri, 6 Jan 2023 17:07:38 +0100 +Subject: [PATCH] r8152: add USB device driver for config selection +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Subclassing the generic USB device driver to override the +default configuration selection regardless of matching interface +drivers. + +The r815x family devices expose a vendor specific function which +the r8152 interface driver wants to handle. This is the preferred +device mode. Additionally one or more USB class functions are +usually supported for hosts lacking a vendor specific driver. The +choice is USB configuration based, with one alternate function per +configuration. + +Example device with both NCM and ECM alternate cfgs: + +T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 4 Spd=5000 MxCh= 0 +D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 3 +P: Vendor=0bda ProdID=8156 Rev=31.00 +S: Manufacturer=Realtek +S: Product=USB 10/100/1G/2.5G LAN +S: SerialNumber=001000001 +C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=256mA +I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=00 Driver=r8152 +E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=83(I) Atr=03(Int.) MxPS= 2 Ivl=128ms +C: #Ifs= 2 Cfg#= 2 Atr=a0 MxPwr=256mA +I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0d Prot=00 Driver= +E: Ad=83(I) Atr=03(Int.) MxPS= 16 Ivl=128ms +I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=01 Driver= +I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=01 Driver= +E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +C: #Ifs= 2 Cfg#= 3 Atr=a0 MxPwr=256mA +I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver= +E: Ad=83(I) Atr=03(Int.) MxPS= 16 Ivl=128ms +I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver= +I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver= +E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms + +A problem with this is that Linux will prefer class functions over +vendor specific functions. Using the above example, Linux defaults +to cfg #2, running the device in a sub-optimal NCM mode. + +Previously we've attempted to work around the problem by +blacklisting the devices in the ECM class driver "cdc_ether", and +matching on the ECM class function in the vendor specific interface +driver. The latter has been used to switch back to the vendor +specific configuration when the driver is probed for a class +function. + +This workaround has several issues; +- class driver blacklists is additional maintanence cruft in an + unrelated driver +- class driver blacklists prevents users from optionally running + the devices in class mode +- each device needs double match entries in the vendor driver +- the initial probing as a class function slows down device + discovery + +Now these issues have become even worse with the introduction of +firmware supporting both NCM and ECM, where NCM ends up as the +default mode in Linux. To use the same workaround, we now have +to blacklist the devices in to two different class drivers and +add yet another match entry to the vendor specific driver. + +This patch implements an alternative workaround strategy - +independent of the interface drivers. It avoids adding a +blacklist to the cdc_ncm driver and will let us remove the +existing blacklist from the cdc_ether driver. + +As an additional bonus, removing the blacklists allow users to +select one of the other device modes if wanted. + +Signed-off-by: Bjørn Mork +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 113 ++++++++++++++++++++++++++++------------ + 1 file changed, 81 insertions(+), 32 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9625,6 +9625,9 @@ static int rtl8152_probe(struct usb_inte + if (version == RTL_VER_UNKNOWN) + return -ENODEV; + ++ if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) ++ return -ENODEV; ++ + if (!rtl_vendor_mode(intf)) + return -ENODEV; + +@@ -9834,43 +9837,35 @@ static void rtl8152_disconnect(struct us + } + } + +-#define REALTEK_USB_DEVICE(vend, prod) { \ +- USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC), \ +-}, \ +-{ \ +- USB_DEVICE_AND_INTERFACE_INFO(vend, prod, USB_CLASS_COMM, \ +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), \ +-} + + /* table of devices that work with this driver */ + static const struct usb_device_id rtl8152_table[] = { + /* Realtek */ +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8050), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8053), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8155), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8156), ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8050) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8053) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8152) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8153) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8155) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8156) }, + + /* Microsoft */ +- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab), +- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6), +- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927), +- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0c5e), +- REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3054), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3069), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3082), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720c), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7214), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x721e), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0xa387), +- REALTEK_USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041), +- REALTEK_USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff), +- REALTEK_USB_DEVICE(VENDOR_ID_TPLINK, 0x0601), ++ { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab) }, ++ { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6) }, ++ { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927) }, ++ { USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x304f) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3054) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3062) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3069) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3082) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x7205) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x720c) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x7214) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x721e) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0xa387) }, ++ { USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041) }, ++ { USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff) }, ++ { USB_DEVICE(VENDOR_ID_TPLINK, 0x0601) }, + {} + }; + +@@ -9890,7 +9885,61 @@ static struct usb_driver rtl8152_driver + .disable_hub_initiated_lpm = 1, + }; + +-module_usb_driver(rtl8152_driver); ++static int rtl8152_cfgselector_probe(struct usb_device *udev) ++{ ++ struct usb_host_config *c; ++ int i, num_configs; ++ ++ /* The vendor mode is not always config #1, so to find it out. */ ++ c = udev->config; ++ num_configs = udev->descriptor.bNumConfigurations; ++ for (i = 0; i < num_configs; (i++, c++)) { ++ struct usb_interface_descriptor *desc = NULL; ++ ++ if (!c->desc.bNumInterfaces) ++ continue; ++ desc = &c->intf_cache[0]->altsetting->desc; ++ if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC) ++ break; ++ } ++ ++ if (i == num_configs) ++ return -ENODEV; ++ ++ if (usb_set_configuration(udev, c->desc.bConfigurationValue)) { ++ dev_err(&udev->dev, "Failed to set configuration %d\n", ++ c->desc.bConfigurationValue); ++ return -ENODEV; ++ } ++ ++ return 0; ++} ++ ++static struct usb_device_driver rtl8152_cfgselector_driver = { ++ .name = MODULENAME "-cfgselector", ++ .probe = rtl8152_cfgselector_probe, ++ .id_table = rtl8152_table, ++ .generic_subclass = 1, ++}; ++ ++static int __init rtl8152_driver_init(void) ++{ ++ int ret; ++ ++ ret = usb_register_device_driver(&rtl8152_cfgselector_driver, THIS_MODULE); ++ if (ret) ++ return ret; ++ return usb_register(&rtl8152_driver); ++} ++ ++static void __exit rtl8152_driver_exit(void) ++{ ++ usb_deregister(&rtl8152_driver); ++ usb_deregister_device_driver(&rtl8152_cfgselector_driver); ++} ++ ++module_init(rtl8152_driver_init); ++module_exit(rtl8152_driver_exit); + + MODULE_AUTHOR(DRIVER_AUTHOR); + MODULE_DESCRIPTION(DRIVER_DESC); diff --git a/target/linux/generic/backport-5.15/795-v6.3-02-cdc_ether-no-need-to-blacklist-any-r8152-devices.patch b/target/linux/generic/backport-5.15/795-v6.3-02-cdc_ether-no-need-to-blacklist-any-r8152-devices.patch new file mode 100644 index 00000000000000..2b3272cebd0149 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.3-02-cdc_ether-no-need-to-blacklist-any-r8152-devices.patch @@ -0,0 +1,158 @@ +From 69649ef8405320f81497f4757faac8234f61b167 Mon Sep 17 00:00:00 2001 +From: Bjørn Mork +Date: Fri, 6 Jan 2023 17:07:39 +0100 +Subject: [PATCH] cdc_ether: no need to blacklist any r8152 devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The r8152 driver does not need this anymore. + +Dropping blacklist entries adds optional support for these +devices in ECM mode. + +The 8153 devices are handled by the r8153_ecm driver when +in ECM mode, and must still be blacklisted here. + +Signed-off-by: Bjørn Mork +Signed-off-by: David S. Miller +--- + drivers/net/usb/cdc_ether.c | 114 ------------------------------------ + 1 file changed, 114 deletions(-) + +--- a/drivers/net/usb/cdc_ether.c ++++ b/drivers/net/usb/cdc_ether.c +@@ -767,13 +767,6 @@ static const struct usb_device_id produc + .driver_info = 0, + }, + +-/* Realtek RTL8152 Based USB 2.0 Ethernet Adapters */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- + /* Realtek RTL8153 Based USB 3.0 Ethernet Adapters */ + { + USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8153, USB_CLASS_COMM, +@@ -781,119 +774,12 @@ static const struct usb_device_id produc + .driver_info = 0, + }, + +-/* Samsung USB Ethernet Adapters */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, 0xa101, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-#if IS_ENABLED(CONFIG_USB_RTL8152) +-/* Linksys USB3GIGV1 Ethernet Adapter */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LINKSYS_VENDOR_ID, 0x0041, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +-#endif +- +-/* Lenovo ThinkPad OneLink+ Dock (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3054, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* ThinkPad USB-C Dock (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3062, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* ThinkPad Thunderbolt 3 Dock (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3069, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* ThinkPad Thunderbolt 3 Dock Gen 2 (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3082, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Lenovo Thinkpad USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x7205, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Lenovo USB C to Ethernet Adapter (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x720c, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Lenovo USB-C Travel Hub (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x7214, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- + /* Lenovo Powered USB-C Travel Hub (4X90S92381, based on Realtek RTL8153) */ + { + USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x721e, USB_CLASS_COMM, + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), + .driver_info = 0, + }, +- +-/* ThinkPad USB-C Dock Gen 2 (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0xa387, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* NVIDIA Tegra USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(NVIDIA_VENDOR_ID, 0x09ff, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Microsoft Surface 2 dock (based on Realtek RTL8152) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07ab, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07c6, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153B) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x0927, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* TP-LINK UE300 USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, 0x0601, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, + + /* Aquantia AQtion USB to 5GbE Controller (based on AQC111U) */ + { diff --git a/target/linux/generic/backport-5.15/795-v6.3-03-r8152-avoid-to-change-cfg-for-all-devices.patch b/target/linux/generic/backport-5.15/795-v6.3-03-r8152-avoid-to-change-cfg-for-all-devices.patch new file mode 100644 index 00000000000000..8bbf0be802be18 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.3-03-r8152-avoid-to-change-cfg-for-all-devices.patch @@ -0,0 +1,64 @@ +From 0d4cda805a183bbe523f2407edb5c14ade50b841 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 17 Jan 2023 11:03:44 +0800 +Subject: [PATCH] r8152: avoid to change cfg for all devices + +The rtl8152_cfgselector_probe() should set the USB configuration to the +vendor mode only for the devices which the driver (r8152) supports. +Otherwise, no driver would be used for such devices. + +Fixes: ec51fbd1b8a2 ("r8152: add USB device driver for config selection") +Signed-off-by: Hayes Wang +Reviewed-by: Simon Horman +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 20 +++++++++++++++++--- + 1 file changed, 17 insertions(+), 3 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9531,9 +9531,8 @@ static int rtl_fw_init(struct r8152 *tp) + return 0; + } + +-u8 rtl8152_get_version(struct usb_interface *intf) ++static u8 __rtl_get_hw_ver(struct usb_device *udev) + { +- struct usb_device *udev = interface_to_usbdev(intf); + u32 ocp_data = 0; + __le32 *tmp; + u8 version; +@@ -9603,10 +9602,19 @@ u8 rtl8152_get_version(struct usb_interf + break; + default: + version = RTL_VER_UNKNOWN; +- dev_info(&intf->dev, "Unknown version 0x%04x\n", ocp_data); ++ dev_info(&udev->dev, "Unknown version 0x%04x\n", ocp_data); + break; + } + ++ return version; ++} ++ ++u8 rtl8152_get_version(struct usb_interface *intf) ++{ ++ u8 version; ++ ++ version = __rtl_get_hw_ver(interface_to_usbdev(intf)); ++ + dev_dbg(&intf->dev, "Detected version 0x%04x\n", version); + + return version; +@@ -9890,6 +9898,12 @@ static int rtl8152_cfgselector_probe(str + struct usb_host_config *c; + int i, num_configs; + ++ /* Switch the device to vendor mode, if and only if the vendor mode ++ * driver supports it. ++ */ ++ if (__rtl_get_hw_ver(udev) == RTL_VER_UNKNOWN) ++ return 0; ++ + /* The vendor mode is not always config #1, so to find it out. */ + c = udev->config; + num_configs = udev->descriptor.bNumConfigurations; diff --git a/target/linux/generic/backport-5.15/795-v6.3-04-r8152-remove-rtl_vendor_mode-function.patch b/target/linux/generic/backport-5.15/795-v6.3-04-r8152-remove-rtl_vendor_mode-function.patch new file mode 100644 index 00000000000000..c9bd0df202fbf8 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.3-04-r8152-remove-rtl_vendor_mode-function.patch @@ -0,0 +1,71 @@ +From 95a4c1d617b92cdc4522297741b56e8f6cd01a1e Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Thu, 19 Jan 2023 15:40:42 +0800 +Subject: [PATCH] r8152: remove rtl_vendor_mode function + +After commit ec51fbd1b8a2 ("r8152: add USB device driver for +config selection"), the code about changing USB configuration +in rtl_vendor_mode() wouldn't be run anymore. Therefore, the +function could be removed. + +Signed-off-by: Hayes Wang +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 39 +-------------------------------------- + 1 file changed, 1 insertion(+), 38 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -8267,43 +8267,6 @@ static bool rtl_check_vendor_ok(struct u + return true; + } + +-static bool rtl_vendor_mode(struct usb_interface *intf) +-{ +- struct usb_host_interface *alt = intf->cur_altsetting; +- struct usb_device *udev; +- struct usb_host_config *c; +- int i, num_configs; +- +- if (alt->desc.bInterfaceClass == USB_CLASS_VENDOR_SPEC) +- return rtl_check_vendor_ok(intf); +- +- /* The vendor mode is not always config #1, so to find it out. */ +- udev = interface_to_usbdev(intf); +- c = udev->config; +- num_configs = udev->descriptor.bNumConfigurations; +- if (num_configs < 2) +- return false; +- +- for (i = 0; i < num_configs; (i++, c++)) { +- struct usb_interface_descriptor *desc = NULL; +- +- if (c->desc.bNumInterfaces > 0) +- desc = &c->intf_cache[0]->altsetting->desc; +- else +- continue; +- +- if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC) { +- usb_driver_set_configuration(udev, c->desc.bConfigurationValue); +- break; +- } +- } +- +- if (i == num_configs) +- dev_err(&intf->dev, "Unexpected Device\n"); +- +- return false; +-} +- + static int rtl8152_pre_reset(struct usb_interface *intf) + { + struct r8152 *tp = usb_get_intfdata(intf); +@@ -9636,7 +9599,7 @@ static int rtl8152_probe(struct usb_inte + if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) + return -ENODEV; + +- if (!rtl_vendor_mode(intf)) ++ if (!rtl_check_vendor_ok(intf)) + return -ENODEV; + + usb_reset_device(udev); diff --git a/target/linux/generic/backport-5.15/795-v6.3-05-r8152-reduce-the-control-transfer-of-rtl8152_get_ver.patch b/target/linux/generic/backport-5.15/795-v6.3-05-r8152-reduce-the-control-transfer-of-rtl8152_get_ver.patch new file mode 100644 index 00000000000000..7d1053aea5a960 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.3-05-r8152-reduce-the-control-transfer-of-rtl8152_get_ver.patch @@ -0,0 +1,46 @@ +From 02767440e1dda9861a11ca1dbe0f19a760b1d5c2 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Thu, 19 Jan 2023 15:40:43 +0800 +Subject: [PATCH] r8152: reduce the control transfer of rtl8152_get_version() + +Reduce the control transfer by moving calling rtl8152_get_version() in +rtl8152_probe(). This could prevent from calling rtl8152_get_version() +for unnecessary situations. For example, after setting config #2 for the +device, there are two interfaces and rtl8152_probe() may be called +twice. However, we don't need to call rtl8152_get_version() for this +situation. + +Signed-off-by: Hayes Wang +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9588,20 +9588,21 @@ static int rtl8152_probe(struct usb_inte + const struct usb_device_id *id) + { + struct usb_device *udev = interface_to_usbdev(intf); +- u8 version = rtl8152_get_version(intf); + struct r8152 *tp; + struct net_device *netdev; ++ u8 version; + int ret; + +- if (version == RTL_VER_UNKNOWN) +- return -ENODEV; +- + if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) + return -ENODEV; + + if (!rtl_check_vendor_ok(intf)) + return -ENODEV; + ++ version = rtl8152_get_version(intf); ++ if (version == RTL_VER_UNKNOWN) ++ return -ENODEV; ++ + usb_reset_device(udev); + netdev = alloc_etherdev(sizeof(struct r8152)); + if (!netdev) { diff --git a/target/linux/generic/backport-5.15/795-v6.3-06-r8152-Add-__GFP_NOWARN-to-big-allocations.patch b/target/linux/generic/backport-5.15/795-v6.3-06-r8152-Add-__GFP_NOWARN-to-big-allocations.patch new file mode 100644 index 00000000000000..5d1dfe3aef17fd --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.3-06-r8152-Add-__GFP_NOWARN-to-big-allocations.patch @@ -0,0 +1,55 @@ +From 5cc33f139e11b893ff6dc60d8a0ae865a65521ac Mon Sep 17 00:00:00 2001 +From: Douglas Anderson +Date: Thu, 6 Apr 2023 17:14:26 -0700 +Subject: [PATCH] r8152: Add __GFP_NOWARN to big allocations + +When memory is a little tight on my system, it's pretty easy to see +warnings that look like this. + + ksoftirqd/0: page allocation failure: order:3, mode:0x40a20(GFP_ATOMIC|__GFP_COMP), nodemask=(null),cpuset=/,mems_allowed=0 + ... + Call trace: + dump_backtrace+0x0/0x1e8 + show_stack+0x20/0x2c + dump_stack_lvl+0x60/0x78 + dump_stack+0x18/0x38 + warn_alloc+0x104/0x174 + __alloc_pages+0x588/0x67c + alloc_rx_agg+0xa0/0x190 [r8152 ...] + r8152_poll+0x270/0x760 [r8152 ...] + __napi_poll+0x44/0x1ec + net_rx_action+0x100/0x300 + __do_softirq+0xec/0x38c + run_ksoftirqd+0x38/0xec + smpboot_thread_fn+0xb8/0x248 + kthread+0x134/0x154 + ret_from_fork+0x10/0x20 + +On a fragmented system it's normal that order 3 allocations will +sometimes fail, especially atomic ones. The driver handles these +failures fine and the WARN just creates spam in the logs for this +case. The __GFP_NOWARN flag is exactly for this situation, so add it +to the allocation. + +NOTE: my testing is on a 5.15 system, but there should be no reason +that this would be fundamentally different on a mainline kernel. + +Signed-off-by: Douglas Anderson +Acked-by: Hayes Wang +Link: https://lore.kernel.org/r/20230406171411.1.I84dbef45786af440fd269b71e9436a96a8e7a152@changeid +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -1944,7 +1944,7 @@ static struct rx_agg *alloc_rx_agg(struc + if (!rx_agg) + return NULL; + +- rx_agg->page = alloc_pages(mflags | __GFP_COMP, order); ++ rx_agg->page = alloc_pages(mflags | __GFP_COMP | __GFP_NOWARN, order); + if (!rx_agg->page) + goto free_rx; + diff --git a/target/linux/generic/backport-5.15/795-v6.4-07-r8152-fix-the-autosuspend-doesn-t-work.patch b/target/linux/generic/backport-5.15/795-v6.4-07-r8152-fix-the-autosuspend-doesn-t-work.patch new file mode 100644 index 00000000000000..df881e26083933 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.4-07-r8152-fix-the-autosuspend-doesn-t-work.patch @@ -0,0 +1,24 @@ +From 0fbd79c01a9a657348f7032df70c57a406468c86 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 2 May 2023 11:36:27 +0800 +Subject: [PATCH] r8152: fix the autosuspend doesn't work + +Set supports_autosuspend = 1 for the rtl8152_cfgselector_driver. + +Fixes: ec51fbd1b8a2 ("r8152: add USB device driver for config selection") +Signed-off-by: Hayes Wang +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9898,6 +9898,7 @@ static struct usb_device_driver rtl8152_ + .probe = rtl8152_cfgselector_probe, + .id_table = rtl8152_table, + .generic_subclass = 1, ++ .supports_autosuspend = 1, + }; + + static int __init rtl8152_driver_init(void) diff --git a/target/linux/generic/backport-5.15/795-v6.6-08-r8152-adjust-generic_ocp_write-function.patch b/target/linux/generic/backport-5.15/795-v6.6-08-r8152-adjust-generic_ocp_write-function.patch new file mode 100644 index 00000000000000..0da1a5b7cf7797 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.6-08-r8152-adjust-generic_ocp_write-function.patch @@ -0,0 +1,70 @@ +From 57df0fb9d511f91202114813e90128d65c0589f0 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Wed, 26 Jul 2023 11:08:07 +0800 +Subject: [PATCH] r8152: adjust generic_ocp_write function + +Reduce the control transfer if all bytes of first or the last DWORD are +written. + +The original method is to split the control transfer into three parts +(the first DWORD, middle continuous data, and the last DWORD). However, +they could be combined if whole bytes of the first DWORD or last DWORD +are written. That is, the first DWORD or the last DWORD could be combined +with the middle continuous data, if the byte_en is 0xff. + +Signed-off-by: Hayes Wang +Link: https://lore.kernel.org/r/20230726030808.9093-418-nic_swsd@realtek.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 29 ++++++++++++++++++----------- + 1 file changed, 18 insertions(+), 11 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -1310,16 +1310,24 @@ static int generic_ocp_write(struct r815 + byteen_end = byteen & BYTE_EN_END_MASK; + + byen = byteen_start | (byteen_start << 4); +- ret = set_registers(tp, index, type | byen, 4, data); +- if (ret < 0) +- goto error1; +- +- index += 4; +- data += 4; +- size -= 4; + +- if (size) { ++ /* Split the first DWORD if the byte_en is not 0xff */ ++ if (byen != BYTE_EN_DWORD) { ++ ret = set_registers(tp, index, type | byen, 4, data); ++ if (ret < 0) ++ goto error1; ++ ++ index += 4; ++ data += 4; + size -= 4; ++ } ++ ++ if (size) { ++ byen = byteen_end | (byteen_end >> 4); ++ ++ /* Split the last DWORD if the byte_en is not 0xff */ ++ if (byen != BYTE_EN_DWORD) ++ size -= 4; + + while (size) { + if (size > limit) { +@@ -1346,10 +1354,9 @@ static int generic_ocp_write(struct r815 + } + } + +- byen = byteen_end | (byteen_end >> 4); +- ret = set_registers(tp, index, type | byen, 4, data); +- if (ret < 0) +- goto error1; ++ /* Set the last DWORD */ ++ if (byen != BYTE_EN_DWORD) ++ ret = set_registers(tp, index, type | byen, 4, data); + } + + error1: diff --git a/target/linux/generic/backport-5.15/795-v6.6-09-r8152-set-bp-in-bulk.patch b/target/linux/generic/backport-5.15/795-v6.6-09-r8152-set-bp-in-bulk.patch new file mode 100644 index 00000000000000..cfc31daf12628c --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.6-09-r8152-set-bp-in-bulk.patch @@ -0,0 +1,129 @@ +From e5c266a61186b462c388c53a3564c375e72f2244 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Wed, 26 Jul 2023 11:08:08 +0800 +Subject: [PATCH] r8152: set bp in bulk + +PLA_BP_0 ~ PLA_BP_15 (0xfc28 ~ 0xfc46) are continuous registers, so we +could combine the control transfers into one control transfer. + +Signed-off-by: Hayes Wang +Link: https://lore.kernel.org/r/20230726030808.9093-419-nic_swsd@realtek.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 75 ++++++++++++++--------------------------- + 1 file changed, 25 insertions(+), 50 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -3977,29 +3977,10 @@ static void rtl_reset_bmu(struct r8152 * + /* Clear the bp to stop the firmware before loading a new one */ + static void rtl_clear_bp(struct r8152 *tp, u16 type) + { +- switch (tp->version) { +- case RTL_VER_01: +- case RTL_VER_02: +- case RTL_VER_07: +- break; +- case RTL_VER_03: +- case RTL_VER_04: +- case RTL_VER_05: +- case RTL_VER_06: +- ocp_write_byte(tp, type, PLA_BP_EN, 0); +- break; +- case RTL_VER_14: +- ocp_write_word(tp, type, USB_BP2_EN, 0); ++ u16 bp[16] = {0}; ++ u16 bp_num; + +- ocp_write_word(tp, type, USB_BP_8, 0); +- ocp_write_word(tp, type, USB_BP_9, 0); +- ocp_write_word(tp, type, USB_BP_10, 0); +- ocp_write_word(tp, type, USB_BP_11, 0); +- ocp_write_word(tp, type, USB_BP_12, 0); +- ocp_write_word(tp, type, USB_BP_13, 0); +- ocp_write_word(tp, type, USB_BP_14, 0); +- ocp_write_word(tp, type, USB_BP_15, 0); +- break; ++ switch (tp->version) { + case RTL_VER_08: + case RTL_VER_09: + case RTL_VER_10: +@@ -4007,32 +3988,31 @@ static void rtl_clear_bp(struct r8152 *t + case RTL_VER_12: + case RTL_VER_13: + case RTL_VER_15: +- default: + if (type == MCU_TYPE_USB) { + ocp_write_word(tp, MCU_TYPE_USB, USB_BP2_EN, 0); +- +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_8, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_9, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_10, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_11, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_12, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_13, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_14, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_15, 0); +- } else { +- ocp_write_byte(tp, MCU_TYPE_PLA, PLA_BP_EN, 0); ++ bp_num = 16; ++ break; + } ++ fallthrough; ++ case RTL_VER_03: ++ case RTL_VER_04: ++ case RTL_VER_05: ++ case RTL_VER_06: ++ ocp_write_byte(tp, type, PLA_BP_EN, 0); ++ fallthrough; ++ case RTL_VER_01: ++ case RTL_VER_02: ++ case RTL_VER_07: ++ bp_num = 8; ++ break; ++ case RTL_VER_14: ++ default: ++ ocp_write_word(tp, type, USB_BP2_EN, 0); ++ bp_num = 16; + break; + } + +- ocp_write_word(tp, type, PLA_BP_0, 0); +- ocp_write_word(tp, type, PLA_BP_1, 0); +- ocp_write_word(tp, type, PLA_BP_2, 0); +- ocp_write_word(tp, type, PLA_BP_3, 0); +- ocp_write_word(tp, type, PLA_BP_4, 0); +- ocp_write_word(tp, type, PLA_BP_5, 0); +- ocp_write_word(tp, type, PLA_BP_6, 0); +- ocp_write_word(tp, type, PLA_BP_7, 0); ++ generic_ocp_write(tp, PLA_BP_0, BYTE_EN_DWORD, bp_num << 1, bp, type); + + /* wait 3 ms to make sure the firmware is stopped */ + usleep_range(3000, 6000); +@@ -5009,10 +4989,9 @@ static void rtl8152_fw_phy_nc_apply(stru + + static void rtl8152_fw_mac_apply(struct r8152 *tp, struct fw_mac *mac) + { +- u16 bp_en_addr, bp_index, type, bp_num, fw_ver_reg; ++ u16 bp_en_addr, type, fw_ver_reg; + u32 length; + u8 *data; +- int i; + + switch (__le32_to_cpu(mac->blk_hdr.type)) { + case RTL_FW_PLA: +@@ -5054,12 +5033,8 @@ static void rtl8152_fw_mac_apply(struct + ocp_write_word(tp, type, __le16_to_cpu(mac->bp_ba_addr), + __le16_to_cpu(mac->bp_ba_value)); + +- bp_index = __le16_to_cpu(mac->bp_start); +- bp_num = __le16_to_cpu(mac->bp_num); +- for (i = 0; i < bp_num; i++) { +- ocp_write_word(tp, type, bp_index, __le16_to_cpu(mac->bp[i])); +- bp_index += 2; +- } ++ generic_ocp_write(tp, __le16_to_cpu(mac->bp_start), BYTE_EN_DWORD, ++ __le16_to_cpu(mac->bp_num) << 1, mac->bp, type); + + bp_en_addr = __le16_to_cpu(mac->bp_en_addr); + if (bp_en_addr) diff --git a/target/linux/generic/backport-5.15/795-v6.6-11-r8152-add-vendor-device-ID-pair-for-D-Link-DUB-E250.patch b/target/linux/generic/backport-5.15/795-v6.6-11-r8152-add-vendor-device-ID-pair-for-D-Link-DUB-E250.patch new file mode 100644 index 00000000000000..4d1b177ff204c4 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.6-11-r8152-add-vendor-device-ID-pair-for-D-Link-DUB-E250.patch @@ -0,0 +1,39 @@ +From 72f93a3136ee18fd59fa6579f84c07e93424681e Mon Sep 17 00:00:00 2001 +From: Antonio Napolitano +Date: Sat, 26 Aug 2023 01:05:50 +0200 +Subject: [PATCH] r8152: add vendor/device ID pair for D-Link DUB-E250 + +The D-Link DUB-E250 is an RTL8156 based 2.5G Ethernet controller. + +Add the vendor and product ID values to the driver. This makes Ethernet +work with the adapter. + +Signed-off-by: Antonio Napolitano +Link: https://lore.kernel.org/r/CV200KJEEUPC.WPKAHXCQJ05I@mercurius +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 1 + + include/linux/usb/r8152.h | 1 + + 2 files changed, 2 insertions(+) + + +--- a/include/linux/usb/r8152.h ++++ b/include/linux/usb/r8152.h +@@ -29,6 +29,7 @@ + #define VENDOR_ID_LINKSYS 0x13b1 + #define VENDOR_ID_NVIDIA 0x0955 + #define VENDOR_ID_TPLINK 0x2357 ++#define VENDOR_ID_DLINK 0x2001 + + #if IS_REACHABLE(CONFIG_USB_RTL8152) + extern u8 rtl8152_get_version(struct usb_interface *intf); +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9820,6 +9820,7 @@ static const struct usb_device_id rtl815 + { USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041) }, + { USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff) }, + { USB_DEVICE(VENDOR_ID_TPLINK, 0x0601) }, ++ { USB_DEVICE(VENDOR_ID_DLINK, 0xb301) }, + {} + }; + diff --git a/target/linux/generic/backport-5.15/795-v6.6-12-r8152-Rename-RTL8152_UNPLUG-to-RTL8152_INACCESSIBLE.patch b/target/linux/generic/backport-5.15/795-v6.6-12-r8152-Rename-RTL8152_UNPLUG-to-RTL8152_INACCESSIBLE.patch new file mode 100644 index 00000000000000..4f0e0e1c658130 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.6-12-r8152-Rename-RTL8152_UNPLUG-to-RTL8152_INACCESSIBLE.patch @@ -0,0 +1,447 @@ +From 715f67f33af45ce2cc3a5b1ef133cc8c8e7787b0 Mon Sep 17 00:00:00 2001 +From: Douglas Anderson +Date: Fri, 20 Oct 2023 14:06:58 -0700 +Subject: [PATCH] r8152: Rename RTL8152_UNPLUG to RTL8152_INACCESSIBLE + +Whenever the RTL8152_UNPLUG is set that just tells the driver that all +accesses will fail and we should just immediately bail. A future patch +will use this same concept at a time when the driver hasn't actually +been unplugged but is about to be reset. Rename the flag in +preparation for the future patch. + +This is a no-op change and just a search and replace. + +Signed-off-by: Douglas Anderson +Reviewed-by: Grant Grundler +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 96 ++++++++++++++++++++--------------------- + 1 file changed, 48 insertions(+), 48 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -763,7 +763,7 @@ enum rtl_register_content { + + /* rtl8152 flags */ + enum rtl8152_flags { +- RTL8152_UNPLUG = 0, ++ RTL8152_INACCESSIBLE = 0, + RTL8152_SET_RX_MODE, + WORK_ENABLE, + RTL8152_LINK_CHG, +@@ -1241,7 +1241,7 @@ int set_registers(struct r8152 *tp, u16 + static void rtl_set_unplug(struct r8152 *tp) + { + if (tp->udev->state == USB_STATE_NOTATTACHED) { +- set_bit(RTL8152_UNPLUG, &tp->flags); ++ set_bit(RTL8152_INACCESSIBLE, &tp->flags); + smp_mb__after_atomic(); + } + } +@@ -1252,7 +1252,7 @@ static int generic_ocp_read(struct r8152 + u16 limit = 64; + int ret = 0; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + /* both size and indix must be 4 bytes align */ +@@ -1296,7 +1296,7 @@ static int generic_ocp_write(struct r815 + u16 byteen_start, byteen_end, byen; + u16 limit = 512; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + /* both size and indix must be 4 bytes align */ +@@ -1533,7 +1533,7 @@ static int read_mii_word(struct net_devi + struct r8152 *tp = netdev_priv(netdev); + int ret; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + if (phy_id != R8152_PHY_ID) +@@ -1549,7 +1549,7 @@ void write_mii_word(struct net_device *n + { + struct r8152 *tp = netdev_priv(netdev); + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (phy_id != R8152_PHY_ID) +@@ -1754,7 +1754,7 @@ static void read_bulk_callback(struct ur + if (!tp) + return; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (!test_bit(WORK_ENABLE, &tp->flags)) +@@ -1846,7 +1846,7 @@ static void write_bulk_callback(struct u + if (!test_bit(WORK_ENABLE, &tp->flags)) + return; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (!skb_queue_empty(&tp->tx_queue)) +@@ -1867,7 +1867,7 @@ static void intr_callback(struct urb *ur + if (!test_bit(WORK_ENABLE, &tp->flags)) + return; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + switch (status) { +@@ -2611,7 +2611,7 @@ static void bottom_half(struct tasklet_s + { + struct r8152 *tp = from_tasklet(tp, t, tx_tl); + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (!test_bit(WORK_ENABLE, &tp->flags)) +@@ -2654,7 +2654,7 @@ int r8152_submit_rx(struct r8152 *tp, st + int ret; + + /* The rx would be stopped, so skip submitting */ +- if (test_bit(RTL8152_UNPLUG, &tp->flags) || ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags) || + !test_bit(WORK_ENABLE, &tp->flags) || !netif_carrier_ok(tp->netdev)) + return 0; + +@@ -3050,7 +3050,7 @@ static int rtl_enable(struct r8152 *tp) + + static int rtl8152_enable(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + set_tx_qlen(tp); +@@ -3137,7 +3137,7 @@ static int rtl8153_enable(struct r8152 * + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + set_tx_qlen(tp); +@@ -3169,7 +3169,7 @@ static void rtl_disable(struct r8152 *tp + u32 ocp_data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -3623,7 +3623,7 @@ static u16 r8153_phy_status(struct r8152 + } + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; + } + +@@ -3655,7 +3655,7 @@ static void r8153b_ups_en(struct r8152 * + int i; + + for (i = 0; i < 500; i++) { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) & + AUTOLOAD_DONE) +@@ -3697,7 +3697,7 @@ static void r8153c_ups_en(struct r8152 * + int i; + + for (i = 0; i < 500; i++) { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) & + AUTOLOAD_DONE) +@@ -4042,8 +4042,8 @@ static int rtl_phy_patch_request(struct + for (i = 0; wait && i < 5000; i++) { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) +- break; ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) ++ return -ENODEV; + + usleep_range(1000, 2000); + ocp_data = ocp_reg_read(tp, OCP_PHY_PATCH_STAT); +@@ -6001,7 +6001,7 @@ static int rtl8156_enable(struct r8152 * + u32 ocp_data; + u16 speed; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + r8156_fc_parameter(tp); +@@ -6059,7 +6059,7 @@ static int rtl8156b_enable(struct r8152 + u32 ocp_data; + u16 speed; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + set_tx_qlen(tp); +@@ -6245,7 +6245,7 @@ out: + + static void rtl8152_up(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8152_aldps_en(tp, false); +@@ -6255,7 +6255,7 @@ static void rtl8152_up(struct r8152 *tp) + + static void rtl8152_down(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -6270,7 +6270,7 @@ static void rtl8153_up(struct r8152 *tp) + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153_u1u2en(tp, false); +@@ -6310,7 +6310,7 @@ static void rtl8153_down(struct r8152 *t + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -6331,7 +6331,7 @@ static void rtl8153b_up(struct r8152 *tp + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -6355,7 +6355,7 @@ static void rtl8153b_down(struct r8152 * + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -6392,7 +6392,7 @@ static void rtl8153c_up(struct r8152 *tp + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -6473,7 +6473,7 @@ static void rtl8156_up(struct r8152 *tp) + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -6546,7 +6546,7 @@ static void rtl8156_down(struct r8152 *t + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -6684,7 +6684,7 @@ static void rtl_work_func_t(struct work_ + /* If the device is unplugged or !netif_running(), the workqueue + * doesn't need to wake the device, and could return directly. + */ +- if (test_bit(RTL8152_UNPLUG, &tp->flags) || !netif_running(tp->netdev)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags) || !netif_running(tp->netdev)) + return; + + if (usb_autopm_get_interface(tp->intf) < 0) +@@ -6723,7 +6723,7 @@ static void rtl_hw_phy_work_func_t(struc + { + struct r8152 *tp = container_of(work, struct r8152, hw_phy_work.work); + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (usb_autopm_get_interface(tp->intf) < 0) +@@ -6850,7 +6850,7 @@ static int rtl8152_close(struct net_devi + netif_stop_queue(netdev); + + res = usb_autopm_get_interface(tp->intf); +- if (res < 0 || test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (res < 0 || test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + rtl_stop_rx(tp); + } else { +@@ -6883,7 +6883,7 @@ static void r8152b_init(struct r8152 *tp + u32 ocp_data; + u16 data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + data = r8152_mdio_read(tp, MII_BMCR); +@@ -6927,7 +6927,7 @@ static void r8153_init(struct r8152 *tp) + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153_u1u2en(tp, false); +@@ -6938,7 +6938,7 @@ static void r8153_init(struct r8152 *tp) + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; + } + +@@ -7067,7 +7067,7 @@ static void r8153b_init(struct r8152 *tp + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -7078,7 +7078,7 @@ static void r8153b_init(struct r8152 *tp + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; + } + +@@ -7149,7 +7149,7 @@ static void r8153c_init(struct r8152 *tp + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -7169,7 +7169,7 @@ static void r8153c_init(struct r8152 *tp + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + } + +@@ -7998,7 +7998,7 @@ static void r8156_init(struct r8152 *tp) + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_ECM_OP); +@@ -8019,7 +8019,7 @@ static void r8156_init(struct r8152 *tp) + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + } + +@@ -8094,7 +8094,7 @@ static void r8156b_init(struct r8152 *tp + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_ECM_OP); +@@ -8128,7 +8128,7 @@ static void r8156b_init(struct r8152 *tp + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + } + +@@ -9153,7 +9153,7 @@ static int rtl8152_ioctl(struct net_devi + struct mii_ioctl_data *data = if_mii(rq); + int res; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + res = usb_autopm_get_interface(tp->intf); +@@ -9255,7 +9255,7 @@ static const struct net_device_ops rtl81 + + static void rtl8152_unload(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (tp->version != RTL_VER_01) +@@ -9264,7 +9264,7 @@ static void rtl8152_unload(struct r8152 + + static void rtl8153_unload(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153_power_cut_en(tp, false); +@@ -9272,7 +9272,7 @@ static void rtl8153_unload(struct r8152 + + static void rtl8153b_unload(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_power_cut_en(tp, false); diff --git a/target/linux/generic/backport-5.15/795-v6.6-13-r8152-Block-future-register-access-if-register-acces.patch b/target/linux/generic/backport-5.15/795-v6.6-13-r8152-Block-future-register-access-if-register-acces.patch new file mode 100644 index 00000000000000..0ce8206657a8e2 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.6-13-r8152-Block-future-register-access-if-register-acces.patch @@ -0,0 +1,398 @@ +From d9962b0d42029bcb40fe3c38bce06d1870fa4df4 Mon Sep 17 00:00:00 2001 +From: Douglas Anderson +Date: Fri, 20 Oct 2023 14:06:59 -0700 +Subject: [PATCH] r8152: Block future register access if register access fails + +Even though the functions to read/write registers can fail, most of +the places in the r8152 driver that read/write register values don't +check error codes. The lack of error code checking is problematic in +at least two ways. + +The first problem is that the r8152 driver often uses code patterns +similar to this: + x = read_register() + x = x | SOME_BIT; + write_register(x); + +...with the above pattern, if the read_register() fails and returns +garbage then we'll end up trying to write modified garbage back to the +Realtek adapter. If the write_register() succeeds that's bad. Note +that as of commit f53a7ad18959 ("r8152: Set memory to all 0xFFs on +failed reg reads") the "garbage" returned by read_register() will at +least be consistent garbage, but it is still garbage. + +It turns out that this problem is very serious. Writing garbage to +some of the hardware registers on the Ethernet adapter can put the +adapter in such a bad state that it needs to be power cycled (fully +unplugged and plugged in again) before it can enumerate again. + +The second problem is that the r8152 driver generally has functions +that are long sequences of register writes. Assuming everything will +be OK if a random register write fails in the middle isn't a great +assumption. + +One might wonder if the above two problems are real. You could ask if +we would really have a successful write after a failed read. It turns +out that the answer appears to be "yes, this can happen". In fact, +we've seen at least two distinct failure modes where this happens. + +On a sc7180-trogdor Chromebook if you drop into kdb for a while and +then resume, you can see: +1. We get a "Tx timeout" +2. The "Tx timeout" queues up a USB reset. +3. In rtl8152_pre_reset() we try to reinit the hardware. +4. The first several (2-9) register accesses fail with a timeout, then + things recover. + +The above test case was actually fixed by the patch ("r8152: Increase +USB control msg timeout to 5000ms as per spec") but at least shows +that we really can see successful calls after failed ones. + +On a different (AMD) based Chromebook with a particular adapter, we +found that during reboot tests we'd also sometimes get a transitory +failure. In this case we saw -EPIPE being returned sometimes. Retrying +worked, but retrying is not always safe for all register accesses +since reading/writing some registers might have side effects (like +registers that clear on read). + +Let's fully lock out all register access if a register access fails. +When we do this, we'll try to queue up a USB reset and try to unlock +register access after the reset. This is slightly tricker than it +sounds since the r8152 driver has an optimized reset sequence that +only works reliably after probe happens. In order to handle this, we +avoid the optimized reset if probe didn't finish. Instead, we simply +retry the probe routine in this case. + +When locking out access, we'll use the existing infrastructure that +the driver was using when it detected we were unplugged. This keeps us +from getting stuck in delay loops in some parts of the driver. + +Signed-off-by: Douglas Anderson +Reviewed-by: Grant Grundler +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 207 ++++++++++++++++++++++++++++++++++------ + 1 file changed, 176 insertions(+), 31 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -772,6 +772,9 @@ enum rtl8152_flags { + SCHEDULE_TASKLET, + GREEN_ETHERNET, + RX_EPROTO, ++ IN_PRE_RESET, ++ PROBED_WITH_NO_ERRORS, ++ PROBE_SHOULD_RETRY, + }; + + #define DEVICE_ID_THINKPAD_ONELINK_PLUS_DOCK 0x3054 +@@ -949,6 +952,8 @@ struct r8152 { + u8 version; + u8 duplex; + u8 autoneg; ++ ++ unsigned int reg_access_reset_count; + }; + + /** +@@ -1196,6 +1201,96 @@ static unsigned int agg_buf_sz = 16384; + + #define RTL_LIMITED_TSO_SIZE (size_to_mtu(agg_buf_sz) - sizeof(struct tx_desc)) + ++/* If register access fails then we block access and issue a reset. If this ++ * happens too many times in a row without a successful access then we stop ++ * trying to reset and just leave access blocked. ++ */ ++#define REGISTER_ACCESS_MAX_RESETS 3 ++ ++static void rtl_set_inaccessible(struct r8152 *tp) ++{ ++ set_bit(RTL8152_INACCESSIBLE, &tp->flags); ++ smp_mb__after_atomic(); ++} ++ ++static void rtl_set_accessible(struct r8152 *tp) ++{ ++ clear_bit(RTL8152_INACCESSIBLE, &tp->flags); ++ smp_mb__after_atomic(); ++} ++ ++static ++int r8152_control_msg(struct r8152 *tp, unsigned int pipe, __u8 request, ++ __u8 requesttype, __u16 value, __u16 index, void *data, ++ __u16 size, const char *msg_tag) ++{ ++ struct usb_device *udev = tp->udev; ++ int ret; ++ ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) ++ return -ENODEV; ++ ++ ret = usb_control_msg(udev, pipe, request, requesttype, ++ value, index, data, size, ++ USB_CTRL_GET_TIMEOUT); ++ ++ /* No need to issue a reset to report an error if the USB device got ++ * unplugged; just return immediately. ++ */ ++ if (ret == -ENODEV) ++ return ret; ++ ++ /* If the write was successful then we're done */ ++ if (ret >= 0) { ++ tp->reg_access_reset_count = 0; ++ return ret; ++ } ++ ++ dev_err(&udev->dev, ++ "Failed to %s %d bytes at %#06x/%#06x (%d)\n", ++ msg_tag, size, value, index, ret); ++ ++ /* Block all future register access until we reset. Much of the code ++ * in the driver doesn't check for errors. Notably, many parts of the ++ * driver do a read/modify/write of a register value without ++ * confirming that the read succeeded. Writing back modified garbage ++ * like this can fully wedge the adapter, requiring a power cycle. ++ */ ++ rtl_set_inaccessible(tp); ++ ++ /* If probe hasn't yet finished, then we'll request a retry of the ++ * whole probe routine if we get any control transfer errors. We ++ * never have to clear this bit since we free/reallocate the whole "tp" ++ * structure if we retry probe. ++ */ ++ if (!test_bit(PROBED_WITH_NO_ERRORS, &tp->flags)) { ++ set_bit(PROBE_SHOULD_RETRY, &tp->flags); ++ return ret; ++ } ++ ++ /* Failing to access registers in pre-reset is not surprising since we ++ * wouldn't be resetting if things were behaving normally. The register ++ * access we do in pre-reset isn't truly mandatory--we're just reusing ++ * the disable() function and trying to be nice by powering the ++ * adapter down before resetting it. Thus, if we're in pre-reset, ++ * we'll return right away and not try to queue up yet another reset. ++ * We know the post-reset is already coming. ++ */ ++ if (test_bit(IN_PRE_RESET, &tp->flags)) ++ return ret; ++ ++ if (tp->reg_access_reset_count < REGISTER_ACCESS_MAX_RESETS) { ++ usb_queue_reset_device(tp->intf); ++ tp->reg_access_reset_count++; ++ } else if (tp->reg_access_reset_count == REGISTER_ACCESS_MAX_RESETS) { ++ dev_err(&udev->dev, ++ "Tried to reset %d times; giving up.\n", ++ REGISTER_ACCESS_MAX_RESETS); ++ } ++ ++ return ret; ++} ++ + static + int get_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data) + { +@@ -1206,9 +1301,10 @@ int get_registers(struct r8152 *tp, u16 + if (!tmp) + return -ENOMEM; + +- ret = usb_control_msg(tp->udev, tp->pipe_ctrl_in, +- RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, +- value, index, tmp, size, USB_CTRL_GET_TIMEOUT); ++ ret = r8152_control_msg(tp, tp->pipe_ctrl_in, ++ RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, ++ value, index, tmp, size, "read"); ++ + if (ret < 0) + memset(data, 0xff, size); + else +@@ -1229,9 +1325,9 @@ int set_registers(struct r8152 *tp, u16 + if (!tmp) + return -ENOMEM; + +- ret = usb_control_msg(tp->udev, tp->pipe_ctrl_out, +- RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE, +- value, index, tmp, size, USB_CTRL_SET_TIMEOUT); ++ ret = r8152_control_msg(tp, tp->pipe_ctrl_out, ++ RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE, ++ value, index, tmp, size, "write"); + + kfree(tmp); + +@@ -1240,10 +1336,8 @@ int set_registers(struct r8152 *tp, u16 + + static void rtl_set_unplug(struct r8152 *tp) + { +- if (tp->udev->state == USB_STATE_NOTATTACHED) { +- set_bit(RTL8152_INACCESSIBLE, &tp->flags); +- smp_mb__after_atomic(); +- } ++ if (tp->udev->state == USB_STATE_NOTATTACHED) ++ rtl_set_inaccessible(tp); + } + + static int generic_ocp_read(struct r8152 *tp, u16 index, u16 size, +@@ -8254,7 +8348,7 @@ static int rtl8152_pre_reset(struct usb_ + struct r8152 *tp = usb_get_intfdata(intf); + struct net_device *netdev; + +- if (!tp) ++ if (!tp || !test_bit(PROBED_WITH_NO_ERRORS, &tp->flags)) + return 0; + + netdev = tp->netdev; +@@ -8269,7 +8363,9 @@ static int rtl8152_pre_reset(struct usb_ + napi_disable(&tp->napi); + if (netif_carrier_ok(netdev)) { + mutex_lock(&tp->control); ++ set_bit(IN_PRE_RESET, &tp->flags); + tp->rtl_ops.disable(tp); ++ clear_bit(IN_PRE_RESET, &tp->flags); + mutex_unlock(&tp->control); + } + +@@ -8282,9 +8378,11 @@ static int rtl8152_post_reset(struct usb + struct net_device *netdev; + struct sockaddr sa; + +- if (!tp) ++ if (!tp || !test_bit(PROBED_WITH_NO_ERRORS, &tp->flags)) + return 0; + ++ rtl_set_accessible(tp); ++ + /* reset the MAC address in case of policy change */ + if (determine_ethernet_addr(tp, &sa) >= 0) { + rtnl_lock(); +@@ -9482,17 +9580,29 @@ static u8 __rtl_get_hw_ver(struct usb_de + __le32 *tmp; + u8 version; + int ret; ++ int i; + + tmp = kmalloc(sizeof(*tmp), GFP_KERNEL); + if (!tmp) + return 0; + +- ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), +- RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, +- PLA_TCR0, MCU_TYPE_PLA, tmp, sizeof(*tmp), +- USB_CTRL_GET_TIMEOUT); +- if (ret > 0) +- ocp_data = (__le32_to_cpu(*tmp) >> 16) & VERSION_MASK; ++ /* Retry up to 3 times in case there is a transitory error. We do this ++ * since retrying a read of the version is always safe and this ++ * function doesn't take advantage of r8152_control_msg(). ++ */ ++ for (i = 0; i < 3; i++) { ++ ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), ++ RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, ++ PLA_TCR0, MCU_TYPE_PLA, tmp, sizeof(*tmp), ++ USB_CTRL_GET_TIMEOUT); ++ if (ret > 0) { ++ ocp_data = (__le32_to_cpu(*tmp) >> 16) & VERSION_MASK; ++ break; ++ } ++ } ++ ++ if (i != 0 && ret > 0) ++ dev_warn(&udev->dev, "Needed %d retries to read version\n", i); + + kfree(tmp); + +@@ -9566,25 +9676,14 @@ u8 rtl8152_get_version(struct usb_interf + } + EXPORT_SYMBOL_GPL(rtl8152_get_version); + +-static int rtl8152_probe(struct usb_interface *intf, +- const struct usb_device_id *id) ++static int rtl8152_probe_once(struct usb_interface *intf, ++ const struct usb_device_id *id, u8 version) + { + struct usb_device *udev = interface_to_usbdev(intf); + struct r8152 *tp; + struct net_device *netdev; +- u8 version; + int ret; + +- if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) +- return -ENODEV; +- +- if (!rtl_check_vendor_ok(intf)) +- return -ENODEV; +- +- version = rtl8152_get_version(intf); +- if (version == RTL_VER_UNKNOWN) +- return -ENODEV; +- + usb_reset_device(udev); + netdev = alloc_etherdev(sizeof(struct r8152)); + if (!netdev) { +@@ -9757,10 +9856,20 @@ static int rtl8152_probe(struct usb_inte + else + device_set_wakeup_enable(&udev->dev, false); + ++ /* If we saw a control transfer error while probing then we may ++ * want to try probe() again. Consider this an error. ++ */ ++ if (test_bit(PROBE_SHOULD_RETRY, &tp->flags)) ++ goto out2; ++ ++ set_bit(PROBED_WITH_NO_ERRORS, &tp->flags); + netif_info(tp, probe, netdev, "%s\n", DRIVER_VERSION); + + return 0; + ++out2: ++ unregister_netdev(netdev); ++ + out1: + tasklet_kill(&tp->tx_tl); + cancel_delayed_work_sync(&tp->hw_phy_work); +@@ -9769,10 +9878,46 @@ out1: + rtl8152_release_firmware(tp); + usb_set_intfdata(intf, NULL); + out: ++ if (test_bit(PROBE_SHOULD_RETRY, &tp->flags)) ++ ret = -EAGAIN; ++ + free_netdev(netdev); + return ret; + } + ++#define RTL8152_PROBE_TRIES 3 ++ ++static int rtl8152_probe(struct usb_interface *intf, ++ const struct usb_device_id *id) ++{ ++ u8 version; ++ int ret; ++ int i; ++ ++ if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) ++ return -ENODEV; ++ ++ if (!rtl_check_vendor_ok(intf)) ++ return -ENODEV; ++ ++ version = rtl8152_get_version(intf); ++ if (version == RTL_VER_UNKNOWN) ++ return -ENODEV; ++ ++ for (i = 0; i < RTL8152_PROBE_TRIES; i++) { ++ ret = rtl8152_probe_once(intf, id, version); ++ if (ret != -EAGAIN) ++ break; ++ } ++ if (ret == -EAGAIN) { ++ dev_err(&intf->dev, ++ "r8152 failed probe after %d tries; giving up\n", i); ++ return -ENODEV; ++ } ++ ++ return ret; ++} ++ + static void rtl8152_disconnect(struct usb_interface *intf) + { + struct r8152 *tp = usb_get_intfdata(intf); diff --git a/target/linux/generic/backport-5.15/795-v6.6-14-r8152-break-the-loop-when-the-budget-is-exhausted.patch b/target/linux/generic/backport-5.15/795-v6.6-14-r8152-break-the-loop-when-the-budget-is-exhausted.patch new file mode 100644 index 00000000000000..42ca9e2ad1c886 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.6-14-r8152-break-the-loop-when-the-budget-is-exhausted.patch @@ -0,0 +1,83 @@ +From 66eee612a1ba39f9a76a9ace4a34d012044767fb Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 26 Sep 2023 19:17:13 +0800 +Subject: [PATCH] r8152: break the loop when the budget is exhausted + +[ Upstream commit 2cf51f931797d9a47e75d999d0993a68cbd2a560 ] + +A bulk transfer of the USB may contain many packets. And, the total +number of the packets in the bulk transfer may be more than budget. + +Originally, only budget packets would be handled by napi_gro_receive(), +and the other packets would be queued in the driver for next schedule. + +This patch would break the loop about getting next bulk transfer, when +the budget is exhausted. That is, only the current bulk transfer would +be handled, and the other bulk transfers would be queued for next +schedule. Besides, the packets which are more than the budget in the +current bulk trasnfer would be still queued in the driver, as the +original method. + +In addition, a bulk transfer wouldn't contain more than 400 packets, so +the check of queue length is unnecessary. Therefore, I replace it with +WARN_ON_ONCE(). + +Fixes: cf74eb5a5bc8 ("eth: r8152: try to use a normal budget") +Signed-off-by: Hayes Wang +Link: https://lore.kernel.org/r/20230926111714.9448-433-nic_swsd@realtek.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/usb/r8152.c | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -2539,7 +2539,7 @@ static int rx_bottom(struct r8152 *tp, i + } + } + +- if (list_empty(&tp->rx_done)) ++ if (list_empty(&tp->rx_done) || work_done >= budget) + goto out1; + + clear_bit(RX_EPROTO, &tp->flags); +@@ -2555,6 +2555,15 @@ static int rx_bottom(struct r8152 *tp, i + struct urb *urb; + u8 *rx_data; + ++ /* A bulk transfer of USB may contain may packets, so the ++ * total packets may more than the budget. Deal with all ++ * packets in current bulk transfer, and stop to handle the ++ * next bulk transfer until next schedule, if budget is ++ * exhausted. ++ */ ++ if (work_done >= budget) ++ break; ++ + list_del_init(cursor); + + agg = list_entry(cursor, struct rx_agg, list); +@@ -2574,9 +2583,7 @@ static int rx_bottom(struct r8152 *tp, i + unsigned int pkt_len, rx_frag_head_sz; + struct sk_buff *skb; + +- /* limit the skb numbers for rx_queue */ +- if (unlikely(skb_queue_len(&tp->rx_queue) >= 1000)) +- break; ++ WARN_ON_ONCE(skb_queue_len(&tp->rx_queue) >= 1000); + + pkt_len = le32_to_cpu(rx_desc->opts1) & RX_LEN_MASK; + if (pkt_len < ETH_ZLEN) +@@ -2654,9 +2661,10 @@ submit: + } + } + ++ /* Splice the remained list back to rx_done for next schedule */ + if (!list_empty(&rx_queue)) { + spin_lock_irqsave(&tp->rx_lock, flags); +- list_splice_tail(&rx_queue, &tp->rx_done); ++ list_splice(&rx_queue, &tp->rx_done); + spin_unlock_irqrestore(&tp->rx_lock, flags); + } + diff --git a/target/linux/generic/backport-5.15/795-v6.6-15-net-usb-cdc_ether-add-u-blox-0x1313-composition.patch b/target/linux/generic/backport-5.15/795-v6.6-15-net-usb-cdc_ether-add-u-blox-0x1313-composition.patch new file mode 100644 index 00000000000000..d578d0107fddc4 --- /dev/null +++ b/target/linux/generic/backport-5.15/795-v6.6-15-net-usb-cdc_ether-add-u-blox-0x1313-composition.patch @@ -0,0 +1,47 @@ +From 1b0fce8c8e69485e49a7d34aac3d4c2a2aa15d62 Mon Sep 17 00:00:00 2001 +From: Davide Tronchin +Date: Thu, 29 Jun 2023 12:37:36 +0200 +Subject: [PATCH] net: usb: cdc_ether: add u-blox 0x1313 composition. + +Add CDC-ECM support for LARA-R6 01B. + +The new LARA-R6 product variant identified by the "01B" string can be +configured (by AT interface) in three different USB modes: +* Default mode (Vendor ID: 0x1546 Product ID: 0x1311) with 4 serial +interfaces +* RmNet mode (Vendor ID: 0x1546 Product ID: 0x1312) with 4 serial +interfaces and 1 RmNet virtual network interface +* CDC-ECM mode (Vendor ID: 0x1546 Product ID: 0x1313) with 4 serial +interface and 1 CDC-ECM virtual network interface +The first 4 interfaces of all the 3 configurations (default, RmNet, ECM) +are the same. + +In CDC-ECM mode LARA-R6 01B exposes the following interfaces: +If 0: Diagnostic +If 1: AT parser +If 2: AT parser +If 3: AT parset/alternative functions +If 4: CDC-ECM interface + +Signed-off-by: Davide Tronchin +Reviewed-by: Simon Horman +Signed-off-by: David S. Miller +--- + drivers/net/usb/cdc_ether.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/net/usb/cdc_ether.c ++++ b/drivers/net/usb/cdc_ether.c +@@ -878,6 +878,12 @@ static const struct usb_device_id produc + USB_CDC_PROTO_NONE), + .driver_info = (unsigned long)&wwan_info, + }, { ++ /* U-blox LARA-R6 01B */ ++ USB_DEVICE_AND_INTERFACE_INFO(UBLOX_VENDOR_ID, 0x1313, USB_CLASS_COMM, ++ USB_CDC_SUBCLASS_ETHERNET, ++ USB_CDC_PROTO_NONE), ++ .driver_info = (unsigned long)&wwan_info, ++}, { + /* ZTE modules */ + USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, USB_CLASS_COMM, + USB_CDC_SUBCLASS_ETHERNET, diff --git a/target/linux/generic/backport-5.15/820-v6.7-0001-nvmem-qfprom-Mark-core-clk-as-optional.patch b/target/linux/generic/backport-5.15/820-v6.7-0001-nvmem-qfprom-Mark-core-clk-as-optional.patch new file mode 100644 index 00000000000000..66d402814057c4 --- /dev/null +++ b/target/linux/generic/backport-5.15/820-v6.7-0001-nvmem-qfprom-Mark-core-clk-as-optional.patch @@ -0,0 +1,37 @@ +From 16724d6ea40a2c9315f5a0d81005dfa4d7a6da24 Mon Sep 17 00:00:00 2001 +From: Luca Weiss +Date: Fri, 20 Oct 2023 11:55:40 +0100 +Subject: [PATCH] nvmem: qfprom: Mark core clk as optional + +On some platforms like sc7280 on non-ChromeOS devices the core clock +cannot be touched by Linux so we cannot provide it. Mark it as optional +as accessing qfprom for reading works without it but we still prohibit +writing if we cannot provide the clock. + +Signed-off-by: Luca Weiss +Reviewed-by: Douglas Anderson +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20231020105545.216052-2-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/qfprom.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/nvmem/qfprom.c ++++ b/drivers/nvmem/qfprom.c +@@ -423,12 +423,12 @@ static int qfprom_probe(struct platform_ + if (IS_ERR(priv->vcc)) + return PTR_ERR(priv->vcc); + +- priv->secclk = devm_clk_get(dev, "core"); ++ priv->secclk = devm_clk_get_optional(dev, "core"); + if (IS_ERR(priv->secclk)) + return dev_err_probe(dev, PTR_ERR(priv->secclk), "Error getting clock\n"); + +- /* Only enable writing if we have SoC data. */ +- if (priv->soc_data) ++ /* Only enable writing if we have SoC data and a valid clock */ ++ if (priv->soc_data && priv->secclk) + econfig.reg_write = qfprom_reg_write; + } + diff --git a/target/linux/generic/backport-5.15/820-v6.7-0002-nvmem-add-explicit-config-option-to-read-old-syntax-.patch b/target/linux/generic/backport-5.15/820-v6.7-0002-nvmem-add-explicit-config-option-to-read-old-syntax-.patch new file mode 100644 index 00000000000000..d207ea4872811c --- /dev/null +++ b/target/linux/generic/backport-5.15/820-v6.7-0002-nvmem-add-explicit-config-option-to-read-old-syntax-.patch @@ -0,0 +1,330 @@ +From 2cc3b37f5b6df8189d55d0e812d9658ce256dfec Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 20 Oct 2023 11:55:41 +0100 +Subject: [PATCH] nvmem: add explicit config option to read old syntax fixed OF + cells +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Binding for fixed NVMEM cells defined directly as NVMEM device subnodes +has been deprecated. It has been replaced by the "fixed-layout" NVMEM +layout binding. + +New syntax is meant to be clearer and should help avoiding imprecise +bindings. + +NVMEM subsystem already supports the new binding. It should be a good +idea to limit support for old syntax to existing drivers that actually +support & use it (we can't break backward compatibility!). That way we +additionally encourage new bindings & drivers to ignore deprecated +binding. + +It wasn't clear (to me) if rtc and w1 code actually uses old syntax +fixed cells. I enabled them to don't risk any breakage. + +Signed-off-by: Rafał Miłecki +[for meson-{efuse,mx-efuse}.c] +Acked-by: Martin Blumenstingl +[for mtk-efuse.c, nvmem/core.c, nvmem-provider.h] +Reviewed-by: AngeloGioacchino Del Regno +[MT8192, MT8195 Chromebooks] +Tested-by: AngeloGioacchino Del Regno +[for microchip-otpc.c] +Reviewed-by: Claudiu Beznea +[SAMA7G5-EK] +Tested-by: Claudiu Beznea +Acked-by: Jernej Skrabec +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20231020105545.216052-3-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mtd/mtdcore.c | 2 ++ + drivers/nvmem/apple-efuses.c | 1 + + drivers/nvmem/core.c | 8 +++++--- + drivers/nvmem/imx-ocotp-scu.c | 1 + + drivers/nvmem/imx-ocotp.c | 1 + + drivers/nvmem/meson-efuse.c | 1 + + drivers/nvmem/meson-mx-efuse.c | 1 + + drivers/nvmem/microchip-otpc.c | 1 + + drivers/nvmem/mtk-efuse.c | 1 + + drivers/nvmem/qcom-spmi-sdam.c | 1 + + drivers/nvmem/qfprom.c | 1 + + drivers/nvmem/rave-sp-eeprom.c | 1 + + drivers/nvmem/rockchip-efuse.c | 1 + + drivers/nvmem/sc27xx-efuse.c | 1 + + drivers/nvmem/sec-qfprom.c | 1 + + drivers/nvmem/sprd-efuse.c | 1 + + drivers/nvmem/stm32-romem.c | 1 + + drivers/nvmem/sunplus-ocotp.c | 1 + + drivers/nvmem/sunxi_sid.c | 1 + + drivers/nvmem/uniphier-efuse.c | 1 + + drivers/nvmem/zynqmp_nvmem.c | 1 + + drivers/rtc/nvmem.c | 1 + + drivers/w1/slaves/w1_ds250x.c | 1 + + include/linux/nvmem-provider.h | 2 ++ + 24 files changed, 30 insertions(+), 3 deletions(-) + +--- a/drivers/mtd/mtdcore.c ++++ b/drivers/mtd/mtdcore.c +@@ -541,6 +541,7 @@ static int mtd_nvmem_add(struct mtd_info + config.dev = &mtd->dev; + config.name = dev_name(&mtd->dev); + config.owner = THIS_MODULE; ++ config.add_legacy_fixed_of_cells = of_device_is_compatible(node, "nvmem-cells"); + config.reg_read = mtd_nvmem_reg_read; + config.size = mtd->size; + config.word_size = 1; +@@ -898,6 +899,7 @@ static struct nvmem_device *mtd_otp_nvme + config.name = compatible; + config.id = NVMEM_DEVID_AUTO; + config.owner = THIS_MODULE; ++ config.add_legacy_fixed_of_cells = true; + config.type = NVMEM_TYPE_OTP; + config.root_only = true; + config.ignore_wp = true; +--- a/drivers/nvmem/apple-efuses.c ++++ b/drivers/nvmem/apple-efuses.c +@@ -36,6 +36,7 @@ static int apple_efuses_probe(struct pla + struct resource *res; + struct nvmem_config config = { + .dev = &pdev->dev, ++ .add_legacy_fixed_of_cells = true, + .read_only = true, + .reg_read = apple_efuses_read, + .stride = sizeof(u32), +--- a/drivers/nvmem/core.c ++++ b/drivers/nvmem/core.c +@@ -998,9 +998,11 @@ struct nvmem_device *nvmem_register(cons + if (rval) + goto err_remove_cells; + +- rval = nvmem_add_cells_from_legacy_of(nvmem); +- if (rval) +- goto err_remove_cells; ++ if (config->add_legacy_fixed_of_cells) { ++ rval = nvmem_add_cells_from_legacy_of(nvmem); ++ if (rval) ++ goto err_remove_cells; ++ } + + rval = nvmem_add_cells_from_fixed_layout(nvmem); + if (rval) +--- a/drivers/nvmem/imx-ocotp-scu.c ++++ b/drivers/nvmem/imx-ocotp-scu.c +@@ -220,6 +220,7 @@ static int imx_scu_ocotp_write(void *con + + static struct nvmem_config imx_scu_ocotp_nvmem_config = { + .name = "imx-scu-ocotp", ++ .add_legacy_fixed_of_cells = true, + .read_only = false, + .word_size = 4, + .stride = 1, +--- a/drivers/nvmem/imx-ocotp.c ++++ b/drivers/nvmem/imx-ocotp.c +@@ -616,6 +616,7 @@ static int imx_ocotp_probe(struct platfo + return PTR_ERR(priv->clk); + + priv->params = of_device_get_match_data(&pdev->dev); ++ imx_ocotp_nvmem_config.add_legacy_fixed_of_cells = true; + imx_ocotp_nvmem_config.size = 4 * priv->params->nregs; + imx_ocotp_nvmem_config.dev = dev; + imx_ocotp_nvmem_config.priv = priv; +--- a/drivers/nvmem/meson-efuse.c ++++ b/drivers/nvmem/meson-efuse.c +@@ -93,6 +93,7 @@ static int meson_efuse_probe(struct plat + + econfig->dev = dev; + econfig->name = dev_name(dev); ++ econfig->add_legacy_fixed_of_cells = true; + econfig->stride = 1; + econfig->word_size = 1; + econfig->reg_read = meson_efuse_read; +--- a/drivers/nvmem/meson-mx-efuse.c ++++ b/drivers/nvmem/meson-mx-efuse.c +@@ -211,6 +211,7 @@ static int meson_mx_efuse_probe(struct p + efuse->config.owner = THIS_MODULE; + efuse->config.dev = &pdev->dev; + efuse->config.priv = efuse; ++ efuse->config.add_legacy_fixed_of_cells = true; + efuse->config.stride = drvdata->word_size; + efuse->config.word_size = drvdata->word_size; + efuse->config.size = SZ_512; +--- a/drivers/nvmem/microchip-otpc.c ++++ b/drivers/nvmem/microchip-otpc.c +@@ -261,6 +261,7 @@ static int mchp_otpc_probe(struct platfo + return ret; + + mchp_nvmem_config.dev = otpc->dev; ++ mchp_nvmem_config.add_legacy_fixed_of_cells = true; + mchp_nvmem_config.size = size; + mchp_nvmem_config.priv = otpc; + nvmem = devm_nvmem_register(&pdev->dev, &mchp_nvmem_config); +--- a/drivers/nvmem/mtk-efuse.c ++++ b/drivers/nvmem/mtk-efuse.c +@@ -83,6 +83,7 @@ static int mtk_efuse_probe(struct platfo + return PTR_ERR(priv->base); + + pdata = device_get_match_data(dev); ++ econfig.add_legacy_fixed_of_cells = true; + econfig.stride = 1; + econfig.word_size = 1; + econfig.reg_read = mtk_reg_read; +--- a/drivers/nvmem/qcom-spmi-sdam.c ++++ b/drivers/nvmem/qcom-spmi-sdam.c +@@ -142,6 +142,7 @@ static int sdam_probe(struct platform_de + sdam->sdam_config.name = "spmi_sdam"; + sdam->sdam_config.id = NVMEM_DEVID_AUTO; + sdam->sdam_config.owner = THIS_MODULE; ++ sdam->sdam_config.add_legacy_fixed_of_cells = true; + sdam->sdam_config.stride = 1; + sdam->sdam_config.word_size = 1; + sdam->sdam_config.reg_read = sdam_read; +--- a/drivers/nvmem/qfprom.c ++++ b/drivers/nvmem/qfprom.c +@@ -357,6 +357,7 @@ static int qfprom_probe(struct platform_ + { + struct nvmem_config econfig = { + .name = "qfprom", ++ .add_legacy_fixed_of_cells = true, + .stride = 1, + .word_size = 1, + .id = NVMEM_DEVID_AUTO, +--- a/drivers/nvmem/rave-sp-eeprom.c ++++ b/drivers/nvmem/rave-sp-eeprom.c +@@ -328,6 +328,7 @@ static int rave_sp_eeprom_probe(struct p + of_property_read_string(np, "zii,eeprom-name", &config.name); + config.priv = eeprom; + config.dev = dev; ++ config.add_legacy_fixed_of_cells = true; + config.size = size; + config.reg_read = rave_sp_eeprom_reg_read; + config.reg_write = rave_sp_eeprom_reg_write; +--- a/drivers/nvmem/rockchip-efuse.c ++++ b/drivers/nvmem/rockchip-efuse.c +@@ -205,6 +205,7 @@ static int rockchip_rk3399_efuse_read(vo + + static struct nvmem_config econfig = { + .name = "rockchip-efuse", ++ .add_legacy_fixed_of_cells = true, + .stride = 1, + .word_size = 1, + .read_only = true, +--- a/drivers/nvmem/sc27xx-efuse.c ++++ b/drivers/nvmem/sc27xx-efuse.c +@@ -248,6 +248,7 @@ static int sc27xx_efuse_probe(struct pla + econfig.reg_read = sc27xx_efuse_read; + econfig.priv = efuse; + econfig.dev = &pdev->dev; ++ econfig.add_legacy_fixed_of_cells = true; + nvmem = devm_nvmem_register(&pdev->dev, &econfig); + if (IS_ERR(nvmem)) { + dev_err(&pdev->dev, "failed to register nvmem config\n"); +--- a/drivers/nvmem/sec-qfprom.c ++++ b/drivers/nvmem/sec-qfprom.c +@@ -47,6 +47,7 @@ static int sec_qfprom_probe(struct platf + { + struct nvmem_config econfig = { + .name = "sec-qfprom", ++ .add_legacy_fixed_of_cells = true, + .stride = 1, + .word_size = 1, + .id = NVMEM_DEVID_AUTO, +--- a/drivers/nvmem/sprd-efuse.c ++++ b/drivers/nvmem/sprd-efuse.c +@@ -408,6 +408,7 @@ static int sprd_efuse_probe(struct platf + econfig.read_only = false; + econfig.name = "sprd-efuse"; + econfig.size = efuse->data->blk_nums * SPRD_EFUSE_BLOCK_WIDTH; ++ econfig.add_legacy_fixed_of_cells = true; + econfig.reg_read = sprd_efuse_read; + econfig.reg_write = sprd_efuse_write; + econfig.priv = efuse; +--- a/drivers/nvmem/stm32-romem.c ++++ b/drivers/nvmem/stm32-romem.c +@@ -207,6 +207,7 @@ static int stm32_romem_probe(struct plat + priv->cfg.priv = priv; + priv->cfg.owner = THIS_MODULE; + priv->cfg.type = NVMEM_TYPE_OTP; ++ priv->cfg.add_legacy_fixed_of_cells = true; + + priv->lower = 0; + +--- a/drivers/nvmem/sunplus-ocotp.c ++++ b/drivers/nvmem/sunplus-ocotp.c +@@ -145,6 +145,7 @@ disable_clk: + + static struct nvmem_config sp_ocotp_nvmem_config = { + .name = "sp-ocotp", ++ .add_legacy_fixed_of_cells = true, + .read_only = true, + .word_size = 1, + .size = QAC628_OTP_SIZE, +--- a/drivers/nvmem/sunxi_sid.c ++++ b/drivers/nvmem/sunxi_sid.c +@@ -154,6 +154,7 @@ static int sunxi_sid_probe(struct platfo + nvmem_cfg->dev = dev; + nvmem_cfg->name = "sunxi-sid"; + nvmem_cfg->type = NVMEM_TYPE_OTP; ++ nvmem_cfg->add_legacy_fixed_of_cells = true; + nvmem_cfg->read_only = true; + nvmem_cfg->size = cfg->size; + nvmem_cfg->word_size = 1; +--- a/drivers/nvmem/uniphier-efuse.c ++++ b/drivers/nvmem/uniphier-efuse.c +@@ -52,6 +52,7 @@ static int uniphier_efuse_probe(struct p + econfig.size = resource_size(res); + econfig.priv = priv; + econfig.dev = dev; ++ econfig.add_legacy_fixed_of_cells = true; + nvmem = devm_nvmem_register(dev, &econfig); + + return PTR_ERR_OR_ZERO(nvmem); +--- a/drivers/nvmem/zynqmp_nvmem.c ++++ b/drivers/nvmem/zynqmp_nvmem.c +@@ -58,6 +58,7 @@ static int zynqmp_nvmem_probe(struct pla + + priv->dev = dev; + econfig.dev = dev; ++ econfig.add_legacy_fixed_of_cells = true; + econfig.reg_read = zynqmp_nvmem_read; + econfig.priv = priv; + +--- a/drivers/rtc/nvmem.c ++++ b/drivers/rtc/nvmem.c +@@ -21,6 +21,7 @@ int devm_rtc_nvmem_register(struct rtc_d + + nvmem_config->dev = dev; + nvmem_config->owner = rtc->owner; ++ nvmem_config->add_legacy_fixed_of_cells = true; + nvmem = devm_nvmem_register(dev, nvmem_config); + if (IS_ERR(nvmem)) + dev_err(dev, "failed to register nvmem device for RTC\n"); +--- a/drivers/w1/slaves/w1_ds250x.c ++++ b/drivers/w1/slaves/w1_ds250x.c +@@ -168,6 +168,7 @@ static int w1_eprom_add_slave(struct w1_ + struct nvmem_device *nvmem; + struct nvmem_config nvmem_cfg = { + .dev = &sl->dev, ++ .add_legacy_fixed_of_cells = true, + .reg_read = w1_nvmem_read, + .type = NVMEM_TYPE_OTP, + .read_only = true, +--- a/include/linux/nvmem-provider.h ++++ b/include/linux/nvmem-provider.h +@@ -82,6 +82,7 @@ struct nvmem_cell_info { + * @owner: Pointer to exporter module. Used for refcounting. + * @cells: Optional array of pre-defined NVMEM cells. + * @ncells: Number of elements in cells. ++ * @add_legacy_fixed_of_cells: Read fixed NVMEM cells from old OF syntax. + * @keepout: Optional array of keepout ranges (sorted ascending by start). + * @nkeepout: Number of elements in the keepout array. + * @type: Type of the nvmem storage +@@ -112,6 +113,7 @@ struct nvmem_config { + struct module *owner; + const struct nvmem_cell_info *cells; + int ncells; ++ bool add_legacy_fixed_of_cells; + const struct nvmem_keepout *keepout; + unsigned int nkeepout; + enum nvmem_type type; diff --git a/target/linux/generic/backport-5.15/820-v6.7-0003-nvmem-Use-device_get_match_data.patch b/target/linux/generic/backport-5.15/820-v6.7-0003-nvmem-Use-device_get_match_data.patch new file mode 100644 index 00000000000000..84c0293982459f --- /dev/null +++ b/target/linux/generic/backport-5.15/820-v6.7-0003-nvmem-Use-device_get_match_data.patch @@ -0,0 +1,77 @@ +From 0720219f4d34a88a9badb4de70cfad7585687d48 Mon Sep 17 00:00:00 2001 +From: Rob Herring +Date: Fri, 20 Oct 2023 11:55:45 +0100 +Subject: [PATCH] nvmem: Use device_get_match_data() + +Use preferred device_get_match_data() instead of of_match_device() to +get the driver match data. With this, adjust the includes to explicitly +include the correct headers. + +Signed-off-by: Rob Herring +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20231020105545.216052-7-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/mxs-ocotp.c | 10 ++++------ + drivers/nvmem/stm32-romem.c | 7 ++++--- + 2 files changed, 8 insertions(+), 9 deletions(-) + +--- a/drivers/nvmem/mxs-ocotp.c ++++ b/drivers/nvmem/mxs-ocotp.c +@@ -13,8 +13,9 @@ + #include + #include + #include +-#include ++#include + #include ++#include + #include + #include + +@@ -140,11 +141,10 @@ static int mxs_ocotp_probe(struct platfo + struct device *dev = &pdev->dev; + const struct mxs_data *data; + struct mxs_ocotp *otp; +- const struct of_device_id *match; + int ret; + +- match = of_match_device(dev->driver->of_match_table, dev); +- if (!match || !match->data) ++ data = device_get_match_data(dev); ++ if (!data) + return -EINVAL; + + otp = devm_kzalloc(dev, sizeof(*otp), GFP_KERNEL); +@@ -169,8 +169,6 @@ static int mxs_ocotp_probe(struct platfo + if (ret) + return ret; + +- data = match->data; +- + ocotp_config.size = data->size; + ocotp_config.priv = otp; + ocotp_config.dev = dev; +--- a/drivers/nvmem/stm32-romem.c ++++ b/drivers/nvmem/stm32-romem.c +@@ -10,7 +10,9 @@ + #include + #include + #include +-#include ++#include ++#include ++#include + #include + + #include "stm32-bsec-optee-ta.h" +@@ -211,8 +213,7 @@ static int stm32_romem_probe(struct plat + + priv->lower = 0; + +- cfg = (const struct stm32_romem_cfg *) +- of_match_device(dev->driver->of_match_table, dev)->data; ++ cfg = device_get_match_data(dev); + if (!cfg) { + priv->cfg.read_only = true; + priv->cfg.size = resource_size(res); diff --git a/target/linux/generic/backport-5.15/820-v6.7-0004-Revert-nvmem-add-new-config-option.patch b/target/linux/generic/backport-5.15/820-v6.7-0004-Revert-nvmem-add-new-config-option.patch new file mode 100644 index 00000000000000..b23a23ef3affc0 --- /dev/null +++ b/target/linux/generic/backport-5.15/820-v6.7-0004-Revert-nvmem-add-new-config-option.patch @@ -0,0 +1,77 @@ +From f4cf4e5db331a5ce69e3f0b21d322cac0f4e4b5d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 23 Oct 2023 12:27:59 +0200 +Subject: [PATCH] Revert "nvmem: add new config option" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This reverts commit 517f14d9cf3533d5ab4fded195ab6f80a92e378f. + +Config option "no_of_node" is no longer needed since adding a more +explicit and targeted option "add_legacy_fixed_of_cells". + +That "no_of_node" config option was needed *earlier* to help mtd's case. + +DT nodes of MTD partitions (that are also NVMEM devices) may contain +subnodes. Those SHOULD NOT be treated as NVMEM fixed cells. + +To prevent NVMEM core code from parsing subnodes a "no_of_node" option +was added (and set to true in mtd) to make for_each_child_of_node() in +NVMEM a no-op. That was a bit hacky because it was messing with +"of_node" pointer to achieve some side-effect. + +With the introduction of "add_legacy_fixed_of_cells" config option +things got more explicit. MTD subsystem simply tells NVMEM when to look +for fixed cells and there is no need to hack "of_node" pointer anymore. + +Signed-off-by: Rafał Miłecki +Reviewed-by: Miquel Raynal +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20231023102759.31529-1-zajec5@gmail.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mtd/mtdcore.c | 1 - + drivers/nvmem/core.c | 2 +- + include/linux/nvmem-provider.h | 2 -- + 3 files changed, 1 insertion(+), 4 deletions(-) + +--- a/drivers/mtd/mtdcore.c ++++ b/drivers/mtd/mtdcore.c +@@ -549,7 +549,6 @@ static int mtd_nvmem_add(struct mtd_info + config.read_only = true; + config.root_only = true; + config.ignore_wp = true; +- config.no_of_node = !of_device_is_compatible(node, "nvmem-cells"); + config.priv = mtd; + + mtd->nvmem = nvmem_register(&config); +--- a/drivers/nvmem/core.c ++++ b/drivers/nvmem/core.c +@@ -936,7 +936,7 @@ struct nvmem_device *nvmem_register(cons + nvmem->nkeepout = config->nkeepout; + if (config->of_node) + nvmem->dev.of_node = config->of_node; +- else if (!config->no_of_node) ++ else + nvmem->dev.of_node = config->dev->of_node; + + switch (config->id) { +--- a/include/linux/nvmem-provider.h ++++ b/include/linux/nvmem-provider.h +@@ -89,7 +89,6 @@ struct nvmem_cell_info { + * @read_only: Device is read-only. + * @root_only: Device is accessibly to root only. + * @of_node: If given, this will be used instead of the parent's of_node. +- * @no_of_node: Device should not use the parent's of_node even if it's !NULL. + * @reg_read: Callback to read data. + * @reg_write: Callback to write data. + * @size: Device size. +@@ -122,7 +121,6 @@ struct nvmem_config { + bool ignore_wp; + struct nvmem_layout *layout; + struct device_node *of_node; +- bool no_of_node; + nvmem_reg_read_t reg_read; + nvmem_reg_write_t reg_write; + int size; diff --git a/target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch b/target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch index b23f9a4b9e2205..725af4b52cf179 100644 --- a/target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch +++ b/target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch @@ -17,7 +17,7 @@ Signed-off-by: Marcel Holtmann --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c -@@ -2275,6 +2275,23 @@ struct btmtk_section_map { +@@ -2287,6 +2287,23 @@ struct btmtk_section_map { }; } __packed; @@ -41,7 +41,7 @@ Signed-off-by: Marcel Holtmann static void btusb_mtk_wmt_recv(struct urb *urb) { struct hci_dev *hdev = urb->context; -@@ -3926,6 +3943,7 @@ static int btusb_probe(struct usb_interf +@@ -3941,6 +3958,7 @@ static int btusb_probe(struct usb_interf hdev->shutdown = btusb_mtk_shutdown; hdev->manufacturer = 70; hdev->cmd_timeout = btusb_mtk_cmd_timeout; diff --git a/target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch b/target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch index 6fe61a9defecd6..d72866eabf1490 100644 --- a/target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch +++ b/target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch @@ -18,7 +18,7 @@ Signed-off-by: Marcel Holtmann --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c -@@ -2280,7 +2280,7 @@ static int btusb_set_bdaddr_mtk(struct h +@@ -2292,7 +2292,7 @@ static int btusb_set_bdaddr_mtk(struct h struct sk_buff *skb; long ret; diff --git a/target/linux/generic/backport-5.15/823-v5.18-Bluetooth-btusb-Add-a-new-PID-VID-13d3-3567-for-MT79.patch b/target/linux/generic/backport-5.15/823-v5.18-Bluetooth-btusb-Add-a-new-PID-VID-13d3-3567-for-MT79.patch index d670195da1f2fa..ebb6cc471768e5 100644 --- a/target/linux/generic/backport-5.15/823-v5.18-Bluetooth-btusb-Add-a-new-PID-VID-13d3-3567-for-MT79.patch +++ b/target/linux/generic/backport-5.15/823-v5.18-Bluetooth-btusb-Add-a-new-PID-VID-13d3-3567-for-MT79.patch @@ -58,7 +58,7 @@ Signed-off-by: Marcel Holtmann --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c -@@ -464,6 +464,9 @@ static const struct usb_device_id blackl +@@ -476,6 +476,9 @@ static const struct usb_device_id blackl { USB_DEVICE(0x13d3, 0x3564), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH | BTUSB_VALID_LE_STATES }, diff --git a/target/linux/generic/backport-5.15/824-v5.19-Bluetooth-btusb-Add-a-new-PID-VID-0489-e0c8-for-MT79.patch b/target/linux/generic/backport-5.15/824-v5.19-Bluetooth-btusb-Add-a-new-PID-VID-0489-e0c8-for-MT79.patch index be9dc734215194..a8c7ca003a9cd8 100644 --- a/target/linux/generic/backport-5.15/824-v5.19-Bluetooth-btusb-Add-a-new-PID-VID-0489-e0c8-for-MT79.patch +++ b/target/linux/generic/backport-5.15/824-v5.19-Bluetooth-btusb-Add-a-new-PID-VID-0489-e0c8-for-MT79.patch @@ -56,7 +56,7 @@ Signed-off-by: Marcel Holtmann --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c -@@ -455,6 +455,9 @@ static const struct usb_device_id blackl +@@ -467,6 +467,9 @@ static const struct usb_device_id blackl BTUSB_VALID_LE_STATES }, /* Additional MediaTek MT7921 Bluetooth devices */ diff --git a/target/linux/generic/backport-5.15/825-v6.1-Bluetooth-btusb-Add-a-new-VID-PID-0e8d-0608-for-MT79.patch b/target/linux/generic/backport-5.15/825-v6.1-Bluetooth-btusb-Add-a-new-VID-PID-0e8d-0608-for-MT79.patch index 24ec68a2ca50b8..b46e6926d1452e 100644 --- a/target/linux/generic/backport-5.15/825-v6.1-Bluetooth-btusb-Add-a-new-VID-PID-0e8d-0608-for-MT79.patch +++ b/target/linux/generic/backport-5.15/825-v6.1-Bluetooth-btusb-Add-a-new-VID-PID-0e8d-0608-for-MT79.patch @@ -54,7 +54,7 @@ Signed-off-by: Luiz Augusto von Dentz --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c -@@ -473,6 +473,9 @@ static const struct usb_device_id blackl +@@ -485,6 +485,9 @@ static const struct usb_device_id blackl { USB_DEVICE(0x0489, 0xe0cd), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH | BTUSB_VALID_LE_STATES }, diff --git a/target/linux/generic/backport-5.15/830-v6.0-leds-turris-omnia-convert-to-use-dev_groups.patch b/target/linux/generic/backport-5.15/830-v6.0-leds-turris-omnia-convert-to-use-dev_groups.patch new file mode 100644 index 00000000000000..99ebe064388c3d --- /dev/null +++ b/target/linux/generic/backport-5.15/830-v6.0-leds-turris-omnia-convert-to-use-dev_groups.patch @@ -0,0 +1,45 @@ +From a01633cd867b8ddf2d8321fe575dc3c54e037b09 Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Fri, 29 Jul 2022 16:03:46 +0200 +Subject: leds: turris-omnia: convert to use dev_groups +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The driver core supports the ability to handle the creation and removal +of device-specific sysfs files in a race-free manner. Take advantage of +that by converting this driver to use this by moving the sysfs +attributes into a group and assigning the dev_groups pointer to it. + +Cc: Pavel Machek +Cc: linux-leds@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Reviewed-by: Marek Behún +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Pavel Machek +--- + drivers/leds/leds-turris-omnia.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +(limited to 'drivers/leds/leds-turris-omnia.c') + +--- a/drivers/leds/leds-turris-omnia.c ++++ b/drivers/leds/leds-turris-omnia.c +@@ -260,9 +260,6 @@ static int omnia_leds_probe(struct i2c_c + led += ret; + } + +- if (devm_device_add_groups(dev, omnia_led_controller_groups)) +- dev_warn(dev, "Could not add attribute group!\n"); +- + return 0; + } + +@@ -304,6 +301,7 @@ static struct i2c_driver omnia_leds_driv + .driver = { + .name = "leds-turris-omnia", + .of_match_table = of_omnia_leds_match, ++ .dev_groups = omnia_led_controller_groups, + }, + }; + diff --git a/target/linux/generic/backport-5.15/830-v6.6-1-leds-turris-omnia-Use-sysfs_emit-instead-of-sprintf.patch b/target/linux/generic/backport-5.15/830-v6.6-1-leds-turris-omnia-Use-sysfs_emit-instead-of-sprintf.patch new file mode 100644 index 00000000000000..835a5e884702b9 --- /dev/null +++ b/target/linux/generic/backport-5.15/830-v6.6-1-leds-turris-omnia-Use-sysfs_emit-instead-of-sprintf.patch @@ -0,0 +1,31 @@ +From 72a29725b6f2577fa447ca9059cdcd17100043b4 Mon Sep 17 00:00:00 2001 +From: Marek Behún +Date: Wed, 2 Aug 2023 18:07:45 +0200 +Subject: leds: turris-omnia: Use sysfs_emit() instead of sprintf() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use the dedicated sysfs_emit() function instead of sprintf() in sysfs +attribute accessor brightness_show(). + +Signed-off-by: Marek Behún +Link: https://lore.kernel.org/r/20230802160748.11208-4-kabel@kernel.org +Signed-off-by: Lee Jones +--- + drivers/leds/leds-turris-omnia.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +(limited to 'drivers/leds/leds-turris-omnia.c') + +--- a/drivers/leds/leds-turris-omnia.c ++++ b/drivers/leds/leds-turris-omnia.c +@@ -194,7 +194,7 @@ static ssize_t brightness_show(struct de + if (ret < 0) + return ret; + +- return sprintf(buf, "%d\n", ret); ++ return sysfs_emit(buf, "%d\n", ret); + } + + static ssize_t brightness_store(struct device *dev, struct device_attribute *a, diff --git a/target/linux/generic/backport-5.15/830-v6.7-2-leds-turris-omnia-Make-set_brightness-more-efficient.patch b/target/linux/generic/backport-5.15/830-v6.7-2-leds-turris-omnia-Make-set_brightness-more-efficient.patch new file mode 100644 index 00000000000000..3f7dd64841ab71 --- /dev/null +++ b/target/linux/generic/backport-5.15/830-v6.7-2-leds-turris-omnia-Make-set_brightness-more-efficient.patch @@ -0,0 +1,207 @@ +From 4d5ed2621c2437d40b8fe92bd0fd34b0b1870753 Mon Sep 17 00:00:00 2001 +From: Marek Behún +Date: Mon, 18 Sep 2023 18:11:02 +0200 +Subject: leds: turris-omnia: Make set_brightness() more efficient +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Implement caching of the LED color and state values that are sent to MCU +in order to make the set_brightness() operation more efficient by +avoiding I2C transactions which are not needed. + +On Turris Omnia's MCU, which acts as the RGB LED controller, each LED +has a RGB color, and a ON/OFF state, which are configurable via I2C +commands CMD_LED_COLOR and CMD_LED_STATE. + +The CMD_LED_COLOR command sends 5 bytes and the CMD_LED_STATE command 2 +bytes over the I2C bus, which operates at 100 kHz. With I2C overhead +this allows ~1670 color changing commands and ~3200 state changing +commands per second (or around 1000 color + state changes per second). +This may seem more than enough, but the issue is that the I2C bus is +shared with another peripheral, the MCU. The MCU exposes an interrupt +interface, and it can trigger hundreds of interrupts per second. Each +time, we need to read the interrupt state register over this I2C bus. +Whenever we are sending a LED color/state changing command, the +interrupt reading is waiting. + +Currently, every time LED brightness or LED multi intensity is changed, +we send a CMD_LED_STATE command, and if the computed color (brightness +adjusted multi_intensity) is non-zero, we also send a CMD_LED_COLOR +command. + +Consider for example the situation when we have a netdev trigger enabled +for a LED. The netdev trigger does not change the LED color, only the +brightness (either to 0 or to currently configured brightness), and so +there is no need to send the CMD_LED_COLOR command. But each change of +brightness to 0 sends one CMD_LED_STATE command, and each change of +brightness to max_brightness sends one CMD_LED_STATE command and one +CMD_LED_COLOR command: + set_brightness(0) -> CMD_LED_STATE + set_brightness(255) -> CMD_LED_STATE + CMD_LED_COLOR + (unnecessary) + +We can avoid the unnecessary I2C transactions if we cache the values of +state and color that are sent to the controller. If the color does not +change from the one previously sent, there is no need to do the +CMD_LED_COLOR I2C transaction, and if the state does not change, there +is no need to do the CMD_LED_STATE transaction. + +Because we need to make sure that our cached values are consistent with +the controller state, add explicit setting of the LED color to white at +probe time (this is the default setting when MCU resets, but does not +necessarily need to be the case, for example if U-Boot played with the +LED colors). + +Signed-off-by: Marek Behún +Link: https://lore.kernel.org/r/20230918161104.20860-3-kabel@kernel.org +Signed-off-by: Lee Jones +--- + drivers/leds/leds-turris-omnia.c | 96 ++++++++++++++++++++++++++++++++-------- + 1 file changed, 78 insertions(+), 18 deletions(-) + +--- a/drivers/leds/leds-turris-omnia.c ++++ b/drivers/leds/leds-turris-omnia.c +@@ -30,6 +30,8 @@ + struct omnia_led { + struct led_classdev_mc mc_cdev; + struct mc_subled subled_info[OMNIA_LED_NUM_CHANNELS]; ++ u8 cached_channels[OMNIA_LED_NUM_CHANNELS]; ++ bool on; + int reg; + }; + +@@ -72,36 +74,82 @@ static int omnia_cmd_read_u8(const struc + return -EIO; + } + ++static int omnia_led_send_color_cmd(const struct i2c_client *client, ++ struct omnia_led *led) ++{ ++ char cmd[5]; ++ int ret; ++ ++ cmd[0] = CMD_LED_COLOR; ++ cmd[1] = led->reg; ++ cmd[2] = led->subled_info[0].brightness; ++ cmd[3] = led->subled_info[1].brightness; ++ cmd[4] = led->subled_info[2].brightness; ++ ++ /* Send the color change command */ ++ ret = i2c_master_send(client, cmd, 5); ++ if (ret < 0) ++ return ret; ++ ++ /* Cache the RGB channel brightnesses */ ++ for (int i = 0; i < OMNIA_LED_NUM_CHANNELS; ++i) ++ led->cached_channels[i] = led->subled_info[i].brightness; ++ ++ return 0; ++} ++ ++/* Determine if the computed RGB channels are different from the cached ones */ ++static bool omnia_led_channels_changed(struct omnia_led *led) ++{ ++ for (int i = 0; i < OMNIA_LED_NUM_CHANNELS; ++i) ++ if (led->subled_info[i].brightness != led->cached_channels[i]) ++ return true; ++ ++ return false; ++} ++ + static int omnia_led_brightness_set_blocking(struct led_classdev *cdev, + enum led_brightness brightness) + { + struct led_classdev_mc *mc_cdev = lcdev_to_mccdev(cdev); + struct omnia_leds *leds = dev_get_drvdata(cdev->dev->parent); + struct omnia_led *led = to_omnia_led(mc_cdev); +- u8 buf[5], state; +- int ret; ++ int err = 0; + + mutex_lock(&leds->lock); + +- led_mc_calc_color_components(&led->mc_cdev, brightness); ++ /* ++ * Only recalculate RGB brightnesses from intensities if brightness is ++ * non-zero. Otherwise we won't be using them and we can save ourselves ++ * some software divisions (Omnia's CPU does not implement the division ++ * instruction). ++ */ ++ if (brightness) { ++ led_mc_calc_color_components(mc_cdev, brightness); ++ ++ /* ++ * Send color command only if brightness is non-zero and the RGB ++ * channel brightnesses changed. ++ */ ++ if (omnia_led_channels_changed(led)) ++ err = omnia_led_send_color_cmd(leds->client, led); ++ } + +- buf[0] = CMD_LED_COLOR; +- buf[1] = led->reg; +- buf[2] = mc_cdev->subled_info[0].brightness; +- buf[3] = mc_cdev->subled_info[1].brightness; +- buf[4] = mc_cdev->subled_info[2].brightness; +- +- state = CMD_LED_STATE_LED(led->reg); +- if (buf[2] || buf[3] || buf[4]) +- state |= CMD_LED_STATE_ON; +- +- ret = omnia_cmd_write_u8(leds->client, CMD_LED_STATE, state); +- if (ret >= 0 && (state & CMD_LED_STATE_ON)) +- ret = i2c_master_send(leds->client, buf, 5); ++ /* Send on/off state change only if (bool)brightness changed */ ++ if (!err && !brightness != !led->on) { ++ u8 state = CMD_LED_STATE_LED(led->reg); ++ ++ if (brightness) ++ state |= CMD_LED_STATE_ON; ++ ++ err = omnia_cmd_write_u8(leds->client, CMD_LED_STATE, state); ++ if (!err) ++ led->on = !!brightness; ++ } + + mutex_unlock(&leds->lock); + +- return ret; ++ return err; + } + + static int omnia_led_register(struct i2c_client *client, struct omnia_led *led, +@@ -129,11 +177,15 @@ static int omnia_led_register(struct i2c + } + + led->subled_info[0].color_index = LED_COLOR_ID_RED; +- led->subled_info[0].channel = 0; + led->subled_info[1].color_index = LED_COLOR_ID_GREEN; +- led->subled_info[1].channel = 1; + led->subled_info[2].color_index = LED_COLOR_ID_BLUE; +- led->subled_info[2].channel = 2; ++ ++ /* Initial color is white */ ++ for (int i = 0; i < OMNIA_LED_NUM_CHANNELS; ++i) { ++ led->subled_info[i].intensity = 255; ++ led->subled_info[i].brightness = 255; ++ led->subled_info[i].channel = i; ++ } + + led->mc_cdev.subled_info = led->subled_info; + led->mc_cdev.num_colors = OMNIA_LED_NUM_CHANNELS; +@@ -162,6 +214,14 @@ static int omnia_led_register(struct i2c + return ret; + } + ++ /* Set initial color and cache it */ ++ ret = omnia_led_send_color_cmd(client, led); ++ if (ret < 0) { ++ dev_err(dev, "Cannot set LED %pOF initial color: %i\n", np, ++ ret); ++ return ret; ++ } ++ + ret = devm_led_classdev_multicolor_register_ext(dev, &led->mc_cdev, + &init_data); + if (ret < 0) { diff --git a/target/linux/generic/backport-5.15/830-v6.7-3-leds-turris-omnia-Support-HW-controlled-mode-via-pri.patch b/target/linux/generic/backport-5.15/830-v6.7-3-leds-turris-omnia-Support-HW-controlled-mode-via-pri.patch new file mode 100644 index 00000000000000..dd2b310d66feb0 --- /dev/null +++ b/target/linux/generic/backport-5.15/830-v6.7-3-leds-turris-omnia-Support-HW-controlled-mode-via-pri.patch @@ -0,0 +1,201 @@ +From aaf38273cf766d88296f4aa3f2e4e3c0d399a4a2 Mon Sep 17 00:00:00 2001 +From: Marek Behún +Date: Mon, 18 Sep 2023 18:11:03 +0200 +Subject: leds: turris-omnia: Support HW controlled mode via private trigger +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add support for enabling MCU controlled mode of the Turris Omnia LEDs +via a LED private trigger called "omnia-mcu". Recall that private LED +triggers will only be listed in the sysfs trigger file for LEDs that +support them (currently there is no user of this mechanism). + +When in MCU controlled mode, the user can still set LED color, but the +blinking is done by MCU, which does different things for different LEDs: +- WAN LED is blinked according to the LED[0] pin of the WAN PHY +- LAN LEDs are blinked according to the LED[0] output of the + corresponding port of the LAN switch +- PCIe LEDs are blinked according to the logical OR of the MiniPCIe port + LED pins + +In the future I want to make the netdev trigger to transparently offload +the blinking to the HW if user sets compatible settings for the netdev +trigger (for LEDs associated with network devices). +There was some work on this already, and hopefully we will be able to +complete it sometime, but for now there are still multiple blockers for +this, and even if there weren't, we still would not be able to configure +HW controlled mode for the LEDs associated with MiniPCIe ports. + +In the meantime let's support HW controlled mode via the private LED +trigger mechanism. If, in the future, we manage to complete the netdev +trigger offloading, we can still keep this private trigger for backwards +compatibility, if needed. + +We also set "omnia-mcu" to cdev->default_trigger, so that the MCU keeps +control until the user first wants to take over it. If a different +default trigger is specified in device-tree via the +'linux,default-trigger' property, LED class will overwrite +cdev->default_trigger, and so the DT property will be respected. + +Signed-off-by: Marek Behún +Link: https://lore.kernel.org/r/20230918161104.20860-4-kabel@kernel.org +Signed-off-by: Lee Jones +--- + drivers/leds/Kconfig | 1 + + drivers/leds/leds-turris-omnia.c | 98 ++++++++++++++++++++++++++++++++++++---- + 2 files changed, 91 insertions(+), 8 deletions(-) + +--- a/drivers/leds/Kconfig ++++ b/drivers/leds/Kconfig +@@ -163,6 +163,7 @@ config LEDS_TURRIS_OMNIA + depends on I2C + depends on MACH_ARMADA_38X || COMPILE_TEST + depends on OF ++ select LEDS_TRIGGERS + help + This option enables basic support for the LEDs found on the front + side of CZ.NIC's Turris Omnia router. There are 12 RGB LEDs on the +--- a/drivers/leds/leds-turris-omnia.c ++++ b/drivers/leds/leds-turris-omnia.c +@@ -31,7 +31,7 @@ struct omnia_led { + struct led_classdev_mc mc_cdev; + struct mc_subled subled_info[OMNIA_LED_NUM_CHANNELS]; + u8 cached_channels[OMNIA_LED_NUM_CHANNELS]; +- bool on; ++ bool on, hwtrig; + int reg; + }; + +@@ -120,12 +120,14 @@ static int omnia_led_brightness_set_bloc + + /* + * Only recalculate RGB brightnesses from intensities if brightness is +- * non-zero. Otherwise we won't be using them and we can save ourselves +- * some software divisions (Omnia's CPU does not implement the division +- * instruction). ++ * non-zero (if it is zero and the LED is in HW blinking mode, we use ++ * max_brightness as brightness). Otherwise we won't be using them and ++ * we can save ourselves some software divisions (Omnia's CPU does not ++ * implement the division instruction). + */ +- if (brightness) { +- led_mc_calc_color_components(mc_cdev, brightness); ++ if (brightness || led->hwtrig) { ++ led_mc_calc_color_components(mc_cdev, brightness ?: ++ cdev->max_brightness); + + /* + * Send color command only if brightness is non-zero and the RGB +@@ -135,8 +137,11 @@ static int omnia_led_brightness_set_bloc + err = omnia_led_send_color_cmd(leds->client, led); + } + +- /* Send on/off state change only if (bool)brightness changed */ +- if (!err && !brightness != !led->on) { ++ /* ++ * Send on/off state change only if (bool)brightness changed and the LED ++ * is not being blinked by HW. ++ */ ++ if (!err && !led->hwtrig && !brightness != !led->on) { + u8 state = CMD_LED_STATE_LED(led->reg); + + if (brightness) +@@ -152,6 +157,71 @@ static int omnia_led_brightness_set_bloc + return err; + } + ++static struct led_hw_trigger_type omnia_hw_trigger_type; ++ ++static int omnia_hwtrig_activate(struct led_classdev *cdev) ++{ ++ struct led_classdev_mc *mc_cdev = lcdev_to_mccdev(cdev); ++ struct omnia_leds *leds = dev_get_drvdata(cdev->dev->parent); ++ struct omnia_led *led = to_omnia_led(mc_cdev); ++ int err = 0; ++ ++ mutex_lock(&leds->lock); ++ ++ if (!led->on) { ++ /* ++ * If the LED is off (brightness was set to 0), the last ++ * configured color was not necessarily sent to the MCU. ++ * Recompute with max_brightness and send if needed. ++ */ ++ led_mc_calc_color_components(mc_cdev, cdev->max_brightness); ++ ++ if (omnia_led_channels_changed(led)) ++ err = omnia_led_send_color_cmd(leds->client, led); ++ } ++ ++ if (!err) { ++ /* Put the LED into MCU controlled mode */ ++ err = omnia_cmd_write_u8(leds->client, CMD_LED_MODE, ++ CMD_LED_MODE_LED(led->reg)); ++ if (!err) ++ led->hwtrig = true; ++ } ++ ++ mutex_unlock(&leds->lock); ++ ++ return err; ++} ++ ++static void omnia_hwtrig_deactivate(struct led_classdev *cdev) ++{ ++ struct omnia_leds *leds = dev_get_drvdata(cdev->dev->parent); ++ struct omnia_led *led = to_omnia_led(lcdev_to_mccdev(cdev)); ++ int err; ++ ++ mutex_lock(&leds->lock); ++ ++ led->hwtrig = false; ++ ++ /* Put the LED into software mode */ ++ err = omnia_cmd_write_u8(leds->client, CMD_LED_MODE, ++ CMD_LED_MODE_LED(led->reg) | ++ CMD_LED_MODE_USER); ++ ++ mutex_unlock(&leds->lock); ++ ++ if (err < 0) ++ dev_err(cdev->dev, "Cannot put LED to software mode: %i\n", ++ err); ++} ++ ++static struct led_trigger omnia_hw_trigger = { ++ .name = "omnia-mcu", ++ .activate = omnia_hwtrig_activate, ++ .deactivate = omnia_hwtrig_deactivate, ++ .trigger_type = &omnia_hw_trigger_type, ++}; ++ + static int omnia_led_register(struct i2c_client *client, struct omnia_led *led, + struct device_node *np) + { +@@ -195,6 +265,12 @@ static int omnia_led_register(struct i2c + cdev = &led->mc_cdev.led_cdev; + cdev->max_brightness = 255; + cdev->brightness_set_blocking = omnia_led_brightness_set_blocking; ++ cdev->trigger_type = &omnia_hw_trigger_type; ++ /* ++ * Use the omnia-mcu trigger as the default trigger. It may be rewritten ++ * by LED class from the linux,default-trigger property. ++ */ ++ cdev->default_trigger = omnia_hw_trigger.name; + + /* put the LED into software mode */ + ret = omnia_cmd_write_u8(client, CMD_LED_MODE, +@@ -309,6 +385,12 @@ static int omnia_leds_probe(struct i2c_c + + mutex_init(&leds->lock); + ++ ret = devm_led_trigger_register(dev, &omnia_hw_trigger); ++ if (ret < 0) { ++ dev_err(dev, "Cannot register private LED trigger: %d\n", ret); ++ return ret; ++ } ++ + led = &leds->leds[0]; + for_each_available_child_of_node(np, child) { + ret = omnia_led_register(client, led, child); diff --git a/target/linux/generic/backport-5.15/830-v6.7-4-leds-turris-omnia-Add-support-for-enabling-disabling.patch b/target/linux/generic/backport-5.15/830-v6.7-4-leds-turris-omnia-Add-support-for-enabling-disabling.patch new file mode 100644 index 00000000000000..3bda4a9cef7c5f --- /dev/null +++ b/target/linux/generic/backport-5.15/830-v6.7-4-leds-turris-omnia-Add-support-for-enabling-disabling.patch @@ -0,0 +1,244 @@ +From 00125699bb35ef58fffa8425e32a44a7af82cd28 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Mon, 18 Sep 2023 18:11:04 +0200 +Subject: [PATCH 07/17] leds: turris-omnia: Add support for enabling/disabling + HW gamma correction +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If the MCU on Turris Omnia is running newer firmware versions, the LED +controller supports RGB gamma correction (and enables it by default for +newer boards). + +Determine whether the gamma correction setting feature is supported and +add the ability to set it via sysfs attribute file. + +Signed-off-by: Marek Behún +Link: https://lore.kernel.org/r/20230918161104.20860-5-kabel@kernel.org +Signed-off-by: Lee Jones +--- + .../sysfs-class-led-driver-turris-omnia | 14 ++ + drivers/leds/leds-turris-omnia.c | 137 +++++++++++++++--- + 2 files changed, 134 insertions(+), 17 deletions(-) + +--- a/Documentation/ABI/testing/sysfs-class-led-driver-turris-omnia ++++ b/Documentation/ABI/testing/sysfs-class-led-driver-turris-omnia +@@ -12,3 +12,17 @@ Description: (RW) On the front panel of + able to change this setting from software. + + Format: %i ++ ++What: /sys/class/leds//device/gamma_correction ++Date: August 2023 ++KernelVersion: 6.6 ++Contact: Marek Behún ++Description: (RW) Newer versions of the microcontroller firmware of the ++ Turris Omnia router support gamma correction for the RGB LEDs. ++ This feature can be enabled/disabled by writing to this file. ++ ++ If the feature is not supported because the MCU firmware is too ++ old, the file always reads as 0, and writing to the file results ++ in the EOPNOTSUPP error. ++ ++ Format: %i +--- a/drivers/leds/leds-turris-omnia.c ++++ b/drivers/leds/leds-turris-omnia.c +@@ -15,17 +15,30 @@ + #define OMNIA_BOARD_LEDS 12 + #define OMNIA_LED_NUM_CHANNELS 3 + +-#define CMD_LED_MODE 3 +-#define CMD_LED_MODE_LED(l) ((l) & 0x0f) +-#define CMD_LED_MODE_USER 0x10 +- +-#define CMD_LED_STATE 4 +-#define CMD_LED_STATE_LED(l) ((l) & 0x0f) +-#define CMD_LED_STATE_ON 0x10 +- +-#define CMD_LED_COLOR 5 +-#define CMD_LED_SET_BRIGHTNESS 7 +-#define CMD_LED_GET_BRIGHTNESS 8 ++/* MCU controller commands at I2C address 0x2a */ ++#define OMNIA_MCU_I2C_ADDR 0x2a ++ ++#define CMD_GET_STATUS_WORD 0x01 ++#define STS_FEATURES_SUPPORTED BIT(2) ++ ++#define CMD_GET_FEATURES 0x10 ++#define FEAT_LED_GAMMA_CORRECTION BIT(5) ++ ++/* LED controller commands at I2C address 0x2b */ ++#define CMD_LED_MODE 0x03 ++#define CMD_LED_MODE_LED(l) ((l) & 0x0f) ++#define CMD_LED_MODE_USER 0x10 ++ ++#define CMD_LED_STATE 0x04 ++#define CMD_LED_STATE_LED(l) ((l) & 0x0f) ++#define CMD_LED_STATE_ON 0x10 ++ ++#define CMD_LED_COLOR 0x05 ++#define CMD_LED_SET_BRIGHTNESS 0x07 ++#define CMD_LED_GET_BRIGHTNESS 0x08 ++ ++#define CMD_SET_GAMMA_CORRECTION 0x30 ++#define CMD_GET_GAMMA_CORRECTION 0x31 + + struct omnia_led { + struct led_classdev_mc mc_cdev; +@@ -40,6 +53,7 @@ struct omnia_led { + struct omnia_leds { + struct i2c_client *client; + struct mutex lock; ++ bool has_gamma_correction; + struct omnia_led leds[]; + }; + +@@ -50,30 +64,42 @@ static int omnia_cmd_write_u8(const stru + return i2c_master_send(client, buf, sizeof(buf)); + } + +-static int omnia_cmd_read_u8(const struct i2c_client *client, u8 cmd) ++static int omnia_cmd_read_raw(struct i2c_adapter *adapter, u8 addr, u8 cmd, ++ void *reply, size_t len) + { + struct i2c_msg msgs[2]; +- u8 reply; + int ret; + +- msgs[0].addr = client->addr; ++ msgs[0].addr = addr; + msgs[0].flags = 0; + msgs[0].len = 1; + msgs[0].buf = &cmd; +- msgs[1].addr = client->addr; ++ msgs[1].addr = addr; + msgs[1].flags = I2C_M_RD; +- msgs[1].len = 1; +- msgs[1].buf = &reply; ++ msgs[1].len = len; ++ msgs[1].buf = reply; + +- ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); ++ ret = i2c_transfer(adapter, msgs, ARRAY_SIZE(msgs)); + if (likely(ret == ARRAY_SIZE(msgs))) +- return reply; ++ return len; + else if (ret < 0) + return ret; + else + return -EIO; + } + ++static int omnia_cmd_read_u8(const struct i2c_client *client, u8 cmd) ++{ ++ u8 reply; ++ int ret; ++ ++ ret = omnia_cmd_read_raw(client->adapter, client->addr, cmd, &reply, 1); ++ if (ret < 0) ++ return ret; ++ ++ return reply; ++} ++ + static int omnia_led_send_color_cmd(const struct i2c_client *client, + struct omnia_led *led) + { +@@ -352,12 +378,74 @@ static ssize_t brightness_store(struct d + } + static DEVICE_ATTR_RW(brightness); + ++static ssize_t gamma_correction_show(struct device *dev, ++ struct device_attribute *a, char *buf) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct omnia_leds *leds = i2c_get_clientdata(client); ++ int ret; ++ ++ if (leds->has_gamma_correction) { ++ ret = omnia_cmd_read_u8(client, CMD_GET_GAMMA_CORRECTION); ++ if (ret < 0) ++ return ret; ++ } else { ++ ret = 0; ++ } ++ ++ return sysfs_emit(buf, "%d\n", !!ret); ++} ++ ++static ssize_t gamma_correction_store(struct device *dev, ++ struct device_attribute *a, ++ const char *buf, size_t count) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct omnia_leds *leds = i2c_get_clientdata(client); ++ bool val; ++ int ret; ++ ++ if (!leds->has_gamma_correction) ++ return -EOPNOTSUPP; ++ ++ if (kstrtobool(buf, &val) < 0) ++ return -EINVAL; ++ ++ ret = omnia_cmd_write_u8(client, CMD_SET_GAMMA_CORRECTION, val); ++ ++ return ret < 0 ? ret : count; ++} ++static DEVICE_ATTR_RW(gamma_correction); ++ + static struct attribute *omnia_led_controller_attrs[] = { + &dev_attr_brightness.attr, ++ &dev_attr_gamma_correction.attr, + NULL, + }; + ATTRIBUTE_GROUPS(omnia_led_controller); + ++static int omnia_mcu_get_features(const struct i2c_client *client) ++{ ++ u16 reply; ++ int err; ++ ++ err = omnia_cmd_read_raw(client->adapter, OMNIA_MCU_I2C_ADDR, ++ CMD_GET_STATUS_WORD, &reply, sizeof(reply)); ++ if (err < 0) ++ return err; ++ ++ /* Check whether MCU firmware supports the CMD_GET_FEAUTRES command */ ++ if (!(le16_to_cpu(reply) & STS_FEATURES_SUPPORTED)) ++ return 0; ++ ++ err = omnia_cmd_read_raw(client->adapter, OMNIA_MCU_I2C_ADDR, ++ CMD_GET_FEATURES, &reply, sizeof(reply)); ++ if (err < 0) ++ return err; ++ ++ return le16_to_cpu(reply); ++} ++ + static int omnia_leds_probe(struct i2c_client *client, + const struct i2c_device_id *id) + { +@@ -383,6 +471,21 @@ static int omnia_leds_probe(struct i2c_c + leds->client = client; + i2c_set_clientdata(client, leds); + ++ ret = omnia_mcu_get_features(client); ++ if (ret < 0) { ++ dev_err(dev, "Cannot determine MCU supported features: %d\n", ++ ret); ++ return ret; ++ } ++ ++ leds->has_gamma_correction = ret & FEAT_LED_GAMMA_CORRECTION; ++ if (!leds->has_gamma_correction) { ++ dev_info(dev, ++ "Your board's MCU firmware does not support the LED gamma correction feature.\n"); ++ dev_info(dev, ++ "Consider upgrading MCU firmware with the omnia-mcutool utility.\n"); ++ } ++ + mutex_init(&leds->lock); + + ret = devm_led_trigger_register(dev, &omnia_hw_trigger); diff --git a/target/linux/generic/backport-5.15/830-v6.7-5-leds-turris-omnia-Fix-brightness-setting-and-trigger.patch b/target/linux/generic/backport-5.15/830-v6.7-5-leds-turris-omnia-Fix-brightness-setting-and-trigger.patch new file mode 100644 index 00000000000000..ec6171ec67afb6 --- /dev/null +++ b/target/linux/generic/backport-5.15/830-v6.7-5-leds-turris-omnia-Fix-brightness-setting-and-trigger.patch @@ -0,0 +1,167 @@ +From 33f339b70f020273ea40fb3c5d7b65697446bd6c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Mon, 16 Oct 2023 15:28:06 +0200 +Subject: [PATCH 08/17] leds: turris-omnia: Fix brightness setting and trigger + activating +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +I have improperly refactored commits + 4d5ed2621c24 ("leds: turris-omnia: Make set_brightness() more efficient") +and + aaf38273cf76 ("leds: turris-omnia: Support HW controlled mode via private trigger") +after Lee requested a change in API semantics of the new functions I +introduced in commit + 28350bc0ac77 ("leds: turris-omnia: Do not use SMBUS calls"). + +Before the change, the function omnia_cmd_write_u8() returned 0 on +success, and afterwards it returned a positive value (number of bytes +written). The latter version was applied, but the following commits did +not properly account for this change. + +This results in non-functional LED's .brightness_set_blocking() and +trigger's .activate() methods. + +The main reasoning behind the semantics change was that read/write +methods should return the number of read/written bytes on success. +It was pointed to me [1] that this is not always true (for example the +regmap API does not do so), and since the driver never uses this number +of read/written bytes information, I decided to fix this issue by +changing the functions to the original semantics (return 0 on success). + +[1] https://lore.kernel.org/linux-gpio/ZQnn+Gi0xVlsGCYA@smile.fi.intel.com/ + +Fixes: 28350bc0ac77 ("leds: turris-omnia: Do not use SMBUS calls") +Signed-off-by: Marek Behún +--- + drivers/leds/leds-turris-omnia.c | 37 +++++++++++++++++--------------- + 1 file changed, 20 insertions(+), 17 deletions(-) + +--- a/drivers/leds/leds-turris-omnia.c ++++ b/drivers/leds/leds-turris-omnia.c +@@ -60,8 +60,11 @@ struct omnia_leds { + static int omnia_cmd_write_u8(const struct i2c_client *client, u8 cmd, u8 val) + { + u8 buf[2] = { cmd, val }; ++ int ret; ++ ++ ret = i2c_master_send(client, buf, sizeof(buf)); + +- return i2c_master_send(client, buf, sizeof(buf)); ++ return ret < 0 ? ret : 0; + } + + static int omnia_cmd_read_raw(struct i2c_adapter *adapter, u8 addr, u8 cmd, +@@ -81,7 +84,7 @@ static int omnia_cmd_read_raw(struct i2c + + ret = i2c_transfer(adapter, msgs, ARRAY_SIZE(msgs)); + if (likely(ret == ARRAY_SIZE(msgs))) +- return len; ++ return 0; + else if (ret < 0) + return ret; + else +@@ -91,11 +94,11 @@ static int omnia_cmd_read_raw(struct i2c + static int omnia_cmd_read_u8(const struct i2c_client *client, u8 cmd) + { + u8 reply; +- int ret; ++ int err; + +- ret = omnia_cmd_read_raw(client->adapter, client->addr, cmd, &reply, 1); +- if (ret < 0) +- return ret; ++ err = omnia_cmd_read_raw(client->adapter, client->addr, cmd, &reply, 1); ++ if (err) ++ return err; + + return reply; + } +@@ -236,7 +239,7 @@ static void omnia_hwtrig_deactivate(stru + + mutex_unlock(&leds->lock); + +- if (err < 0) ++ if (err) + dev_err(cdev->dev, "Cannot put LED to software mode: %i\n", + err); + } +@@ -302,7 +305,7 @@ static int omnia_led_register(struct i2c + ret = omnia_cmd_write_u8(client, CMD_LED_MODE, + CMD_LED_MODE_LED(led->reg) | + CMD_LED_MODE_USER); +- if (ret < 0) { ++ if (ret) { + dev_err(dev, "Cannot set LED %pOF to software mode: %i\n", np, + ret); + return ret; +@@ -311,7 +314,7 @@ static int omnia_led_register(struct i2c + /* disable the LED */ + ret = omnia_cmd_write_u8(client, CMD_LED_STATE, + CMD_LED_STATE_LED(led->reg)); +- if (ret < 0) { ++ if (ret) { + dev_err(dev, "Cannot set LED %pOF brightness: %i\n", np, ret); + return ret; + } +@@ -364,7 +367,7 @@ static ssize_t brightness_store(struct d + { + struct i2c_client *client = to_i2c_client(dev); + unsigned long brightness; +- int ret; ++ int err; + + if (kstrtoul(buf, 10, &brightness)) + return -EINVAL; +@@ -372,9 +375,9 @@ static ssize_t brightness_store(struct d + if (brightness > 100) + return -EINVAL; + +- ret = omnia_cmd_write_u8(client, CMD_LED_SET_BRIGHTNESS, brightness); ++ err = omnia_cmd_write_u8(client, CMD_LED_SET_BRIGHTNESS, brightness); + +- return ret < 0 ? ret : count; ++ return err ?: count; + } + static DEVICE_ATTR_RW(brightness); + +@@ -403,7 +406,7 @@ static ssize_t gamma_correction_store(st + struct i2c_client *client = to_i2c_client(dev); + struct omnia_leds *leds = i2c_get_clientdata(client); + bool val; +- int ret; ++ int err; + + if (!leds->has_gamma_correction) + return -EOPNOTSUPP; +@@ -411,9 +414,9 @@ static ssize_t gamma_correction_store(st + if (kstrtobool(buf, &val) < 0) + return -EINVAL; + +- ret = omnia_cmd_write_u8(client, CMD_SET_GAMMA_CORRECTION, val); ++ err = omnia_cmd_write_u8(client, CMD_SET_GAMMA_CORRECTION, val); + +- return ret < 0 ? ret : count; ++ return err ?: count; + } + static DEVICE_ATTR_RW(gamma_correction); + +@@ -431,7 +434,7 @@ static int omnia_mcu_get_features(const + + err = omnia_cmd_read_raw(client->adapter, OMNIA_MCU_I2C_ADDR, + CMD_GET_STATUS_WORD, &reply, sizeof(reply)); +- if (err < 0) ++ if (err) + return err; + + /* Check whether MCU firmware supports the CMD_GET_FEAUTRES command */ +@@ -440,7 +443,7 @@ static int omnia_mcu_get_features(const + + err = omnia_cmd_read_raw(client->adapter, OMNIA_MCU_I2C_ADDR, + CMD_GET_FEATURES, &reply, sizeof(reply)); +- if (err < 0) ++ if (err) + return err; + + return le16_to_cpu(reply); diff --git a/target/linux/generic/backport-5.15/831-v6.1-dt-bindings-leds-Expand-LED_COLOR_ID-definitions.patch b/target/linux/generic/backport-5.15/831-v6.1-dt-bindings-leds-Expand-LED_COLOR_ID-definitions.patch new file mode 100644 index 00000000000000..c2a938c614f7fe --- /dev/null +++ b/target/linux/generic/backport-5.15/831-v6.1-dt-bindings-leds-Expand-LED_COLOR_ID-definitions.patch @@ -0,0 +1,47 @@ +From 472d7b9e8141729ec1e3fe6821b88563f6379533 Mon Sep 17 00:00:00 2001 +From: Olliver Schinagl +Date: Tue, 30 Aug 2022 15:46:13 +0200 +Subject: [PATCH] dt-bindings: leds: Expand LED_COLOR_ID definitions + +In commit 853a78a7d6c7 (dt-bindings: leds: Add LED_COLOR_ID definitions, +Sun Jun 9 20:19:04 2019 +0200) the most basic color definitions where +added. However, there's a little more very common LED colors. + +While the documentation states 'add what is missing', engineers tend to +be lazy and will just use what currently exists. So this patch will take +(a) list from online retailers [0], [1], [2] and use the common LED colors from +there, this being reasonable as this is what is currently available to purchase. + +Note, that LIME seems to be the modern take to 'Yellow-green' or +'Yellowish-green' from some older datasheets. + +[0]: https://www.digikey.com/en/products/filter/led-lighting-color/125 +[1]: https://eu.mouser.com/c/optoelectronics/led-lighting/led-emitters/standard-leds-smd +[2]: https://nl.farnell.com/en-NL/c/optoelectronics-displays/led-products/standard-single-colour-leds-under-75ma + +Signed-off-by: Olliver Schinagl +Acked-by: Krzysztof Kozlowski +Acked-by: Alexander Dahl +Acked-by: Jacek Anaszewski +Link: https://lore.kernel.org/r/20220830134613.1564059-1-oliver@schinagl.nl +Signed-off-by: Rob Herring +--- + include/dt-bindings/leds/common.h | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/include/dt-bindings/leds/common.h ++++ b/include/dt-bindings/leds/common.h +@@ -33,7 +33,12 @@ + #define LED_COLOR_ID_MULTI 8 /* For multicolor LEDs */ + #define LED_COLOR_ID_RGB 9 /* For multicolor LEDs that can do arbitrary color, + so this would include RGBW and similar */ +-#define LED_COLOR_ID_MAX 10 ++#define LED_COLOR_ID_PURPLE 10 ++#define LED_COLOR_ID_ORANGE 11 ++#define LED_COLOR_ID_PINK 12 ++#define LED_COLOR_ID_CYAN 13 ++#define LED_COLOR_ID_LIME 14 ++#define LED_COLOR_ID_MAX 15 + + /* Standard LED functions */ + /* Keyboard LEDs, usually it would be input4::capslock etc. */ diff --git a/target/linux/generic/backport-5.15/833-v6.8-leds-core-Add-more-colors-from-DT-bindings-to-led_co.patch.patch b/target/linux/generic/backport-5.15/833-v6.8-leds-core-Add-more-colors-from-DT-bindings-to-led_co.patch.patch new file mode 100644 index 00000000000000..b71df6fa5726da --- /dev/null +++ b/target/linux/generic/backport-5.15/833-v6.8-leds-core-Add-more-colors-from-DT-bindings-to-led_co.patch.patch @@ -0,0 +1,29 @@ +From a067943129b4ec6b835e02cfd5fbef01093c1471 Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Sun, 8 Oct 2023 16:40:13 +0200 +Subject: [PATCH] leds: core: Add more colors from DT bindings to led_colors + +The colors are already part of DT bindings. Make sure the kernel is +able to convert them to strings. + +Signed-off-by: Ondrej Jirman +Link: https://lore.kernel.org/r/20231008144014.1180334-1-megi@xff.cz +Signed-off-by: Lee Jones +--- + drivers/leds/led-core.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/leds/led-core.c ++++ b/drivers/leds/led-core.c +@@ -36,6 +36,11 @@ const char * const led_colors[LED_COLOR_ + [LED_COLOR_ID_IR] = "ir", + [LED_COLOR_ID_MULTI] = "multicolor", + [LED_COLOR_ID_RGB] = "rgb", ++ [LED_COLOR_ID_PURPLE] = "purple", ++ [LED_COLOR_ID_ORANGE] = "orange", ++ [LED_COLOR_ID_PINK] = "pink", ++ [LED_COLOR_ID_CYAN] = "cyan", ++ [LED_COLOR_ID_LIME] = "lime", + }; + EXPORT_SYMBOL_GPL(led_colors); + diff --git a/target/linux/generic/backport-5.15/893-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch b/target/linux/generic/backport-5.15/893-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch index 01bc65609c5ac6..8aa498046dc1b8 100644 --- a/target/linux/generic/backport-5.15/893-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch +++ b/target/linux/generic/backport-5.15/893-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch @@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -5370,7 +5370,8 @@ static const struct mv88e6xxx_info mv88e +@@ -5372,7 +5372,8 @@ static const struct mv88e6xxx_info mv88e .name = "Marvell 88E6191X", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ @@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski .max_vid = 8191, .port_base_addr = 0x0, .phy_base_addr = 0x0, -@@ -5392,7 +5393,8 @@ static const struct mv88e6xxx_info mv88e +@@ -5394,7 +5395,8 @@ static const struct mv88e6xxx_info mv88e .name = "Marvell 88E6193X", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ @@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski .max_vid = 8191, .port_base_addr = 0x0, .phy_base_addr = 0x0, -@@ -5702,7 +5704,8 @@ static const struct mv88e6xxx_info mv88e +@@ -5704,7 +5706,8 @@ static const struct mv88e6xxx_info mv88e .name = "Marvell 88E6393X", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ diff --git a/target/linux/generic/backport-5.15/893-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch b/target/linux/generic/backport-5.15/893-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch index c8254e5e4270c8..d86adf034edc56 100644 --- a/target/linux/generic/backport-5.15/893-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch +++ b/target/linux/generic/backport-5.15/893-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch @@ -71,7 +71,7 @@ Signed-off-by: Robert Marko mv88e6065_phylink_validate(chip, port, mask, state); } -@@ -5649,6 +5671,31 @@ static const struct mv88e6xxx_info mv88e +@@ -5651,6 +5673,31 @@ static const struct mv88e6xxx_info mv88e .ptp_support = true, .ops = &mv88e6352_ops, }, diff --git a/target/linux/generic/backport-6.1/020-v6.3-06-BACKPORT-mm-multi-gen-LRU-per-node-lru_gen_folio-lis.patch b/target/linux/generic/backport-6.1/020-v6.3-06-BACKPORT-mm-multi-gen-LRU-per-node-lru_gen_folio-lis.patch index ef98d52b78d616..10fee0adf6344f 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-06-BACKPORT-mm-multi-gen-LRU-per-node-lru_gen_folio-lis.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-06-BACKPORT-mm-multi-gen-LRU-per-node-lru_gen_folio-lis.patch @@ -325,7 +325,7 @@ Signed-off-by: T.J. Mercier mctz = soft_limit_tree.rb_tree_per_node[nid]; if (!mctz) return; -@@ -3523,6 +3533,9 @@ unsigned long mem_cgroup_soft_limit_recl +@@ -3524,6 +3534,9 @@ unsigned long mem_cgroup_soft_limit_recl struct mem_cgroup_tree_per_node *mctz; unsigned long excess; @@ -335,7 +335,7 @@ Signed-off-by: T.J. Mercier if (order > 0) return 0; -@@ -5383,6 +5396,7 @@ static int mem_cgroup_css_online(struct +@@ -5387,6 +5400,7 @@ static int mem_cgroup_css_online(struct if (unlikely(mem_cgroup_is_root(memcg))) queue_delayed_work(system_unbound_wq, &stats_flush_dwork, 2UL*HZ); @@ -343,7 +343,7 @@ Signed-off-by: T.J. Mercier return 0; offline_kmem: memcg_offline_kmem(memcg); -@@ -5414,6 +5428,7 @@ static void mem_cgroup_css_offline(struc +@@ -5418,6 +5432,7 @@ static void mem_cgroup_css_offline(struc memcg_offline_kmem(memcg); reparent_shrinker_deferred(memcg); wb_memcg_offline(memcg); @@ -351,7 +351,7 @@ Signed-off-by: T.J. Mercier drain_all_stock(memcg); -@@ -5425,6 +5440,7 @@ static void mem_cgroup_css_released(stru +@@ -5429,6 +5444,7 @@ static void mem_cgroup_css_released(stru struct mem_cgroup *memcg = mem_cgroup_from_css(css); invalidate_reclaim_iterators(memcg); @@ -361,7 +361,7 @@ Signed-off-by: T.J. Mercier static void mem_cgroup_css_free(struct cgroup_subsys_state *css) --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -7957,6 +7957,7 @@ static void __init free_area_init_node(i +@@ -7943,6 +7943,7 @@ static void __init free_area_init_node(i pgdat_set_deferred_range(pgdat); free_area_init_core(pgdat); diff --git a/target/linux/generic/backport-6.1/020-v6.3-10-UPSTREAM-mm-add-vma_has_recency.patch b/target/linux/generic/backport-6.1/020-v6.3-10-UPSTREAM-mm-add-vma_has_recency.patch index 8fd5564d00790f..aea6aa18e28fa9 100644 --- a/target/linux/generic/backport-6.1/020-v6.3-10-UPSTREAM-mm-add-vma_has_recency.patch +++ b/target/linux/generic/backport-6.1/020-v6.3-10-UPSTREAM-mm-add-vma_has_recency.patch @@ -77,7 +77,7 @@ Signed-off-by: T.J. Mercier #endif --- a/mm/memory.c +++ b/mm/memory.c -@@ -1435,8 +1435,7 @@ again: +@@ -1445,8 +1445,7 @@ again: force_flush = 1; set_page_dirty(page); } @@ -87,7 +87,7 @@ Signed-off-by: T.J. Mercier mark_page_accessed(page); } rss[mm_counter(page)]--; -@@ -5189,8 +5188,8 @@ static inline void mm_account_fault(stru +@@ -5199,8 +5198,8 @@ static inline void mm_account_fault(stru #ifdef CONFIG_LRU_GEN static void lru_gen_enter_fault(struct vm_area_struct *vma) { diff --git a/target/linux/generic/backport-6.1/702-01-v6.7-net-phy-aquantia-move-to-separate-directory.patch b/target/linux/generic/backport-6.1/702-01-v6.7-net-phy-aquantia-move-to-separate-directory.patch new file mode 100644 index 00000000000000..0cad6c53d4283e --- /dev/null +++ b/target/linux/generic/backport-6.1/702-01-v6.7-net-phy-aquantia-move-to-separate-directory.patch @@ -0,0 +1,2306 @@ +From d2213db3f49bce8e7a87c8de05b9a091f78f654e Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Tue, 14 Nov 2023 15:08:41 +0100 +Subject: [PATCH 1/3] net: phy: aquantia: move to separate directory + +Move aquantia PHY driver to separate driectory in preparation for +firmware loading support to keep things tidy. + +Signed-off-by: Christian Marangi +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/phy/Kconfig | 5 +---- + drivers/net/phy/Makefile | 6 +----- + drivers/net/phy/aquantia/Kconfig | 5 +++++ + drivers/net/phy/aquantia/Makefile | 6 ++++++ + drivers/net/phy/{ => aquantia}/aquantia.h | 0 + drivers/net/phy/{ => aquantia}/aquantia_hwmon.c | 0 + drivers/net/phy/{ => aquantia}/aquantia_main.c | 0 + 7 files changed, 13 insertions(+), 9 deletions(-) + create mode 100644 drivers/net/phy/aquantia/Kconfig + create mode 100644 drivers/net/phy/aquantia/Makefile + rename drivers/net/phy/{ => aquantia}/aquantia.h (100%) + rename drivers/net/phy/{ => aquantia}/aquantia_hwmon.c (100%) + rename drivers/net/phy/{ => aquantia}/aquantia_main.c (100%) + +--- a/drivers/net/phy/Kconfig ++++ b/drivers/net/phy/Kconfig +@@ -90,10 +90,7 @@ config ADIN1100_PHY + Currently supports the: + - ADIN1100 - Robust,Industrial, Low Power 10BASE-T1L Ethernet PHY + +-config AQUANTIA_PHY +- tristate "Aquantia PHYs" +- help +- Currently supports the Aquantia AQ1202, AQ2104, AQR105, AQR405 ++source "drivers/net/phy/aquantia/Kconfig" + + config AX88796B_PHY + tristate "Asix PHYs" +--- a/drivers/net/phy/Makefile ++++ b/drivers/net/phy/Makefile +@@ -33,11 +33,7 @@ obj-y += $(sfp-obj-y) $(sfp-obj-m) + obj-$(CONFIG_ADIN_PHY) += adin.o + obj-$(CONFIG_ADIN1100_PHY) += adin1100.o + obj-$(CONFIG_AMD_PHY) += amd.o +-aquantia-objs += aquantia_main.o +-ifdef CONFIG_HWMON +-aquantia-objs += aquantia_hwmon.o +-endif +-obj-$(CONFIG_AQUANTIA_PHY) += aquantia.o ++obj-$(CONFIG_AQUANTIA_PHY) += aquantia/ + obj-$(CONFIG_AT803X_PHY) += at803x.o + obj-$(CONFIG_AX88796B_PHY) += ax88796b.o + obj-$(CONFIG_BCM54140_PHY) += bcm54140.o +--- /dev/null ++++ b/drivers/net/phy/aquantia/Kconfig +@@ -0,0 +1,5 @@ ++# SPDX-License-Identifier: GPL-2.0-only ++config AQUANTIA_PHY ++ tristate "Aquantia PHYs" ++ help ++ Currently supports the Aquantia AQ1202, AQ2104, AQR105, AQR405 +--- /dev/null ++++ b/drivers/net/phy/aquantia/Makefile +@@ -0,0 +1,6 @@ ++# SPDX-License-Identifier: GPL-2.0 ++aquantia-objs += aquantia_main.o ++ifdef CONFIG_HWMON ++aquantia-objs += aquantia_hwmon.o ++endif ++obj-$(CONFIG_AQUANTIA_PHY) += aquantia.o +--- a/drivers/net/phy/aquantia.h ++++ /dev/null +@@ -1,16 +0,0 @@ +-/* SPDX-License-Identifier: GPL-2.0 */ +-/* HWMON driver for Aquantia PHY +- * +- * Author: Nikita Yushchenko +- * Author: Andrew Lunn +- * Author: Heiner Kallweit +- */ +- +-#include +-#include +- +-#if IS_REACHABLE(CONFIG_HWMON) +-int aqr_hwmon_probe(struct phy_device *phydev); +-#else +-static inline int aqr_hwmon_probe(struct phy_device *phydev) { return 0; } +-#endif +--- /dev/null ++++ b/drivers/net/phy/aquantia/aquantia.h +@@ -0,0 +1,16 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++/* HWMON driver for Aquantia PHY ++ * ++ * Author: Nikita Yushchenko ++ * Author: Andrew Lunn ++ * Author: Heiner Kallweit ++ */ ++ ++#include ++#include ++ ++#if IS_REACHABLE(CONFIG_HWMON) ++int aqr_hwmon_probe(struct phy_device *phydev); ++#else ++static inline int aqr_hwmon_probe(struct phy_device *phydev) { return 0; } ++#endif +--- /dev/null ++++ b/drivers/net/phy/aquantia/aquantia_hwmon.c +@@ -0,0 +1,250 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* HWMON driver for Aquantia PHY ++ * ++ * Author: Nikita Yushchenko ++ * Author: Andrew Lunn ++ * Author: Heiner Kallweit ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include "aquantia.h" ++ ++/* Vendor specific 1, MDIO_MMD_VEND2 */ ++#define VEND1_THERMAL_PROV_HIGH_TEMP_FAIL 0xc421 ++#define VEND1_THERMAL_PROV_LOW_TEMP_FAIL 0xc422 ++#define VEND1_THERMAL_PROV_HIGH_TEMP_WARN 0xc423 ++#define VEND1_THERMAL_PROV_LOW_TEMP_WARN 0xc424 ++#define VEND1_THERMAL_STAT1 0xc820 ++#define VEND1_THERMAL_STAT2 0xc821 ++#define VEND1_THERMAL_STAT2_VALID BIT(0) ++#define VEND1_GENERAL_STAT1 0xc830 ++#define VEND1_GENERAL_STAT1_HIGH_TEMP_FAIL BIT(14) ++#define VEND1_GENERAL_STAT1_LOW_TEMP_FAIL BIT(13) ++#define VEND1_GENERAL_STAT1_HIGH_TEMP_WARN BIT(12) ++#define VEND1_GENERAL_STAT1_LOW_TEMP_WARN BIT(11) ++ ++#if IS_REACHABLE(CONFIG_HWMON) ++ ++static umode_t aqr_hwmon_is_visible(const void *data, ++ enum hwmon_sensor_types type, ++ u32 attr, int channel) ++{ ++ if (type != hwmon_temp) ++ return 0; ++ ++ switch (attr) { ++ case hwmon_temp_input: ++ case hwmon_temp_min_alarm: ++ case hwmon_temp_max_alarm: ++ case hwmon_temp_lcrit_alarm: ++ case hwmon_temp_crit_alarm: ++ return 0444; ++ case hwmon_temp_min: ++ case hwmon_temp_max: ++ case hwmon_temp_lcrit: ++ case hwmon_temp_crit: ++ return 0644; ++ default: ++ return 0; ++ } ++} ++ ++static int aqr_hwmon_get(struct phy_device *phydev, int reg, long *value) ++{ ++ int temp = phy_read_mmd(phydev, MDIO_MMD_VEND1, reg); ++ ++ if (temp < 0) ++ return temp; ++ ++ /* 16 bit value is 2's complement with LSB = 1/256th degree Celsius */ ++ *value = (s16)temp * 1000 / 256; ++ ++ return 0; ++} ++ ++static int aqr_hwmon_set(struct phy_device *phydev, int reg, long value) ++{ ++ int temp; ++ ++ if (value >= 128000 || value < -128000) ++ return -ERANGE; ++ ++ temp = value * 256 / 1000; ++ ++ /* temp is in s16 range and we're interested in lower 16 bits only */ ++ return phy_write_mmd(phydev, MDIO_MMD_VEND1, reg, (u16)temp); ++} ++ ++static int aqr_hwmon_test_bit(struct phy_device *phydev, int reg, int bit) ++{ ++ int val = phy_read_mmd(phydev, MDIO_MMD_VEND1, reg); ++ ++ if (val < 0) ++ return val; ++ ++ return !!(val & bit); ++} ++ ++static int aqr_hwmon_status1(struct phy_device *phydev, int bit, long *value) ++{ ++ int val = aqr_hwmon_test_bit(phydev, VEND1_GENERAL_STAT1, bit); ++ ++ if (val < 0) ++ return val; ++ ++ *value = val; ++ ++ return 0; ++} ++ ++static int aqr_hwmon_read(struct device *dev, enum hwmon_sensor_types type, ++ u32 attr, int channel, long *value) ++{ ++ struct phy_device *phydev = dev_get_drvdata(dev); ++ int reg; ++ ++ if (type != hwmon_temp) ++ return -EOPNOTSUPP; ++ ++ switch (attr) { ++ case hwmon_temp_input: ++ reg = aqr_hwmon_test_bit(phydev, VEND1_THERMAL_STAT2, ++ VEND1_THERMAL_STAT2_VALID); ++ if (reg < 0) ++ return reg; ++ if (!reg) ++ return -EBUSY; ++ ++ return aqr_hwmon_get(phydev, VEND1_THERMAL_STAT1, value); ++ ++ case hwmon_temp_lcrit: ++ return aqr_hwmon_get(phydev, VEND1_THERMAL_PROV_LOW_TEMP_FAIL, ++ value); ++ case hwmon_temp_min: ++ return aqr_hwmon_get(phydev, VEND1_THERMAL_PROV_LOW_TEMP_WARN, ++ value); ++ case hwmon_temp_max: ++ return aqr_hwmon_get(phydev, VEND1_THERMAL_PROV_HIGH_TEMP_WARN, ++ value); ++ case hwmon_temp_crit: ++ return aqr_hwmon_get(phydev, VEND1_THERMAL_PROV_HIGH_TEMP_FAIL, ++ value); ++ case hwmon_temp_lcrit_alarm: ++ return aqr_hwmon_status1(phydev, ++ VEND1_GENERAL_STAT1_LOW_TEMP_FAIL, ++ value); ++ case hwmon_temp_min_alarm: ++ return aqr_hwmon_status1(phydev, ++ VEND1_GENERAL_STAT1_LOW_TEMP_WARN, ++ value); ++ case hwmon_temp_max_alarm: ++ return aqr_hwmon_status1(phydev, ++ VEND1_GENERAL_STAT1_HIGH_TEMP_WARN, ++ value); ++ case hwmon_temp_crit_alarm: ++ return aqr_hwmon_status1(phydev, ++ VEND1_GENERAL_STAT1_HIGH_TEMP_FAIL, ++ value); ++ default: ++ return -EOPNOTSUPP; ++ } ++} ++ ++static int aqr_hwmon_write(struct device *dev, enum hwmon_sensor_types type, ++ u32 attr, int channel, long value) ++{ ++ struct phy_device *phydev = dev_get_drvdata(dev); ++ ++ if (type != hwmon_temp) ++ return -EOPNOTSUPP; ++ ++ switch (attr) { ++ case hwmon_temp_lcrit: ++ return aqr_hwmon_set(phydev, VEND1_THERMAL_PROV_LOW_TEMP_FAIL, ++ value); ++ case hwmon_temp_min: ++ return aqr_hwmon_set(phydev, VEND1_THERMAL_PROV_LOW_TEMP_WARN, ++ value); ++ case hwmon_temp_max: ++ return aqr_hwmon_set(phydev, VEND1_THERMAL_PROV_HIGH_TEMP_WARN, ++ value); ++ case hwmon_temp_crit: ++ return aqr_hwmon_set(phydev, VEND1_THERMAL_PROV_HIGH_TEMP_FAIL, ++ value); ++ default: ++ return -EOPNOTSUPP; ++ } ++} ++ ++static const struct hwmon_ops aqr_hwmon_ops = { ++ .is_visible = aqr_hwmon_is_visible, ++ .read = aqr_hwmon_read, ++ .write = aqr_hwmon_write, ++}; ++ ++static u32 aqr_hwmon_chip_config[] = { ++ HWMON_C_REGISTER_TZ, ++ 0, ++}; ++ ++static const struct hwmon_channel_info aqr_hwmon_chip = { ++ .type = hwmon_chip, ++ .config = aqr_hwmon_chip_config, ++}; ++ ++static u32 aqr_hwmon_temp_config[] = { ++ HWMON_T_INPUT | ++ HWMON_T_MAX | HWMON_T_MIN | ++ HWMON_T_MAX_ALARM | HWMON_T_MIN_ALARM | ++ HWMON_T_CRIT | HWMON_T_LCRIT | ++ HWMON_T_CRIT_ALARM | HWMON_T_LCRIT_ALARM, ++ 0, ++}; ++ ++static const struct hwmon_channel_info aqr_hwmon_temp = { ++ .type = hwmon_temp, ++ .config = aqr_hwmon_temp_config, ++}; ++ ++static const struct hwmon_channel_info *aqr_hwmon_info[] = { ++ &aqr_hwmon_chip, ++ &aqr_hwmon_temp, ++ NULL, ++}; ++ ++static const struct hwmon_chip_info aqr_hwmon_chip_info = { ++ .ops = &aqr_hwmon_ops, ++ .info = aqr_hwmon_info, ++}; ++ ++int aqr_hwmon_probe(struct phy_device *phydev) ++{ ++ struct device *dev = &phydev->mdio.dev; ++ struct device *hwmon_dev; ++ char *hwmon_name; ++ int i, j; ++ ++ hwmon_name = devm_kstrdup(dev, dev_name(dev), GFP_KERNEL); ++ if (!hwmon_name) ++ return -ENOMEM; ++ ++ for (i = j = 0; hwmon_name[i]; i++) { ++ if (isalnum(hwmon_name[i])) { ++ if (i != j) ++ hwmon_name[j] = hwmon_name[i]; ++ j++; ++ } ++ } ++ hwmon_name[j] = '\0'; ++ ++ hwmon_dev = devm_hwmon_device_register_with_info(dev, hwmon_name, ++ phydev, &aqr_hwmon_chip_info, NULL); ++ ++ return PTR_ERR_OR_ZERO(hwmon_dev); ++} ++ ++#endif +--- /dev/null ++++ b/drivers/net/phy/aquantia/aquantia_main.c +@@ -0,0 +1,842 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Driver for Aquantia PHY ++ * ++ * Author: Shaohui Xie ++ * ++ * Copyright 2015 Freescale Semiconductor, Inc. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "aquantia.h" ++ ++#define PHY_ID_AQ1202 0x03a1b445 ++#define PHY_ID_AQ2104 0x03a1b460 ++#define PHY_ID_AQR105 0x03a1b4a2 ++#define PHY_ID_AQR106 0x03a1b4d0 ++#define PHY_ID_AQR107 0x03a1b4e0 ++#define PHY_ID_AQCS109 0x03a1b5c2 ++#define PHY_ID_AQR405 0x03a1b4b0 ++#define PHY_ID_AQR113C 0x31c31c12 ++ ++#define MDIO_PHYXS_VEND_IF_STATUS 0xe812 ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3) ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_KR 0 ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_KX 1 ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_XFI 2 ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_USXGMII 3 ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_XAUI 4 ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_SGMII 6 ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_RXAUI 7 ++#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_OCSGMII 10 ++ ++#define MDIO_AN_VEND_PROV 0xc400 ++#define MDIO_AN_VEND_PROV_1000BASET_FULL BIT(15) ++#define MDIO_AN_VEND_PROV_1000BASET_HALF BIT(14) ++#define MDIO_AN_VEND_PROV_5000BASET_FULL BIT(11) ++#define MDIO_AN_VEND_PROV_2500BASET_FULL BIT(10) ++#define MDIO_AN_VEND_PROV_DOWNSHIFT_EN BIT(4) ++#define MDIO_AN_VEND_PROV_DOWNSHIFT_MASK GENMASK(3, 0) ++#define MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT 4 ++ ++#define MDIO_AN_TX_VEND_STATUS1 0xc800 ++#define MDIO_AN_TX_VEND_STATUS1_RATE_MASK GENMASK(3, 1) ++#define MDIO_AN_TX_VEND_STATUS1_10BASET 0 ++#define MDIO_AN_TX_VEND_STATUS1_100BASETX 1 ++#define MDIO_AN_TX_VEND_STATUS1_1000BASET 2 ++#define MDIO_AN_TX_VEND_STATUS1_10GBASET 3 ++#define MDIO_AN_TX_VEND_STATUS1_2500BASET 4 ++#define MDIO_AN_TX_VEND_STATUS1_5000BASET 5 ++#define MDIO_AN_TX_VEND_STATUS1_FULL_DUPLEX BIT(0) ++ ++#define MDIO_AN_TX_VEND_INT_STATUS1 0xcc00 ++#define MDIO_AN_TX_VEND_INT_STATUS1_DOWNSHIFT BIT(1) ++ ++#define MDIO_AN_TX_VEND_INT_STATUS2 0xcc01 ++#define MDIO_AN_TX_VEND_INT_STATUS2_MASK BIT(0) ++ ++#define MDIO_AN_TX_VEND_INT_MASK2 0xd401 ++#define MDIO_AN_TX_VEND_INT_MASK2_LINK BIT(0) ++ ++#define MDIO_AN_RX_LP_STAT1 0xe820 ++#define MDIO_AN_RX_LP_STAT1_1000BASET_FULL BIT(15) ++#define MDIO_AN_RX_LP_STAT1_1000BASET_HALF BIT(14) ++#define MDIO_AN_RX_LP_STAT1_SHORT_REACH BIT(13) ++#define MDIO_AN_RX_LP_STAT1_AQRATE_DOWNSHIFT BIT(12) ++#define MDIO_AN_RX_LP_STAT1_AQ_PHY BIT(2) ++ ++#define MDIO_AN_RX_LP_STAT4 0xe823 ++#define MDIO_AN_RX_LP_STAT4_FW_MAJOR GENMASK(15, 8) ++#define MDIO_AN_RX_LP_STAT4_FW_MINOR GENMASK(7, 0) ++ ++#define MDIO_AN_RX_VEND_STAT3 0xe832 ++#define MDIO_AN_RX_VEND_STAT3_AFR BIT(0) ++ ++/* MDIO_MMD_C22EXT */ ++#define MDIO_C22EXT_STAT_SGMII_RX_GOOD_FRAMES 0xd292 ++#define MDIO_C22EXT_STAT_SGMII_RX_BAD_FRAMES 0xd294 ++#define MDIO_C22EXT_STAT_SGMII_RX_FALSE_CARRIER 0xd297 ++#define MDIO_C22EXT_STAT_SGMII_TX_GOOD_FRAMES 0xd313 ++#define MDIO_C22EXT_STAT_SGMII_TX_BAD_FRAMES 0xd315 ++#define MDIO_C22EXT_STAT_SGMII_TX_FALSE_CARRIER 0xd317 ++#define MDIO_C22EXT_STAT_SGMII_TX_COLLISIONS 0xd318 ++#define MDIO_C22EXT_STAT_SGMII_TX_LINE_COLLISIONS 0xd319 ++#define MDIO_C22EXT_STAT_SGMII_TX_FRAME_ALIGN_ERR 0xd31a ++#define MDIO_C22EXT_STAT_SGMII_TX_RUNT_FRAMES 0xd31b ++ ++/* Vendor specific 1, MDIO_MMD_VEND1 */ ++#define VEND1_GLOBAL_FW_ID 0x0020 ++#define VEND1_GLOBAL_FW_ID_MAJOR GENMASK(15, 8) ++#define VEND1_GLOBAL_FW_ID_MINOR GENMASK(7, 0) ++ ++#define VEND1_GLOBAL_GEN_STAT2 0xc831 ++#define VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG BIT(15) ++ ++/* The following registers all have similar layouts; first the registers... */ ++#define VEND1_GLOBAL_CFG_10M 0x0310 ++#define VEND1_GLOBAL_CFG_100M 0x031b ++#define VEND1_GLOBAL_CFG_1G 0x031c ++#define VEND1_GLOBAL_CFG_2_5G 0x031d ++#define VEND1_GLOBAL_CFG_5G 0x031e ++#define VEND1_GLOBAL_CFG_10G 0x031f ++/* ...and now the fields */ ++#define VEND1_GLOBAL_CFG_RATE_ADAPT GENMASK(8, 7) ++#define VEND1_GLOBAL_CFG_RATE_ADAPT_NONE 0 ++#define VEND1_GLOBAL_CFG_RATE_ADAPT_USX 1 ++#define VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE 2 ++ ++#define VEND1_GLOBAL_RSVD_STAT1 0xc885 ++#define VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID GENMASK(7, 4) ++#define VEND1_GLOBAL_RSVD_STAT1_PROV_ID GENMASK(3, 0) ++ ++#define VEND1_GLOBAL_RSVD_STAT9 0xc88d ++#define VEND1_GLOBAL_RSVD_STAT9_MODE GENMASK(7, 0) ++#define VEND1_GLOBAL_RSVD_STAT9_1000BT2 0x23 ++ ++#define VEND1_GLOBAL_INT_STD_STATUS 0xfc00 ++#define VEND1_GLOBAL_INT_VEND_STATUS 0xfc01 ++ ++#define VEND1_GLOBAL_INT_STD_MASK 0xff00 ++#define VEND1_GLOBAL_INT_STD_MASK_PMA1 BIT(15) ++#define VEND1_GLOBAL_INT_STD_MASK_PMA2 BIT(14) ++#define VEND1_GLOBAL_INT_STD_MASK_PCS1 BIT(13) ++#define VEND1_GLOBAL_INT_STD_MASK_PCS2 BIT(12) ++#define VEND1_GLOBAL_INT_STD_MASK_PCS3 BIT(11) ++#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS1 BIT(10) ++#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS2 BIT(9) ++#define VEND1_GLOBAL_INT_STD_MASK_AN1 BIT(8) ++#define VEND1_GLOBAL_INT_STD_MASK_AN2 BIT(7) ++#define VEND1_GLOBAL_INT_STD_MASK_GBE BIT(6) ++#define VEND1_GLOBAL_INT_STD_MASK_ALL BIT(0) ++ ++#define VEND1_GLOBAL_INT_VEND_MASK 0xff01 ++#define VEND1_GLOBAL_INT_VEND_MASK_PMA BIT(15) ++#define VEND1_GLOBAL_INT_VEND_MASK_PCS BIT(14) ++#define VEND1_GLOBAL_INT_VEND_MASK_PHY_XS BIT(13) ++#define VEND1_GLOBAL_INT_VEND_MASK_AN BIT(12) ++#define VEND1_GLOBAL_INT_VEND_MASK_GBE BIT(11) ++#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL1 BIT(2) ++#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL2 BIT(1) ++#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 BIT(0) ++ ++/* Sleep and timeout for checking if the Processor-Intensive ++ * MDIO operation is finished ++ */ ++#define AQR107_OP_IN_PROG_SLEEP 1000 ++#define AQR107_OP_IN_PROG_TIMEOUT 100000 ++ ++struct aqr107_hw_stat { ++ const char *name; ++ int reg; ++ int size; ++}; ++ ++#define SGMII_STAT(n, r, s) { n, MDIO_C22EXT_STAT_SGMII_ ## r, s } ++static const struct aqr107_hw_stat aqr107_hw_stats[] = { ++ SGMII_STAT("sgmii_rx_good_frames", RX_GOOD_FRAMES, 26), ++ SGMII_STAT("sgmii_rx_bad_frames", RX_BAD_FRAMES, 26), ++ SGMII_STAT("sgmii_rx_false_carrier_events", RX_FALSE_CARRIER, 8), ++ SGMII_STAT("sgmii_tx_good_frames", TX_GOOD_FRAMES, 26), ++ SGMII_STAT("sgmii_tx_bad_frames", TX_BAD_FRAMES, 26), ++ SGMII_STAT("sgmii_tx_false_carrier_events", TX_FALSE_CARRIER, 8), ++ SGMII_STAT("sgmii_tx_collisions", TX_COLLISIONS, 8), ++ SGMII_STAT("sgmii_tx_line_collisions", TX_LINE_COLLISIONS, 8), ++ SGMII_STAT("sgmii_tx_frame_alignment_err", TX_FRAME_ALIGN_ERR, 16), ++ SGMII_STAT("sgmii_tx_runt_frames", TX_RUNT_FRAMES, 22), ++}; ++#define AQR107_SGMII_STAT_SZ ARRAY_SIZE(aqr107_hw_stats) ++ ++struct aqr107_priv { ++ u64 sgmii_stats[AQR107_SGMII_STAT_SZ]; ++}; ++ ++static int aqr107_get_sset_count(struct phy_device *phydev) ++{ ++ return AQR107_SGMII_STAT_SZ; ++} ++ ++static void aqr107_get_strings(struct phy_device *phydev, u8 *data) ++{ ++ int i; ++ ++ for (i = 0; i < AQR107_SGMII_STAT_SZ; i++) ++ strscpy(data + i * ETH_GSTRING_LEN, aqr107_hw_stats[i].name, ++ ETH_GSTRING_LEN); ++} ++ ++static u64 aqr107_get_stat(struct phy_device *phydev, int index) ++{ ++ const struct aqr107_hw_stat *stat = aqr107_hw_stats + index; ++ int len_l = min(stat->size, 16); ++ int len_h = stat->size - len_l; ++ u64 ret; ++ int val; ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_C22EXT, stat->reg); ++ if (val < 0) ++ return U64_MAX; ++ ++ ret = val & GENMASK(len_l - 1, 0); ++ if (len_h) { ++ val = phy_read_mmd(phydev, MDIO_MMD_C22EXT, stat->reg + 1); ++ if (val < 0) ++ return U64_MAX; ++ ++ ret += (val & GENMASK(len_h - 1, 0)) << 16; ++ } ++ ++ return ret; ++} ++ ++static void aqr107_get_stats(struct phy_device *phydev, ++ struct ethtool_stats *stats, u64 *data) ++{ ++ struct aqr107_priv *priv = phydev->priv; ++ u64 val; ++ int i; ++ ++ for (i = 0; i < AQR107_SGMII_STAT_SZ; i++) { ++ val = aqr107_get_stat(phydev, i); ++ if (val == U64_MAX) ++ phydev_err(phydev, "Reading HW Statistics failed for %s\n", ++ aqr107_hw_stats[i].name); ++ else ++ priv->sgmii_stats[i] += val; ++ ++ data[i] = priv->sgmii_stats[i]; ++ } ++} ++ ++static int aqr_config_aneg(struct phy_device *phydev) ++{ ++ bool changed = false; ++ u16 reg; ++ int ret; ++ ++ if (phydev->autoneg == AUTONEG_DISABLE) ++ return genphy_c45_pma_setup_forced(phydev); ++ ++ ret = genphy_c45_an_config_aneg(phydev); ++ if (ret < 0) ++ return ret; ++ if (ret > 0) ++ changed = true; ++ ++ /* Clause 45 has no standardized support for 1000BaseT, therefore ++ * use vendor registers for this mode. ++ */ ++ reg = 0; ++ if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, ++ phydev->advertising)) ++ reg |= MDIO_AN_VEND_PROV_1000BASET_FULL; ++ ++ if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, ++ phydev->advertising)) ++ reg |= MDIO_AN_VEND_PROV_1000BASET_HALF; ++ ++ /* Handle the case when the 2.5G and 5G speeds are not advertised */ ++ if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, ++ phydev->advertising)) ++ reg |= MDIO_AN_VEND_PROV_2500BASET_FULL; ++ ++ if (linkmode_test_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT, ++ phydev->advertising)) ++ reg |= MDIO_AN_VEND_PROV_5000BASET_FULL; ++ ++ ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_VEND_PROV, ++ MDIO_AN_VEND_PROV_1000BASET_HALF | ++ MDIO_AN_VEND_PROV_1000BASET_FULL | ++ MDIO_AN_VEND_PROV_2500BASET_FULL | ++ MDIO_AN_VEND_PROV_5000BASET_FULL, reg); ++ if (ret < 0) ++ return ret; ++ if (ret > 0) ++ changed = true; ++ ++ return genphy_c45_check_and_restart_aneg(phydev, changed); ++} ++ ++static int aqr_config_intr(struct phy_device *phydev) ++{ ++ bool en = phydev->interrupts == PHY_INTERRUPT_ENABLED; ++ int err; ++ ++ if (en) { ++ /* Clear any pending interrupts before enabling them */ ++ err = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_STATUS2); ++ if (err < 0) ++ return err; ++ } ++ ++ err = phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_MASK2, ++ en ? MDIO_AN_TX_VEND_INT_MASK2_LINK : 0); ++ if (err < 0) ++ return err; ++ ++ err = phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_INT_STD_MASK, ++ en ? VEND1_GLOBAL_INT_STD_MASK_ALL : 0); ++ if (err < 0) ++ return err; ++ ++ err = phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_INT_VEND_MASK, ++ en ? VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 | ++ VEND1_GLOBAL_INT_VEND_MASK_AN : 0); ++ if (err < 0) ++ return err; ++ ++ if (!en) { ++ /* Clear any pending interrupts after we have disabled them */ ++ err = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_STATUS2); ++ if (err < 0) ++ return err; ++ } ++ ++ return 0; ++} ++ ++static irqreturn_t aqr_handle_interrupt(struct phy_device *phydev) ++{ ++ int irq_status; ++ ++ irq_status = phy_read_mmd(phydev, MDIO_MMD_AN, ++ MDIO_AN_TX_VEND_INT_STATUS2); ++ if (irq_status < 0) { ++ phy_error(phydev); ++ return IRQ_NONE; ++ } ++ ++ if (!(irq_status & MDIO_AN_TX_VEND_INT_STATUS2_MASK)) ++ return IRQ_NONE; ++ ++ phy_trigger_machine(phydev); ++ ++ return IRQ_HANDLED; ++} ++ ++static int aqr_read_status(struct phy_device *phydev) ++{ ++ int val; ++ ++ if (phydev->autoneg == AUTONEG_ENABLE) { ++ val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_RX_LP_STAT1); ++ if (val < 0) ++ return val; ++ ++ linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, ++ phydev->lp_advertising, ++ val & MDIO_AN_RX_LP_STAT1_1000BASET_FULL); ++ linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, ++ phydev->lp_advertising, ++ val & MDIO_AN_RX_LP_STAT1_1000BASET_HALF); ++ } ++ ++ return genphy_c45_read_status(phydev); ++} ++ ++static int aqr107_read_rate(struct phy_device *phydev) ++{ ++ u32 config_reg; ++ int val; ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_STATUS1); ++ if (val < 0) ++ return val; ++ ++ if (val & MDIO_AN_TX_VEND_STATUS1_FULL_DUPLEX) ++ phydev->duplex = DUPLEX_FULL; ++ else ++ phydev->duplex = DUPLEX_HALF; ++ ++ switch (FIELD_GET(MDIO_AN_TX_VEND_STATUS1_RATE_MASK, val)) { ++ case MDIO_AN_TX_VEND_STATUS1_10BASET: ++ phydev->speed = SPEED_10; ++ config_reg = VEND1_GLOBAL_CFG_10M; ++ break; ++ case MDIO_AN_TX_VEND_STATUS1_100BASETX: ++ phydev->speed = SPEED_100; ++ config_reg = VEND1_GLOBAL_CFG_100M; ++ break; ++ case MDIO_AN_TX_VEND_STATUS1_1000BASET: ++ phydev->speed = SPEED_1000; ++ config_reg = VEND1_GLOBAL_CFG_1G; ++ break; ++ case MDIO_AN_TX_VEND_STATUS1_2500BASET: ++ phydev->speed = SPEED_2500; ++ config_reg = VEND1_GLOBAL_CFG_2_5G; ++ break; ++ case MDIO_AN_TX_VEND_STATUS1_5000BASET: ++ phydev->speed = SPEED_5000; ++ config_reg = VEND1_GLOBAL_CFG_5G; ++ break; ++ case MDIO_AN_TX_VEND_STATUS1_10GBASET: ++ phydev->speed = SPEED_10000; ++ config_reg = VEND1_GLOBAL_CFG_10G; ++ break; ++ default: ++ phydev->speed = SPEED_UNKNOWN; ++ return 0; ++ } ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_VEND1, config_reg); ++ if (val < 0) ++ return val; ++ ++ if (FIELD_GET(VEND1_GLOBAL_CFG_RATE_ADAPT, val) == ++ VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE) ++ phydev->rate_matching = RATE_MATCH_PAUSE; ++ else ++ phydev->rate_matching = RATE_MATCH_NONE; ++ ++ return 0; ++} ++ ++static int aqr107_read_status(struct phy_device *phydev) ++{ ++ int val, ret; ++ ++ ret = aqr_read_status(phydev); ++ if (ret) ++ return ret; ++ ++ if (!phydev->link || phydev->autoneg == AUTONEG_DISABLE) ++ return 0; ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_PHYXS, MDIO_PHYXS_VEND_IF_STATUS); ++ if (val < 0) ++ return val; ++ ++ switch (FIELD_GET(MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK, val)) { ++ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_KR: ++ phydev->interface = PHY_INTERFACE_MODE_10GKR; ++ break; ++ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_KX: ++ phydev->interface = PHY_INTERFACE_MODE_1000BASEKX; ++ break; ++ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_XFI: ++ phydev->interface = PHY_INTERFACE_MODE_10GBASER; ++ break; ++ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_USXGMII: ++ phydev->interface = PHY_INTERFACE_MODE_USXGMII; ++ break; ++ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_XAUI: ++ phydev->interface = PHY_INTERFACE_MODE_XAUI; ++ break; ++ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_SGMII: ++ phydev->interface = PHY_INTERFACE_MODE_SGMII; ++ break; ++ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_RXAUI: ++ phydev->interface = PHY_INTERFACE_MODE_RXAUI; ++ break; ++ case MDIO_PHYXS_VEND_IF_STATUS_TYPE_OCSGMII: ++ phydev->interface = PHY_INTERFACE_MODE_2500BASEX; ++ break; ++ default: ++ phydev->interface = PHY_INTERFACE_MODE_NA; ++ break; ++ } ++ ++ /* Read possibly downshifted rate from vendor register */ ++ return aqr107_read_rate(phydev); ++} ++ ++static int aqr107_get_downshift(struct phy_device *phydev, u8 *data) ++{ ++ int val, cnt, enable; ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_VEND_PROV); ++ if (val < 0) ++ return val; ++ ++ enable = FIELD_GET(MDIO_AN_VEND_PROV_DOWNSHIFT_EN, val); ++ cnt = FIELD_GET(MDIO_AN_VEND_PROV_DOWNSHIFT_MASK, val); ++ ++ *data = enable && cnt ? cnt : DOWNSHIFT_DEV_DISABLE; ++ ++ return 0; ++} ++ ++static int aqr107_set_downshift(struct phy_device *phydev, u8 cnt) ++{ ++ int val = 0; ++ ++ if (!FIELD_FIT(MDIO_AN_VEND_PROV_DOWNSHIFT_MASK, cnt)) ++ return -E2BIG; ++ ++ if (cnt != DOWNSHIFT_DEV_DISABLE) { ++ val = MDIO_AN_VEND_PROV_DOWNSHIFT_EN; ++ val |= FIELD_PREP(MDIO_AN_VEND_PROV_DOWNSHIFT_MASK, cnt); ++ } ++ ++ return phy_modify_mmd(phydev, MDIO_MMD_AN, MDIO_AN_VEND_PROV, ++ MDIO_AN_VEND_PROV_DOWNSHIFT_EN | ++ MDIO_AN_VEND_PROV_DOWNSHIFT_MASK, val); ++} ++ ++static int aqr107_get_tunable(struct phy_device *phydev, ++ struct ethtool_tunable *tuna, void *data) ++{ ++ switch (tuna->id) { ++ case ETHTOOL_PHY_DOWNSHIFT: ++ return aqr107_get_downshift(phydev, data); ++ default: ++ return -EOPNOTSUPP; ++ } ++} ++ ++static int aqr107_set_tunable(struct phy_device *phydev, ++ struct ethtool_tunable *tuna, const void *data) ++{ ++ switch (tuna->id) { ++ case ETHTOOL_PHY_DOWNSHIFT: ++ return aqr107_set_downshift(phydev, *(const u8 *)data); ++ default: ++ return -EOPNOTSUPP; ++ } ++} ++ ++/* If we configure settings whilst firmware is still initializing the chip, ++ * then these settings may be overwritten. Therefore make sure chip ++ * initialization has completed. Use presence of the firmware ID as ++ * indicator for initialization having completed. ++ * The chip also provides a "reset completed" bit, but it's cleared after ++ * read. Therefore function would time out if called again. ++ */ ++static int aqr107_wait_reset_complete(struct phy_device *phydev) ++{ ++ int val; ++ ++ return phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1, ++ VEND1_GLOBAL_FW_ID, val, val != 0, ++ 20000, 2000000, false); ++} ++ ++static void aqr107_chip_info(struct phy_device *phydev) ++{ ++ u8 fw_major, fw_minor, build_id, prov_id; ++ int val; ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_FW_ID); ++ if (val < 0) ++ return; ++ ++ fw_major = FIELD_GET(VEND1_GLOBAL_FW_ID_MAJOR, val); ++ fw_minor = FIELD_GET(VEND1_GLOBAL_FW_ID_MINOR, val); ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_RSVD_STAT1); ++ if (val < 0) ++ return; ++ ++ build_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID, val); ++ prov_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_PROV_ID, val); ++ ++ phydev_dbg(phydev, "FW %u.%u, Build %u, Provisioning %u\n", ++ fw_major, fw_minor, build_id, prov_id); ++} ++ ++static int aqr107_config_init(struct phy_device *phydev) ++{ ++ int ret; ++ ++ /* Check that the PHY interface type is compatible */ ++ if (phydev->interface != PHY_INTERFACE_MODE_SGMII && ++ phydev->interface != PHY_INTERFACE_MODE_1000BASEKX && ++ phydev->interface != PHY_INTERFACE_MODE_2500BASEX && ++ phydev->interface != PHY_INTERFACE_MODE_XGMII && ++ phydev->interface != PHY_INTERFACE_MODE_USXGMII && ++ phydev->interface != PHY_INTERFACE_MODE_10GKR && ++ phydev->interface != PHY_INTERFACE_MODE_10GBASER && ++ phydev->interface != PHY_INTERFACE_MODE_XAUI && ++ phydev->interface != PHY_INTERFACE_MODE_RXAUI) ++ return -ENODEV; ++ ++ WARN(phydev->interface == PHY_INTERFACE_MODE_XGMII, ++ "Your devicetree is out of date, please update it. The AQR107 family doesn't support XGMII, maybe you mean USXGMII.\n"); ++ ++ ret = aqr107_wait_reset_complete(phydev); ++ if (!ret) ++ aqr107_chip_info(phydev); ++ ++ return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT); ++} ++ ++static int aqcs109_config_init(struct phy_device *phydev) ++{ ++ int ret; ++ ++ /* Check that the PHY interface type is compatible */ ++ if (phydev->interface != PHY_INTERFACE_MODE_SGMII && ++ phydev->interface != PHY_INTERFACE_MODE_2500BASEX) ++ return -ENODEV; ++ ++ ret = aqr107_wait_reset_complete(phydev); ++ if (!ret) ++ aqr107_chip_info(phydev); ++ ++ /* AQCS109 belongs to a chip family partially supporting 10G and 5G. ++ * PMA speed ability bits are the same for all members of the family, ++ * AQCS109 however supports speeds up to 2.5G only. ++ */ ++ phy_set_max_speed(phydev, SPEED_2500); ++ ++ return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT); ++} ++ ++static void aqr107_link_change_notify(struct phy_device *phydev) ++{ ++ u8 fw_major, fw_minor; ++ bool downshift, short_reach, afr; ++ int mode, val; ++ ++ if (phydev->state != PHY_RUNNING || phydev->autoneg == AUTONEG_DISABLE) ++ return; ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_RX_LP_STAT1); ++ /* call failed or link partner is no Aquantia PHY */ ++ if (val < 0 || !(val & MDIO_AN_RX_LP_STAT1_AQ_PHY)) ++ return; ++ ++ short_reach = val & MDIO_AN_RX_LP_STAT1_SHORT_REACH; ++ downshift = val & MDIO_AN_RX_LP_STAT1_AQRATE_DOWNSHIFT; ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_RX_LP_STAT4); ++ if (val < 0) ++ return; ++ ++ fw_major = FIELD_GET(MDIO_AN_RX_LP_STAT4_FW_MAJOR, val); ++ fw_minor = FIELD_GET(MDIO_AN_RX_LP_STAT4_FW_MINOR, val); ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_RX_VEND_STAT3); ++ if (val < 0) ++ return; ++ ++ afr = val & MDIO_AN_RX_VEND_STAT3_AFR; ++ ++ phydev_dbg(phydev, "Link partner is Aquantia PHY, FW %u.%u%s%s%s\n", ++ fw_major, fw_minor, ++ short_reach ? ", short reach mode" : "", ++ downshift ? ", fast-retrain downshift advertised" : "", ++ afr ? ", fast reframe advertised" : ""); ++ ++ val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_RSVD_STAT9); ++ if (val < 0) ++ return; ++ ++ mode = FIELD_GET(VEND1_GLOBAL_RSVD_STAT9_MODE, val); ++ if (mode == VEND1_GLOBAL_RSVD_STAT9_1000BT2) ++ phydev_info(phydev, "Aquantia 1000Base-T2 mode active\n"); ++} ++ ++static int aqr107_wait_processor_intensive_op(struct phy_device *phydev) ++{ ++ int val, err; ++ ++ /* The datasheet notes to wait at least 1ms after issuing a ++ * processor intensive operation before checking. ++ * We cannot use the 'sleep_before_read' parameter of read_poll_timeout ++ * because that just determines the maximum time slept, not the minimum. ++ */ ++ usleep_range(1000, 5000); ++ ++ err = phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1, ++ VEND1_GLOBAL_GEN_STAT2, val, ++ !(val & VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG), ++ AQR107_OP_IN_PROG_SLEEP, ++ AQR107_OP_IN_PROG_TIMEOUT, false); ++ if (err) { ++ phydev_err(phydev, "timeout: processor-intensive MDIO operation\n"); ++ return err; ++ } ++ ++ return 0; ++} ++ ++static int aqr107_get_rate_matching(struct phy_device *phydev, ++ phy_interface_t iface) ++{ ++ if (iface == PHY_INTERFACE_MODE_10GBASER || ++ iface == PHY_INTERFACE_MODE_2500BASEX || ++ iface == PHY_INTERFACE_MODE_NA) ++ return RATE_MATCH_PAUSE; ++ return RATE_MATCH_NONE; ++} ++ ++static int aqr107_suspend(struct phy_device *phydev) ++{ ++ int err; ++ ++ err = phy_set_bits_mmd(phydev, MDIO_MMD_VEND1, MDIO_CTRL1, ++ MDIO_CTRL1_LPOWER); ++ if (err) ++ return err; ++ ++ return aqr107_wait_processor_intensive_op(phydev); ++} ++ ++static int aqr107_resume(struct phy_device *phydev) ++{ ++ int err; ++ ++ err = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1, MDIO_CTRL1, ++ MDIO_CTRL1_LPOWER); ++ if (err) ++ return err; ++ ++ return aqr107_wait_processor_intensive_op(phydev); ++} ++ ++static int aqr107_probe(struct phy_device *phydev) ++{ ++ phydev->priv = devm_kzalloc(&phydev->mdio.dev, ++ sizeof(struct aqr107_priv), GFP_KERNEL); ++ if (!phydev->priv) ++ return -ENOMEM; ++ ++ return aqr_hwmon_probe(phydev); ++} ++ ++static struct phy_driver aqr_driver[] = { ++{ ++ PHY_ID_MATCH_MODEL(PHY_ID_AQ1202), ++ .name = "Aquantia AQ1202", ++ .config_aneg = aqr_config_aneg, ++ .config_intr = aqr_config_intr, ++ .handle_interrupt = aqr_handle_interrupt, ++ .read_status = aqr_read_status, ++}, ++{ ++ PHY_ID_MATCH_MODEL(PHY_ID_AQ2104), ++ .name = "Aquantia AQ2104", ++ .config_aneg = aqr_config_aneg, ++ .config_intr = aqr_config_intr, ++ .handle_interrupt = aqr_handle_interrupt, ++ .read_status = aqr_read_status, ++}, ++{ ++ PHY_ID_MATCH_MODEL(PHY_ID_AQR105), ++ .name = "Aquantia AQR105", ++ .config_aneg = aqr_config_aneg, ++ .config_intr = aqr_config_intr, ++ .handle_interrupt = aqr_handle_interrupt, ++ .read_status = aqr_read_status, ++ .suspend = aqr107_suspend, ++ .resume = aqr107_resume, ++}, ++{ ++ PHY_ID_MATCH_MODEL(PHY_ID_AQR106), ++ .name = "Aquantia AQR106", ++ .config_aneg = aqr_config_aneg, ++ .config_intr = aqr_config_intr, ++ .handle_interrupt = aqr_handle_interrupt, ++ .read_status = aqr_read_status, ++}, ++{ ++ PHY_ID_MATCH_MODEL(PHY_ID_AQR107), ++ .name = "Aquantia AQR107", ++ .probe = aqr107_probe, ++ .get_rate_matching = aqr107_get_rate_matching, ++ .config_init = aqr107_config_init, ++ .config_aneg = aqr_config_aneg, ++ .config_intr = aqr_config_intr, ++ .handle_interrupt = aqr_handle_interrupt, ++ .read_status = aqr107_read_status, ++ .get_tunable = aqr107_get_tunable, ++ .set_tunable = aqr107_set_tunable, ++ .suspend = aqr107_suspend, ++ .resume = aqr107_resume, ++ .get_sset_count = aqr107_get_sset_count, ++ .get_strings = aqr107_get_strings, ++ .get_stats = aqr107_get_stats, ++ .link_change_notify = aqr107_link_change_notify, ++}, ++{ ++ PHY_ID_MATCH_MODEL(PHY_ID_AQCS109), ++ .name = "Aquantia AQCS109", ++ .probe = aqr107_probe, ++ .get_rate_matching = aqr107_get_rate_matching, ++ .config_init = aqcs109_config_init, ++ .config_aneg = aqr_config_aneg, ++ .config_intr = aqr_config_intr, ++ .handle_interrupt = aqr_handle_interrupt, ++ .read_status = aqr107_read_status, ++ .get_tunable = aqr107_get_tunable, ++ .set_tunable = aqr107_set_tunable, ++ .suspend = aqr107_suspend, ++ .resume = aqr107_resume, ++ .get_sset_count = aqr107_get_sset_count, ++ .get_strings = aqr107_get_strings, ++ .get_stats = aqr107_get_stats, ++ .link_change_notify = aqr107_link_change_notify, ++}, ++{ ++ PHY_ID_MATCH_MODEL(PHY_ID_AQR405), ++ .name = "Aquantia AQR405", ++ .config_aneg = aqr_config_aneg, ++ .config_intr = aqr_config_intr, ++ .handle_interrupt = aqr_handle_interrupt, ++ .read_status = aqr_read_status, ++}, ++{ ++ PHY_ID_MATCH_MODEL(PHY_ID_AQR113C), ++ .name = "Aquantia AQR113C", ++ .probe = aqr107_probe, ++ .get_rate_matching = aqr107_get_rate_matching, ++ .config_init = aqr107_config_init, ++ .config_aneg = aqr_config_aneg, ++ .config_intr = aqr_config_intr, ++ .handle_interrupt = aqr_handle_interrupt, ++ .read_status = aqr107_read_status, ++ .get_tunable = aqr107_get_tunable, ++ .set_tunable = aqr107_set_tunable, ++ .suspend = aqr107_suspend, ++ .resume = aqr107_resume, ++ .get_sset_count = aqr107_get_sset_count, ++ .get_strings = aqr107_get_strings, ++ .get_stats = aqr107_get_stats, ++ .link_change_notify = aqr107_link_change_notify, ++}, ++}; ++ ++module_phy_driver(aqr_driver); ++ ++static struct mdio_device_id __maybe_unused aqr_tbl[] = { ++ { PHY_ID_MATCH_MODEL(PHY_ID_AQ1202) }, ++ { PHY_ID_MATCH_MODEL(PHY_ID_AQ2104) }, ++ { PHY_ID_MATCH_MODEL(PHY_ID_AQR105) }, ++ { PHY_ID_MATCH_MODEL(PHY_ID_AQR106) }, ++ { PHY_ID_MATCH_MODEL(PHY_ID_AQR107) }, ++ { PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) }, ++ { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) }, ++ { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) }, ++ { } ++}; ++ ++MODULE_DEVICE_TABLE(mdio, aqr_tbl); ++ ++MODULE_DESCRIPTION("Aquantia PHY driver"); ++MODULE_AUTHOR("Shaohui Xie "); ++MODULE_LICENSE("GPL v2"); +--- a/drivers/net/phy/aquantia_hwmon.c ++++ /dev/null +@@ -1,250 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0 +-/* HWMON driver for Aquantia PHY +- * +- * Author: Nikita Yushchenko +- * Author: Andrew Lunn +- * Author: Heiner Kallweit +- */ +- +-#include +-#include +-#include +-#include +- +-#include "aquantia.h" +- +-/* Vendor specific 1, MDIO_MMD_VEND2 */ +-#define VEND1_THERMAL_PROV_HIGH_TEMP_FAIL 0xc421 +-#define VEND1_THERMAL_PROV_LOW_TEMP_FAIL 0xc422 +-#define VEND1_THERMAL_PROV_HIGH_TEMP_WARN 0xc423 +-#define VEND1_THERMAL_PROV_LOW_TEMP_WARN 0xc424 +-#define VEND1_THERMAL_STAT1 0xc820 +-#define VEND1_THERMAL_STAT2 0xc821 +-#define VEND1_THERMAL_STAT2_VALID BIT(0) +-#define VEND1_GENERAL_STAT1 0xc830 +-#define VEND1_GENERAL_STAT1_HIGH_TEMP_FAIL BIT(14) +-#define VEND1_GENERAL_STAT1_LOW_TEMP_FAIL BIT(13) +-#define VEND1_GENERAL_STAT1_HIGH_TEMP_WARN BIT(12) +-#define VEND1_GENERAL_STAT1_LOW_TEMP_WARN BIT(11) +- +-#if IS_REACHABLE(CONFIG_HWMON) +- +-static umode_t aqr_hwmon_is_visible(const void *data, +- enum hwmon_sensor_types type, +- u32 attr, int channel) +-{ +- if (type != hwmon_temp) +- return 0; +- +- switch (attr) { +- case hwmon_temp_input: +- case hwmon_temp_min_alarm: +- case hwmon_temp_max_alarm: +- case hwmon_temp_lcrit_alarm: +- case hwmon_temp_crit_alarm: +- return 0444; +- case hwmon_temp_min: +- case hwmon_temp_max: +- case hwmon_temp_lcrit: +- case hwmon_temp_crit: +- return 0644; +- default: +- return 0; +- } +-} +- +-static int aqr_hwmon_get(struct phy_device *phydev, int reg, long *value) +-{ +- int temp = phy_read_mmd(phydev, MDIO_MMD_VEND1, reg); +- +- if (temp < 0) +- return temp; +- +- /* 16 bit value is 2's complement with LSB = 1/256th degree Celsius */ +- *value = (s16)temp * 1000 / 256; +- +- return 0; +-} +- +-static int aqr_hwmon_set(struct phy_device *phydev, int reg, long value) +-{ +- int temp; +- +- if (value >= 128000 || value < -128000) +- return -ERANGE; +- +- temp = value * 256 / 1000; +- +- /* temp is in s16 range and we're interested in lower 16 bits only */ +- return phy_write_mmd(phydev, MDIO_MMD_VEND1, reg, (u16)temp); +-} +- +-static int aqr_hwmon_test_bit(struct phy_device *phydev, int reg, int bit) +-{ +- int val = phy_read_mmd(phydev, MDIO_MMD_VEND1, reg); +- +- if (val < 0) +- return val; +- +- return !!(val & bit); +-} +- +-static int aqr_hwmon_status1(struct phy_device *phydev, int bit, long *value) +-{ +- int val = aqr_hwmon_test_bit(phydev, VEND1_GENERAL_STAT1, bit); +- +- if (val < 0) +- return val; +- +- *value = val; +- +- return 0; +-} +- +-static int aqr_hwmon_read(struct device *dev, enum hwmon_sensor_types type, +- u32 attr, int channel, long *value) +-{ +- struct phy_device *phydev = dev_get_drvdata(dev); +- int reg; +- +- if (type != hwmon_temp) +- return -EOPNOTSUPP; +- +- switch (attr) { +- case hwmon_temp_input: +- reg = aqr_hwmon_test_bit(phydev, VEND1_THERMAL_STAT2, +- VEND1_THERMAL_STAT2_VALID); +- if (reg < 0) +- return reg; +- if (!reg) +- return -EBUSY; +- +- return aqr_hwmon_get(phydev, VEND1_THERMAL_STAT1, value); +- +- case hwmon_temp_lcrit: +- return aqr_hwmon_get(phydev, VEND1_THERMAL_PROV_LOW_TEMP_FAIL, +- value); +- case hwmon_temp_min: +- return aqr_hwmon_get(phydev, VEND1_THERMAL_PROV_LOW_TEMP_WARN, +- value); +- case hwmon_temp_max: +- return aqr_hwmon_get(phydev, VEND1_THERMAL_PROV_HIGH_TEMP_WARN, +- value); +- case hwmon_temp_crit: +- return aqr_hwmon_get(phydev, VEND1_THERMAL_PROV_HIGH_TEMP_FAIL, +- value); +- case hwmon_temp_lcrit_alarm: +- return aqr_hwmon_status1(phydev, +- VEND1_GENERAL_STAT1_LOW_TEMP_FAIL, +- value); +- case hwmon_temp_min_alarm: +- return aqr_hwmon_status1(phydev, +- VEND1_GENERAL_STAT1_LOW_TEMP_WARN, +- value); +- case hwmon_temp_max_alarm: +- return aqr_hwmon_status1(phydev, +- VEND1_GENERAL_STAT1_HIGH_TEMP_WARN, +- value); +- case hwmon_temp_crit_alarm: +- return aqr_hwmon_status1(phydev, +- VEND1_GENERAL_STAT1_HIGH_TEMP_FAIL, +- value); +- default: +- return -EOPNOTSUPP; +- } +-} +- +-static int aqr_hwmon_write(struct device *dev, enum hwmon_sensor_types type, +- u32 attr, int channel, long value) +-{ +- struct phy_device *phydev = dev_get_drvdata(dev); +- +- if (type != hwmon_temp) +- return -EOPNOTSUPP; +- +- switch (attr) { +- case hwmon_temp_lcrit: +- return aqr_hwmon_set(phydev, VEND1_THERMAL_PROV_LOW_TEMP_FAIL, +- value); +- case hwmon_temp_min: +- return aqr_hwmon_set(phydev, VEND1_THERMAL_PROV_LOW_TEMP_WARN, +- value); +- case hwmon_temp_max: +- return aqr_hwmon_set(phydev, VEND1_THERMAL_PROV_HIGH_TEMP_WARN, +- value); +- case hwmon_temp_crit: +- return aqr_hwmon_set(phydev, VEND1_THERMAL_PROV_HIGH_TEMP_FAIL, +- value); +- default: +- return -EOPNOTSUPP; +- } +-} +- +-static const struct hwmon_ops aqr_hwmon_ops = { +- .is_visible = aqr_hwmon_is_visible, +- .read = aqr_hwmon_read, +- .write = aqr_hwmon_write, +-}; +- +-static u32 aqr_hwmon_chip_config[] = { +- HWMON_C_REGISTER_TZ, +- 0, +-}; +- +-static const struct hwmon_channel_info aqr_hwmon_chip = { +- .type = hwmon_chip, +- .config = aqr_hwmon_chip_config, +-}; +- +-static u32 aqr_hwmon_temp_config[] = { +- HWMON_T_INPUT | +- HWMON_T_MAX | HWMON_T_MIN | +- HWMON_T_MAX_ALARM | HWMON_T_MIN_ALARM | +- HWMON_T_CRIT | HWMON_T_LCRIT | +- HWMON_T_CRIT_ALARM | HWMON_T_LCRIT_ALARM, +- 0, +-}; +- +-static const struct hwmon_channel_info aqr_hwmon_temp = { +- .type = hwmon_temp, +- .config = aqr_hwmon_temp_config, +-}; +- +-static const struct hwmon_channel_info *aqr_hwmon_info[] = { +- &aqr_hwmon_chip, +- &aqr_hwmon_temp, +- NULL, +-}; +- +-static const struct hwmon_chip_info aqr_hwmon_chip_info = { +- .ops = &aqr_hwmon_ops, +- .info = aqr_hwmon_info, +-}; +- +-int aqr_hwmon_probe(struct phy_device *phydev) +-{ +- struct device *dev = &phydev->mdio.dev; +- struct device *hwmon_dev; +- char *hwmon_name; +- int i, j; +- +- hwmon_name = devm_kstrdup(dev, dev_name(dev), GFP_KERNEL); +- if (!hwmon_name) +- return -ENOMEM; +- +- for (i = j = 0; hwmon_name[i]; i++) { +- if (isalnum(hwmon_name[i])) { +- if (i != j) +- hwmon_name[j] = hwmon_name[i]; +- j++; +- } +- } +- hwmon_name[j] = '\0'; +- +- hwmon_dev = devm_hwmon_device_register_with_info(dev, hwmon_name, +- phydev, &aqr_hwmon_chip_info, NULL); +- +- return PTR_ERR_OR_ZERO(hwmon_dev); +-} +- +-#endif +--- a/drivers/net/phy/aquantia_main.c ++++ /dev/null +@@ -1,842 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0 +-/* +- * Driver for Aquantia PHY +- * +- * Author: Shaohui Xie +- * +- * Copyright 2015 Freescale Semiconductor, Inc. +- */ +- +-#include +-#include +-#include +-#include +-#include +- +-#include "aquantia.h" +- +-#define PHY_ID_AQ1202 0x03a1b445 +-#define PHY_ID_AQ2104 0x03a1b460 +-#define PHY_ID_AQR105 0x03a1b4a2 +-#define PHY_ID_AQR106 0x03a1b4d0 +-#define PHY_ID_AQR107 0x03a1b4e0 +-#define PHY_ID_AQCS109 0x03a1b5c2 +-#define PHY_ID_AQR405 0x03a1b4b0 +-#define PHY_ID_AQR113C 0x31c31c12 +- +-#define MDIO_PHYXS_VEND_IF_STATUS 0xe812 +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3) +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_KR 0 +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_KX 1 +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_XFI 2 +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_USXGMII 3 +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_XAUI 4 +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_SGMII 6 +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_RXAUI 7 +-#define MDIO_PHYXS_VEND_IF_STATUS_TYPE_OCSGMII 10 +- +-#define MDIO_AN_VEND_PROV 0xc400 +-#define MDIO_AN_VEND_PROV_1000BASET_FULL BIT(15) +-#define MDIO_AN_VEND_PROV_1000BASET_HALF BIT(14) +-#define MDIO_AN_VEND_PROV_5000BASET_FULL BIT(11) +-#define MDIO_AN_VEND_PROV_2500BASET_FULL BIT(10) +-#define MDIO_AN_VEND_PROV_DOWNSHIFT_EN BIT(4) +-#define MDIO_AN_VEND_PROV_DOWNSHIFT_MASK GENMASK(3, 0) +-#define MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT 4 +- +-#define MDIO_AN_TX_VEND_STATUS1 0xc800 +-#define MDIO_AN_TX_VEND_STATUS1_RATE_MASK GENMASK(3, 1) +-#define MDIO_AN_TX_VEND_STATUS1_10BASET 0 +-#define MDIO_AN_TX_VEND_STATUS1_100BASETX 1 +-#define MDIO_AN_TX_VEND_STATUS1_1000BASET 2 +-#define MDIO_AN_TX_VEND_STATUS1_10GBASET 3 +-#define MDIO_AN_TX_VEND_STATUS1_2500BASET 4 +-#define MDIO_AN_TX_VEND_STATUS1_5000BASET 5 +-#define MDIO_AN_TX_VEND_STATUS1_FULL_DUPLEX BIT(0) +- +-#define MDIO_AN_TX_VEND_INT_STATUS1 0xcc00 +-#define MDIO_AN_TX_VEND_INT_STATUS1_DOWNSHIFT BIT(1) +- +-#define MDIO_AN_TX_VEND_INT_STATUS2 0xcc01 +-#define MDIO_AN_TX_VEND_INT_STATUS2_MASK BIT(0) +- +-#define MDIO_AN_TX_VEND_INT_MASK2 0xd401 +-#define MDIO_AN_TX_VEND_INT_MASK2_LINK BIT(0) +- +-#define MDIO_AN_RX_LP_STAT1 0xe820 +-#define MDIO_AN_RX_LP_STAT1_1000BASET_FULL BIT(15) +-#define MDIO_AN_RX_LP_STAT1_1000BASET_HALF BIT(14) +-#define MDIO_AN_RX_LP_STAT1_SHORT_REACH BIT(13) +-#define MDIO_AN_RX_LP_STAT1_AQRATE_DOWNSHIFT BIT(12) +-#define MDIO_AN_RX_LP_STAT1_AQ_PHY BIT(2) +- +-#define MDIO_AN_RX_LP_STAT4 0xe823 +-#define MDIO_AN_RX_LP_STAT4_FW_MAJOR GENMASK(15, 8) +-#define MDIO_AN_RX_LP_STAT4_FW_MINOR GENMASK(7, 0) +- +-#define MDIO_AN_RX_VEND_STAT3 0xe832 +-#define MDIO_AN_RX_VEND_STAT3_AFR BIT(0) +- +-/* MDIO_MMD_C22EXT */ +-#define MDIO_C22EXT_STAT_SGMII_RX_GOOD_FRAMES 0xd292 +-#define MDIO_C22EXT_STAT_SGMII_RX_BAD_FRAMES 0xd294 +-#define MDIO_C22EXT_STAT_SGMII_RX_FALSE_CARRIER 0xd297 +-#define MDIO_C22EXT_STAT_SGMII_TX_GOOD_FRAMES 0xd313 +-#define MDIO_C22EXT_STAT_SGMII_TX_BAD_FRAMES 0xd315 +-#define MDIO_C22EXT_STAT_SGMII_TX_FALSE_CARRIER 0xd317 +-#define MDIO_C22EXT_STAT_SGMII_TX_COLLISIONS 0xd318 +-#define MDIO_C22EXT_STAT_SGMII_TX_LINE_COLLISIONS 0xd319 +-#define MDIO_C22EXT_STAT_SGMII_TX_FRAME_ALIGN_ERR 0xd31a +-#define MDIO_C22EXT_STAT_SGMII_TX_RUNT_FRAMES 0xd31b +- +-/* Vendor specific 1, MDIO_MMD_VEND1 */ +-#define VEND1_GLOBAL_FW_ID 0x0020 +-#define VEND1_GLOBAL_FW_ID_MAJOR GENMASK(15, 8) +-#define VEND1_GLOBAL_FW_ID_MINOR GENMASK(7, 0) +- +-#define VEND1_GLOBAL_GEN_STAT2 0xc831 +-#define VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG BIT(15) +- +-/* The following registers all have similar layouts; first the registers... */ +-#define VEND1_GLOBAL_CFG_10M 0x0310 +-#define VEND1_GLOBAL_CFG_100M 0x031b +-#define VEND1_GLOBAL_CFG_1G 0x031c +-#define VEND1_GLOBAL_CFG_2_5G 0x031d +-#define VEND1_GLOBAL_CFG_5G 0x031e +-#define VEND1_GLOBAL_CFG_10G 0x031f +-/* ...and now the fields */ +-#define VEND1_GLOBAL_CFG_RATE_ADAPT GENMASK(8, 7) +-#define VEND1_GLOBAL_CFG_RATE_ADAPT_NONE 0 +-#define VEND1_GLOBAL_CFG_RATE_ADAPT_USX 1 +-#define VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE 2 +- +-#define VEND1_GLOBAL_RSVD_STAT1 0xc885 +-#define VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID GENMASK(7, 4) +-#define VEND1_GLOBAL_RSVD_STAT1_PROV_ID GENMASK(3, 0) +- +-#define VEND1_GLOBAL_RSVD_STAT9 0xc88d +-#define VEND1_GLOBAL_RSVD_STAT9_MODE GENMASK(7, 0) +-#define VEND1_GLOBAL_RSVD_STAT9_1000BT2 0x23 +- +-#define VEND1_GLOBAL_INT_STD_STATUS 0xfc00 +-#define VEND1_GLOBAL_INT_VEND_STATUS 0xfc01 +- +-#define VEND1_GLOBAL_INT_STD_MASK 0xff00 +-#define VEND1_GLOBAL_INT_STD_MASK_PMA1 BIT(15) +-#define VEND1_GLOBAL_INT_STD_MASK_PMA2 BIT(14) +-#define VEND1_GLOBAL_INT_STD_MASK_PCS1 BIT(13) +-#define VEND1_GLOBAL_INT_STD_MASK_PCS2 BIT(12) +-#define VEND1_GLOBAL_INT_STD_MASK_PCS3 BIT(11) +-#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS1 BIT(10) +-#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS2 BIT(9) +-#define VEND1_GLOBAL_INT_STD_MASK_AN1 BIT(8) +-#define VEND1_GLOBAL_INT_STD_MASK_AN2 BIT(7) +-#define VEND1_GLOBAL_INT_STD_MASK_GBE BIT(6) +-#define VEND1_GLOBAL_INT_STD_MASK_ALL BIT(0) +- +-#define VEND1_GLOBAL_INT_VEND_MASK 0xff01 +-#define VEND1_GLOBAL_INT_VEND_MASK_PMA BIT(15) +-#define VEND1_GLOBAL_INT_VEND_MASK_PCS BIT(14) +-#define VEND1_GLOBAL_INT_VEND_MASK_PHY_XS BIT(13) +-#define VEND1_GLOBAL_INT_VEND_MASK_AN BIT(12) +-#define VEND1_GLOBAL_INT_VEND_MASK_GBE BIT(11) +-#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL1 BIT(2) +-#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL2 BIT(1) +-#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 BIT(0) +- +-/* Sleep and timeout for checking if the Processor-Intensive +- * MDIO operation is finished +- */ +-#define AQR107_OP_IN_PROG_SLEEP 1000 +-#define AQR107_OP_IN_PROG_TIMEOUT 100000 +- +-struct aqr107_hw_stat { +- const char *name; +- int reg; +- int size; +-}; +- +-#define SGMII_STAT(n, r, s) { n, MDIO_C22EXT_STAT_SGMII_ ## r, s } +-static const struct aqr107_hw_stat aqr107_hw_stats[] = { +- SGMII_STAT("sgmii_rx_good_frames", RX_GOOD_FRAMES, 26), +- SGMII_STAT("sgmii_rx_bad_frames", RX_BAD_FRAMES, 26), +- SGMII_STAT("sgmii_rx_false_carrier_events", RX_FALSE_CARRIER, 8), +- SGMII_STAT("sgmii_tx_good_frames", TX_GOOD_FRAMES, 26), +- SGMII_STAT("sgmii_tx_bad_frames", TX_BAD_FRAMES, 26), +- SGMII_STAT("sgmii_tx_false_carrier_events", TX_FALSE_CARRIER, 8), +- SGMII_STAT("sgmii_tx_collisions", TX_COLLISIONS, 8), +- SGMII_STAT("sgmii_tx_line_collisions", TX_LINE_COLLISIONS, 8), +- SGMII_STAT("sgmii_tx_frame_alignment_err", TX_FRAME_ALIGN_ERR, 16), +- SGMII_STAT("sgmii_tx_runt_frames", TX_RUNT_FRAMES, 22), +-}; +-#define AQR107_SGMII_STAT_SZ ARRAY_SIZE(aqr107_hw_stats) +- +-struct aqr107_priv { +- u64 sgmii_stats[AQR107_SGMII_STAT_SZ]; +-}; +- +-static int aqr107_get_sset_count(struct phy_device *phydev) +-{ +- return AQR107_SGMII_STAT_SZ; +-} +- +-static void aqr107_get_strings(struct phy_device *phydev, u8 *data) +-{ +- int i; +- +- for (i = 0; i < AQR107_SGMII_STAT_SZ; i++) +- strscpy(data + i * ETH_GSTRING_LEN, aqr107_hw_stats[i].name, +- ETH_GSTRING_LEN); +-} +- +-static u64 aqr107_get_stat(struct phy_device *phydev, int index) +-{ +- const struct aqr107_hw_stat *stat = aqr107_hw_stats + index; +- int len_l = min(stat->size, 16); +- int len_h = stat->size - len_l; +- u64 ret; +- int val; +- +- val = phy_read_mmd(phydev, MDIO_MMD_C22EXT, stat->reg); +- if (val < 0) +- return U64_MAX; +- +- ret = val & GENMASK(len_l - 1, 0); +- if (len_h) { +- val = phy_read_mmd(phydev, MDIO_MMD_C22EXT, stat->reg + 1); +- if (val < 0) +- return U64_MAX; +- +- ret += (val & GENMASK(len_h - 1, 0)) << 16; +- } +- +- return ret; +-} +- +-static void aqr107_get_stats(struct phy_device *phydev, +- struct ethtool_stats *stats, u64 *data) +-{ +- struct aqr107_priv *priv = phydev->priv; +- u64 val; +- int i; +- +- for (i = 0; i < AQR107_SGMII_STAT_SZ; i++) { +- val = aqr107_get_stat(phydev, i); +- if (val == U64_MAX) +- phydev_err(phydev, "Reading HW Statistics failed for %s\n", +- aqr107_hw_stats[i].name); +- else +- priv->sgmii_stats[i] += val; +- +- data[i] = priv->sgmii_stats[i]; +- } +-} +- +-static int aqr_config_aneg(struct phy_device *phydev) +-{ +- bool changed = false; +- u16 reg; +- int ret; +- +- if (phydev->autoneg == AUTONEG_DISABLE) +- return genphy_c45_pma_setup_forced(phydev); +- +- ret = genphy_c45_an_config_aneg(phydev); +- if (ret < 0) +- return ret; +- if (ret > 0) +- changed = true; +- +- /* Clause 45 has no standardized support for 1000BaseT, therefore +- * use vendor registers for this mode. +- */ +- reg = 0; +- if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, +- phydev->advertising)) +- reg |= MDIO_AN_VEND_PROV_1000BASET_FULL; +- +- if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, +- phydev->advertising)) +- reg |= MDIO_AN_VEND_PROV_1000BASET_HALF; +- +- /* Handle the case when the 2.5G and 5G speeds are not advertised */ +- if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, +- phydev->advertising)) +- reg |= MDIO_AN_VEND_PROV_2500BASET_FULL; +- +- if (linkmode_test_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT, +- phydev->advertising)) +- reg |= MDIO_AN_VEND_PROV_5000BASET_FULL; +- +- ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_VEND_PROV, +- MDIO_AN_VEND_PROV_1000BASET_HALF | +- MDIO_AN_VEND_PROV_1000BASET_FULL | +- MDIO_AN_VEND_PROV_2500BASET_FULL | +- MDIO_AN_VEND_PROV_5000BASET_FULL, reg); +- if (ret < 0) +- return ret; +- if (ret > 0) +- changed = true; +- +- return genphy_c45_check_and_restart_aneg(phydev, changed); +-} +- +-static int aqr_config_intr(struct phy_device *phydev) +-{ +- bool en = phydev->interrupts == PHY_INTERRUPT_ENABLED; +- int err; +- +- if (en) { +- /* Clear any pending interrupts before enabling them */ +- err = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_STATUS2); +- if (err < 0) +- return err; +- } +- +- err = phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_MASK2, +- en ? MDIO_AN_TX_VEND_INT_MASK2_LINK : 0); +- if (err < 0) +- return err; +- +- err = phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_INT_STD_MASK, +- en ? VEND1_GLOBAL_INT_STD_MASK_ALL : 0); +- if (err < 0) +- return err; +- +- err = phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_INT_VEND_MASK, +- en ? VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 | +- VEND1_GLOBAL_INT_VEND_MASK_AN : 0); +- if (err < 0) +- return err; +- +- if (!en) { +- /* Clear any pending interrupts after we have disabled them */ +- err = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_STATUS2); +- if (err < 0) +- return err; +- } +- +- return 0; +-} +- +-static irqreturn_t aqr_handle_interrupt(struct phy_device *phydev) +-{ +- int irq_status; +- +- irq_status = phy_read_mmd(phydev, MDIO_MMD_AN, +- MDIO_AN_TX_VEND_INT_STATUS2); +- if (irq_status < 0) { +- phy_error(phydev); +- return IRQ_NONE; +- } +- +- if (!(irq_status & MDIO_AN_TX_VEND_INT_STATUS2_MASK)) +- return IRQ_NONE; +- +- phy_trigger_machine(phydev); +- +- return IRQ_HANDLED; +-} +- +-static int aqr_read_status(struct phy_device *phydev) +-{ +- int val; +- +- if (phydev->autoneg == AUTONEG_ENABLE) { +- val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_RX_LP_STAT1); +- if (val < 0) +- return val; +- +- linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, +- phydev->lp_advertising, +- val & MDIO_AN_RX_LP_STAT1_1000BASET_FULL); +- linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, +- phydev->lp_advertising, +- val & MDIO_AN_RX_LP_STAT1_1000BASET_HALF); +- } +- +- return genphy_c45_read_status(phydev); +-} +- +-static int aqr107_read_rate(struct phy_device *phydev) +-{ +- u32 config_reg; +- int val; +- +- val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_STATUS1); +- if (val < 0) +- return val; +- +- if (val & MDIO_AN_TX_VEND_STATUS1_FULL_DUPLEX) +- phydev->duplex = DUPLEX_FULL; +- else +- phydev->duplex = DUPLEX_HALF; +- +- switch (FIELD_GET(MDIO_AN_TX_VEND_STATUS1_RATE_MASK, val)) { +- case MDIO_AN_TX_VEND_STATUS1_10BASET: +- phydev->speed = SPEED_10; +- config_reg = VEND1_GLOBAL_CFG_10M; +- break; +- case MDIO_AN_TX_VEND_STATUS1_100BASETX: +- phydev->speed = SPEED_100; +- config_reg = VEND1_GLOBAL_CFG_100M; +- break; +- case MDIO_AN_TX_VEND_STATUS1_1000BASET: +- phydev->speed = SPEED_1000; +- config_reg = VEND1_GLOBAL_CFG_1G; +- break; +- case MDIO_AN_TX_VEND_STATUS1_2500BASET: +- phydev->speed = SPEED_2500; +- config_reg = VEND1_GLOBAL_CFG_2_5G; +- break; +- case MDIO_AN_TX_VEND_STATUS1_5000BASET: +- phydev->speed = SPEED_5000; +- config_reg = VEND1_GLOBAL_CFG_5G; +- break; +- case MDIO_AN_TX_VEND_STATUS1_10GBASET: +- phydev->speed = SPEED_10000; +- config_reg = VEND1_GLOBAL_CFG_10G; +- break; +- default: +- phydev->speed = SPEED_UNKNOWN; +- return 0; +- } +- +- val = phy_read_mmd(phydev, MDIO_MMD_VEND1, config_reg); +- if (val < 0) +- return val; +- +- if (FIELD_GET(VEND1_GLOBAL_CFG_RATE_ADAPT, val) == +- VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE) +- phydev->rate_matching = RATE_MATCH_PAUSE; +- else +- phydev->rate_matching = RATE_MATCH_NONE; +- +- return 0; +-} +- +-static int aqr107_read_status(struct phy_device *phydev) +-{ +- int val, ret; +- +- ret = aqr_read_status(phydev); +- if (ret) +- return ret; +- +- if (!phydev->link || phydev->autoneg == AUTONEG_DISABLE) +- return 0; +- +- val = phy_read_mmd(phydev, MDIO_MMD_PHYXS, MDIO_PHYXS_VEND_IF_STATUS); +- if (val < 0) +- return val; +- +- switch (FIELD_GET(MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK, val)) { +- case MDIO_PHYXS_VEND_IF_STATUS_TYPE_KR: +- phydev->interface = PHY_INTERFACE_MODE_10GKR; +- break; +- case MDIO_PHYXS_VEND_IF_STATUS_TYPE_KX: +- phydev->interface = PHY_INTERFACE_MODE_1000BASEKX; +- break; +- case MDIO_PHYXS_VEND_IF_STATUS_TYPE_XFI: +- phydev->interface = PHY_INTERFACE_MODE_10GBASER; +- break; +- case MDIO_PHYXS_VEND_IF_STATUS_TYPE_USXGMII: +- phydev->interface = PHY_INTERFACE_MODE_USXGMII; +- break; +- case MDIO_PHYXS_VEND_IF_STATUS_TYPE_XAUI: +- phydev->interface = PHY_INTERFACE_MODE_XAUI; +- break; +- case MDIO_PHYXS_VEND_IF_STATUS_TYPE_SGMII: +- phydev->interface = PHY_INTERFACE_MODE_SGMII; +- break; +- case MDIO_PHYXS_VEND_IF_STATUS_TYPE_RXAUI: +- phydev->interface = PHY_INTERFACE_MODE_RXAUI; +- break; +- case MDIO_PHYXS_VEND_IF_STATUS_TYPE_OCSGMII: +- phydev->interface = PHY_INTERFACE_MODE_2500BASEX; +- break; +- default: +- phydev->interface = PHY_INTERFACE_MODE_NA; +- break; +- } +- +- /* Read possibly downshifted rate from vendor register */ +- return aqr107_read_rate(phydev); +-} +- +-static int aqr107_get_downshift(struct phy_device *phydev, u8 *data) +-{ +- int val, cnt, enable; +- +- val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_VEND_PROV); +- if (val < 0) +- return val; +- +- enable = FIELD_GET(MDIO_AN_VEND_PROV_DOWNSHIFT_EN, val); +- cnt = FIELD_GET(MDIO_AN_VEND_PROV_DOWNSHIFT_MASK, val); +- +- *data = enable && cnt ? cnt : DOWNSHIFT_DEV_DISABLE; +- +- return 0; +-} +- +-static int aqr107_set_downshift(struct phy_device *phydev, u8 cnt) +-{ +- int val = 0; +- +- if (!FIELD_FIT(MDIO_AN_VEND_PROV_DOWNSHIFT_MASK, cnt)) +- return -E2BIG; +- +- if (cnt != DOWNSHIFT_DEV_DISABLE) { +- val = MDIO_AN_VEND_PROV_DOWNSHIFT_EN; +- val |= FIELD_PREP(MDIO_AN_VEND_PROV_DOWNSHIFT_MASK, cnt); +- } +- +- return phy_modify_mmd(phydev, MDIO_MMD_AN, MDIO_AN_VEND_PROV, +- MDIO_AN_VEND_PROV_DOWNSHIFT_EN | +- MDIO_AN_VEND_PROV_DOWNSHIFT_MASK, val); +-} +- +-static int aqr107_get_tunable(struct phy_device *phydev, +- struct ethtool_tunable *tuna, void *data) +-{ +- switch (tuna->id) { +- case ETHTOOL_PHY_DOWNSHIFT: +- return aqr107_get_downshift(phydev, data); +- default: +- return -EOPNOTSUPP; +- } +-} +- +-static int aqr107_set_tunable(struct phy_device *phydev, +- struct ethtool_tunable *tuna, const void *data) +-{ +- switch (tuna->id) { +- case ETHTOOL_PHY_DOWNSHIFT: +- return aqr107_set_downshift(phydev, *(const u8 *)data); +- default: +- return -EOPNOTSUPP; +- } +-} +- +-/* If we configure settings whilst firmware is still initializing the chip, +- * then these settings may be overwritten. Therefore make sure chip +- * initialization has completed. Use presence of the firmware ID as +- * indicator for initialization having completed. +- * The chip also provides a "reset completed" bit, but it's cleared after +- * read. Therefore function would time out if called again. +- */ +-static int aqr107_wait_reset_complete(struct phy_device *phydev) +-{ +- int val; +- +- return phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1, +- VEND1_GLOBAL_FW_ID, val, val != 0, +- 20000, 2000000, false); +-} +- +-static void aqr107_chip_info(struct phy_device *phydev) +-{ +- u8 fw_major, fw_minor, build_id, prov_id; +- int val; +- +- val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_FW_ID); +- if (val < 0) +- return; +- +- fw_major = FIELD_GET(VEND1_GLOBAL_FW_ID_MAJOR, val); +- fw_minor = FIELD_GET(VEND1_GLOBAL_FW_ID_MINOR, val); +- +- val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_RSVD_STAT1); +- if (val < 0) +- return; +- +- build_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID, val); +- prov_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_PROV_ID, val); +- +- phydev_dbg(phydev, "FW %u.%u, Build %u, Provisioning %u\n", +- fw_major, fw_minor, build_id, prov_id); +-} +- +-static int aqr107_config_init(struct phy_device *phydev) +-{ +- int ret; +- +- /* Check that the PHY interface type is compatible */ +- if (phydev->interface != PHY_INTERFACE_MODE_SGMII && +- phydev->interface != PHY_INTERFACE_MODE_1000BASEKX && +- phydev->interface != PHY_INTERFACE_MODE_2500BASEX && +- phydev->interface != PHY_INTERFACE_MODE_XGMII && +- phydev->interface != PHY_INTERFACE_MODE_USXGMII && +- phydev->interface != PHY_INTERFACE_MODE_10GKR && +- phydev->interface != PHY_INTERFACE_MODE_10GBASER && +- phydev->interface != PHY_INTERFACE_MODE_XAUI && +- phydev->interface != PHY_INTERFACE_MODE_RXAUI) +- return -ENODEV; +- +- WARN(phydev->interface == PHY_INTERFACE_MODE_XGMII, +- "Your devicetree is out of date, please update it. The AQR107 family doesn't support XGMII, maybe you mean USXGMII.\n"); +- +- ret = aqr107_wait_reset_complete(phydev); +- if (!ret) +- aqr107_chip_info(phydev); +- +- return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT); +-} +- +-static int aqcs109_config_init(struct phy_device *phydev) +-{ +- int ret; +- +- /* Check that the PHY interface type is compatible */ +- if (phydev->interface != PHY_INTERFACE_MODE_SGMII && +- phydev->interface != PHY_INTERFACE_MODE_2500BASEX) +- return -ENODEV; +- +- ret = aqr107_wait_reset_complete(phydev); +- if (!ret) +- aqr107_chip_info(phydev); +- +- /* AQCS109 belongs to a chip family partially supporting 10G and 5G. +- * PMA speed ability bits are the same for all members of the family, +- * AQCS109 however supports speeds up to 2.5G only. +- */ +- phy_set_max_speed(phydev, SPEED_2500); +- +- return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT); +-} +- +-static void aqr107_link_change_notify(struct phy_device *phydev) +-{ +- u8 fw_major, fw_minor; +- bool downshift, short_reach, afr; +- int mode, val; +- +- if (phydev->state != PHY_RUNNING || phydev->autoneg == AUTONEG_DISABLE) +- return; +- +- val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_RX_LP_STAT1); +- /* call failed or link partner is no Aquantia PHY */ +- if (val < 0 || !(val & MDIO_AN_RX_LP_STAT1_AQ_PHY)) +- return; +- +- short_reach = val & MDIO_AN_RX_LP_STAT1_SHORT_REACH; +- downshift = val & MDIO_AN_RX_LP_STAT1_AQRATE_DOWNSHIFT; +- +- val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_RX_LP_STAT4); +- if (val < 0) +- return; +- +- fw_major = FIELD_GET(MDIO_AN_RX_LP_STAT4_FW_MAJOR, val); +- fw_minor = FIELD_GET(MDIO_AN_RX_LP_STAT4_FW_MINOR, val); +- +- val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_RX_VEND_STAT3); +- if (val < 0) +- return; +- +- afr = val & MDIO_AN_RX_VEND_STAT3_AFR; +- +- phydev_dbg(phydev, "Link partner is Aquantia PHY, FW %u.%u%s%s%s\n", +- fw_major, fw_minor, +- short_reach ? ", short reach mode" : "", +- downshift ? ", fast-retrain downshift advertised" : "", +- afr ? ", fast reframe advertised" : ""); +- +- val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_RSVD_STAT9); +- if (val < 0) +- return; +- +- mode = FIELD_GET(VEND1_GLOBAL_RSVD_STAT9_MODE, val); +- if (mode == VEND1_GLOBAL_RSVD_STAT9_1000BT2) +- phydev_info(phydev, "Aquantia 1000Base-T2 mode active\n"); +-} +- +-static int aqr107_wait_processor_intensive_op(struct phy_device *phydev) +-{ +- int val, err; +- +- /* The datasheet notes to wait at least 1ms after issuing a +- * processor intensive operation before checking. +- * We cannot use the 'sleep_before_read' parameter of read_poll_timeout +- * because that just determines the maximum time slept, not the minimum. +- */ +- usleep_range(1000, 5000); +- +- err = phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1, +- VEND1_GLOBAL_GEN_STAT2, val, +- !(val & VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG), +- AQR107_OP_IN_PROG_SLEEP, +- AQR107_OP_IN_PROG_TIMEOUT, false); +- if (err) { +- phydev_err(phydev, "timeout: processor-intensive MDIO operation\n"); +- return err; +- } +- +- return 0; +-} +- +-static int aqr107_get_rate_matching(struct phy_device *phydev, +- phy_interface_t iface) +-{ +- if (iface == PHY_INTERFACE_MODE_10GBASER || +- iface == PHY_INTERFACE_MODE_2500BASEX || +- iface == PHY_INTERFACE_MODE_NA) +- return RATE_MATCH_PAUSE; +- return RATE_MATCH_NONE; +-} +- +-static int aqr107_suspend(struct phy_device *phydev) +-{ +- int err; +- +- err = phy_set_bits_mmd(phydev, MDIO_MMD_VEND1, MDIO_CTRL1, +- MDIO_CTRL1_LPOWER); +- if (err) +- return err; +- +- return aqr107_wait_processor_intensive_op(phydev); +-} +- +-static int aqr107_resume(struct phy_device *phydev) +-{ +- int err; +- +- err = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1, MDIO_CTRL1, +- MDIO_CTRL1_LPOWER); +- if (err) +- return err; +- +- return aqr107_wait_processor_intensive_op(phydev); +-} +- +-static int aqr107_probe(struct phy_device *phydev) +-{ +- phydev->priv = devm_kzalloc(&phydev->mdio.dev, +- sizeof(struct aqr107_priv), GFP_KERNEL); +- if (!phydev->priv) +- return -ENOMEM; +- +- return aqr_hwmon_probe(phydev); +-} +- +-static struct phy_driver aqr_driver[] = { +-{ +- PHY_ID_MATCH_MODEL(PHY_ID_AQ1202), +- .name = "Aquantia AQ1202", +- .config_aneg = aqr_config_aneg, +- .config_intr = aqr_config_intr, +- .handle_interrupt = aqr_handle_interrupt, +- .read_status = aqr_read_status, +-}, +-{ +- PHY_ID_MATCH_MODEL(PHY_ID_AQ2104), +- .name = "Aquantia AQ2104", +- .config_aneg = aqr_config_aneg, +- .config_intr = aqr_config_intr, +- .handle_interrupt = aqr_handle_interrupt, +- .read_status = aqr_read_status, +-}, +-{ +- PHY_ID_MATCH_MODEL(PHY_ID_AQR105), +- .name = "Aquantia AQR105", +- .config_aneg = aqr_config_aneg, +- .config_intr = aqr_config_intr, +- .handle_interrupt = aqr_handle_interrupt, +- .read_status = aqr_read_status, +- .suspend = aqr107_suspend, +- .resume = aqr107_resume, +-}, +-{ +- PHY_ID_MATCH_MODEL(PHY_ID_AQR106), +- .name = "Aquantia AQR106", +- .config_aneg = aqr_config_aneg, +- .config_intr = aqr_config_intr, +- .handle_interrupt = aqr_handle_interrupt, +- .read_status = aqr_read_status, +-}, +-{ +- PHY_ID_MATCH_MODEL(PHY_ID_AQR107), +- .name = "Aquantia AQR107", +- .probe = aqr107_probe, +- .get_rate_matching = aqr107_get_rate_matching, +- .config_init = aqr107_config_init, +- .config_aneg = aqr_config_aneg, +- .config_intr = aqr_config_intr, +- .handle_interrupt = aqr_handle_interrupt, +- .read_status = aqr107_read_status, +- .get_tunable = aqr107_get_tunable, +- .set_tunable = aqr107_set_tunable, +- .suspend = aqr107_suspend, +- .resume = aqr107_resume, +- .get_sset_count = aqr107_get_sset_count, +- .get_strings = aqr107_get_strings, +- .get_stats = aqr107_get_stats, +- .link_change_notify = aqr107_link_change_notify, +-}, +-{ +- PHY_ID_MATCH_MODEL(PHY_ID_AQCS109), +- .name = "Aquantia AQCS109", +- .probe = aqr107_probe, +- .get_rate_matching = aqr107_get_rate_matching, +- .config_init = aqcs109_config_init, +- .config_aneg = aqr_config_aneg, +- .config_intr = aqr_config_intr, +- .handle_interrupt = aqr_handle_interrupt, +- .read_status = aqr107_read_status, +- .get_tunable = aqr107_get_tunable, +- .set_tunable = aqr107_set_tunable, +- .suspend = aqr107_suspend, +- .resume = aqr107_resume, +- .get_sset_count = aqr107_get_sset_count, +- .get_strings = aqr107_get_strings, +- .get_stats = aqr107_get_stats, +- .link_change_notify = aqr107_link_change_notify, +-}, +-{ +- PHY_ID_MATCH_MODEL(PHY_ID_AQR405), +- .name = "Aquantia AQR405", +- .config_aneg = aqr_config_aneg, +- .config_intr = aqr_config_intr, +- .handle_interrupt = aqr_handle_interrupt, +- .read_status = aqr_read_status, +-}, +-{ +- PHY_ID_MATCH_MODEL(PHY_ID_AQR113C), +- .name = "Aquantia AQR113C", +- .probe = aqr107_probe, +- .get_rate_matching = aqr107_get_rate_matching, +- .config_init = aqr107_config_init, +- .config_aneg = aqr_config_aneg, +- .config_intr = aqr_config_intr, +- .handle_interrupt = aqr_handle_interrupt, +- .read_status = aqr107_read_status, +- .get_tunable = aqr107_get_tunable, +- .set_tunable = aqr107_set_tunable, +- .suspend = aqr107_suspend, +- .resume = aqr107_resume, +- .get_sset_count = aqr107_get_sset_count, +- .get_strings = aqr107_get_strings, +- .get_stats = aqr107_get_stats, +- .link_change_notify = aqr107_link_change_notify, +-}, +-}; +- +-module_phy_driver(aqr_driver); +- +-static struct mdio_device_id __maybe_unused aqr_tbl[] = { +- { PHY_ID_MATCH_MODEL(PHY_ID_AQ1202) }, +- { PHY_ID_MATCH_MODEL(PHY_ID_AQ2104) }, +- { PHY_ID_MATCH_MODEL(PHY_ID_AQR105) }, +- { PHY_ID_MATCH_MODEL(PHY_ID_AQR106) }, +- { PHY_ID_MATCH_MODEL(PHY_ID_AQR107) }, +- { PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) }, +- { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) }, +- { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) }, +- { } +-}; +- +-MODULE_DEVICE_TABLE(mdio, aqr_tbl); +- +-MODULE_DESCRIPTION("Aquantia PHY driver"); +-MODULE_AUTHOR("Shaohui Xie "); +-MODULE_LICENSE("GPL v2"); diff --git a/target/linux/generic/backport-6.1/702-02-v6.7-net-phy-aquantia-move-MMD_VEND-define-to-header.patch b/target/linux/generic/backport-6.1/702-02-v6.7-net-phy-aquantia-move-MMD_VEND-define-to-header.patch new file mode 100644 index 00000000000000..2b945227237762 --- /dev/null +++ b/target/linux/generic/backport-6.1/702-02-v6.7-net-phy-aquantia-move-MMD_VEND-define-to-header.patch @@ -0,0 +1,183 @@ +From e1fbfa4a995d42e02e22b0dff2f8b4fdee1504b3 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Tue, 14 Nov 2023 15:08:42 +0100 +Subject: [PATCH 2/3] net: phy: aquantia: move MMD_VEND define to header + +Move MMD_VEND define to header to clean things up and in preparation for +firmware loading support that require some define placed in +aquantia_main. + +Signed-off-by: Christian Marangi +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/phy/aquantia/aquantia.h | 69 +++++++++++++++++++++++ + drivers/net/phy/aquantia/aquantia_hwmon.c | 14 ----- + drivers/net/phy/aquantia/aquantia_main.c | 55 ------------------ + 3 files changed, 69 insertions(+), 69 deletions(-) + +--- a/drivers/net/phy/aquantia/aquantia.h ++++ b/drivers/net/phy/aquantia/aquantia.h +@@ -9,6 +9,75 @@ + #include + #include + ++/* Vendor specific 1, MDIO_MMD_VEND1 */ ++#define VEND1_GLOBAL_FW_ID 0x0020 ++#define VEND1_GLOBAL_FW_ID_MAJOR GENMASK(15, 8) ++#define VEND1_GLOBAL_FW_ID_MINOR GENMASK(7, 0) ++ ++/* The following registers all have similar layouts; first the registers... */ ++#define VEND1_GLOBAL_CFG_10M 0x0310 ++#define VEND1_GLOBAL_CFG_100M 0x031b ++#define VEND1_GLOBAL_CFG_1G 0x031c ++#define VEND1_GLOBAL_CFG_2_5G 0x031d ++#define VEND1_GLOBAL_CFG_5G 0x031e ++#define VEND1_GLOBAL_CFG_10G 0x031f ++/* ...and now the fields */ ++#define VEND1_GLOBAL_CFG_RATE_ADAPT GENMASK(8, 7) ++#define VEND1_GLOBAL_CFG_RATE_ADAPT_NONE 0 ++#define VEND1_GLOBAL_CFG_RATE_ADAPT_USX 1 ++#define VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE 2 ++ ++/* Vendor specific 1, MDIO_MMD_VEND2 */ ++#define VEND1_THERMAL_PROV_HIGH_TEMP_FAIL 0xc421 ++#define VEND1_THERMAL_PROV_LOW_TEMP_FAIL 0xc422 ++#define VEND1_THERMAL_PROV_HIGH_TEMP_WARN 0xc423 ++#define VEND1_THERMAL_PROV_LOW_TEMP_WARN 0xc424 ++#define VEND1_THERMAL_STAT1 0xc820 ++#define VEND1_THERMAL_STAT2 0xc821 ++#define VEND1_THERMAL_STAT2_VALID BIT(0) ++#define VEND1_GENERAL_STAT1 0xc830 ++#define VEND1_GENERAL_STAT1_HIGH_TEMP_FAIL BIT(14) ++#define VEND1_GENERAL_STAT1_LOW_TEMP_FAIL BIT(13) ++#define VEND1_GENERAL_STAT1_HIGH_TEMP_WARN BIT(12) ++#define VEND1_GENERAL_STAT1_LOW_TEMP_WARN BIT(11) ++ ++#define VEND1_GLOBAL_GEN_STAT2 0xc831 ++#define VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG BIT(15) ++ ++#define VEND1_GLOBAL_RSVD_STAT1 0xc885 ++#define VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID GENMASK(7, 4) ++#define VEND1_GLOBAL_RSVD_STAT1_PROV_ID GENMASK(3, 0) ++ ++#define VEND1_GLOBAL_RSVD_STAT9 0xc88d ++#define VEND1_GLOBAL_RSVD_STAT9_MODE GENMASK(7, 0) ++#define VEND1_GLOBAL_RSVD_STAT9_1000BT2 0x23 ++ ++#define VEND1_GLOBAL_INT_STD_STATUS 0xfc00 ++#define VEND1_GLOBAL_INT_VEND_STATUS 0xfc01 ++ ++#define VEND1_GLOBAL_INT_STD_MASK 0xff00 ++#define VEND1_GLOBAL_INT_STD_MASK_PMA1 BIT(15) ++#define VEND1_GLOBAL_INT_STD_MASK_PMA2 BIT(14) ++#define VEND1_GLOBAL_INT_STD_MASK_PCS1 BIT(13) ++#define VEND1_GLOBAL_INT_STD_MASK_PCS2 BIT(12) ++#define VEND1_GLOBAL_INT_STD_MASK_PCS3 BIT(11) ++#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS1 BIT(10) ++#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS2 BIT(9) ++#define VEND1_GLOBAL_INT_STD_MASK_AN1 BIT(8) ++#define VEND1_GLOBAL_INT_STD_MASK_AN2 BIT(7) ++#define VEND1_GLOBAL_INT_STD_MASK_GBE BIT(6) ++#define VEND1_GLOBAL_INT_STD_MASK_ALL BIT(0) ++ ++#define VEND1_GLOBAL_INT_VEND_MASK 0xff01 ++#define VEND1_GLOBAL_INT_VEND_MASK_PMA BIT(15) ++#define VEND1_GLOBAL_INT_VEND_MASK_PCS BIT(14) ++#define VEND1_GLOBAL_INT_VEND_MASK_PHY_XS BIT(13) ++#define VEND1_GLOBAL_INT_VEND_MASK_AN BIT(12) ++#define VEND1_GLOBAL_INT_VEND_MASK_GBE BIT(11) ++#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL1 BIT(2) ++#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL2 BIT(1) ++#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 BIT(0) ++ + #if IS_REACHABLE(CONFIG_HWMON) + int aqr_hwmon_probe(struct phy_device *phydev); + #else +--- a/drivers/net/phy/aquantia/aquantia_hwmon.c ++++ b/drivers/net/phy/aquantia/aquantia_hwmon.c +@@ -13,20 +13,6 @@ + + #include "aquantia.h" + +-/* Vendor specific 1, MDIO_MMD_VEND2 */ +-#define VEND1_THERMAL_PROV_HIGH_TEMP_FAIL 0xc421 +-#define VEND1_THERMAL_PROV_LOW_TEMP_FAIL 0xc422 +-#define VEND1_THERMAL_PROV_HIGH_TEMP_WARN 0xc423 +-#define VEND1_THERMAL_PROV_LOW_TEMP_WARN 0xc424 +-#define VEND1_THERMAL_STAT1 0xc820 +-#define VEND1_THERMAL_STAT2 0xc821 +-#define VEND1_THERMAL_STAT2_VALID BIT(0) +-#define VEND1_GENERAL_STAT1 0xc830 +-#define VEND1_GENERAL_STAT1_HIGH_TEMP_FAIL BIT(14) +-#define VEND1_GENERAL_STAT1_LOW_TEMP_FAIL BIT(13) +-#define VEND1_GENERAL_STAT1_HIGH_TEMP_WARN BIT(12) +-#define VEND1_GENERAL_STAT1_LOW_TEMP_WARN BIT(11) +- + #if IS_REACHABLE(CONFIG_HWMON) + + static umode_t aqr_hwmon_is_visible(const void *data, +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c +@@ -89,61 +89,6 @@ + #define MDIO_C22EXT_STAT_SGMII_TX_FRAME_ALIGN_ERR 0xd31a + #define MDIO_C22EXT_STAT_SGMII_TX_RUNT_FRAMES 0xd31b + +-/* Vendor specific 1, MDIO_MMD_VEND1 */ +-#define VEND1_GLOBAL_FW_ID 0x0020 +-#define VEND1_GLOBAL_FW_ID_MAJOR GENMASK(15, 8) +-#define VEND1_GLOBAL_FW_ID_MINOR GENMASK(7, 0) +- +-#define VEND1_GLOBAL_GEN_STAT2 0xc831 +-#define VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG BIT(15) +- +-/* The following registers all have similar layouts; first the registers... */ +-#define VEND1_GLOBAL_CFG_10M 0x0310 +-#define VEND1_GLOBAL_CFG_100M 0x031b +-#define VEND1_GLOBAL_CFG_1G 0x031c +-#define VEND1_GLOBAL_CFG_2_5G 0x031d +-#define VEND1_GLOBAL_CFG_5G 0x031e +-#define VEND1_GLOBAL_CFG_10G 0x031f +-/* ...and now the fields */ +-#define VEND1_GLOBAL_CFG_RATE_ADAPT GENMASK(8, 7) +-#define VEND1_GLOBAL_CFG_RATE_ADAPT_NONE 0 +-#define VEND1_GLOBAL_CFG_RATE_ADAPT_USX 1 +-#define VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE 2 +- +-#define VEND1_GLOBAL_RSVD_STAT1 0xc885 +-#define VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID GENMASK(7, 4) +-#define VEND1_GLOBAL_RSVD_STAT1_PROV_ID GENMASK(3, 0) +- +-#define VEND1_GLOBAL_RSVD_STAT9 0xc88d +-#define VEND1_GLOBAL_RSVD_STAT9_MODE GENMASK(7, 0) +-#define VEND1_GLOBAL_RSVD_STAT9_1000BT2 0x23 +- +-#define VEND1_GLOBAL_INT_STD_STATUS 0xfc00 +-#define VEND1_GLOBAL_INT_VEND_STATUS 0xfc01 +- +-#define VEND1_GLOBAL_INT_STD_MASK 0xff00 +-#define VEND1_GLOBAL_INT_STD_MASK_PMA1 BIT(15) +-#define VEND1_GLOBAL_INT_STD_MASK_PMA2 BIT(14) +-#define VEND1_GLOBAL_INT_STD_MASK_PCS1 BIT(13) +-#define VEND1_GLOBAL_INT_STD_MASK_PCS2 BIT(12) +-#define VEND1_GLOBAL_INT_STD_MASK_PCS3 BIT(11) +-#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS1 BIT(10) +-#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS2 BIT(9) +-#define VEND1_GLOBAL_INT_STD_MASK_AN1 BIT(8) +-#define VEND1_GLOBAL_INT_STD_MASK_AN2 BIT(7) +-#define VEND1_GLOBAL_INT_STD_MASK_GBE BIT(6) +-#define VEND1_GLOBAL_INT_STD_MASK_ALL BIT(0) +- +-#define VEND1_GLOBAL_INT_VEND_MASK 0xff01 +-#define VEND1_GLOBAL_INT_VEND_MASK_PMA BIT(15) +-#define VEND1_GLOBAL_INT_VEND_MASK_PCS BIT(14) +-#define VEND1_GLOBAL_INT_VEND_MASK_PHY_XS BIT(13) +-#define VEND1_GLOBAL_INT_VEND_MASK_AN BIT(12) +-#define VEND1_GLOBAL_INT_VEND_MASK_GBE BIT(11) +-#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL1 BIT(2) +-#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL2 BIT(1) +-#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 BIT(0) +- + /* Sleep and timeout for checking if the Processor-Intensive + * MDIO operation is finished + */ diff --git a/target/linux/generic/backport-6.1/702-03-v6.7-net-phy-aquantia-add-firmware-load-support.patch b/target/linux/generic/backport-6.1/702-03-v6.7-net-phy-aquantia-add-firmware-load-support.patch new file mode 100644 index 00000000000000..aa52b3baa64ca5 --- /dev/null +++ b/target/linux/generic/backport-6.1/702-03-v6.7-net-phy-aquantia-add-firmware-load-support.patch @@ -0,0 +1,504 @@ +From e93984ebc1c82bd34f7a1b3391efaceee0a8ae96 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Tue, 14 Nov 2023 15:08:43 +0100 +Subject: [PATCH 3/3] net: phy: aquantia: add firmware load support + +Aquantia PHY-s require firmware to be loaded before they start operating. +It can be automatically loaded in case when there is a SPI-NOR connected +to Aquantia PHY-s or can be loaded from the host via MDIO. + +This patch adds support for loading the firmware via MDIO as in most cases +there is no SPI-NOR being used to save on cost. +Firmware loading code itself is ported from mainline U-boot with cleanups. + +The firmware has mixed values both in big and little endian. +PHY core itself is big-endian but it expects values to be in little-endian. +The firmware is little-endian but CRC-16 value for it is stored at the end +of firmware in big-endian. + +It seems the PHY does the conversion internally from firmware that is +little-endian to the PHY that is big-endian on using the mailbox +but mailbox returns a big-endian CRC-16 to verify the written data +integrity. + +Co-developed-by: Christian Marangi +Signed-off-by: Robert Marko +Signed-off-by: Christian Marangi +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/phy/aquantia/Kconfig | 1 + + drivers/net/phy/aquantia/Makefile | 2 +- + drivers/net/phy/aquantia/aquantia.h | 32 ++ + drivers/net/phy/aquantia/aquantia_firmware.c | 370 +++++++++++++++++++ + drivers/net/phy/aquantia/aquantia_main.c | 6 + + 5 files changed, 410 insertions(+), 1 deletion(-) + create mode 100644 drivers/net/phy/aquantia/aquantia_firmware.c + +--- a/drivers/net/phy/aquantia/Kconfig ++++ b/drivers/net/phy/aquantia/Kconfig +@@ -1,5 +1,6 @@ + # SPDX-License-Identifier: GPL-2.0-only + config AQUANTIA_PHY + tristate "Aquantia PHYs" ++ select CRC_CCITT + help + Currently supports the Aquantia AQ1202, AQ2104, AQR105, AQR405 +--- a/drivers/net/phy/aquantia/Makefile ++++ b/drivers/net/phy/aquantia/Makefile +@@ -1,5 +1,5 @@ + # SPDX-License-Identifier: GPL-2.0 +-aquantia-objs += aquantia_main.o ++aquantia-objs += aquantia_main.o aquantia_firmware.o + ifdef CONFIG_HWMON + aquantia-objs += aquantia_hwmon.o + endif +--- a/drivers/net/phy/aquantia/aquantia.h ++++ b/drivers/net/phy/aquantia/aquantia.h +@@ -10,10 +10,35 @@ + #include + + /* Vendor specific 1, MDIO_MMD_VEND1 */ ++#define VEND1_GLOBAL_SC 0x0 ++#define VEND1_GLOBAL_SC_SOFT_RESET BIT(15) ++#define VEND1_GLOBAL_SC_LOW_POWER BIT(11) ++ + #define VEND1_GLOBAL_FW_ID 0x0020 + #define VEND1_GLOBAL_FW_ID_MAJOR GENMASK(15, 8) + #define VEND1_GLOBAL_FW_ID_MINOR GENMASK(7, 0) + ++#define VEND1_GLOBAL_MAILBOX_INTERFACE1 0x0200 ++#define VEND1_GLOBAL_MAILBOX_INTERFACE1_EXECUTE BIT(15) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE1_WRITE BIT(14) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE1_CRC_RESET BIT(12) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE1_BUSY BIT(8) ++ ++#define VEND1_GLOBAL_MAILBOX_INTERFACE2 0x0201 ++#define VEND1_GLOBAL_MAILBOX_INTERFACE3 0x0202 ++#define VEND1_GLOBAL_MAILBOX_INTERFACE3_MSW_ADDR_MASK GENMASK(15, 0) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE3_MSW_ADDR(x) FIELD_PREP(VEND1_GLOBAL_MAILBOX_INTERFACE3_MSW_ADDR_MASK, (u16)((x) >> 16)) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE4 0x0203 ++#define VEND1_GLOBAL_MAILBOX_INTERFACE4_LSW_ADDR_MASK GENMASK(15, 2) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE4_LSW_ADDR(x) FIELD_PREP(VEND1_GLOBAL_MAILBOX_INTERFACE4_LSW_ADDR_MASK, (u16)(x)) ++ ++#define VEND1_GLOBAL_MAILBOX_INTERFACE5 0x0204 ++#define VEND1_GLOBAL_MAILBOX_INTERFACE5_MSW_DATA_MASK GENMASK(15, 0) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE5_MSW_DATA(x) FIELD_PREP(VEND1_GLOBAL_MAILBOX_INTERFACE5_MSW_DATA_MASK, (u16)((x) >> 16)) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE6 0x0205 ++#define VEND1_GLOBAL_MAILBOX_INTERFACE6_LSW_DATA_MASK GENMASK(15, 0) ++#define VEND1_GLOBAL_MAILBOX_INTERFACE6_LSW_DATA(x) FIELD_PREP(VEND1_GLOBAL_MAILBOX_INTERFACE6_LSW_DATA_MASK, (u16)(x)) ++ + /* The following registers all have similar layouts; first the registers... */ + #define VEND1_GLOBAL_CFG_10M 0x0310 + #define VEND1_GLOBAL_CFG_100M 0x031b +@@ -28,6 +53,11 @@ + #define VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE 2 + + /* Vendor specific 1, MDIO_MMD_VEND2 */ ++#define VEND1_GLOBAL_CONTROL2 0xc001 ++#define VEND1_GLOBAL_CONTROL2_UP_RUN_STALL_RST BIT(15) ++#define VEND1_GLOBAL_CONTROL2_UP_RUN_STALL_OVD BIT(6) ++#define VEND1_GLOBAL_CONTROL2_UP_RUN_STALL BIT(0) ++ + #define VEND1_THERMAL_PROV_HIGH_TEMP_FAIL 0xc421 + #define VEND1_THERMAL_PROV_LOW_TEMP_FAIL 0xc422 + #define VEND1_THERMAL_PROV_HIGH_TEMP_WARN 0xc423 +@@ -83,3 +113,5 @@ int aqr_hwmon_probe(struct phy_device *p + #else + static inline int aqr_hwmon_probe(struct phy_device *phydev) { return 0; } + #endif ++ ++int aqr_firmware_load(struct phy_device *phydev); +--- /dev/null ++++ b/drivers/net/phy/aquantia/aquantia_firmware.c +@@ -0,0 +1,370 @@ ++// SPDX-License-Identifier: GPL-2.0 ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#include "aquantia.h" ++ ++#define UP_RESET_SLEEP 100 ++ ++/* addresses of memory segments in the phy */ ++#define DRAM_BASE_ADDR 0x3FFE0000 ++#define IRAM_BASE_ADDR 0x40000000 ++ ++/* firmware image format constants */ ++#define VERSION_STRING_SIZE 0x40 ++#define VERSION_STRING_OFFSET 0x0200 ++/* primary offset is written at an offset from the start of the fw blob */ ++#define PRIMARY_OFFSET_OFFSET 0x8 ++/* primary offset needs to be then added to a base offset */ ++#define PRIMARY_OFFSET_SHIFT 12 ++#define PRIMARY_OFFSET(x) ((x) << PRIMARY_OFFSET_SHIFT) ++#define HEADER_OFFSET 0x300 ++ ++struct aqr_fw_header { ++ u32 padding; ++ u8 iram_offset[3]; ++ u8 iram_size[3]; ++ u8 dram_offset[3]; ++ u8 dram_size[3]; ++} __packed; ++ ++enum aqr_fw_src { ++ AQR_FW_SRC_NVMEM = 0, ++ AQR_FW_SRC_FS, ++}; ++ ++static const char * const aqr_fw_src_string[] = { ++ [AQR_FW_SRC_NVMEM] = "NVMEM", ++ [AQR_FW_SRC_FS] = "FS", ++}; ++ ++/* AQR firmware doesn't have fixed offsets for iram and dram section ++ * but instead provide an header with the offset to use on reading ++ * and parsing the firmware. ++ * ++ * AQR firmware can't be trusted and each offset is validated to be ++ * not negative and be in the size of the firmware itself. ++ */ ++static bool aqr_fw_validate_get(size_t size, size_t offset, size_t get_size) ++{ ++ return offset + get_size <= size; ++} ++ ++static int aqr_fw_get_be16(const u8 *data, size_t offset, size_t size, u16 *value) ++{ ++ if (!aqr_fw_validate_get(size, offset, sizeof(u16))) ++ return -EINVAL; ++ ++ *value = get_unaligned_be16(data + offset); ++ ++ return 0; ++} ++ ++static int aqr_fw_get_le16(const u8 *data, size_t offset, size_t size, u16 *value) ++{ ++ if (!aqr_fw_validate_get(size, offset, sizeof(u16))) ++ return -EINVAL; ++ ++ *value = get_unaligned_le16(data + offset); ++ ++ return 0; ++} ++ ++static int aqr_fw_get_le24(const u8 *data, size_t offset, size_t size, u32 *value) ++{ ++ if (!aqr_fw_validate_get(size, offset, sizeof(u8) * 3)) ++ return -EINVAL; ++ ++ *value = get_unaligned_le24(data + offset); ++ ++ return 0; ++} ++ ++/* load data into the phy's memory */ ++static int aqr_fw_load_memory(struct phy_device *phydev, u32 addr, ++ const u8 *data, size_t len) ++{ ++ u16 crc = 0, up_crc; ++ size_t pos; ++ ++ /* PHY expect addr in LE */ ++ addr = (__force u32)cpu_to_le32(addr); ++ ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, ++ VEND1_GLOBAL_MAILBOX_INTERFACE1, ++ VEND1_GLOBAL_MAILBOX_INTERFACE1_CRC_RESET); ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, ++ VEND1_GLOBAL_MAILBOX_INTERFACE3, ++ VEND1_GLOBAL_MAILBOX_INTERFACE3_MSW_ADDR(addr)); ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, ++ VEND1_GLOBAL_MAILBOX_INTERFACE4, ++ VEND1_GLOBAL_MAILBOX_INTERFACE4_LSW_ADDR(addr)); ++ ++ /* We assume and enforce the size to be word aligned. ++ * If a firmware that is not word aligned is found, please report upstream. ++ */ ++ for (pos = 0; pos < len; pos += sizeof(u32)) { ++ u32 word; ++ ++ /* FW data is always stored in little-endian */ ++ word = get_unaligned((const u32 *)(data + pos)); ++ ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_MAILBOX_INTERFACE5, ++ VEND1_GLOBAL_MAILBOX_INTERFACE5_MSW_DATA(word)); ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_MAILBOX_INTERFACE6, ++ VEND1_GLOBAL_MAILBOX_INTERFACE6_LSW_DATA(word)); ++ ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_MAILBOX_INTERFACE1, ++ VEND1_GLOBAL_MAILBOX_INTERFACE1_EXECUTE | ++ VEND1_GLOBAL_MAILBOX_INTERFACE1_WRITE); ++ ++ /* calculate CRC as we load data to the mailbox. ++ * We convert word to big-endian as PHY is BE and mailbox will ++ * return a BE CRC. ++ */ ++ word = (__force u32)cpu_to_be32(word); ++ crc = crc_ccitt_false(crc, (u8 *)&word, sizeof(word)); ++ } ++ ++ up_crc = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_MAILBOX_INTERFACE2); ++ if (crc != up_crc) { ++ phydev_err(phydev, "CRC mismatch: calculated 0x%04x PHY 0x%04x\n", ++ crc, up_crc); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++static int aqr_fw_boot(struct phy_device *phydev, const u8 *data, size_t size, ++ enum aqr_fw_src fw_src) ++{ ++ u16 calculated_crc, read_crc, read_primary_offset; ++ u32 iram_offset = 0, iram_size = 0; ++ u32 dram_offset = 0, dram_size = 0; ++ char version[VERSION_STRING_SIZE]; ++ u32 primary_offset = 0; ++ int ret; ++ ++ /* extract saved CRC at the end of the fw ++ * CRC is saved in big-endian as PHY is BE ++ */ ++ ret = aqr_fw_get_be16(data, size - sizeof(u16), size, &read_crc); ++ if (ret) { ++ phydev_err(phydev, "bad firmware CRC in firmware\n"); ++ return ret; ++ } ++ calculated_crc = crc_ccitt_false(0, data, size - sizeof(u16)); ++ if (read_crc != calculated_crc) { ++ phydev_err(phydev, "bad firmware CRC: file 0x%04x calculated 0x%04x\n", ++ read_crc, calculated_crc); ++ return -EINVAL; ++ } ++ ++ /* Get the primary offset to extract DRAM and IRAM sections. */ ++ ret = aqr_fw_get_le16(data, PRIMARY_OFFSET_OFFSET, size, &read_primary_offset); ++ if (ret) { ++ phydev_err(phydev, "bad primary offset in firmware\n"); ++ return ret; ++ } ++ primary_offset = PRIMARY_OFFSET(read_primary_offset); ++ ++ /* Find the DRAM and IRAM sections within the firmware file. ++ * Make sure the fw_header is correctly in the firmware. ++ */ ++ if (!aqr_fw_validate_get(size, primary_offset + HEADER_OFFSET, ++ sizeof(struct aqr_fw_header))) { ++ phydev_err(phydev, "bad fw_header in firmware\n"); ++ return -EINVAL; ++ } ++ ++ /* offset are in LE and values needs to be converted to cpu endian */ ++ ret = aqr_fw_get_le24(data, primary_offset + HEADER_OFFSET + ++ offsetof(struct aqr_fw_header, iram_offset), ++ size, &iram_offset); ++ if (ret) { ++ phydev_err(phydev, "bad iram offset in firmware\n"); ++ return ret; ++ } ++ ret = aqr_fw_get_le24(data, primary_offset + HEADER_OFFSET + ++ offsetof(struct aqr_fw_header, iram_size), ++ size, &iram_size); ++ if (ret) { ++ phydev_err(phydev, "invalid iram size in firmware\n"); ++ return ret; ++ } ++ ret = aqr_fw_get_le24(data, primary_offset + HEADER_OFFSET + ++ offsetof(struct aqr_fw_header, dram_offset), ++ size, &dram_offset); ++ if (ret) { ++ phydev_err(phydev, "bad dram offset in firmware\n"); ++ return ret; ++ } ++ ret = aqr_fw_get_le24(data, primary_offset + HEADER_OFFSET + ++ offsetof(struct aqr_fw_header, dram_size), ++ size, &dram_size); ++ if (ret) { ++ phydev_err(phydev, "invalid dram size in firmware\n"); ++ return ret; ++ } ++ ++ /* Increment the offset with the primary offset. ++ * Validate iram/dram offset and size. ++ */ ++ iram_offset += primary_offset; ++ if (iram_size % sizeof(u32)) { ++ phydev_err(phydev, "iram size if not aligned to word size. Please report this upstream!\n"); ++ return -EINVAL; ++ } ++ if (!aqr_fw_validate_get(size, iram_offset, iram_size)) { ++ phydev_err(phydev, "invalid iram offset for iram size\n"); ++ return -EINVAL; ++ } ++ ++ dram_offset += primary_offset; ++ if (dram_size % sizeof(u32)) { ++ phydev_err(phydev, "dram size if not aligned to word size. Please report this upstream!\n"); ++ return -EINVAL; ++ } ++ if (!aqr_fw_validate_get(size, dram_offset, dram_size)) { ++ phydev_err(phydev, "invalid iram offset for iram size\n"); ++ return -EINVAL; ++ } ++ ++ phydev_dbg(phydev, "primary %d IRAM offset=%d size=%d DRAM offset=%d size=%d\n", ++ primary_offset, iram_offset, iram_size, dram_offset, dram_size); ++ ++ if (!aqr_fw_validate_get(size, dram_offset + VERSION_STRING_OFFSET, ++ VERSION_STRING_SIZE)) { ++ phydev_err(phydev, "invalid version in firmware\n"); ++ return -EINVAL; ++ } ++ strscpy(version, (char *)data + dram_offset + VERSION_STRING_OFFSET, ++ VERSION_STRING_SIZE); ++ if (version[0] == '\0') { ++ phydev_err(phydev, "invalid version in firmware\n"); ++ return -EINVAL; ++ } ++ phydev_info(phydev, "loading firmware version '%s' from '%s'\n", version, ++ aqr_fw_src_string[fw_src]); ++ ++ /* stall the microcprocessor */ ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_CONTROL2, ++ VEND1_GLOBAL_CONTROL2_UP_RUN_STALL | VEND1_GLOBAL_CONTROL2_UP_RUN_STALL_OVD); ++ ++ phydev_dbg(phydev, "loading DRAM 0x%08x from offset=%d size=%d\n", ++ DRAM_BASE_ADDR, dram_offset, dram_size); ++ ret = aqr_fw_load_memory(phydev, DRAM_BASE_ADDR, data + dram_offset, ++ dram_size); ++ if (ret) ++ return ret; ++ ++ phydev_dbg(phydev, "loading IRAM 0x%08x from offset=%d size=%d\n", ++ IRAM_BASE_ADDR, iram_offset, iram_size); ++ ret = aqr_fw_load_memory(phydev, IRAM_BASE_ADDR, data + iram_offset, ++ iram_size); ++ if (ret) ++ return ret; ++ ++ /* make sure soft reset and low power mode are clear */ ++ phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_SC, ++ VEND1_GLOBAL_SC_SOFT_RESET | VEND1_GLOBAL_SC_LOW_POWER); ++ ++ /* Release the microprocessor. UP_RESET must be held for 100 usec. */ ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_CONTROL2, ++ VEND1_GLOBAL_CONTROL2_UP_RUN_STALL | ++ VEND1_GLOBAL_CONTROL2_UP_RUN_STALL_OVD | ++ VEND1_GLOBAL_CONTROL2_UP_RUN_STALL_RST); ++ usleep_range(UP_RESET_SLEEP, UP_RESET_SLEEP * 2); ++ ++ phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_CONTROL2, ++ VEND1_GLOBAL_CONTROL2_UP_RUN_STALL_OVD); ++ ++ return 0; ++} ++ ++static int aqr_firmware_load_nvmem(struct phy_device *phydev) ++{ ++ struct nvmem_cell *cell; ++ size_t size; ++ u8 *buf; ++ int ret; ++ ++ cell = nvmem_cell_get(&phydev->mdio.dev, "firmware"); ++ if (IS_ERR(cell)) ++ return PTR_ERR(cell); ++ ++ buf = nvmem_cell_read(cell, &size); ++ if (IS_ERR(buf)) { ++ ret = PTR_ERR(buf); ++ goto exit; ++ } ++ ++ ret = aqr_fw_boot(phydev, buf, size, AQR_FW_SRC_NVMEM); ++ if (ret) ++ phydev_err(phydev, "firmware loading failed: %d\n", ret); ++ ++ kfree(buf); ++exit: ++ nvmem_cell_put(cell); ++ ++ return ret; ++} ++ ++static int aqr_firmware_load_fs(struct phy_device *phydev) ++{ ++ struct device *dev = &phydev->mdio.dev; ++ const struct firmware *fw; ++ const char *fw_name; ++ int ret; ++ ++ ret = of_property_read_string(dev->of_node, "firmware-name", ++ &fw_name); ++ if (ret) ++ return ret; ++ ++ ret = request_firmware(&fw, fw_name, dev); ++ if (ret) { ++ phydev_err(phydev, "failed to find FW file %s (%d)\n", ++ fw_name, ret); ++ return ret; ++ } ++ ++ ret = aqr_fw_boot(phydev, fw->data, fw->size, AQR_FW_SRC_FS); ++ if (ret) ++ phydev_err(phydev, "firmware loading failed: %d\n", ret); ++ ++ release_firmware(fw); ++ ++ return ret; ++} ++ ++int aqr_firmware_load(struct phy_device *phydev) ++{ ++ int ret; ++ ++ /* Check if the firmware is not already loaded by pooling ++ * the current version returned by the PHY. If 0 is returned, ++ * no firmware is loaded. ++ */ ++ ret = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_FW_ID); ++ if (ret > 0) ++ goto exit; ++ ++ ret = aqr_firmware_load_nvmem(phydev); ++ if (!ret) ++ goto exit; ++ ++ ret = aqr_firmware_load_fs(phydev); ++ if (ret) ++ return ret; ++ ++exit: ++ return 0; ++} +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c +@@ -656,11 +656,17 @@ static int aqr107_resume(struct phy_devi + + static int aqr107_probe(struct phy_device *phydev) + { ++ int ret; ++ + phydev->priv = devm_kzalloc(&phydev->mdio.dev, + sizeof(struct aqr107_priv), GFP_KERNEL); + if (!phydev->priv) + return -ENOMEM; + ++ ret = aqr_firmware_load(phydev); ++ if (ret) ++ return ret; ++ + return aqr_hwmon_probe(phydev); + } + diff --git a/target/linux/generic/backport-6.1/777-v6.2-05-net-dsa-qca8k-improve-mdio-master-read-write-by-usin.patch b/target/linux/generic/backport-6.1/777-v6.2-05-net-dsa-qca8k-improve-mdio-master-read-write-by-usin.patch index ea34901472dd71..dcafad0fd5edfa 100644 --- a/target/linux/generic/backport-6.1/777-v6.2-05-net-dsa-qca8k-improve-mdio-master-read-write-by-usin.patch +++ b/target/linux/generic/backport-6.1/777-v6.2-05-net-dsa-qca8k-improve-mdio-master-read-write-by-usin.patch @@ -28,7 +28,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c -@@ -743,9 +743,9 @@ qca8k_mdio_busy_wait(struct mii_bus *bus +@@ -754,9 +754,9 @@ qca8k_mdio_busy_wait(struct mii_bus *bus qca8k_split_addr(reg, &r1, &r2, &page); @@ -40,7 +40,7 @@ Signed-off-by: David S. Miller /* Check if qca8k_read has failed for a different reason * before returnting -ETIMEDOUT -@@ -787,7 +787,7 @@ qca8k_mdio_write(struct qca8k_priv *priv +@@ -798,7 +798,7 @@ qca8k_mdio_write(struct qca8k_priv *priv exit: /* even if the busy_wait timeouts try to clear the MASTER_EN */ @@ -49,7 +49,7 @@ Signed-off-by: David S. Miller mutex_unlock(&bus->mdio_lock); -@@ -817,18 +817,18 @@ qca8k_mdio_read(struct qca8k_priv *priv, +@@ -828,18 +828,18 @@ qca8k_mdio_read(struct qca8k_priv *priv, if (ret) goto exit; diff --git a/target/linux/generic/backport-6.1/778-v6.3-02-net-dsa-qca8k-convert-to-regmap-read-write-API.patch b/target/linux/generic/backport-6.1/778-v6.3-02-net-dsa-qca8k-convert-to-regmap-read-write-API.patch index f66149ae37dc65..0a631a09c1daa5 100644 --- a/target/linux/generic/backport-6.1/778-v6.3-02-net-dsa-qca8k-convert-to-regmap-read-write-API.patch +++ b/target/linux/generic/backport-6.1/778-v6.3-02-net-dsa-qca8k-convert-to-regmap-read-write-API.patch @@ -168,7 +168,7 @@ Signed-off-by: David S. Miller }; static int -@@ -2091,8 +2147,6 @@ static SIMPLE_DEV_PM_OPS(qca8k_pm_ops, +@@ -2102,8 +2158,6 @@ static SIMPLE_DEV_PM_OPS(qca8k_pm_ops, static const struct qca8k_info_ops qca8xxx_ops = { .autocast_mib = qca8k_get_ethtool_stats_eth, diff --git a/target/linux/generic/backport-6.1/780-v6.6-01-net-dsa-qca8k-make-learning-configurable-and-keep-of.patch b/target/linux/generic/backport-6.1/780-v6.6-01-net-dsa-qca8k-make-learning-configurable-and-keep-of.patch index b1c0a32e1bf526..6e93491a1278d4 100644 --- a/target/linux/generic/backport-6.1/780-v6.6-01-net-dsa-qca8k-make-learning-configurable-and-keep-of.patch +++ b/target/linux/generic/backport-6.1/780-v6.6-01-net-dsa-qca8k-make-learning-configurable-and-keep-of.patch @@ -32,7 +32,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c -@@ -1883,9 +1883,8 @@ qca8k_setup(struct dsa_switch *ds) +@@ -1894,9 +1894,8 @@ qca8k_setup(struct dsa_switch *ds) if (ret) return ret; @@ -44,7 +44,7 @@ Signed-off-by: Paolo Abeni if (ret) return ret; -@@ -1991,6 +1990,8 @@ static const struct dsa_switch_ops qca8k +@@ -2002,6 +2001,8 @@ static const struct dsa_switch_ops qca8k .port_change_mtu = qca8k_port_change_mtu, .port_max_mtu = qca8k_port_max_mtu, .port_stp_state_set = qca8k_port_stp_state_set, diff --git a/target/linux/generic/backport-6.1/780-v6.6-02-net-dsa-qca8k-limit-user-ports-access-to-the-first-C.patch b/target/linux/generic/backport-6.1/780-v6.6-02-net-dsa-qca8k-limit-user-ports-access-to-the-first-C.patch index b430d2f7922817..fdb3a8cdb9486b 100644 --- a/target/linux/generic/backport-6.1/780-v6.6-02-net-dsa-qca8k-limit-user-ports-access-to-the-first-C.patch +++ b/target/linux/generic/backport-6.1/780-v6.6-02-net-dsa-qca8k-limit-user-ports-access-to-the-first-C.patch @@ -26,7 +26,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c -@@ -1863,18 +1863,16 @@ qca8k_setup(struct dsa_switch *ds) +@@ -1874,18 +1874,16 @@ qca8k_setup(struct dsa_switch *ds) if (ret) return ret; diff --git a/target/linux/generic/backport-6.1/780-v6.6-03-net-dsa-qca8k-move-qca8xxx-hol-fixup-to-separate-fun.patch b/target/linux/generic/backport-6.1/780-v6.6-03-net-dsa-qca8k-move-qca8xxx-hol-fixup-to-separate-fun.patch index 9423c4b6047f4b..c789fdf05ee7cc 100644 --- a/target/linux/generic/backport-6.1/780-v6.6-03-net-dsa-qca8k-move-qca8xxx-hol-fixup-to-separate-fun.patch +++ b/target/linux/generic/backport-6.1/780-v6.6-03-net-dsa-qca8k-move-qca8xxx-hol-fixup-to-separate-fun.patch @@ -17,7 +17,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c -@@ -1773,6 +1773,46 @@ static int qca8k_connect_tag_protocol(st +@@ -1784,6 +1784,46 @@ static int qca8k_connect_tag_protocol(st return 0; } @@ -64,7 +64,7 @@ Signed-off-by: Paolo Abeni static int qca8k_setup(struct dsa_switch *ds) { -@@ -1908,42 +1948,8 @@ qca8k_setup(struct dsa_switch *ds) +@@ -1919,42 +1959,8 @@ qca8k_setup(struct dsa_switch *ds) * missing settings to improve switch stability under load condition. * This problem is limited to qca8337 and other qca8k switch are not affected. */ diff --git a/target/linux/generic/backport-6.1/780-v6.6-04-net-dsa-qca8k-use-dsa_for_each-macro-instead-of-for-.patch b/target/linux/generic/backport-6.1/780-v6.6-04-net-dsa-qca8k-use-dsa_for_each-macro-instead-of-for-.patch index 60de71096522cf..4f9581235db18c 100644 --- a/target/linux/generic/backport-6.1/780-v6.6-04-net-dsa-qca8k-use-dsa_for_each-macro-instead-of-for-.patch +++ b/target/linux/generic/backport-6.1/780-v6.6-04-net-dsa-qca8k-use-dsa_for_each-macro-instead-of-for-.patch @@ -17,7 +17,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c -@@ -1817,7 +1817,8 @@ static int +@@ -1828,7 +1828,8 @@ static int qca8k_setup(struct dsa_switch *ds) { struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; @@ -27,7 +27,7 @@ Signed-off-by: Paolo Abeni u32 mask; cpu_port = qca8k_find_cpu_port(ds); -@@ -1868,27 +1869,27 @@ qca8k_setup(struct dsa_switch *ds) +@@ -1879,27 +1880,27 @@ qca8k_setup(struct dsa_switch *ds) dev_warn(priv->dev, "mib init failed"); /* Initial setup of all ports */ @@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni } /* Forward all unknown frames to CPU port for Linux processing -@@ -1910,48 +1911,48 @@ qca8k_setup(struct dsa_switch *ds) +@@ -1921,48 +1922,48 @@ qca8k_setup(struct dsa_switch *ds) return ret; /* Setup connection between CPU port & user ports diff --git a/target/linux/generic/backport-6.1/781-v6.6-01-net-dsa-qca8k-fix-regmap-bulk-read-write-methods-on-.patch b/target/linux/generic/backport-6.1/781-v6.6-01-net-dsa-qca8k-fix-regmap-bulk-read-write-methods-on-.patch new file mode 100644 index 00000000000000..632f422d1ff7e8 --- /dev/null +++ b/target/linux/generic/backport-6.1/781-v6.6-01-net-dsa-qca8k-fix-regmap-bulk-read-write-methods-on-.patch @@ -0,0 +1,61 @@ +From 5652d1741574eb89cc02576e50ee3e348bd6dd77 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Wed, 4 Oct 2023 11:19:03 +0200 +Subject: [PATCH 1/2] net: dsa: qca8k: fix regmap bulk read/write methods on + big endian systems +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit c766e077d927 ("net: dsa: qca8k: convert to regmap read/write +API") introduced bulk read/write methods to qca8k's regmap. + +The regmap bulk read/write methods get the register address in a buffer +passed as a void pointer parameter (the same buffer contains also the +read/written values). The register address occupies only as many bytes +as it requires at the beginning of this buffer. For example if the +.reg_bits member in regmap_config is 16 (as is the case for this +driver), the register address occupies only the first 2 bytes in this +buffer, so it can be cast to u16. + +But the original commit implementing these bulk read/write methods cast +the buffer to u32: + u32 reg = *(u32 *)reg_buf & U16_MAX; +taking the first 4 bytes. This works on little endian systems where the +first 2 bytes of the buffer correspond to the low 16-bits, but it +obviously cannot work on big endian systems. + +Fix this by casting the beginning of the buffer to u16 as + u32 reg = *(u16 *)reg_buf; + +Fixes: c766e077d927 ("net: dsa: qca8k: convert to regmap read/write API") +Signed-off-by: Marek Behún +Tested-by: Christian Marangi +Reviewed-by: Christian Marangi +Signed-off-by: David S. Miller +--- + drivers/net/dsa/qca/qca8k-8xxx.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/dsa/qca/qca8k-8xxx.c ++++ b/drivers/net/dsa/qca/qca8k-8xxx.c +@@ -504,8 +504,8 @@ qca8k_bulk_read(void *ctx, const void *r + void *val_buf, size_t val_len) + { + int i, count = val_len / sizeof(u32), ret; +- u32 reg = *(u32 *)reg_buf & U16_MAX; + struct qca8k_priv *priv = ctx; ++ u32 reg = *(u16 *)reg_buf; + + if (priv->mgmt_master && + !qca8k_read_eth(priv, reg, val_buf, val_len)) +@@ -526,8 +526,8 @@ qca8k_bulk_gather_write(void *ctx, const + const void *val_buf, size_t val_len) + { + int i, count = val_len / sizeof(u32), ret; +- u32 reg = *(u32 *)reg_buf & U16_MAX; + struct qca8k_priv *priv = ctx; ++ u32 reg = *(u16 *)reg_buf; + u32 *val = (u32 *)val_buf; + + if (priv->mgmt_master && diff --git a/target/linux/generic/backport-6.1/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch b/target/linux/generic/backport-6.1/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch index ddb32385e4e088..06dddffcaa5e0b 100644 --- a/target/linux/generic/backport-6.1/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch +++ b/target/linux/generic/backport-6.1/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch @@ -31,7 +31,7 @@ Signed-off-by: David S. Miller F: drivers/net/phy/motorcomm.c --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -260,7 +260,7 @@ config MOTORCOMM_PHY +@@ -257,7 +257,7 @@ config MOTORCOMM_PHY tristate "Motorcomm PHYs" help Enables support for Motorcomm network PHYs. diff --git a/target/linux/generic/backport-6.1/791-v6.2-03-net-phy-add-Motorcomm-YT8531S-phy-id.patch b/target/linux/generic/backport-6.1/791-v6.2-03-net-phy-add-Motorcomm-YT8531S-phy-id.patch index a2f22ee99b6491..d22cc69425d4f9 100644 --- a/target/linux/generic/backport-6.1/791-v6.2-03-net-phy-add-Motorcomm-YT8531S-phy-id.patch +++ b/target/linux/generic/backport-6.1/791-v6.2-03-net-phy-add-Motorcomm-YT8531S-phy-id.patch @@ -22,7 +22,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -260,7 +260,7 @@ config MOTORCOMM_PHY +@@ -257,7 +257,7 @@ config MOTORCOMM_PHY tristate "Motorcomm PHYs" help Enables support for Motorcomm network PHYs. diff --git a/target/linux/generic/backport-6.1/791-v6.3-09-net-phy-Add-driver-for-Motorcomm-yt8531-gigabit-ethernet.patch b/target/linux/generic/backport-6.1/791-v6.3-09-net-phy-Add-driver-for-Motorcomm-yt8531-gigabit-ethernet.patch index 35495978efa18d..60eea4fa477ec2 100644 --- a/target/linux/generic/backport-6.1/791-v6.3-09-net-phy-Add-driver-for-Motorcomm-yt8531-gigabit-ethernet.patch +++ b/target/linux/generic/backport-6.1/791-v6.3-09-net-phy-Add-driver-for-Motorcomm-yt8531-gigabit-ethernet.patch @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -260,7 +260,7 @@ config MOTORCOMM_PHY +@@ -257,7 +257,7 @@ config MOTORCOMM_PHY tristate "Motorcomm PHYs" help Enables support for Motorcomm network PHYs. diff --git a/target/linux/generic/backport-6.1/792-v6.6-net-phylink-add-pcs_enable-pcs_disable-methods.patch b/target/linux/generic/backport-6.1/792-v6.6-net-phylink-add-pcs_enable-pcs_disable-methods.patch index 6ade45ee3edba4..eac8966a48069a 100644 --- a/target/linux/generic/backport-6.1/792-v6.6-net-phylink-add-pcs_enable-pcs_disable-methods.patch +++ b/target/linux/generic/backport-6.1/792-v6.6-net-phylink-add-pcs_enable-pcs_disable-methods.patch @@ -76,7 +76,7 @@ Signed-off-by: David S. Miller if (pl->pcs) { err = pl->pcs->ops->pcs_config(pl->pcs, pl->cur_link_an_mode, state->interface, -@@ -1498,6 +1524,7 @@ struct phylink *phylink_create(struct ph +@@ -1499,6 +1525,7 @@ struct phylink *phylink_create(struct ph pl->link_config.speed = SPEED_UNKNOWN; pl->link_config.duplex = DUPLEX_UNKNOWN; pl->link_config.an_enabled = true; @@ -84,7 +84,7 @@ Signed-off-by: David S. Miller pl->mac_ops = mac_ops; __set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state); timer_setup(&pl->link_poll, phylink_fixed_poll, 0); -@@ -1899,6 +1926,8 @@ void phylink_start(struct phylink *pl) +@@ -1900,6 +1927,8 @@ void phylink_start(struct phylink *pl) if (pl->netdev) netif_carrier_off(pl->netdev); @@ -93,7 +93,7 @@ Signed-off-by: David S. Miller /* Apply the link configuration to the MAC when starting. This allows * a fixed-link to start with the correct parameters, and also * ensures that we set the appropriate advertisement for Serdes links. -@@ -1909,6 +1938,8 @@ void phylink_start(struct phylink *pl) +@@ -1910,6 +1939,8 @@ void phylink_start(struct phylink *pl) */ phylink_mac_initial_config(pl, true); @@ -102,7 +102,7 @@ Signed-off-by: David S. Miller phylink_enable_and_run_resolve(pl, PHYLINK_DISABLE_STOPPED); if (pl->cfg_link_an_mode == MLO_AN_FIXED && pl->link_gpio) { -@@ -1927,15 +1958,9 @@ void phylink_start(struct phylink *pl) +@@ -1928,15 +1959,9 @@ void phylink_start(struct phylink *pl) poll = true; } @@ -120,7 +120,7 @@ Signed-off-by: David S. Miller if (poll) mod_timer(&pl->link_poll, jiffies + HZ); if (pl->phydev) -@@ -1972,6 +1997,10 @@ void phylink_stop(struct phylink *pl) +@@ -1973,6 +1998,10 @@ void phylink_stop(struct phylink *pl) } phylink_run_resolve_and_disable(pl, PHYLINK_DISABLE_STOPPED); diff --git a/target/linux/generic/backport-6.1/794-v6.2-net-core-Allow-live-renaming-when-an-interface-is-up.patch b/target/linux/generic/backport-6.1/794-v6.2-net-core-Allow-live-renaming-when-an-interface-is-up.patch index e04dcec7636f24..c15604717be06c 100644 --- a/target/linux/generic/backport-6.1/794-v6.2-net-core-Allow-live-renaming-when-an-interface-is-up.patch +++ b/target/linux/generic/backport-6.1/794-v6.2-net-core-Allow-live-renaming-when-an-interface-is-up.patch @@ -73,7 +73,7 @@ Signed-off-by: David S. Miller /* Specifies the type of the struct net_device::ml_priv pointer */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -1163,22 +1163,6 @@ int dev_change_name(struct net_device *d +@@ -1188,22 +1188,6 @@ int dev_change_name(struct net_device *d net = dev_net(dev); @@ -96,7 +96,7 @@ Signed-off-by: David S. Miller down_write(&devnet_rename_sem); if (strncmp(newname, dev->name, IFNAMSIZ) == 0) { -@@ -1195,7 +1179,8 @@ int dev_change_name(struct net_device *d +@@ -1220,7 +1204,8 @@ int dev_change_name(struct net_device *d } if (oldname[0] && !strchr(oldname, '%')) diff --git a/target/linux/generic/backport-6.1/795-v6.3-01-r8152-add-USB-device-driver-for-config-selection.patch b/target/linux/generic/backport-6.1/795-v6.3-01-r8152-add-USB-device-driver-for-config-selection.patch new file mode 100644 index 00000000000000..605faeec035dfb --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.3-01-r8152-add-USB-device-driver-for-config-selection.patch @@ -0,0 +1,229 @@ +From ec51fbd1b8a2bca2948dede99c14ec63dc57ff6b Mon Sep 17 00:00:00 2001 +From: Bjørn Mork +Date: Fri, 6 Jan 2023 17:07:38 +0100 +Subject: [PATCH] r8152: add USB device driver for config selection +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Subclassing the generic USB device driver to override the +default configuration selection regardless of matching interface +drivers. + +The r815x family devices expose a vendor specific function which +the r8152 interface driver wants to handle. This is the preferred +device mode. Additionally one or more USB class functions are +usually supported for hosts lacking a vendor specific driver. The +choice is USB configuration based, with one alternate function per +configuration. + +Example device with both NCM and ECM alternate cfgs: + +T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 4 Spd=5000 MxCh= 0 +D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 3 +P: Vendor=0bda ProdID=8156 Rev=31.00 +S: Manufacturer=Realtek +S: Product=USB 10/100/1G/2.5G LAN +S: SerialNumber=001000001 +C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=256mA +I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=00 Driver=r8152 +E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=83(I) Atr=03(Int.) MxPS= 2 Ivl=128ms +C: #Ifs= 2 Cfg#= 2 Atr=a0 MxPwr=256mA +I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0d Prot=00 Driver= +E: Ad=83(I) Atr=03(Int.) MxPS= 16 Ivl=128ms +I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=01 Driver= +I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=01 Driver= +E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +C: #Ifs= 2 Cfg#= 3 Atr=a0 MxPwr=256mA +I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver= +E: Ad=83(I) Atr=03(Int.) MxPS= 16 Ivl=128ms +I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver= +I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver= +E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms + +A problem with this is that Linux will prefer class functions over +vendor specific functions. Using the above example, Linux defaults +to cfg #2, running the device in a sub-optimal NCM mode. + +Previously we've attempted to work around the problem by +blacklisting the devices in the ECM class driver "cdc_ether", and +matching on the ECM class function in the vendor specific interface +driver. The latter has been used to switch back to the vendor +specific configuration when the driver is probed for a class +function. + +This workaround has several issues; +- class driver blacklists is additional maintanence cruft in an + unrelated driver +- class driver blacklists prevents users from optionally running + the devices in class mode +- each device needs double match entries in the vendor driver +- the initial probing as a class function slows down device + discovery + +Now these issues have become even worse with the introduction of +firmware supporting both NCM and ECM, where NCM ends up as the +default mode in Linux. To use the same workaround, we now have +to blacklist the devices in to two different class drivers and +add yet another match entry to the vendor specific driver. + +This patch implements an alternative workaround strategy - +independent of the interface drivers. It avoids adding a +blacklist to the cdc_ncm driver and will let us remove the +existing blacklist from the cdc_ether driver. + +As an additional bonus, removing the blacklists allow users to +select one of the other device modes if wanted. + +Signed-off-by: Bjørn Mork +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 113 ++++++++++++++++++++++++++++------------ + 1 file changed, 81 insertions(+), 32 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9661,6 +9661,9 @@ static int rtl8152_probe(struct usb_inte + if (version == RTL_VER_UNKNOWN) + return -ENODEV; + ++ if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) ++ return -ENODEV; ++ + if (!rtl_vendor_mode(intf)) + return -ENODEV; + +@@ -9861,43 +9864,35 @@ static void rtl8152_disconnect(struct us + } + } + +-#define REALTEK_USB_DEVICE(vend, prod) { \ +- USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC), \ +-}, \ +-{ \ +- USB_DEVICE_AND_INTERFACE_INFO(vend, prod, USB_CLASS_COMM, \ +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), \ +-} + + /* table of devices that work with this driver */ + static const struct usb_device_id rtl8152_table[] = { + /* Realtek */ +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8050), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8053), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8155), +- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8156), ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8050) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8053) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8152) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8153) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8155) }, ++ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8156) }, + + /* Microsoft */ +- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab), +- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6), +- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927), +- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0c5e), +- REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3054), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3069), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3082), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720c), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7214), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x721e), +- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0xa387), +- REALTEK_USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041), +- REALTEK_USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff), +- REALTEK_USB_DEVICE(VENDOR_ID_TPLINK, 0x0601), ++ { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab) }, ++ { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6) }, ++ { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927) }, ++ { USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x304f) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3054) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3062) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3069) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3082) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x7205) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x720c) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x7214) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0x721e) }, ++ { USB_DEVICE(VENDOR_ID_LENOVO, 0xa387) }, ++ { USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041) }, ++ { USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff) }, ++ { USB_DEVICE(VENDOR_ID_TPLINK, 0x0601) }, + {} + }; + +@@ -9917,7 +9912,61 @@ static struct usb_driver rtl8152_driver + .disable_hub_initiated_lpm = 1, + }; + +-module_usb_driver(rtl8152_driver); ++static int rtl8152_cfgselector_probe(struct usb_device *udev) ++{ ++ struct usb_host_config *c; ++ int i, num_configs; ++ ++ /* The vendor mode is not always config #1, so to find it out. */ ++ c = udev->config; ++ num_configs = udev->descriptor.bNumConfigurations; ++ for (i = 0; i < num_configs; (i++, c++)) { ++ struct usb_interface_descriptor *desc = NULL; ++ ++ if (!c->desc.bNumInterfaces) ++ continue; ++ desc = &c->intf_cache[0]->altsetting->desc; ++ if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC) ++ break; ++ } ++ ++ if (i == num_configs) ++ return -ENODEV; ++ ++ if (usb_set_configuration(udev, c->desc.bConfigurationValue)) { ++ dev_err(&udev->dev, "Failed to set configuration %d\n", ++ c->desc.bConfigurationValue); ++ return -ENODEV; ++ } ++ ++ return 0; ++} ++ ++static struct usb_device_driver rtl8152_cfgselector_driver = { ++ .name = MODULENAME "-cfgselector", ++ .probe = rtl8152_cfgselector_probe, ++ .id_table = rtl8152_table, ++ .generic_subclass = 1, ++}; ++ ++static int __init rtl8152_driver_init(void) ++{ ++ int ret; ++ ++ ret = usb_register_device_driver(&rtl8152_cfgselector_driver, THIS_MODULE); ++ if (ret) ++ return ret; ++ return usb_register(&rtl8152_driver); ++} ++ ++static void __exit rtl8152_driver_exit(void) ++{ ++ usb_deregister(&rtl8152_driver); ++ usb_deregister_device_driver(&rtl8152_cfgselector_driver); ++} ++ ++module_init(rtl8152_driver_init); ++module_exit(rtl8152_driver_exit); + + MODULE_AUTHOR(DRIVER_AUTHOR); + MODULE_DESCRIPTION(DRIVER_DESC); diff --git a/target/linux/generic/backport-6.1/795-v6.3-02-cdc_ether-no-need-to-blacklist-any-r8152-devices.patch b/target/linux/generic/backport-6.1/795-v6.3-02-cdc_ether-no-need-to-blacklist-any-r8152-devices.patch new file mode 100644 index 00000000000000..17131c16d39f72 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.3-02-cdc_ether-no-need-to-blacklist-any-r8152-devices.patch @@ -0,0 +1,158 @@ +From 69649ef8405320f81497f4757faac8234f61b167 Mon Sep 17 00:00:00 2001 +From: Bjørn Mork +Date: Fri, 6 Jan 2023 17:07:39 +0100 +Subject: [PATCH] cdc_ether: no need to blacklist any r8152 devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The r8152 driver does not need this anymore. + +Dropping blacklist entries adds optional support for these +devices in ECM mode. + +The 8153 devices are handled by the r8153_ecm driver when +in ECM mode, and must still be blacklisted here. + +Signed-off-by: Bjørn Mork +Signed-off-by: David S. Miller +--- + drivers/net/usb/cdc_ether.c | 114 ------------------------------------ + 1 file changed, 114 deletions(-) + +--- a/drivers/net/usb/cdc_ether.c ++++ b/drivers/net/usb/cdc_ether.c +@@ -768,13 +768,6 @@ static const struct usb_device_id produc + .driver_info = 0, + }, + +-/* Realtek RTL8152 Based USB 2.0 Ethernet Adapters */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- + /* Realtek RTL8153 Based USB 3.0 Ethernet Adapters */ + { + USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8153, USB_CLASS_COMM, +@@ -782,119 +775,12 @@ static const struct usb_device_id produc + .driver_info = 0, + }, + +-/* Samsung USB Ethernet Adapters */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, 0xa101, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-#if IS_ENABLED(CONFIG_USB_RTL8152) +-/* Linksys USB3GIGV1 Ethernet Adapter */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LINKSYS_VENDOR_ID, 0x0041, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +-#endif +- +-/* Lenovo ThinkPad OneLink+ Dock (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3054, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* ThinkPad USB-C Dock (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3062, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* ThinkPad Thunderbolt 3 Dock (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3069, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* ThinkPad Thunderbolt 3 Dock Gen 2 (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3082, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Lenovo Thinkpad USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x7205, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Lenovo USB C to Ethernet Adapter (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x720c, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Lenovo USB-C Travel Hub (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x7214, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- + /* Lenovo Powered USB-C Travel Hub (4X90S92381, based on Realtek RTL8153) */ + { + USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x721e, USB_CLASS_COMM, + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), + .driver_info = 0, + }, +- +-/* ThinkPad USB-C Dock Gen 2 (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0xa387, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* NVIDIA Tegra USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(NVIDIA_VENDOR_ID, 0x09ff, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Microsoft Surface 2 dock (based on Realtek RTL8152) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07ab, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07c6, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153B) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x0927, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, +- +-/* TP-LINK UE300 USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */ +-{ +- USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, 0x0601, USB_CLASS_COMM, +- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), +- .driver_info = 0, +-}, + + /* Aquantia AQtion USB to 5GbE Controller (based on AQC111U) */ + { diff --git a/target/linux/generic/backport-6.1/795-v6.3-03-r8152-avoid-to-change-cfg-for-all-devices.patch b/target/linux/generic/backport-6.1/795-v6.3-03-r8152-avoid-to-change-cfg-for-all-devices.patch new file mode 100644 index 00000000000000..a5b01f7b0829a3 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.3-03-r8152-avoid-to-change-cfg-for-all-devices.patch @@ -0,0 +1,64 @@ +From 0d4cda805a183bbe523f2407edb5c14ade50b841 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 17 Jan 2023 11:03:44 +0800 +Subject: [PATCH] r8152: avoid to change cfg for all devices + +The rtl8152_cfgselector_probe() should set the USB configuration to the +vendor mode only for the devices which the driver (r8152) supports. +Otherwise, no driver would be used for such devices. + +Fixes: ec51fbd1b8a2 ("r8152: add USB device driver for config selection") +Signed-off-by: Hayes Wang +Reviewed-by: Simon Horman +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 20 +++++++++++++++++--- + 1 file changed, 17 insertions(+), 3 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9542,9 +9542,8 @@ static int rtl_fw_init(struct r8152 *tp) + return 0; + } + +-u8 rtl8152_get_version(struct usb_interface *intf) ++static u8 __rtl_get_hw_ver(struct usb_device *udev) + { +- struct usb_device *udev = interface_to_usbdev(intf); + u32 ocp_data = 0; + __le32 *tmp; + u8 version; +@@ -9614,10 +9613,19 @@ u8 rtl8152_get_version(struct usb_interf + break; + default: + version = RTL_VER_UNKNOWN; +- dev_info(&intf->dev, "Unknown version 0x%04x\n", ocp_data); ++ dev_info(&udev->dev, "Unknown version 0x%04x\n", ocp_data); + break; + } + ++ return version; ++} ++ ++u8 rtl8152_get_version(struct usb_interface *intf) ++{ ++ u8 version; ++ ++ version = __rtl_get_hw_ver(interface_to_usbdev(intf)); ++ + dev_dbg(&intf->dev, "Detected version 0x%04x\n", version); + + return version; +@@ -9917,6 +9925,12 @@ static int rtl8152_cfgselector_probe(str + struct usb_host_config *c; + int i, num_configs; + ++ /* Switch the device to vendor mode, if and only if the vendor mode ++ * driver supports it. ++ */ ++ if (__rtl_get_hw_ver(udev) == RTL_VER_UNKNOWN) ++ return 0; ++ + /* The vendor mode is not always config #1, so to find it out. */ + c = udev->config; + num_configs = udev->descriptor.bNumConfigurations; diff --git a/target/linux/generic/backport-6.1/795-v6.3-04-r8152-remove-rtl_vendor_mode-function.patch b/target/linux/generic/backport-6.1/795-v6.3-04-r8152-remove-rtl_vendor_mode-function.patch new file mode 100644 index 00000000000000..f97750861c3e4d --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.3-04-r8152-remove-rtl_vendor_mode-function.patch @@ -0,0 +1,71 @@ +From 95a4c1d617b92cdc4522297741b56e8f6cd01a1e Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Thu, 19 Jan 2023 15:40:42 +0800 +Subject: [PATCH] r8152: remove rtl_vendor_mode function + +After commit ec51fbd1b8a2 ("r8152: add USB device driver for +config selection"), the code about changing USB configuration +in rtl_vendor_mode() wouldn't be run anymore. Therefore, the +function could be removed. + +Signed-off-by: Hayes Wang +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 39 +-------------------------------------- + 1 file changed, 1 insertion(+), 38 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -8274,43 +8274,6 @@ static bool rtl_check_vendor_ok(struct u + return true; + } + +-static bool rtl_vendor_mode(struct usb_interface *intf) +-{ +- struct usb_host_interface *alt = intf->cur_altsetting; +- struct usb_device *udev; +- struct usb_host_config *c; +- int i, num_configs; +- +- if (alt->desc.bInterfaceClass == USB_CLASS_VENDOR_SPEC) +- return rtl_check_vendor_ok(intf); +- +- /* The vendor mode is not always config #1, so to find it out. */ +- udev = interface_to_usbdev(intf); +- c = udev->config; +- num_configs = udev->descriptor.bNumConfigurations; +- if (num_configs < 2) +- return false; +- +- for (i = 0; i < num_configs; (i++, c++)) { +- struct usb_interface_descriptor *desc = NULL; +- +- if (c->desc.bNumInterfaces > 0) +- desc = &c->intf_cache[0]->altsetting->desc; +- else +- continue; +- +- if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC) { +- usb_driver_set_configuration(udev, c->desc.bConfigurationValue); +- break; +- } +- } +- +- if (i == num_configs) +- dev_err(&intf->dev, "Unexpected Device\n"); +- +- return false; +-} +- + static int rtl8152_pre_reset(struct usb_interface *intf) + { + struct r8152 *tp = usb_get_intfdata(intf); +@@ -9672,7 +9635,7 @@ static int rtl8152_probe(struct usb_inte + if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) + return -ENODEV; + +- if (!rtl_vendor_mode(intf)) ++ if (!rtl_check_vendor_ok(intf)) + return -ENODEV; + + usb_reset_device(udev); diff --git a/target/linux/generic/backport-6.1/795-v6.3-05-r8152-reduce-the-control-transfer-of-rtl8152_get_ver.patch b/target/linux/generic/backport-6.1/795-v6.3-05-r8152-reduce-the-control-transfer-of-rtl8152_get_ver.patch new file mode 100644 index 00000000000000..421f2c7f8f51dc --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.3-05-r8152-reduce-the-control-transfer-of-rtl8152_get_ver.patch @@ -0,0 +1,46 @@ +From 02767440e1dda9861a11ca1dbe0f19a760b1d5c2 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Thu, 19 Jan 2023 15:40:43 +0800 +Subject: [PATCH] r8152: reduce the control transfer of rtl8152_get_version() + +Reduce the control transfer by moving calling rtl8152_get_version() in +rtl8152_probe(). This could prevent from calling rtl8152_get_version() +for unnecessary situations. For example, after setting config #2 for the +device, there are two interfaces and rtl8152_probe() may be called +twice. However, we don't need to call rtl8152_get_version() for this +situation. + +Signed-off-by: Hayes Wang +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9624,20 +9624,21 @@ static int rtl8152_probe(struct usb_inte + const struct usb_device_id *id) + { + struct usb_device *udev = interface_to_usbdev(intf); +- u8 version = rtl8152_get_version(intf); + struct r8152 *tp; + struct net_device *netdev; ++ u8 version; + int ret; + +- if (version == RTL_VER_UNKNOWN) +- return -ENODEV; +- + if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) + return -ENODEV; + + if (!rtl_check_vendor_ok(intf)) + return -ENODEV; + ++ version = rtl8152_get_version(intf); ++ if (version == RTL_VER_UNKNOWN) ++ return -ENODEV; ++ + usb_reset_device(udev); + netdev = alloc_etherdev(sizeof(struct r8152)); + if (!netdev) { diff --git a/target/linux/generic/backport-6.1/795-v6.3-06-r8152-Add-__GFP_NOWARN-to-big-allocations.patch b/target/linux/generic/backport-6.1/795-v6.3-06-r8152-Add-__GFP_NOWARN-to-big-allocations.patch new file mode 100644 index 00000000000000..cdabca36d2a8a9 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.3-06-r8152-Add-__GFP_NOWARN-to-big-allocations.patch @@ -0,0 +1,55 @@ +From 5cc33f139e11b893ff6dc60d8a0ae865a65521ac Mon Sep 17 00:00:00 2001 +From: Douglas Anderson +Date: Thu, 6 Apr 2023 17:14:26 -0700 +Subject: [PATCH] r8152: Add __GFP_NOWARN to big allocations + +When memory is a little tight on my system, it's pretty easy to see +warnings that look like this. + + ksoftirqd/0: page allocation failure: order:3, mode:0x40a20(GFP_ATOMIC|__GFP_COMP), nodemask=(null),cpuset=/,mems_allowed=0 + ... + Call trace: + dump_backtrace+0x0/0x1e8 + show_stack+0x20/0x2c + dump_stack_lvl+0x60/0x78 + dump_stack+0x18/0x38 + warn_alloc+0x104/0x174 + __alloc_pages+0x588/0x67c + alloc_rx_agg+0xa0/0x190 [r8152 ...] + r8152_poll+0x270/0x760 [r8152 ...] + __napi_poll+0x44/0x1ec + net_rx_action+0x100/0x300 + __do_softirq+0xec/0x38c + run_ksoftirqd+0x38/0xec + smpboot_thread_fn+0xb8/0x248 + kthread+0x134/0x154 + ret_from_fork+0x10/0x20 + +On a fragmented system it's normal that order 3 allocations will +sometimes fail, especially atomic ones. The driver handles these +failures fine and the WARN just creates spam in the logs for this +case. The __GFP_NOWARN flag is exactly for this situation, so add it +to the allocation. + +NOTE: my testing is on a 5.15 system, but there should be no reason +that this would be fundamentally different on a mainline kernel. + +Signed-off-by: Douglas Anderson +Acked-by: Hayes Wang +Link: https://lore.kernel.org/r/20230406171411.1.I84dbef45786af440fd269b71e9436a96a8e7a152@changeid +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -1947,7 +1947,7 @@ static struct rx_agg *alloc_rx_agg(struc + if (!rx_agg) + return NULL; + +- rx_agg->page = alloc_pages(mflags | __GFP_COMP, order); ++ rx_agg->page = alloc_pages(mflags | __GFP_COMP | __GFP_NOWARN, order); + if (!rx_agg->page) + goto free_rx; + diff --git a/target/linux/generic/backport-6.1/795-v6.4-07-r8152-fix-the-autosuspend-doesn-t-work.patch b/target/linux/generic/backport-6.1/795-v6.4-07-r8152-fix-the-autosuspend-doesn-t-work.patch new file mode 100644 index 00000000000000..b4d5b8bdb91519 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.4-07-r8152-fix-the-autosuspend-doesn-t-work.patch @@ -0,0 +1,24 @@ +From 0fbd79c01a9a657348f7032df70c57a406468c86 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 2 May 2023 11:36:27 +0800 +Subject: [PATCH] r8152: fix the autosuspend doesn't work + +Set supports_autosuspend = 1 for the rtl8152_cfgselector_driver. + +Fixes: ec51fbd1b8a2 ("r8152: add USB device driver for config selection") +Signed-off-by: Hayes Wang +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9925,6 +9925,7 @@ static struct usb_device_driver rtl8152_ + .probe = rtl8152_cfgselector_probe, + .id_table = rtl8152_table, + .generic_subclass = 1, ++ .supports_autosuspend = 1, + }; + + static int __init rtl8152_driver_init(void) diff --git a/target/linux/generic/backport-6.1/795-v6.6-08-r8152-adjust-generic_ocp_write-function.patch b/target/linux/generic/backport-6.1/795-v6.6-08-r8152-adjust-generic_ocp_write-function.patch new file mode 100644 index 00000000000000..3ba79d6cc6a383 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.6-08-r8152-adjust-generic_ocp_write-function.patch @@ -0,0 +1,70 @@ +From 57df0fb9d511f91202114813e90128d65c0589f0 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Wed, 26 Jul 2023 11:08:07 +0800 +Subject: [PATCH] r8152: adjust generic_ocp_write function + +Reduce the control transfer if all bytes of first or the last DWORD are +written. + +The original method is to split the control transfer into three parts +(the first DWORD, middle continuous data, and the last DWORD). However, +they could be combined if whole bytes of the first DWORD or last DWORD +are written. That is, the first DWORD or the last DWORD could be combined +with the middle continuous data, if the byte_en is 0xff. + +Signed-off-by: Hayes Wang +Link: https://lore.kernel.org/r/20230726030808.9093-418-nic_swsd@realtek.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 29 ++++++++++++++++++----------- + 1 file changed, 18 insertions(+), 11 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -1313,16 +1313,24 @@ static int generic_ocp_write(struct r815 + byteen_end = byteen & BYTE_EN_END_MASK; + + byen = byteen_start | (byteen_start << 4); +- ret = set_registers(tp, index, type | byen, 4, data); +- if (ret < 0) +- goto error1; +- +- index += 4; +- data += 4; +- size -= 4; + +- if (size) { ++ /* Split the first DWORD if the byte_en is not 0xff */ ++ if (byen != BYTE_EN_DWORD) { ++ ret = set_registers(tp, index, type | byen, 4, data); ++ if (ret < 0) ++ goto error1; ++ ++ index += 4; ++ data += 4; + size -= 4; ++ } ++ ++ if (size) { ++ byen = byteen_end | (byteen_end >> 4); ++ ++ /* Split the last DWORD if the byte_en is not 0xff */ ++ if (byen != BYTE_EN_DWORD) ++ size -= 4; + + while (size) { + if (size > limit) { +@@ -1349,10 +1357,9 @@ static int generic_ocp_write(struct r815 + } + } + +- byen = byteen_end | (byteen_end >> 4); +- ret = set_registers(tp, index, type | byen, 4, data); +- if (ret < 0) +- goto error1; ++ /* Set the last DWORD */ ++ if (byen != BYTE_EN_DWORD) ++ ret = set_registers(tp, index, type | byen, 4, data); + } + + error1: diff --git a/target/linux/generic/backport-6.1/795-v6.6-09-r8152-set-bp-in-bulk.patch b/target/linux/generic/backport-6.1/795-v6.6-09-r8152-set-bp-in-bulk.patch new file mode 100644 index 00000000000000..485a005b174bdd --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.6-09-r8152-set-bp-in-bulk.patch @@ -0,0 +1,129 @@ +From e5c266a61186b462c388c53a3564c375e72f2244 Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Wed, 26 Jul 2023 11:08:08 +0800 +Subject: [PATCH] r8152: set bp in bulk + +PLA_BP_0 ~ PLA_BP_15 (0xfc28 ~ 0xfc46) are continuous registers, so we +could combine the control transfers into one control transfer. + +Signed-off-by: Hayes Wang +Link: https://lore.kernel.org/r/20230726030808.9093-419-nic_swsd@realtek.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 75 ++++++++++++++--------------------------- + 1 file changed, 25 insertions(+), 50 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -3984,29 +3984,10 @@ static void rtl_reset_bmu(struct r8152 * + /* Clear the bp to stop the firmware before loading a new one */ + static void rtl_clear_bp(struct r8152 *tp, u16 type) + { +- switch (tp->version) { +- case RTL_VER_01: +- case RTL_VER_02: +- case RTL_VER_07: +- break; +- case RTL_VER_03: +- case RTL_VER_04: +- case RTL_VER_05: +- case RTL_VER_06: +- ocp_write_byte(tp, type, PLA_BP_EN, 0); +- break; +- case RTL_VER_14: +- ocp_write_word(tp, type, USB_BP2_EN, 0); ++ u16 bp[16] = {0}; ++ u16 bp_num; + +- ocp_write_word(tp, type, USB_BP_8, 0); +- ocp_write_word(tp, type, USB_BP_9, 0); +- ocp_write_word(tp, type, USB_BP_10, 0); +- ocp_write_word(tp, type, USB_BP_11, 0); +- ocp_write_word(tp, type, USB_BP_12, 0); +- ocp_write_word(tp, type, USB_BP_13, 0); +- ocp_write_word(tp, type, USB_BP_14, 0); +- ocp_write_word(tp, type, USB_BP_15, 0); +- break; ++ switch (tp->version) { + case RTL_VER_08: + case RTL_VER_09: + case RTL_VER_10: +@@ -4014,32 +3995,31 @@ static void rtl_clear_bp(struct r8152 *t + case RTL_VER_12: + case RTL_VER_13: + case RTL_VER_15: +- default: + if (type == MCU_TYPE_USB) { + ocp_write_word(tp, MCU_TYPE_USB, USB_BP2_EN, 0); +- +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_8, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_9, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_10, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_11, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_12, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_13, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_14, 0); +- ocp_write_word(tp, MCU_TYPE_USB, USB_BP_15, 0); +- } else { +- ocp_write_byte(tp, MCU_TYPE_PLA, PLA_BP_EN, 0); ++ bp_num = 16; ++ break; + } ++ fallthrough; ++ case RTL_VER_03: ++ case RTL_VER_04: ++ case RTL_VER_05: ++ case RTL_VER_06: ++ ocp_write_byte(tp, type, PLA_BP_EN, 0); ++ fallthrough; ++ case RTL_VER_01: ++ case RTL_VER_02: ++ case RTL_VER_07: ++ bp_num = 8; ++ break; ++ case RTL_VER_14: ++ default: ++ ocp_write_word(tp, type, USB_BP2_EN, 0); ++ bp_num = 16; + break; + } + +- ocp_write_word(tp, type, PLA_BP_0, 0); +- ocp_write_word(tp, type, PLA_BP_1, 0); +- ocp_write_word(tp, type, PLA_BP_2, 0); +- ocp_write_word(tp, type, PLA_BP_3, 0); +- ocp_write_word(tp, type, PLA_BP_4, 0); +- ocp_write_word(tp, type, PLA_BP_5, 0); +- ocp_write_word(tp, type, PLA_BP_6, 0); +- ocp_write_word(tp, type, PLA_BP_7, 0); ++ generic_ocp_write(tp, PLA_BP_0, BYTE_EN_DWORD, bp_num << 1, bp, type); + + /* wait 3 ms to make sure the firmware is stopped */ + usleep_range(3000, 6000); +@@ -5016,10 +4996,9 @@ static void rtl8152_fw_phy_nc_apply(stru + + static void rtl8152_fw_mac_apply(struct r8152 *tp, struct fw_mac *mac) + { +- u16 bp_en_addr, bp_index, type, bp_num, fw_ver_reg; ++ u16 bp_en_addr, type, fw_ver_reg; + u32 length; + u8 *data; +- int i; + + switch (__le32_to_cpu(mac->blk_hdr.type)) { + case RTL_FW_PLA: +@@ -5061,12 +5040,8 @@ static void rtl8152_fw_mac_apply(struct + ocp_write_word(tp, type, __le16_to_cpu(mac->bp_ba_addr), + __le16_to_cpu(mac->bp_ba_value)); + +- bp_index = __le16_to_cpu(mac->bp_start); +- bp_num = __le16_to_cpu(mac->bp_num); +- for (i = 0; i < bp_num; i++) { +- ocp_write_word(tp, type, bp_index, __le16_to_cpu(mac->bp[i])); +- bp_index += 2; +- } ++ generic_ocp_write(tp, __le16_to_cpu(mac->bp_start), BYTE_EN_DWORD, ++ __le16_to_cpu(mac->bp_num) << 1, mac->bp, type); + + bp_en_addr = __le16_to_cpu(mac->bp_en_addr); + if (bp_en_addr) diff --git a/target/linux/generic/backport-6.1/795-v6.6-10-eth-r8152-try-to-use-a-normal-budget.patch b/target/linux/generic/backport-6.1/795-v6.6-10-eth-r8152-try-to-use-a-normal-budget.patch new file mode 100644 index 00000000000000..864671bb32f16e --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.6-10-eth-r8152-try-to-use-a-normal-budget.patch @@ -0,0 +1,39 @@ +From cf74eb5a5bc867258e7d0b0d1c3c4a60e1e3de2f Mon Sep 17 00:00:00 2001 +From: Jakub Kicinski +Date: Mon, 14 Aug 2023 08:35:21 -0700 +Subject: [PATCH] eth: r8152: try to use a normal budget + +Mario reports that loading r8152 on his system leads to a: + + netif_napi_add_weight() called with weight 256 + +warning getting printed. We don't have any solid data +on why such high budget was chosen, and it may cause +stalls in processing other softirqs and rt threads. +So try to switch back to the default (64) weight. + +If this slows down someone's system we should investigate +which part of stopping starting the NAPI poll in this +driver are expensive. + +Reported-by: Mario Limonciello +Link: https://lore.kernel.org/all/0bfd445a-81f7-f702-08b0-bd5a72095e49@amd.com/ +Acked-by: Hayes Wang +Link: https://lore.kernel.org/r/20230814153521.2697982-1-kuba@kernel.org +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9770,8 +9770,7 @@ static int rtl8152_probe(struct usb_inte + + usb_set_intfdata(intf, tp); + +- netif_napi_add_weight(netdev, &tp->napi, r8152_poll, +- tp->support_2500full ? 256 : 64); ++ netif_napi_add(netdev, &tp->napi, r8152_poll); + + ret = register_netdev(netdev); + if (ret != 0) { diff --git a/target/linux/generic/backport-6.1/795-v6.6-11-r8152-add-vendor-device-ID-pair-for-D-Link-DUB-E250.patch b/target/linux/generic/backport-6.1/795-v6.6-11-r8152-add-vendor-device-ID-pair-for-D-Link-DUB-E250.patch new file mode 100644 index 00000000000000..ab6563d5c43628 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.6-11-r8152-add-vendor-device-ID-pair-for-D-Link-DUB-E250.patch @@ -0,0 +1,39 @@ +From 72f93a3136ee18fd59fa6579f84c07e93424681e Mon Sep 17 00:00:00 2001 +From: Antonio Napolitano +Date: Sat, 26 Aug 2023 01:05:50 +0200 +Subject: [PATCH] r8152: add vendor/device ID pair for D-Link DUB-E250 + +The D-Link DUB-E250 is an RTL8156 based 2.5G Ethernet controller. + +Add the vendor and product ID values to the driver. This makes Ethernet +work with the adapter. + +Signed-off-by: Antonio Napolitano +Link: https://lore.kernel.org/r/CV200KJEEUPC.WPKAHXCQJ05I@mercurius +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 1 + + include/linux/usb/r8152.h | 1 + + 2 files changed, 2 insertions(+) + + +--- a/include/linux/usb/r8152.h ++++ b/include/linux/usb/r8152.h +@@ -29,6 +29,7 @@ + #define VENDOR_ID_LINKSYS 0x13b1 + #define VENDOR_ID_NVIDIA 0x0955 + #define VENDOR_ID_TPLINK 0x2357 ++#define VENDOR_ID_DLINK 0x2001 + + #if IS_REACHABLE(CONFIG_USB_RTL8152) + extern u8 rtl8152_get_version(struct usb_interface *intf); +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -9846,6 +9846,7 @@ static const struct usb_device_id rtl815 + { USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041) }, + { USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff) }, + { USB_DEVICE(VENDOR_ID_TPLINK, 0x0601) }, ++ { USB_DEVICE(VENDOR_ID_DLINK, 0xb301) }, + {} + }; + diff --git a/target/linux/generic/backport-6.1/795-v6.6-12-r8152-Rename-RTL8152_UNPLUG-to-RTL8152_INACCESSIBLE.patch b/target/linux/generic/backport-6.1/795-v6.6-12-r8152-Rename-RTL8152_UNPLUG-to-RTL8152_INACCESSIBLE.patch new file mode 100644 index 00000000000000..480a60212ae611 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.6-12-r8152-Rename-RTL8152_UNPLUG-to-RTL8152_INACCESSIBLE.patch @@ -0,0 +1,447 @@ +From 715f67f33af45ce2cc3a5b1ef133cc8c8e7787b0 Mon Sep 17 00:00:00 2001 +From: Douglas Anderson +Date: Fri, 20 Oct 2023 14:06:58 -0700 +Subject: [PATCH] r8152: Rename RTL8152_UNPLUG to RTL8152_INACCESSIBLE + +Whenever the RTL8152_UNPLUG is set that just tells the driver that all +accesses will fail and we should just immediately bail. A future patch +will use this same concept at a time when the driver hasn't actually +been unplugged but is about to be reset. Rename the flag in +preparation for the future patch. + +This is a no-op change and just a search and replace. + +Signed-off-by: Douglas Anderson +Reviewed-by: Grant Grundler +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 96 ++++++++++++++++++++--------------------- + 1 file changed, 48 insertions(+), 48 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -763,7 +763,7 @@ enum rtl_register_content { + + /* rtl8152 flags */ + enum rtl8152_flags { +- RTL8152_UNPLUG = 0, ++ RTL8152_INACCESSIBLE = 0, + RTL8152_SET_RX_MODE, + WORK_ENABLE, + RTL8152_LINK_CHG, +@@ -1244,7 +1244,7 @@ int set_registers(struct r8152 *tp, u16 + static void rtl_set_unplug(struct r8152 *tp) + { + if (tp->udev->state == USB_STATE_NOTATTACHED) { +- set_bit(RTL8152_UNPLUG, &tp->flags); ++ set_bit(RTL8152_INACCESSIBLE, &tp->flags); + smp_mb__after_atomic(); + } + } +@@ -1255,7 +1255,7 @@ static int generic_ocp_read(struct r8152 + u16 limit = 64; + int ret = 0; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + /* both size and indix must be 4 bytes align */ +@@ -1299,7 +1299,7 @@ static int generic_ocp_write(struct r815 + u16 byteen_start, byteen_end, byen; + u16 limit = 512; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + /* both size and indix must be 4 bytes align */ +@@ -1536,7 +1536,7 @@ static int read_mii_word(struct net_devi + struct r8152 *tp = netdev_priv(netdev); + int ret; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + if (phy_id != R8152_PHY_ID) +@@ -1552,7 +1552,7 @@ void write_mii_word(struct net_device *n + { + struct r8152 *tp = netdev_priv(netdev); + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (phy_id != R8152_PHY_ID) +@@ -1757,7 +1757,7 @@ static void read_bulk_callback(struct ur + if (!tp) + return; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (!test_bit(WORK_ENABLE, &tp->flags)) +@@ -1849,7 +1849,7 @@ static void write_bulk_callback(struct u + if (!test_bit(WORK_ENABLE, &tp->flags)) + return; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (!skb_queue_empty(&tp->tx_queue)) +@@ -1870,7 +1870,7 @@ static void intr_callback(struct urb *ur + if (!test_bit(WORK_ENABLE, &tp->flags)) + return; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + switch (status) { +@@ -2614,7 +2614,7 @@ static void bottom_half(struct tasklet_s + { + struct r8152 *tp = from_tasklet(tp, t, tx_tl); + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (!test_bit(WORK_ENABLE, &tp->flags)) +@@ -2657,7 +2657,7 @@ int r8152_submit_rx(struct r8152 *tp, st + int ret; + + /* The rx would be stopped, so skip submitting */ +- if (test_bit(RTL8152_UNPLUG, &tp->flags) || ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags) || + !test_bit(WORK_ENABLE, &tp->flags) || !netif_carrier_ok(tp->netdev)) + return 0; + +@@ -3057,7 +3057,7 @@ static int rtl_enable(struct r8152 *tp) + + static int rtl8152_enable(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + set_tx_qlen(tp); +@@ -3144,7 +3144,7 @@ static int rtl8153_enable(struct r8152 * + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + set_tx_qlen(tp); +@@ -3176,7 +3176,7 @@ static void rtl_disable(struct r8152 *tp + u32 ocp_data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -3630,7 +3630,7 @@ static u16 r8153_phy_status(struct r8152 + } + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; + } + +@@ -3662,7 +3662,7 @@ static void r8153b_ups_en(struct r8152 * + int i; + + for (i = 0; i < 500; i++) { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) & + AUTOLOAD_DONE) +@@ -3704,7 +3704,7 @@ static void r8153c_ups_en(struct r8152 * + int i; + + for (i = 0; i < 500; i++) { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) & + AUTOLOAD_DONE) +@@ -4049,8 +4049,8 @@ static int rtl_phy_patch_request(struct + for (i = 0; wait && i < 5000; i++) { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) +- break; ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) ++ return -ENODEV; + + usleep_range(1000, 2000); + ocp_data = ocp_reg_read(tp, OCP_PHY_PATCH_STAT); +@@ -6008,7 +6008,7 @@ static int rtl8156_enable(struct r8152 * + u32 ocp_data; + u16 speed; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + r8156_fc_parameter(tp); +@@ -6066,7 +6066,7 @@ static int rtl8156b_enable(struct r8152 + u32 ocp_data; + u16 speed; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + set_tx_qlen(tp); +@@ -6252,7 +6252,7 @@ out: + + static void rtl8152_up(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8152_aldps_en(tp, false); +@@ -6262,7 +6262,7 @@ static void rtl8152_up(struct r8152 *tp) + + static void rtl8152_down(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -6277,7 +6277,7 @@ static void rtl8153_up(struct r8152 *tp) + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153_u1u2en(tp, false); +@@ -6317,7 +6317,7 @@ static void rtl8153_down(struct r8152 *t + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -6338,7 +6338,7 @@ static void rtl8153b_up(struct r8152 *tp + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -6362,7 +6362,7 @@ static void rtl8153b_down(struct r8152 * + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -6399,7 +6399,7 @@ static void rtl8153c_up(struct r8152 *tp + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -6480,7 +6480,7 @@ static void rtl8156_up(struct r8152 *tp) + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -6553,7 +6553,7 @@ static void rtl8156_down(struct r8152 *t + { + u32 ocp_data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + return; + } +@@ -6691,7 +6691,7 @@ static void rtl_work_func_t(struct work_ + /* If the device is unplugged or !netif_running(), the workqueue + * doesn't need to wake the device, and could return directly. + */ +- if (test_bit(RTL8152_UNPLUG, &tp->flags) || !netif_running(tp->netdev)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags) || !netif_running(tp->netdev)) + return; + + if (usb_autopm_get_interface(tp->intf) < 0) +@@ -6730,7 +6730,7 @@ static void rtl_hw_phy_work_func_t(struc + { + struct r8152 *tp = container_of(work, struct r8152, hw_phy_work.work); + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (usb_autopm_get_interface(tp->intf) < 0) +@@ -6857,7 +6857,7 @@ static int rtl8152_close(struct net_devi + netif_stop_queue(netdev); + + res = usb_autopm_get_interface(tp->intf); +- if (res < 0 || test_bit(RTL8152_UNPLUG, &tp->flags)) { ++ if (res < 0 || test_bit(RTL8152_INACCESSIBLE, &tp->flags)) { + rtl_drop_queued_tx(tp); + rtl_stop_rx(tp); + } else { +@@ -6890,7 +6890,7 @@ static void r8152b_init(struct r8152 *tp + u32 ocp_data; + u16 data; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + data = r8152_mdio_read(tp, MII_BMCR); +@@ -6934,7 +6934,7 @@ static void r8153_init(struct r8152 *tp) + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153_u1u2en(tp, false); +@@ -6945,7 +6945,7 @@ static void r8153_init(struct r8152 *tp) + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; + } + +@@ -7074,7 +7074,7 @@ static void r8153b_init(struct r8152 *tp + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -7085,7 +7085,7 @@ static void r8153b_init(struct r8152 *tp + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + break; + } + +@@ -7156,7 +7156,7 @@ static void r8153c_init(struct r8152 *tp + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_u1u2en(tp, false); +@@ -7176,7 +7176,7 @@ static void r8153c_init(struct r8152 *tp + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + } + +@@ -8005,7 +8005,7 @@ static void r8156_init(struct r8152 *tp) + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_ECM_OP); +@@ -8026,7 +8026,7 @@ static void r8156_init(struct r8152 *tp) + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + } + +@@ -8101,7 +8101,7 @@ static void r8156b_init(struct r8152 *tp + u16 data; + int i; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_ECM_OP); +@@ -8135,7 +8135,7 @@ static void r8156b_init(struct r8152 *tp + break; + + msleep(20); +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + } + +@@ -9164,7 +9164,7 @@ static int rtl8152_ioctl(struct net_devi + struct mii_ioctl_data *data = if_mii(rq); + int res; + +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return -ENODEV; + + res = usb_autopm_get_interface(tp->intf); +@@ -9266,7 +9266,7 @@ static const struct net_device_ops rtl81 + + static void rtl8152_unload(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + if (tp->version != RTL_VER_01) +@@ -9275,7 +9275,7 @@ static void rtl8152_unload(struct r8152 + + static void rtl8153_unload(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153_power_cut_en(tp, false); +@@ -9283,7 +9283,7 @@ static void rtl8153_unload(struct r8152 + + static void rtl8153b_unload(struct r8152 *tp) + { +- if (test_bit(RTL8152_UNPLUG, &tp->flags)) ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) + return; + + r8153b_power_cut_en(tp, false); diff --git a/target/linux/generic/backport-6.1/795-v6.6-13-r8152-Block-future-register-access-if-register-acces.patch b/target/linux/generic/backport-6.1/795-v6.6-13-r8152-Block-future-register-access-if-register-acces.patch new file mode 100644 index 00000000000000..2cbe3650352d6b --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.6-13-r8152-Block-future-register-access-if-register-acces.patch @@ -0,0 +1,398 @@ +From d9962b0d42029bcb40fe3c38bce06d1870fa4df4 Mon Sep 17 00:00:00 2001 +From: Douglas Anderson +Date: Fri, 20 Oct 2023 14:06:59 -0700 +Subject: [PATCH] r8152: Block future register access if register access fails + +Even though the functions to read/write registers can fail, most of +the places in the r8152 driver that read/write register values don't +check error codes. The lack of error code checking is problematic in +at least two ways. + +The first problem is that the r8152 driver often uses code patterns +similar to this: + x = read_register() + x = x | SOME_BIT; + write_register(x); + +...with the above pattern, if the read_register() fails and returns +garbage then we'll end up trying to write modified garbage back to the +Realtek adapter. If the write_register() succeeds that's bad. Note +that as of commit f53a7ad18959 ("r8152: Set memory to all 0xFFs on +failed reg reads") the "garbage" returned by read_register() will at +least be consistent garbage, but it is still garbage. + +It turns out that this problem is very serious. Writing garbage to +some of the hardware registers on the Ethernet adapter can put the +adapter in such a bad state that it needs to be power cycled (fully +unplugged and plugged in again) before it can enumerate again. + +The second problem is that the r8152 driver generally has functions +that are long sequences of register writes. Assuming everything will +be OK if a random register write fails in the middle isn't a great +assumption. + +One might wonder if the above two problems are real. You could ask if +we would really have a successful write after a failed read. It turns +out that the answer appears to be "yes, this can happen". In fact, +we've seen at least two distinct failure modes where this happens. + +On a sc7180-trogdor Chromebook if you drop into kdb for a while and +then resume, you can see: +1. We get a "Tx timeout" +2. The "Tx timeout" queues up a USB reset. +3. In rtl8152_pre_reset() we try to reinit the hardware. +4. The first several (2-9) register accesses fail with a timeout, then + things recover. + +The above test case was actually fixed by the patch ("r8152: Increase +USB control msg timeout to 5000ms as per spec") but at least shows +that we really can see successful calls after failed ones. + +On a different (AMD) based Chromebook with a particular adapter, we +found that during reboot tests we'd also sometimes get a transitory +failure. In this case we saw -EPIPE being returned sometimes. Retrying +worked, but retrying is not always safe for all register accesses +since reading/writing some registers might have side effects (like +registers that clear on read). + +Let's fully lock out all register access if a register access fails. +When we do this, we'll try to queue up a USB reset and try to unlock +register access after the reset. This is slightly tricker than it +sounds since the r8152 driver has an optimized reset sequence that +only works reliably after probe happens. In order to handle this, we +avoid the optimized reset if probe didn't finish. Instead, we simply +retry the probe routine in this case. + +When locking out access, we'll use the existing infrastructure that +the driver was using when it detected we were unplugged. This keeps us +from getting stuck in delay loops in some parts of the driver. + +Signed-off-by: Douglas Anderson +Reviewed-by: Grant Grundler +Signed-off-by: David S. Miller +--- + drivers/net/usb/r8152.c | 207 ++++++++++++++++++++++++++++++++++------ + 1 file changed, 176 insertions(+), 31 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -772,6 +772,9 @@ enum rtl8152_flags { + SCHEDULE_TASKLET, + GREEN_ETHERNET, + RX_EPROTO, ++ IN_PRE_RESET, ++ PROBED_WITH_NO_ERRORS, ++ PROBE_SHOULD_RETRY, + }; + + #define DEVICE_ID_LENOVO_USB_C_TRAVEL_HUB 0x721e +@@ -952,6 +955,8 @@ struct r8152 { + u8 version; + u8 duplex; + u8 autoneg; ++ ++ unsigned int reg_access_reset_count; + }; + + /** +@@ -1199,6 +1204,96 @@ static unsigned int agg_buf_sz = 16384; + + #define RTL_LIMITED_TSO_SIZE (size_to_mtu(agg_buf_sz) - sizeof(struct tx_desc)) + ++/* If register access fails then we block access and issue a reset. If this ++ * happens too many times in a row without a successful access then we stop ++ * trying to reset and just leave access blocked. ++ */ ++#define REGISTER_ACCESS_MAX_RESETS 3 ++ ++static void rtl_set_inaccessible(struct r8152 *tp) ++{ ++ set_bit(RTL8152_INACCESSIBLE, &tp->flags); ++ smp_mb__after_atomic(); ++} ++ ++static void rtl_set_accessible(struct r8152 *tp) ++{ ++ clear_bit(RTL8152_INACCESSIBLE, &tp->flags); ++ smp_mb__after_atomic(); ++} ++ ++static ++int r8152_control_msg(struct r8152 *tp, unsigned int pipe, __u8 request, ++ __u8 requesttype, __u16 value, __u16 index, void *data, ++ __u16 size, const char *msg_tag) ++{ ++ struct usb_device *udev = tp->udev; ++ int ret; ++ ++ if (test_bit(RTL8152_INACCESSIBLE, &tp->flags)) ++ return -ENODEV; ++ ++ ret = usb_control_msg(udev, pipe, request, requesttype, ++ value, index, data, size, ++ USB_CTRL_GET_TIMEOUT); ++ ++ /* No need to issue a reset to report an error if the USB device got ++ * unplugged; just return immediately. ++ */ ++ if (ret == -ENODEV) ++ return ret; ++ ++ /* If the write was successful then we're done */ ++ if (ret >= 0) { ++ tp->reg_access_reset_count = 0; ++ return ret; ++ } ++ ++ dev_err(&udev->dev, ++ "Failed to %s %d bytes at %#06x/%#06x (%d)\n", ++ msg_tag, size, value, index, ret); ++ ++ /* Block all future register access until we reset. Much of the code ++ * in the driver doesn't check for errors. Notably, many parts of the ++ * driver do a read/modify/write of a register value without ++ * confirming that the read succeeded. Writing back modified garbage ++ * like this can fully wedge the adapter, requiring a power cycle. ++ */ ++ rtl_set_inaccessible(tp); ++ ++ /* If probe hasn't yet finished, then we'll request a retry of the ++ * whole probe routine if we get any control transfer errors. We ++ * never have to clear this bit since we free/reallocate the whole "tp" ++ * structure if we retry probe. ++ */ ++ if (!test_bit(PROBED_WITH_NO_ERRORS, &tp->flags)) { ++ set_bit(PROBE_SHOULD_RETRY, &tp->flags); ++ return ret; ++ } ++ ++ /* Failing to access registers in pre-reset is not surprising since we ++ * wouldn't be resetting if things were behaving normally. The register ++ * access we do in pre-reset isn't truly mandatory--we're just reusing ++ * the disable() function and trying to be nice by powering the ++ * adapter down before resetting it. Thus, if we're in pre-reset, ++ * we'll return right away and not try to queue up yet another reset. ++ * We know the post-reset is already coming. ++ */ ++ if (test_bit(IN_PRE_RESET, &tp->flags)) ++ return ret; ++ ++ if (tp->reg_access_reset_count < REGISTER_ACCESS_MAX_RESETS) { ++ usb_queue_reset_device(tp->intf); ++ tp->reg_access_reset_count++; ++ } else if (tp->reg_access_reset_count == REGISTER_ACCESS_MAX_RESETS) { ++ dev_err(&udev->dev, ++ "Tried to reset %d times; giving up.\n", ++ REGISTER_ACCESS_MAX_RESETS); ++ } ++ ++ return ret; ++} ++ + static + int get_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data) + { +@@ -1209,9 +1304,10 @@ int get_registers(struct r8152 *tp, u16 + if (!tmp) + return -ENOMEM; + +- ret = usb_control_msg(tp->udev, tp->pipe_ctrl_in, +- RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, +- value, index, tmp, size, USB_CTRL_GET_TIMEOUT); ++ ret = r8152_control_msg(tp, tp->pipe_ctrl_in, ++ RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, ++ value, index, tmp, size, "read"); ++ + if (ret < 0) + memset(data, 0xff, size); + else +@@ -1232,9 +1328,9 @@ int set_registers(struct r8152 *tp, u16 + if (!tmp) + return -ENOMEM; + +- ret = usb_control_msg(tp->udev, tp->pipe_ctrl_out, +- RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE, +- value, index, tmp, size, USB_CTRL_SET_TIMEOUT); ++ ret = r8152_control_msg(tp, tp->pipe_ctrl_out, ++ RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE, ++ value, index, tmp, size, "write"); + + kfree(tmp); + +@@ -1243,10 +1339,8 @@ int set_registers(struct r8152 *tp, u16 + + static void rtl_set_unplug(struct r8152 *tp) + { +- if (tp->udev->state == USB_STATE_NOTATTACHED) { +- set_bit(RTL8152_INACCESSIBLE, &tp->flags); +- smp_mb__after_atomic(); +- } ++ if (tp->udev->state == USB_STATE_NOTATTACHED) ++ rtl_set_inaccessible(tp); + } + + static int generic_ocp_read(struct r8152 *tp, u16 index, u16 size, +@@ -8261,7 +8355,7 @@ static int rtl8152_pre_reset(struct usb_ + struct r8152 *tp = usb_get_intfdata(intf); + struct net_device *netdev; + +- if (!tp) ++ if (!tp || !test_bit(PROBED_WITH_NO_ERRORS, &tp->flags)) + return 0; + + netdev = tp->netdev; +@@ -8276,7 +8370,9 @@ static int rtl8152_pre_reset(struct usb_ + napi_disable(&tp->napi); + if (netif_carrier_ok(netdev)) { + mutex_lock(&tp->control); ++ set_bit(IN_PRE_RESET, &tp->flags); + tp->rtl_ops.disable(tp); ++ clear_bit(IN_PRE_RESET, &tp->flags); + mutex_unlock(&tp->control); + } + +@@ -8289,9 +8385,11 @@ static int rtl8152_post_reset(struct usb + struct net_device *netdev; + struct sockaddr sa; + +- if (!tp) ++ if (!tp || !test_bit(PROBED_WITH_NO_ERRORS, &tp->flags)) + return 0; + ++ rtl_set_accessible(tp); ++ + /* reset the MAC address in case of policy change */ + if (determine_ethernet_addr(tp, &sa) >= 0) { + rtnl_lock(); +@@ -9493,17 +9591,29 @@ static u8 __rtl_get_hw_ver(struct usb_de + __le32 *tmp; + u8 version; + int ret; ++ int i; + + tmp = kmalloc(sizeof(*tmp), GFP_KERNEL); + if (!tmp) + return 0; + +- ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), +- RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, +- PLA_TCR0, MCU_TYPE_PLA, tmp, sizeof(*tmp), +- USB_CTRL_GET_TIMEOUT); +- if (ret > 0) +- ocp_data = (__le32_to_cpu(*tmp) >> 16) & VERSION_MASK; ++ /* Retry up to 3 times in case there is a transitory error. We do this ++ * since retrying a read of the version is always safe and this ++ * function doesn't take advantage of r8152_control_msg(). ++ */ ++ for (i = 0; i < 3; i++) { ++ ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), ++ RTL8152_REQ_GET_REGS, RTL8152_REQT_READ, ++ PLA_TCR0, MCU_TYPE_PLA, tmp, sizeof(*tmp), ++ USB_CTRL_GET_TIMEOUT); ++ if (ret > 0) { ++ ocp_data = (__le32_to_cpu(*tmp) >> 16) & VERSION_MASK; ++ break; ++ } ++ } ++ ++ if (i != 0 && ret > 0) ++ dev_warn(&udev->dev, "Needed %d retries to read version\n", i); + + kfree(tmp); + +@@ -9602,25 +9712,14 @@ static bool rtl8152_supports_lenovo_macp + return 0; + } + +-static int rtl8152_probe(struct usb_interface *intf, +- const struct usb_device_id *id) ++static int rtl8152_probe_once(struct usb_interface *intf, ++ const struct usb_device_id *id, u8 version) + { + struct usb_device *udev = interface_to_usbdev(intf); + struct r8152 *tp; + struct net_device *netdev; +- u8 version; + int ret; + +- if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) +- return -ENODEV; +- +- if (!rtl_check_vendor_ok(intf)) +- return -ENODEV; +- +- version = rtl8152_get_version(intf); +- if (version == RTL_VER_UNKNOWN) +- return -ENODEV; +- + usb_reset_device(udev); + netdev = alloc_etherdev(sizeof(struct r8152)); + if (!netdev) { +@@ -9783,10 +9882,20 @@ static int rtl8152_probe(struct usb_inte + else + device_set_wakeup_enable(&udev->dev, false); + ++ /* If we saw a control transfer error while probing then we may ++ * want to try probe() again. Consider this an error. ++ */ ++ if (test_bit(PROBE_SHOULD_RETRY, &tp->flags)) ++ goto out2; ++ ++ set_bit(PROBED_WITH_NO_ERRORS, &tp->flags); + netif_info(tp, probe, netdev, "%s\n", DRIVER_VERSION); + + return 0; + ++out2: ++ unregister_netdev(netdev); ++ + out1: + tasklet_kill(&tp->tx_tl); + cancel_delayed_work_sync(&tp->hw_phy_work); +@@ -9795,10 +9904,46 @@ out1: + rtl8152_release_firmware(tp); + usb_set_intfdata(intf, NULL); + out: ++ if (test_bit(PROBE_SHOULD_RETRY, &tp->flags)) ++ ret = -EAGAIN; ++ + free_netdev(netdev); + return ret; + } + ++#define RTL8152_PROBE_TRIES 3 ++ ++static int rtl8152_probe(struct usb_interface *intf, ++ const struct usb_device_id *id) ++{ ++ u8 version; ++ int ret; ++ int i; ++ ++ if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) ++ return -ENODEV; ++ ++ if (!rtl_check_vendor_ok(intf)) ++ return -ENODEV; ++ ++ version = rtl8152_get_version(intf); ++ if (version == RTL_VER_UNKNOWN) ++ return -ENODEV; ++ ++ for (i = 0; i < RTL8152_PROBE_TRIES; i++) { ++ ret = rtl8152_probe_once(intf, id, version); ++ if (ret != -EAGAIN) ++ break; ++ } ++ if (ret == -EAGAIN) { ++ dev_err(&intf->dev, ++ "r8152 failed probe after %d tries; giving up\n", i); ++ return -ENODEV; ++ } ++ ++ return ret; ++} ++ + static void rtl8152_disconnect(struct usb_interface *intf) + { + struct r8152 *tp = usb_get_intfdata(intf); diff --git a/target/linux/generic/backport-6.1/795-v6.6-14-r8152-break-the-loop-when-the-budget-is-exhausted.patch b/target/linux/generic/backport-6.1/795-v6.6-14-r8152-break-the-loop-when-the-budget-is-exhausted.patch new file mode 100644 index 00000000000000..7bbd1be82085aa --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.6-14-r8152-break-the-loop-when-the-budget-is-exhausted.patch @@ -0,0 +1,83 @@ +From 66eee612a1ba39f9a76a9ace4a34d012044767fb Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 26 Sep 2023 19:17:13 +0800 +Subject: [PATCH] r8152: break the loop when the budget is exhausted + +[ Upstream commit 2cf51f931797d9a47e75d999d0993a68cbd2a560 ] + +A bulk transfer of the USB may contain many packets. And, the total +number of the packets in the bulk transfer may be more than budget. + +Originally, only budget packets would be handled by napi_gro_receive(), +and the other packets would be queued in the driver for next schedule. + +This patch would break the loop about getting next bulk transfer, when +the budget is exhausted. That is, only the current bulk transfer would +be handled, and the other bulk transfers would be queued for next +schedule. Besides, the packets which are more than the budget in the +current bulk trasnfer would be still queued in the driver, as the +original method. + +In addition, a bulk transfer wouldn't contain more than 400 packets, so +the check of queue length is unnecessary. Therefore, I replace it with +WARN_ON_ONCE(). + +Fixes: cf74eb5a5bc8 ("eth: r8152: try to use a normal budget") +Signed-off-by: Hayes Wang +Link: https://lore.kernel.org/r/20230926111714.9448-433-nic_swsd@realtek.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/usb/r8152.c | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -2542,7 +2542,7 @@ static int rx_bottom(struct r8152 *tp, i + } + } + +- if (list_empty(&tp->rx_done)) ++ if (list_empty(&tp->rx_done) || work_done >= budget) + goto out1; + + clear_bit(RX_EPROTO, &tp->flags); +@@ -2558,6 +2558,15 @@ static int rx_bottom(struct r8152 *tp, i + struct urb *urb; + u8 *rx_data; + ++ /* A bulk transfer of USB may contain may packets, so the ++ * total packets may more than the budget. Deal with all ++ * packets in current bulk transfer, and stop to handle the ++ * next bulk transfer until next schedule, if budget is ++ * exhausted. ++ */ ++ if (work_done >= budget) ++ break; ++ + list_del_init(cursor); + + agg = list_entry(cursor, struct rx_agg, list); +@@ -2577,9 +2586,7 @@ static int rx_bottom(struct r8152 *tp, i + unsigned int pkt_len, rx_frag_head_sz; + struct sk_buff *skb; + +- /* limit the skb numbers for rx_queue */ +- if (unlikely(skb_queue_len(&tp->rx_queue) >= 1000)) +- break; ++ WARN_ON_ONCE(skb_queue_len(&tp->rx_queue) >= 1000); + + pkt_len = le32_to_cpu(rx_desc->opts1) & RX_LEN_MASK; + if (pkt_len < ETH_ZLEN) +@@ -2657,9 +2664,10 @@ submit: + } + } + ++ /* Splice the remained list back to rx_done for next schedule */ + if (!list_empty(&rx_queue)) { + spin_lock_irqsave(&tp->rx_lock, flags); +- list_splice_tail(&rx_queue, &tp->rx_done); ++ list_splice(&rx_queue, &tp->rx_done); + spin_unlock_irqrestore(&tp->rx_lock, flags); + } + diff --git a/target/linux/generic/backport-6.1/795-v6.6-15-net-usb-cdc_ether-add-u-blox-0x1313-composition.patch b/target/linux/generic/backport-6.1/795-v6.6-15-net-usb-cdc_ether-add-u-blox-0x1313-composition.patch new file mode 100644 index 00000000000000..c858152067c96a --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.6-15-net-usb-cdc_ether-add-u-blox-0x1313-composition.patch @@ -0,0 +1,47 @@ +From 1b0fce8c8e69485e49a7d34aac3d4c2a2aa15d62 Mon Sep 17 00:00:00 2001 +From: Davide Tronchin +Date: Thu, 29 Jun 2023 12:37:36 +0200 +Subject: [PATCH] net: usb: cdc_ether: add u-blox 0x1313 composition. + +Add CDC-ECM support for LARA-R6 01B. + +The new LARA-R6 product variant identified by the "01B" string can be +configured (by AT interface) in three different USB modes: +* Default mode (Vendor ID: 0x1546 Product ID: 0x1311) with 4 serial +interfaces +* RmNet mode (Vendor ID: 0x1546 Product ID: 0x1312) with 4 serial +interfaces and 1 RmNet virtual network interface +* CDC-ECM mode (Vendor ID: 0x1546 Product ID: 0x1313) with 4 serial +interface and 1 CDC-ECM virtual network interface +The first 4 interfaces of all the 3 configurations (default, RmNet, ECM) +are the same. + +In CDC-ECM mode LARA-R6 01B exposes the following interfaces: +If 0: Diagnostic +If 1: AT parser +If 2: AT parser +If 3: AT parset/alternative functions +If 4: CDC-ECM interface + +Signed-off-by: Davide Tronchin +Reviewed-by: Simon Horman +Signed-off-by: David S. Miller +--- + drivers/net/usb/cdc_ether.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/net/usb/cdc_ether.c ++++ b/drivers/net/usb/cdc_ether.c +@@ -879,6 +879,12 @@ static const struct usb_device_id produc + USB_CDC_PROTO_NONE), + .driver_info = (unsigned long)&wwan_info, + }, { ++ /* U-blox LARA-R6 01B */ ++ USB_DEVICE_AND_INTERFACE_INFO(UBLOX_VENDOR_ID, 0x1313, USB_CLASS_COMM, ++ USB_CDC_SUBCLASS_ETHERNET, ++ USB_CDC_PROTO_NONE), ++ .driver_info = (unsigned long)&wwan_info, ++}, { + /* ZTE modules */ + USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, USB_CLASS_COMM, + USB_CDC_SUBCLASS_ETHERNET, diff --git a/target/linux/generic/backport-6.1/795-v6.7-16-r8152-use-napi_gro_frags.patch b/target/linux/generic/backport-6.1/795-v6.7-16-r8152-use-napi_gro_frags.patch new file mode 100644 index 00000000000000..3c9680a2790ae4 --- /dev/null +++ b/target/linux/generic/backport-6.1/795-v6.7-16-r8152-use-napi_gro_frags.patch @@ -0,0 +1,122 @@ +From 788d30daa8f97f06166b6a63f0e51f2a4c2f036a Mon Sep 17 00:00:00 2001 +From: Hayes Wang +Date: Tue, 26 Sep 2023 19:17:14 +0800 +Subject: [PATCH] r8152: use napi_gro_frags + +Use napi_gro_frags() for the skb of fragments when the work_done is less +than budget. + +Signed-off-by: Hayes Wang +Link: https://lore.kernel.org/r/20230926111714.9448-434-nic_swsd@realtek.com +Signed-off-by: Jakub Kicinski +--- + drivers/net/usb/r8152.c | 67 ++++++++++++++++++++++++++++++----------- + 1 file changed, 50 insertions(+), 17 deletions(-) + +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -2583,8 +2583,9 @@ static int rx_bottom(struct r8152 *tp, i + while (urb->actual_length > len_used) { + struct net_device *netdev = tp->netdev; + struct net_device_stats *stats = &netdev->stats; +- unsigned int pkt_len, rx_frag_head_sz; ++ unsigned int pkt_len, rx_frag_head_sz, len; + struct sk_buff *skb; ++ bool use_frags; + + WARN_ON_ONCE(skb_queue_len(&tp->rx_queue) >= 1000); + +@@ -2597,45 +2598,77 @@ static int rx_bottom(struct r8152 *tp, i + break; + + pkt_len -= ETH_FCS_LEN; ++ len = pkt_len; + rx_data += sizeof(struct rx_desc); + +- if (!agg_free || tp->rx_copybreak > pkt_len) +- rx_frag_head_sz = pkt_len; ++ if (!agg_free || tp->rx_copybreak > len) ++ use_frags = false; + else +- rx_frag_head_sz = tp->rx_copybreak; ++ use_frags = true; ++ ++ if (use_frags) { ++ /* If the budget is exhausted, the packet ++ * would be queued in the driver. That is, ++ * napi_gro_frags() wouldn't be called, so ++ * we couldn't use napi_get_frags(). ++ */ ++ if (work_done >= budget) { ++ rx_frag_head_sz = tp->rx_copybreak; ++ skb = napi_alloc_skb(napi, ++ rx_frag_head_sz); ++ } else { ++ rx_frag_head_sz = 0; ++ skb = napi_get_frags(napi); ++ } ++ } else { ++ rx_frag_head_sz = 0; ++ skb = napi_alloc_skb(napi, len); ++ } + +- skb = napi_alloc_skb(napi, rx_frag_head_sz); + if (!skb) { + stats->rx_dropped++; + goto find_next_rx; + } + + skb->ip_summed = r8152_rx_csum(tp, rx_desc); +- memcpy(skb->data, rx_data, rx_frag_head_sz); +- skb_put(skb, rx_frag_head_sz); +- pkt_len -= rx_frag_head_sz; +- rx_data += rx_frag_head_sz; +- if (pkt_len) { ++ rtl_rx_vlan_tag(rx_desc, skb); ++ ++ if (use_frags) { ++ if (rx_frag_head_sz) { ++ memcpy(skb->data, rx_data, ++ rx_frag_head_sz); ++ skb_put(skb, rx_frag_head_sz); ++ len -= rx_frag_head_sz; ++ rx_data += rx_frag_head_sz; ++ skb->protocol = eth_type_trans(skb, ++ netdev); ++ } ++ + skb_add_rx_frag(skb, 0, agg->page, + agg_offset(agg, rx_data), +- pkt_len, +- SKB_DATA_ALIGN(pkt_len)); ++ len, SKB_DATA_ALIGN(len)); + get_page(agg->page); ++ } else { ++ memcpy(skb->data, rx_data, len); ++ skb_put(skb, len); ++ skb->protocol = eth_type_trans(skb, netdev); + } + +- skb->protocol = eth_type_trans(skb, netdev); +- rtl_rx_vlan_tag(rx_desc, skb); + if (work_done < budget) { ++ if (use_frags) ++ napi_gro_frags(napi); ++ else ++ napi_gro_receive(napi, skb); ++ + work_done++; + stats->rx_packets++; +- stats->rx_bytes += skb->len; +- napi_gro_receive(napi, skb); ++ stats->rx_bytes += pkt_len; + } else { + __skb_queue_tail(&tp->rx_queue, skb); + } + + find_next_rx: +- rx_data = rx_agg_align(rx_data + pkt_len + ETH_FCS_LEN); ++ rx_data = rx_agg_align(rx_data + len + ETH_FCS_LEN); + rx_desc = (struct rx_desc *)rx_data; + len_used = agg_offset(agg, rx_data); + len_used += sizeof(struct rx_desc); diff --git a/target/linux/generic/backport-6.1/801-v6.4-01-net-dsa-qca8k-move-qca8k_port_to_phy-to-header.patch b/target/linux/generic/backport-6.1/801-v6.4-01-net-dsa-qca8k-move-qca8k_port_to_phy-to-header.patch index 3c89819ac08aa4..f6a025fa12a3a8 100644 --- a/target/linux/generic/backport-6.1/801-v6.4-01-net-dsa-qca8k-move-qca8k_port_to_phy-to-header.patch +++ b/target/linux/generic/backport-6.1/801-v6.4-01-net-dsa-qca8k-move-qca8k_port_to_phy-to-header.patch @@ -20,7 +20,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c -@@ -778,21 +778,6 @@ err_clear_skb: +@@ -789,21 +789,6 @@ err_clear_skb: return ret; } diff --git a/target/linux/generic/backport-6.1/801-v6.4-02-net-dsa-qca8k-add-LEDs-basic-support.patch b/target/linux/generic/backport-6.1/801-v6.4-02-net-dsa-qca8k-add-LEDs-basic-support.patch index 58478f56ccc40a..4bd84223ef33f1 100644 --- a/target/linux/generic/backport-6.1/801-v6.4-02-net-dsa-qca8k-add-LEDs-basic-support.patch +++ b/target/linux/generic/backport-6.1/801-v6.4-02-net-dsa-qca8k-add-LEDs-basic-support.patch @@ -71,7 +71,7 @@ Signed-off-by: David S. Miller static void qca8k_split_addr(u32 regaddr, u16 *r1, u16 *r2, u16 *page) -@@ -1829,6 +1830,10 @@ qca8k_setup(struct dsa_switch *ds) +@@ -1840,6 +1841,10 @@ qca8k_setup(struct dsa_switch *ds) if (ret) return ret; diff --git a/target/linux/generic/backport-6.1/807-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch b/target/linux/generic/backport-6.1/807-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch index b7db7fb1bc4183..12ea3ebda077c7 100644 --- a/target/linux/generic/backport-6.1/807-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch +++ b/target/linux/generic/backport-6.1/807-v6.5-04-net-dsa-mv88e6xxx-fix-88E6393X-family-internal-phys-.patch @@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -5942,7 +5942,8 @@ static const struct mv88e6xxx_info mv88e +@@ -5944,7 +5944,8 @@ static const struct mv88e6xxx_info mv88e .name = "Marvell 88E6191X", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ @@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski .max_vid = 8191, .max_sid = 63, .port_base_addr = 0x0, -@@ -5965,7 +5966,8 @@ static const struct mv88e6xxx_info mv88e +@@ -5967,7 +5968,8 @@ static const struct mv88e6xxx_info mv88e .name = "Marvell 88E6193X", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ @@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski .max_vid = 8191, .max_sid = 63, .port_base_addr = 0x0, -@@ -6284,7 +6286,8 @@ static const struct mv88e6xxx_info mv88e +@@ -6286,7 +6288,8 @@ static const struct mv88e6xxx_info mv88e .name = "Marvell 88E6393X", .num_databases = 4096, .num_ports = 11, /* 10 + Z80 */ diff --git a/target/linux/generic/backport-6.1/807-v6.5-05-net-dsa-mv88e6xxx-pass-mv88e6xxx_chip-structure-to-p.patch b/target/linux/generic/backport-6.1/807-v6.5-05-net-dsa-mv88e6xxx-pass-mv88e6xxx_chip-structure-to-p.patch index 92ce97b27b4e9c..72dfcee82c13ac 100644 --- a/target/linux/generic/backport-6.1/807-v6.5-05-net-dsa-mv88e6xxx-pass-mv88e6xxx_chip-structure-to-p.patch +++ b/target/linux/generic/backport-6.1/807-v6.5-05-net-dsa-mv88e6xxx-pass-mv88e6xxx_chip-structure-to-p.patch @@ -24,7 +24,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -3326,7 +3326,7 @@ static int mv88e6xxx_setup_port(struct m +@@ -3328,7 +3328,7 @@ static int mv88e6xxx_setup_port(struct m caps = pl_config.mac_capabilities; if (chip->info->ops->port_max_speed_mode) diff --git a/target/linux/generic/backport-6.1/807-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch b/target/linux/generic/backport-6.1/807-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch index e5e815d2a4b869..dc6d5497f21178 100644 --- a/target/linux/generic/backport-6.1/807-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch +++ b/target/linux/generic/backport-6.1/807-v6.5-06-net-dsa-mv88e6xxx-enable-support-for-88E6361-switch.patch @@ -58,7 +58,7 @@ Signed-off-by: Jakub Kicinski } } -@@ -6229,6 +6235,32 @@ static const struct mv88e6xxx_info mv88e +@@ -6231,6 +6237,32 @@ static const struct mv88e6xxx_info mv88e .ptp_support = true, .ops = &mv88e6352_ops, }, diff --git a/target/linux/generic/backport-6.1/815-v6.6-1-leds-turris-omnia-Use-sysfs_emit-instead-of-sprintf.patch b/target/linux/generic/backport-6.1/815-v6.6-1-leds-turris-omnia-Use-sysfs_emit-instead-of-sprintf.patch new file mode 100644 index 00000000000000..e17be439b24db1 --- /dev/null +++ b/target/linux/generic/backport-6.1/815-v6.6-1-leds-turris-omnia-Use-sysfs_emit-instead-of-sprintf.patch @@ -0,0 +1,29 @@ +From a75b58a46423cfd9b1f73581f4bd2ac2ae743996 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Wed, 2 Aug 2023 18:07:45 +0200 +Subject: [PATCH 1/6] leds: turris-omnia: Use sysfs_emit() instead of sprintf() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use the dedicated sysfs_emit() function instead of sprintf() in sysfs +attribute accessor brightness_show(). + +Signed-off-by: Marek Behún +Link: https://lore.kernel.org/r/20230802160748.11208-4-kabel@kernel.org +Signed-off-by: Lee Jones +--- + drivers/leds/leds-turris-omnia.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/leds/leds-turris-omnia.c ++++ b/drivers/leds/leds-turris-omnia.c +@@ -194,7 +194,7 @@ static ssize_t brightness_show(struct de + if (ret < 0) + return ret; + +- return sprintf(buf, "%d\n", ret); ++ return sysfs_emit(buf, "%d\n", ret); + } + + static ssize_t brightness_store(struct device *dev, struct device_attribute *a, diff --git a/target/linux/generic/backport-6.1/815-v6.7-2-leds-turris-omnia-Make-set_brightness-more-efficient.patch b/target/linux/generic/backport-6.1/815-v6.7-2-leds-turris-omnia-Make-set_brightness-more-efficient.patch new file mode 100644 index 00000000000000..d84ad671259100 --- /dev/null +++ b/target/linux/generic/backport-6.1/815-v6.7-2-leds-turris-omnia-Make-set_brightness-more-efficient.patch @@ -0,0 +1,207 @@ +From a64c3c1357275b1fd61bc9734f638cdb5d8a8bbb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Mon, 18 Sep 2023 18:11:02 +0200 +Subject: [PATCH 4/6] leds: turris-omnia: Make set_brightness() more efficient +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Implement caching of the LED color and state values that are sent to MCU +in order to make the set_brightness() operation more efficient by +avoiding I2C transactions which are not needed. + +On Turris Omnia's MCU, which acts as the RGB LED controller, each LED +has a RGB color, and a ON/OFF state, which are configurable via I2C +commands CMD_LED_COLOR and CMD_LED_STATE. + +The CMD_LED_COLOR command sends 5 bytes and the CMD_LED_STATE command 2 +bytes over the I2C bus, which operates at 100 kHz. With I2C overhead +this allows ~1670 color changing commands and ~3200 state changing +commands per second (or around 1000 color + state changes per second). +This may seem more than enough, but the issue is that the I2C bus is +shared with another peripheral, the MCU. The MCU exposes an interrupt +interface, and it can trigger hundreds of interrupts per second. Each +time, we need to read the interrupt state register over this I2C bus. +Whenever we are sending a LED color/state changing command, the +interrupt reading is waiting. + +Currently, every time LED brightness or LED multi intensity is changed, +we send a CMD_LED_STATE command, and if the computed color (brightness +adjusted multi_intensity) is non-zero, we also send a CMD_LED_COLOR +command. + +Consider for example the situation when we have a netdev trigger enabled +for a LED. The netdev trigger does not change the LED color, only the +brightness (either to 0 or to currently configured brightness), and so +there is no need to send the CMD_LED_COLOR command. But each change of +brightness to 0 sends one CMD_LED_STATE command, and each change of +brightness to max_brightness sends one CMD_LED_STATE command and one +CMD_LED_COLOR command: + set_brightness(0) -> CMD_LED_STATE + set_brightness(255) -> CMD_LED_STATE + CMD_LED_COLOR + (unnecessary) + +We can avoid the unnecessary I2C transactions if we cache the values of +state and color that are sent to the controller. If the color does not +change from the one previously sent, there is no need to do the +CMD_LED_COLOR I2C transaction, and if the state does not change, there +is no need to do the CMD_LED_STATE transaction. + +Because we need to make sure that our cached values are consistent with +the controller state, add explicit setting of the LED color to white at +probe time (this is the default setting when MCU resets, but does not +necessarily need to be the case, for example if U-Boot played with the +LED colors). + +Signed-off-by: Marek Behún +Link: https://lore.kernel.org/r/20230918161104.20860-3-kabel@kernel.org +Signed-off-by: Lee Jones +--- + drivers/leds/leds-turris-omnia.c | 96 ++++++++++++++++++++++++++------ + 1 file changed, 78 insertions(+), 18 deletions(-) + +--- a/drivers/leds/leds-turris-omnia.c ++++ b/drivers/leds/leds-turris-omnia.c +@@ -30,6 +30,8 @@ + struct omnia_led { + struct led_classdev_mc mc_cdev; + struct mc_subled subled_info[OMNIA_LED_NUM_CHANNELS]; ++ u8 cached_channels[OMNIA_LED_NUM_CHANNELS]; ++ bool on; + int reg; + }; + +@@ -72,36 +74,82 @@ static int omnia_cmd_read_u8(const struc + return -EIO; + } + ++static int omnia_led_send_color_cmd(const struct i2c_client *client, ++ struct omnia_led *led) ++{ ++ char cmd[5]; ++ int ret; ++ ++ cmd[0] = CMD_LED_COLOR; ++ cmd[1] = led->reg; ++ cmd[2] = led->subled_info[0].brightness; ++ cmd[3] = led->subled_info[1].brightness; ++ cmd[4] = led->subled_info[2].brightness; ++ ++ /* Send the color change command */ ++ ret = i2c_master_send(client, cmd, 5); ++ if (ret < 0) ++ return ret; ++ ++ /* Cache the RGB channel brightnesses */ ++ for (int i = 0; i < OMNIA_LED_NUM_CHANNELS; ++i) ++ led->cached_channels[i] = led->subled_info[i].brightness; ++ ++ return 0; ++} ++ ++/* Determine if the computed RGB channels are different from the cached ones */ ++static bool omnia_led_channels_changed(struct omnia_led *led) ++{ ++ for (int i = 0; i < OMNIA_LED_NUM_CHANNELS; ++i) ++ if (led->subled_info[i].brightness != led->cached_channels[i]) ++ return true; ++ ++ return false; ++} ++ + static int omnia_led_brightness_set_blocking(struct led_classdev *cdev, + enum led_brightness brightness) + { + struct led_classdev_mc *mc_cdev = lcdev_to_mccdev(cdev); + struct omnia_leds *leds = dev_get_drvdata(cdev->dev->parent); + struct omnia_led *led = to_omnia_led(mc_cdev); +- u8 buf[5], state; +- int ret; ++ int err = 0; + + mutex_lock(&leds->lock); + +- led_mc_calc_color_components(&led->mc_cdev, brightness); ++ /* ++ * Only recalculate RGB brightnesses from intensities if brightness is ++ * non-zero. Otherwise we won't be using them and we can save ourselves ++ * some software divisions (Omnia's CPU does not implement the division ++ * instruction). ++ */ ++ if (brightness) { ++ led_mc_calc_color_components(mc_cdev, brightness); ++ ++ /* ++ * Send color command only if brightness is non-zero and the RGB ++ * channel brightnesses changed. ++ */ ++ if (omnia_led_channels_changed(led)) ++ err = omnia_led_send_color_cmd(leds->client, led); ++ } + +- buf[0] = CMD_LED_COLOR; +- buf[1] = led->reg; +- buf[2] = mc_cdev->subled_info[0].brightness; +- buf[3] = mc_cdev->subled_info[1].brightness; +- buf[4] = mc_cdev->subled_info[2].brightness; +- +- state = CMD_LED_STATE_LED(led->reg); +- if (buf[2] || buf[3] || buf[4]) +- state |= CMD_LED_STATE_ON; +- +- ret = omnia_cmd_write_u8(leds->client, CMD_LED_STATE, state); +- if (ret >= 0 && (state & CMD_LED_STATE_ON)) +- ret = i2c_master_send(leds->client, buf, 5); ++ /* Send on/off state change only if (bool)brightness changed */ ++ if (!err && !brightness != !led->on) { ++ u8 state = CMD_LED_STATE_LED(led->reg); ++ ++ if (brightness) ++ state |= CMD_LED_STATE_ON; ++ ++ err = omnia_cmd_write_u8(leds->client, CMD_LED_STATE, state); ++ if (!err) ++ led->on = !!brightness; ++ } + + mutex_unlock(&leds->lock); + +- return ret; ++ return err; + } + + static int omnia_led_register(struct i2c_client *client, struct omnia_led *led, +@@ -129,11 +177,15 @@ static int omnia_led_register(struct i2c + } + + led->subled_info[0].color_index = LED_COLOR_ID_RED; +- led->subled_info[0].channel = 0; + led->subled_info[1].color_index = LED_COLOR_ID_GREEN; +- led->subled_info[1].channel = 1; + led->subled_info[2].color_index = LED_COLOR_ID_BLUE; +- led->subled_info[2].channel = 2; ++ ++ /* Initial color is white */ ++ for (int i = 0; i < OMNIA_LED_NUM_CHANNELS; ++i) { ++ led->subled_info[i].intensity = 255; ++ led->subled_info[i].brightness = 255; ++ led->subled_info[i].channel = i; ++ } + + led->mc_cdev.subled_info = led->subled_info; + led->mc_cdev.num_colors = OMNIA_LED_NUM_CHANNELS; +@@ -162,6 +214,14 @@ static int omnia_led_register(struct i2c + return ret; + } + ++ /* Set initial color and cache it */ ++ ret = omnia_led_send_color_cmd(client, led); ++ if (ret < 0) { ++ dev_err(dev, "Cannot set LED %pOF initial color: %i\n", np, ++ ret); ++ return ret; ++ } ++ + ret = devm_led_classdev_multicolor_register_ext(dev, &led->mc_cdev, + &init_data); + if (ret < 0) { diff --git a/target/linux/generic/backport-6.1/815-v6.7-3-leds-turris-omnia-Support-HW-controlled-mode-via-pri.patch b/target/linux/generic/backport-6.1/815-v6.7-3-leds-turris-omnia-Support-HW-controlled-mode-via-pri.patch new file mode 100644 index 00000000000000..f64bbc7782772b --- /dev/null +++ b/target/linux/generic/backport-6.1/815-v6.7-3-leds-turris-omnia-Support-HW-controlled-mode-via-pri.patch @@ -0,0 +1,202 @@ +From e965e0f6de60874fc0a0caed9a9e0122999e0c7b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Mon, 18 Sep 2023 18:11:03 +0200 +Subject: [PATCH 5/6] leds: turris-omnia: Support HW controlled mode via + private trigger +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add support for enabling MCU controlled mode of the Turris Omnia LEDs +via a LED private trigger called "omnia-mcu". Recall that private LED +triggers will only be listed in the sysfs trigger file for LEDs that +support them (currently there is no user of this mechanism). + +When in MCU controlled mode, the user can still set LED color, but the +blinking is done by MCU, which does different things for different LEDs: +- WAN LED is blinked according to the LED[0] pin of the WAN PHY +- LAN LEDs are blinked according to the LED[0] output of the + corresponding port of the LAN switch +- PCIe LEDs are blinked according to the logical OR of the MiniPCIe port + LED pins + +In the future I want to make the netdev trigger to transparently offload +the blinking to the HW if user sets compatible settings for the netdev +trigger (for LEDs associated with network devices). +There was some work on this already, and hopefully we will be able to +complete it sometime, but for now there are still multiple blockers for +this, and even if there weren't, we still would not be able to configure +HW controlled mode for the LEDs associated with MiniPCIe ports. + +In the meantime let's support HW controlled mode via the private LED +trigger mechanism. If, in the future, we manage to complete the netdev +trigger offloading, we can still keep this private trigger for backwards +compatibility, if needed. + +We also set "omnia-mcu" to cdev->default_trigger, so that the MCU keeps +control until the user first wants to take over it. If a different +default trigger is specified in device-tree via the +'linux,default-trigger' property, LED class will overwrite +cdev->default_trigger, and so the DT property will be respected. + +Signed-off-by: Marek Behún +Link: https://lore.kernel.org/r/20230918161104.20860-4-kabel@kernel.org +Signed-off-by: Lee Jones +--- + drivers/leds/Kconfig | 1 + + drivers/leds/leds-turris-omnia.c | 98 +++++++++++++++++++++++++++++--- + 2 files changed, 91 insertions(+), 8 deletions(-) + +--- a/drivers/leds/Kconfig ++++ b/drivers/leds/Kconfig +@@ -163,6 +163,7 @@ config LEDS_TURRIS_OMNIA + depends on I2C + depends on MACH_ARMADA_38X || COMPILE_TEST + depends on OF ++ select LEDS_TRIGGERS + help + This option enables basic support for the LEDs found on the front + side of CZ.NIC's Turris Omnia router. There are 12 RGB LEDs on the +--- a/drivers/leds/leds-turris-omnia.c ++++ b/drivers/leds/leds-turris-omnia.c +@@ -31,7 +31,7 @@ struct omnia_led { + struct led_classdev_mc mc_cdev; + struct mc_subled subled_info[OMNIA_LED_NUM_CHANNELS]; + u8 cached_channels[OMNIA_LED_NUM_CHANNELS]; +- bool on; ++ bool on, hwtrig; + int reg; + }; + +@@ -120,12 +120,14 @@ static int omnia_led_brightness_set_bloc + + /* + * Only recalculate RGB brightnesses from intensities if brightness is +- * non-zero. Otherwise we won't be using them and we can save ourselves +- * some software divisions (Omnia's CPU does not implement the division +- * instruction). ++ * non-zero (if it is zero and the LED is in HW blinking mode, we use ++ * max_brightness as brightness). Otherwise we won't be using them and ++ * we can save ourselves some software divisions (Omnia's CPU does not ++ * implement the division instruction). + */ +- if (brightness) { +- led_mc_calc_color_components(mc_cdev, brightness); ++ if (brightness || led->hwtrig) { ++ led_mc_calc_color_components(mc_cdev, brightness ?: ++ cdev->max_brightness); + + /* + * Send color command only if brightness is non-zero and the RGB +@@ -135,8 +137,11 @@ static int omnia_led_brightness_set_bloc + err = omnia_led_send_color_cmd(leds->client, led); + } + +- /* Send on/off state change only if (bool)brightness changed */ +- if (!err && !brightness != !led->on) { ++ /* ++ * Send on/off state change only if (bool)brightness changed and the LED ++ * is not being blinked by HW. ++ */ ++ if (!err && !led->hwtrig && !brightness != !led->on) { + u8 state = CMD_LED_STATE_LED(led->reg); + + if (brightness) +@@ -152,6 +157,71 @@ static int omnia_led_brightness_set_bloc + return err; + } + ++static struct led_hw_trigger_type omnia_hw_trigger_type; ++ ++static int omnia_hwtrig_activate(struct led_classdev *cdev) ++{ ++ struct led_classdev_mc *mc_cdev = lcdev_to_mccdev(cdev); ++ struct omnia_leds *leds = dev_get_drvdata(cdev->dev->parent); ++ struct omnia_led *led = to_omnia_led(mc_cdev); ++ int err = 0; ++ ++ mutex_lock(&leds->lock); ++ ++ if (!led->on) { ++ /* ++ * If the LED is off (brightness was set to 0), the last ++ * configured color was not necessarily sent to the MCU. ++ * Recompute with max_brightness and send if needed. ++ */ ++ led_mc_calc_color_components(mc_cdev, cdev->max_brightness); ++ ++ if (omnia_led_channels_changed(led)) ++ err = omnia_led_send_color_cmd(leds->client, led); ++ } ++ ++ if (!err) { ++ /* Put the LED into MCU controlled mode */ ++ err = omnia_cmd_write_u8(leds->client, CMD_LED_MODE, ++ CMD_LED_MODE_LED(led->reg)); ++ if (!err) ++ led->hwtrig = true; ++ } ++ ++ mutex_unlock(&leds->lock); ++ ++ return err; ++} ++ ++static void omnia_hwtrig_deactivate(struct led_classdev *cdev) ++{ ++ struct omnia_leds *leds = dev_get_drvdata(cdev->dev->parent); ++ struct omnia_led *led = to_omnia_led(lcdev_to_mccdev(cdev)); ++ int err; ++ ++ mutex_lock(&leds->lock); ++ ++ led->hwtrig = false; ++ ++ /* Put the LED into software mode */ ++ err = omnia_cmd_write_u8(leds->client, CMD_LED_MODE, ++ CMD_LED_MODE_LED(led->reg) | ++ CMD_LED_MODE_USER); ++ ++ mutex_unlock(&leds->lock); ++ ++ if (err < 0) ++ dev_err(cdev->dev, "Cannot put LED to software mode: %i\n", ++ err); ++} ++ ++static struct led_trigger omnia_hw_trigger = { ++ .name = "omnia-mcu", ++ .activate = omnia_hwtrig_activate, ++ .deactivate = omnia_hwtrig_deactivate, ++ .trigger_type = &omnia_hw_trigger_type, ++}; ++ + static int omnia_led_register(struct i2c_client *client, struct omnia_led *led, + struct device_node *np) + { +@@ -195,6 +265,12 @@ static int omnia_led_register(struct i2c + cdev = &led->mc_cdev.led_cdev; + cdev->max_brightness = 255; + cdev->brightness_set_blocking = omnia_led_brightness_set_blocking; ++ cdev->trigger_type = &omnia_hw_trigger_type; ++ /* ++ * Use the omnia-mcu trigger as the default trigger. It may be rewritten ++ * by LED class from the linux,default-trigger property. ++ */ ++ cdev->default_trigger = omnia_hw_trigger.name; + + /* put the LED into software mode */ + ret = omnia_cmd_write_u8(client, CMD_LED_MODE, +@@ -309,6 +385,12 @@ static int omnia_leds_probe(struct i2c_c + + mutex_init(&leds->lock); + ++ ret = devm_led_trigger_register(dev, &omnia_hw_trigger); ++ if (ret < 0) { ++ dev_err(dev, "Cannot register private LED trigger: %d\n", ret); ++ return ret; ++ } ++ + led = &leds->leds[0]; + for_each_available_child_of_node(np, child) { + ret = omnia_led_register(client, led, child); diff --git a/target/linux/generic/backport-6.1/815-v6.7-4-leds-turris-omnia-Add-support-for-enabling-disabling.patch b/target/linux/generic/backport-6.1/815-v6.7-4-leds-turris-omnia-Add-support-for-enabling-disabling.patch new file mode 100644 index 00000000000000..e98397922d286b --- /dev/null +++ b/target/linux/generic/backport-6.1/815-v6.7-4-leds-turris-omnia-Add-support-for-enabling-disabling.patch @@ -0,0 +1,244 @@ +From 0efb3f9609d3de5a7d8c31e3835d7eb3e6adce79 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Mon, 18 Sep 2023 18:11:04 +0200 +Subject: [PATCH 6/6] leds: turris-omnia: Add support for enabling/disabling HW + gamma correction +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If the MCU on Turris Omnia is running newer firmware versions, the LED +controller supports RGB gamma correction (and enables it by default for +newer boards). + +Determine whether the gamma correction setting feature is supported and +add the ability to set it via sysfs attribute file. + +Signed-off-by: Marek Behún +Link: https://lore.kernel.org/r/20230918161104.20860-5-kabel@kernel.org +Signed-off-by: Lee Jones +--- + .../sysfs-class-led-driver-turris-omnia | 14 ++ + drivers/leds/leds-turris-omnia.c | 137 +++++++++++++++--- + 2 files changed, 134 insertions(+), 17 deletions(-) + +--- a/Documentation/ABI/testing/sysfs-class-led-driver-turris-omnia ++++ b/Documentation/ABI/testing/sysfs-class-led-driver-turris-omnia +@@ -12,3 +12,17 @@ Description: (RW) On the front panel of + able to change this setting from software. + + Format: %i ++ ++What: /sys/class/leds//device/gamma_correction ++Date: August 2023 ++KernelVersion: 6.6 ++Contact: Marek Behún ++Description: (RW) Newer versions of the microcontroller firmware of the ++ Turris Omnia router support gamma correction for the RGB LEDs. ++ This feature can be enabled/disabled by writing to this file. ++ ++ If the feature is not supported because the MCU firmware is too ++ old, the file always reads as 0, and writing to the file results ++ in the EOPNOTSUPP error. ++ ++ Format: %i +--- a/drivers/leds/leds-turris-omnia.c ++++ b/drivers/leds/leds-turris-omnia.c +@@ -15,17 +15,30 @@ + #define OMNIA_BOARD_LEDS 12 + #define OMNIA_LED_NUM_CHANNELS 3 + +-#define CMD_LED_MODE 3 +-#define CMD_LED_MODE_LED(l) ((l) & 0x0f) +-#define CMD_LED_MODE_USER 0x10 +- +-#define CMD_LED_STATE 4 +-#define CMD_LED_STATE_LED(l) ((l) & 0x0f) +-#define CMD_LED_STATE_ON 0x10 +- +-#define CMD_LED_COLOR 5 +-#define CMD_LED_SET_BRIGHTNESS 7 +-#define CMD_LED_GET_BRIGHTNESS 8 ++/* MCU controller commands at I2C address 0x2a */ ++#define OMNIA_MCU_I2C_ADDR 0x2a ++ ++#define CMD_GET_STATUS_WORD 0x01 ++#define STS_FEATURES_SUPPORTED BIT(2) ++ ++#define CMD_GET_FEATURES 0x10 ++#define FEAT_LED_GAMMA_CORRECTION BIT(5) ++ ++/* LED controller commands at I2C address 0x2b */ ++#define CMD_LED_MODE 0x03 ++#define CMD_LED_MODE_LED(l) ((l) & 0x0f) ++#define CMD_LED_MODE_USER 0x10 ++ ++#define CMD_LED_STATE 0x04 ++#define CMD_LED_STATE_LED(l) ((l) & 0x0f) ++#define CMD_LED_STATE_ON 0x10 ++ ++#define CMD_LED_COLOR 0x05 ++#define CMD_LED_SET_BRIGHTNESS 0x07 ++#define CMD_LED_GET_BRIGHTNESS 0x08 ++ ++#define CMD_SET_GAMMA_CORRECTION 0x30 ++#define CMD_GET_GAMMA_CORRECTION 0x31 + + struct omnia_led { + struct led_classdev_mc mc_cdev; +@@ -40,6 +53,7 @@ struct omnia_led { + struct omnia_leds { + struct i2c_client *client; + struct mutex lock; ++ bool has_gamma_correction; + struct omnia_led leds[]; + }; + +@@ -50,30 +64,42 @@ static int omnia_cmd_write_u8(const stru + return i2c_master_send(client, buf, sizeof(buf)); + } + +-static int omnia_cmd_read_u8(const struct i2c_client *client, u8 cmd) ++static int omnia_cmd_read_raw(struct i2c_adapter *adapter, u8 addr, u8 cmd, ++ void *reply, size_t len) + { + struct i2c_msg msgs[2]; +- u8 reply; + int ret; + +- msgs[0].addr = client->addr; ++ msgs[0].addr = addr; + msgs[0].flags = 0; + msgs[0].len = 1; + msgs[0].buf = &cmd; +- msgs[1].addr = client->addr; ++ msgs[1].addr = addr; + msgs[1].flags = I2C_M_RD; +- msgs[1].len = 1; +- msgs[1].buf = &reply; ++ msgs[1].len = len; ++ msgs[1].buf = reply; + +- ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)); ++ ret = i2c_transfer(adapter, msgs, ARRAY_SIZE(msgs)); + if (likely(ret == ARRAY_SIZE(msgs))) +- return reply; ++ return len; + else if (ret < 0) + return ret; + else + return -EIO; + } + ++static int omnia_cmd_read_u8(const struct i2c_client *client, u8 cmd) ++{ ++ u8 reply; ++ int ret; ++ ++ ret = omnia_cmd_read_raw(client->adapter, client->addr, cmd, &reply, 1); ++ if (ret < 0) ++ return ret; ++ ++ return reply; ++} ++ + static int omnia_led_send_color_cmd(const struct i2c_client *client, + struct omnia_led *led) + { +@@ -352,12 +378,74 @@ static ssize_t brightness_store(struct d + } + static DEVICE_ATTR_RW(brightness); + ++static ssize_t gamma_correction_show(struct device *dev, ++ struct device_attribute *a, char *buf) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct omnia_leds *leds = i2c_get_clientdata(client); ++ int ret; ++ ++ if (leds->has_gamma_correction) { ++ ret = omnia_cmd_read_u8(client, CMD_GET_GAMMA_CORRECTION); ++ if (ret < 0) ++ return ret; ++ } else { ++ ret = 0; ++ } ++ ++ return sysfs_emit(buf, "%d\n", !!ret); ++} ++ ++static ssize_t gamma_correction_store(struct device *dev, ++ struct device_attribute *a, ++ const char *buf, size_t count) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct omnia_leds *leds = i2c_get_clientdata(client); ++ bool val; ++ int ret; ++ ++ if (!leds->has_gamma_correction) ++ return -EOPNOTSUPP; ++ ++ if (kstrtobool(buf, &val) < 0) ++ return -EINVAL; ++ ++ ret = omnia_cmd_write_u8(client, CMD_SET_GAMMA_CORRECTION, val); ++ ++ return ret < 0 ? ret : count; ++} ++static DEVICE_ATTR_RW(gamma_correction); ++ + static struct attribute *omnia_led_controller_attrs[] = { + &dev_attr_brightness.attr, ++ &dev_attr_gamma_correction.attr, + NULL, + }; + ATTRIBUTE_GROUPS(omnia_led_controller); + ++static int omnia_mcu_get_features(const struct i2c_client *client) ++{ ++ u16 reply; ++ int err; ++ ++ err = omnia_cmd_read_raw(client->adapter, OMNIA_MCU_I2C_ADDR, ++ CMD_GET_STATUS_WORD, &reply, sizeof(reply)); ++ if (err < 0) ++ return err; ++ ++ /* Check whether MCU firmware supports the CMD_GET_FEAUTRES command */ ++ if (!(le16_to_cpu(reply) & STS_FEATURES_SUPPORTED)) ++ return 0; ++ ++ err = omnia_cmd_read_raw(client->adapter, OMNIA_MCU_I2C_ADDR, ++ CMD_GET_FEATURES, &reply, sizeof(reply)); ++ if (err < 0) ++ return err; ++ ++ return le16_to_cpu(reply); ++} ++ + static int omnia_leds_probe(struct i2c_client *client, + const struct i2c_device_id *id) + { +@@ -383,6 +471,21 @@ static int omnia_leds_probe(struct i2c_c + leds->client = client; + i2c_set_clientdata(client, leds); + ++ ret = omnia_mcu_get_features(client); ++ if (ret < 0) { ++ dev_err(dev, "Cannot determine MCU supported features: %d\n", ++ ret); ++ return ret; ++ } ++ ++ leds->has_gamma_correction = ret & FEAT_LED_GAMMA_CORRECTION; ++ if (!leds->has_gamma_correction) { ++ dev_info(dev, ++ "Your board's MCU firmware does not support the LED gamma correction feature.\n"); ++ dev_info(dev, ++ "Consider upgrading MCU firmware with the omnia-mcutool utility.\n"); ++ } ++ + mutex_init(&leds->lock); + + ret = devm_led_trigger_register(dev, &omnia_hw_trigger); diff --git a/target/linux/generic/backport-6.1/815-v6.7-5-leds-turris-omnia-Fix-brightness-setting-and-trigger.patch b/target/linux/generic/backport-6.1/815-v6.7-5-leds-turris-omnia-Fix-brightness-setting-and-trigger.patch new file mode 100644 index 00000000000000..b0cebdcf149005 --- /dev/null +++ b/target/linux/generic/backport-6.1/815-v6.7-5-leds-turris-omnia-Fix-brightness-setting-and-trigger.patch @@ -0,0 +1,167 @@ +From ffec49d391c5f0195360912b216aa24dbc9b53c8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Mon, 16 Oct 2023 16:15:38 +0200 +Subject: [PATCH] leds: turris-omnia: Fix brightness setting and trigger + activating +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +I have improperly refactored commits + 4d5ed2621c24 ("leds: turris-omnia: Make set_brightness() more efficient") +and + aaf38273cf76 ("leds: turris-omnia: Support HW controlled mode via private trigger") +after Lee requested a change in API semantics of the new functions I +introduced in commit + 28350bc0ac77 ("leds: turris-omnia: Do not use SMBUS calls"). + +Before the change, the function omnia_cmd_write_u8() returned 0 on +success, and afterwards it returned a positive value (number of bytes +written). The latter version was applied, but the following commits did +not properly account for this change. + +This results in non-functional LED's .brightness_set_blocking() and +trigger's .activate() methods. + +The main reasoning behind the semantics change was that read/write +methods should return the number of read/written bytes on success. +It was pointed to me [1] that this is not always true (for example the +regmap API does not do so), and since the driver never uses this number +of read/written bytes information, I decided to fix this issue by +changing the functions to the original semantics (return 0 on success). + +[1] https://lore.kernel.org/linux-gpio/ZQnn+Gi0xVlsGCYA@smile.fi.intel.com/ + +Fixes: 28350bc0ac77 ("leds: turris-omnia: Do not use SMBUS calls") +Signed-off-by: Marek Behún +--- + drivers/leds/leds-turris-omnia.c | 37 +++++++++++++++++--------------- + 1 file changed, 20 insertions(+), 17 deletions(-) + +--- a/drivers/leds/leds-turris-omnia.c ++++ b/drivers/leds/leds-turris-omnia.c +@@ -60,8 +60,11 @@ struct omnia_leds { + static int omnia_cmd_write_u8(const struct i2c_client *client, u8 cmd, u8 val) + { + u8 buf[2] = { cmd, val }; ++ int ret; ++ ++ ret = i2c_master_send(client, buf, sizeof(buf)); + +- return i2c_master_send(client, buf, sizeof(buf)); ++ return ret < 0 ? ret : 0; + } + + static int omnia_cmd_read_raw(struct i2c_adapter *adapter, u8 addr, u8 cmd, +@@ -81,7 +84,7 @@ static int omnia_cmd_read_raw(struct i2c + + ret = i2c_transfer(adapter, msgs, ARRAY_SIZE(msgs)); + if (likely(ret == ARRAY_SIZE(msgs))) +- return len; ++ return 0; + else if (ret < 0) + return ret; + else +@@ -91,11 +94,11 @@ static int omnia_cmd_read_raw(struct i2c + static int omnia_cmd_read_u8(const struct i2c_client *client, u8 cmd) + { + u8 reply; +- int ret; ++ int err; + +- ret = omnia_cmd_read_raw(client->adapter, client->addr, cmd, &reply, 1); +- if (ret < 0) +- return ret; ++ err = omnia_cmd_read_raw(client->adapter, client->addr, cmd, &reply, 1); ++ if (err) ++ return err; + + return reply; + } +@@ -236,7 +239,7 @@ static void omnia_hwtrig_deactivate(stru + + mutex_unlock(&leds->lock); + +- if (err < 0) ++ if (err) + dev_err(cdev->dev, "Cannot put LED to software mode: %i\n", + err); + } +@@ -302,7 +305,7 @@ static int omnia_led_register(struct i2c + ret = omnia_cmd_write_u8(client, CMD_LED_MODE, + CMD_LED_MODE_LED(led->reg) | + CMD_LED_MODE_USER); +- if (ret < 0) { ++ if (ret) { + dev_err(dev, "Cannot set LED %pOF to software mode: %i\n", np, + ret); + return ret; +@@ -311,7 +314,7 @@ static int omnia_led_register(struct i2c + /* disable the LED */ + ret = omnia_cmd_write_u8(client, CMD_LED_STATE, + CMD_LED_STATE_LED(led->reg)); +- if (ret < 0) { ++ if (ret) { + dev_err(dev, "Cannot set LED %pOF brightness: %i\n", np, ret); + return ret; + } +@@ -364,7 +367,7 @@ static ssize_t brightness_store(struct d + { + struct i2c_client *client = to_i2c_client(dev); + unsigned long brightness; +- int ret; ++ int err; + + if (kstrtoul(buf, 10, &brightness)) + return -EINVAL; +@@ -372,9 +375,9 @@ static ssize_t brightness_store(struct d + if (brightness > 100) + return -EINVAL; + +- ret = omnia_cmd_write_u8(client, CMD_LED_SET_BRIGHTNESS, brightness); ++ err = omnia_cmd_write_u8(client, CMD_LED_SET_BRIGHTNESS, brightness); + +- return ret < 0 ? ret : count; ++ return err ?: count; + } + static DEVICE_ATTR_RW(brightness); + +@@ -403,7 +406,7 @@ static ssize_t gamma_correction_store(st + struct i2c_client *client = to_i2c_client(dev); + struct omnia_leds *leds = i2c_get_clientdata(client); + bool val; +- int ret; ++ int err; + + if (!leds->has_gamma_correction) + return -EOPNOTSUPP; +@@ -411,9 +414,9 @@ static ssize_t gamma_correction_store(st + if (kstrtobool(buf, &val) < 0) + return -EINVAL; + +- ret = omnia_cmd_write_u8(client, CMD_SET_GAMMA_CORRECTION, val); ++ err = omnia_cmd_write_u8(client, CMD_SET_GAMMA_CORRECTION, val); + +- return ret < 0 ? ret : count; ++ return err ?: count; + } + static DEVICE_ATTR_RW(gamma_correction); + +@@ -431,7 +434,7 @@ static int omnia_mcu_get_features(const + + err = omnia_cmd_read_raw(client->adapter, OMNIA_MCU_I2C_ADDR, + CMD_GET_STATUS_WORD, &reply, sizeof(reply)); +- if (err < 0) ++ if (err) + return err; + + /* Check whether MCU firmware supports the CMD_GET_FEAUTRES command */ +@@ -440,7 +443,7 @@ static int omnia_mcu_get_features(const + + err = omnia_cmd_read_raw(client->adapter, OMNIA_MCU_I2C_ADDR, + CMD_GET_FEATURES, &reply, sizeof(reply)); +- if (err < 0) ++ if (err) + return err; + + return le16_to_cpu(reply); diff --git a/target/linux/generic/backport-6.1/816-v6.7-0001-nvmem-qfprom-Mark-core-clk-as-optional.patch b/target/linux/generic/backport-6.1/816-v6.7-0001-nvmem-qfprom-Mark-core-clk-as-optional.patch new file mode 100644 index 00000000000000..66d402814057c4 --- /dev/null +++ b/target/linux/generic/backport-6.1/816-v6.7-0001-nvmem-qfprom-Mark-core-clk-as-optional.patch @@ -0,0 +1,37 @@ +From 16724d6ea40a2c9315f5a0d81005dfa4d7a6da24 Mon Sep 17 00:00:00 2001 +From: Luca Weiss +Date: Fri, 20 Oct 2023 11:55:40 +0100 +Subject: [PATCH] nvmem: qfprom: Mark core clk as optional + +On some platforms like sc7280 on non-ChromeOS devices the core clock +cannot be touched by Linux so we cannot provide it. Mark it as optional +as accessing qfprom for reading works without it but we still prohibit +writing if we cannot provide the clock. + +Signed-off-by: Luca Weiss +Reviewed-by: Douglas Anderson +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20231020105545.216052-2-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/qfprom.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/nvmem/qfprom.c ++++ b/drivers/nvmem/qfprom.c +@@ -423,12 +423,12 @@ static int qfprom_probe(struct platform_ + if (IS_ERR(priv->vcc)) + return PTR_ERR(priv->vcc); + +- priv->secclk = devm_clk_get(dev, "core"); ++ priv->secclk = devm_clk_get_optional(dev, "core"); + if (IS_ERR(priv->secclk)) + return dev_err_probe(dev, PTR_ERR(priv->secclk), "Error getting clock\n"); + +- /* Only enable writing if we have SoC data. */ +- if (priv->soc_data) ++ /* Only enable writing if we have SoC data and a valid clock */ ++ if (priv->soc_data && priv->secclk) + econfig.reg_write = qfprom_reg_write; + } + diff --git a/target/linux/generic/backport-6.1/816-v6.7-0002-nvmem-add-explicit-config-option-to-read-old-syntax-.patch b/target/linux/generic/backport-6.1/816-v6.7-0002-nvmem-add-explicit-config-option-to-read-old-syntax-.patch new file mode 100644 index 00000000000000..35b15776fb7e66 --- /dev/null +++ b/target/linux/generic/backport-6.1/816-v6.7-0002-nvmem-add-explicit-config-option-to-read-old-syntax-.patch @@ -0,0 +1,330 @@ +From 2cc3b37f5b6df8189d55d0e812d9658ce256dfec Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 20 Oct 2023 11:55:41 +0100 +Subject: [PATCH] nvmem: add explicit config option to read old syntax fixed OF + cells +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Binding for fixed NVMEM cells defined directly as NVMEM device subnodes +has been deprecated. It has been replaced by the "fixed-layout" NVMEM +layout binding. + +New syntax is meant to be clearer and should help avoiding imprecise +bindings. + +NVMEM subsystem already supports the new binding. It should be a good +idea to limit support for old syntax to existing drivers that actually +support & use it (we can't break backward compatibility!). That way we +additionally encourage new bindings & drivers to ignore deprecated +binding. + +It wasn't clear (to me) if rtc and w1 code actually uses old syntax +fixed cells. I enabled them to don't risk any breakage. + +Signed-off-by: Rafał Miłecki +[for meson-{efuse,mx-efuse}.c] +Acked-by: Martin Blumenstingl +[for mtk-efuse.c, nvmem/core.c, nvmem-provider.h] +Reviewed-by: AngeloGioacchino Del Regno +[MT8192, MT8195 Chromebooks] +Tested-by: AngeloGioacchino Del Regno +[for microchip-otpc.c] +Reviewed-by: Claudiu Beznea +[SAMA7G5-EK] +Tested-by: Claudiu Beznea +Acked-by: Jernej Skrabec +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20231020105545.216052-3-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mtd/mtdcore.c | 2 ++ + drivers/nvmem/apple-efuses.c | 1 + + drivers/nvmem/core.c | 8 +++++--- + drivers/nvmem/imx-ocotp-scu.c | 1 + + drivers/nvmem/imx-ocotp.c | 1 + + drivers/nvmem/meson-efuse.c | 1 + + drivers/nvmem/meson-mx-efuse.c | 1 + + drivers/nvmem/microchip-otpc.c | 1 + + drivers/nvmem/mtk-efuse.c | 1 + + drivers/nvmem/qcom-spmi-sdam.c | 1 + + drivers/nvmem/qfprom.c | 1 + + drivers/nvmem/rave-sp-eeprom.c | 1 + + drivers/nvmem/rockchip-efuse.c | 1 + + drivers/nvmem/sc27xx-efuse.c | 1 + + drivers/nvmem/sec-qfprom.c | 1 + + drivers/nvmem/sprd-efuse.c | 1 + + drivers/nvmem/stm32-romem.c | 1 + + drivers/nvmem/sunplus-ocotp.c | 1 + + drivers/nvmem/sunxi_sid.c | 1 + + drivers/nvmem/uniphier-efuse.c | 1 + + drivers/nvmem/zynqmp_nvmem.c | 1 + + drivers/rtc/nvmem.c | 1 + + drivers/w1/slaves/w1_ds250x.c | 1 + + include/linux/nvmem-provider.h | 2 ++ + 24 files changed, 30 insertions(+), 3 deletions(-) + +--- a/drivers/mtd/mtdcore.c ++++ b/drivers/mtd/mtdcore.c +@@ -523,6 +523,7 @@ static int mtd_nvmem_add(struct mtd_info + config.dev = &mtd->dev; + config.name = dev_name(&mtd->dev); + config.owner = THIS_MODULE; ++ config.add_legacy_fixed_of_cells = of_device_is_compatible(node, "nvmem-cells"); + config.reg_read = mtd_nvmem_reg_read; + config.size = mtd->size; + config.word_size = 1; +@@ -891,6 +892,7 @@ static struct nvmem_device *mtd_otp_nvme + config.name = compatible; + config.id = NVMEM_DEVID_AUTO; + config.owner = THIS_MODULE; ++ config.add_legacy_fixed_of_cells = true; + config.type = NVMEM_TYPE_OTP; + config.root_only = true; + config.ignore_wp = true; +--- a/drivers/nvmem/apple-efuses.c ++++ b/drivers/nvmem/apple-efuses.c +@@ -36,6 +36,7 @@ static int apple_efuses_probe(struct pla + struct resource *res; + struct nvmem_config config = { + .dev = &pdev->dev, ++ .add_legacy_fixed_of_cells = true, + .read_only = true, + .reg_read = apple_efuses_read, + .stride = sizeof(u32), +--- a/drivers/nvmem/core.c ++++ b/drivers/nvmem/core.c +@@ -998,9 +998,11 @@ struct nvmem_device *nvmem_register(cons + if (rval) + goto err_remove_cells; + +- rval = nvmem_add_cells_from_legacy_of(nvmem); +- if (rval) +- goto err_remove_cells; ++ if (config->add_legacy_fixed_of_cells) { ++ rval = nvmem_add_cells_from_legacy_of(nvmem); ++ if (rval) ++ goto err_remove_cells; ++ } + + rval = nvmem_add_cells_from_fixed_layout(nvmem); + if (rval) +--- a/drivers/nvmem/imx-ocotp-scu.c ++++ b/drivers/nvmem/imx-ocotp-scu.c +@@ -220,6 +220,7 @@ static int imx_scu_ocotp_write(void *con + + static struct nvmem_config imx_scu_ocotp_nvmem_config = { + .name = "imx-scu-ocotp", ++ .add_legacy_fixed_of_cells = true, + .read_only = false, + .word_size = 4, + .stride = 1, +--- a/drivers/nvmem/imx-ocotp.c ++++ b/drivers/nvmem/imx-ocotp.c +@@ -616,6 +616,7 @@ static int imx_ocotp_probe(struct platfo + return PTR_ERR(priv->clk); + + priv->params = of_device_get_match_data(&pdev->dev); ++ imx_ocotp_nvmem_config.add_legacy_fixed_of_cells = true; + imx_ocotp_nvmem_config.size = 4 * priv->params->nregs; + imx_ocotp_nvmem_config.dev = dev; + imx_ocotp_nvmem_config.priv = priv; +--- a/drivers/nvmem/meson-efuse.c ++++ b/drivers/nvmem/meson-efuse.c +@@ -93,6 +93,7 @@ static int meson_efuse_probe(struct plat + + econfig->dev = dev; + econfig->name = dev_name(dev); ++ econfig->add_legacy_fixed_of_cells = true; + econfig->stride = 1; + econfig->word_size = 1; + econfig->reg_read = meson_efuse_read; +--- a/drivers/nvmem/meson-mx-efuse.c ++++ b/drivers/nvmem/meson-mx-efuse.c +@@ -211,6 +211,7 @@ static int meson_mx_efuse_probe(struct p + efuse->config.owner = THIS_MODULE; + efuse->config.dev = &pdev->dev; + efuse->config.priv = efuse; ++ efuse->config.add_legacy_fixed_of_cells = true; + efuse->config.stride = drvdata->word_size; + efuse->config.word_size = drvdata->word_size; + efuse->config.size = SZ_512; +--- a/drivers/nvmem/microchip-otpc.c ++++ b/drivers/nvmem/microchip-otpc.c +@@ -261,6 +261,7 @@ static int mchp_otpc_probe(struct platfo + return ret; + + mchp_nvmem_config.dev = otpc->dev; ++ mchp_nvmem_config.add_legacy_fixed_of_cells = true; + mchp_nvmem_config.size = size; + mchp_nvmem_config.priv = otpc; + nvmem = devm_nvmem_register(&pdev->dev, &mchp_nvmem_config); +--- a/drivers/nvmem/mtk-efuse.c ++++ b/drivers/nvmem/mtk-efuse.c +@@ -83,6 +83,7 @@ static int mtk_efuse_probe(struct platfo + return PTR_ERR(priv->base); + + pdata = device_get_match_data(dev); ++ econfig.add_legacy_fixed_of_cells = true; + econfig.stride = 1; + econfig.word_size = 1; + econfig.reg_read = mtk_reg_read; +--- a/drivers/nvmem/qcom-spmi-sdam.c ++++ b/drivers/nvmem/qcom-spmi-sdam.c +@@ -142,6 +142,7 @@ static int sdam_probe(struct platform_de + sdam->sdam_config.name = "spmi_sdam"; + sdam->sdam_config.id = NVMEM_DEVID_AUTO; + sdam->sdam_config.owner = THIS_MODULE; ++ sdam->sdam_config.add_legacy_fixed_of_cells = true; + sdam->sdam_config.stride = 1; + sdam->sdam_config.word_size = 1; + sdam->sdam_config.reg_read = sdam_read; +--- a/drivers/nvmem/qfprom.c ++++ b/drivers/nvmem/qfprom.c +@@ -357,6 +357,7 @@ static int qfprom_probe(struct platform_ + { + struct nvmem_config econfig = { + .name = "qfprom", ++ .add_legacy_fixed_of_cells = true, + .stride = 1, + .word_size = 1, + .id = NVMEM_DEVID_AUTO, +--- a/drivers/nvmem/rave-sp-eeprom.c ++++ b/drivers/nvmem/rave-sp-eeprom.c +@@ -328,6 +328,7 @@ static int rave_sp_eeprom_probe(struct p + of_property_read_string(np, "zii,eeprom-name", &config.name); + config.priv = eeprom; + config.dev = dev; ++ config.add_legacy_fixed_of_cells = true; + config.size = size; + config.reg_read = rave_sp_eeprom_reg_read; + config.reg_write = rave_sp_eeprom_reg_write; +--- a/drivers/nvmem/rockchip-efuse.c ++++ b/drivers/nvmem/rockchip-efuse.c +@@ -205,6 +205,7 @@ static int rockchip_rk3399_efuse_read(vo + + static struct nvmem_config econfig = { + .name = "rockchip-efuse", ++ .add_legacy_fixed_of_cells = true, + .stride = 1, + .word_size = 1, + .read_only = true, +--- a/drivers/nvmem/sc27xx-efuse.c ++++ b/drivers/nvmem/sc27xx-efuse.c +@@ -248,6 +248,7 @@ static int sc27xx_efuse_probe(struct pla + econfig.reg_read = sc27xx_efuse_read; + econfig.priv = efuse; + econfig.dev = &pdev->dev; ++ econfig.add_legacy_fixed_of_cells = true; + nvmem = devm_nvmem_register(&pdev->dev, &econfig); + if (IS_ERR(nvmem)) { + dev_err(&pdev->dev, "failed to register nvmem config\n"); +--- a/drivers/nvmem/sec-qfprom.c ++++ b/drivers/nvmem/sec-qfprom.c +@@ -47,6 +47,7 @@ static int sec_qfprom_probe(struct platf + { + struct nvmem_config econfig = { + .name = "sec-qfprom", ++ .add_legacy_fixed_of_cells = true, + .stride = 1, + .word_size = 1, + .id = NVMEM_DEVID_AUTO, +--- a/drivers/nvmem/sprd-efuse.c ++++ b/drivers/nvmem/sprd-efuse.c +@@ -408,6 +408,7 @@ static int sprd_efuse_probe(struct platf + econfig.read_only = false; + econfig.name = "sprd-efuse"; + econfig.size = efuse->data->blk_nums * SPRD_EFUSE_BLOCK_WIDTH; ++ econfig.add_legacy_fixed_of_cells = true; + econfig.reg_read = sprd_efuse_read; + econfig.reg_write = sprd_efuse_write; + econfig.priv = efuse; +--- a/drivers/nvmem/stm32-romem.c ++++ b/drivers/nvmem/stm32-romem.c +@@ -207,6 +207,7 @@ static int stm32_romem_probe(struct plat + priv->cfg.priv = priv; + priv->cfg.owner = THIS_MODULE; + priv->cfg.type = NVMEM_TYPE_OTP; ++ priv->cfg.add_legacy_fixed_of_cells = true; + + priv->lower = 0; + +--- a/drivers/nvmem/sunplus-ocotp.c ++++ b/drivers/nvmem/sunplus-ocotp.c +@@ -145,6 +145,7 @@ disable_clk: + + static struct nvmem_config sp_ocotp_nvmem_config = { + .name = "sp-ocotp", ++ .add_legacy_fixed_of_cells = true, + .read_only = true, + .word_size = 1, + .size = QAC628_OTP_SIZE, +--- a/drivers/nvmem/sunxi_sid.c ++++ b/drivers/nvmem/sunxi_sid.c +@@ -154,6 +154,7 @@ static int sunxi_sid_probe(struct platfo + nvmem_cfg->dev = dev; + nvmem_cfg->name = "sunxi-sid"; + nvmem_cfg->type = NVMEM_TYPE_OTP; ++ nvmem_cfg->add_legacy_fixed_of_cells = true; + nvmem_cfg->read_only = true; + nvmem_cfg->size = cfg->size; + nvmem_cfg->word_size = 1; +--- a/drivers/nvmem/uniphier-efuse.c ++++ b/drivers/nvmem/uniphier-efuse.c +@@ -52,6 +52,7 @@ static int uniphier_efuse_probe(struct p + econfig.size = resource_size(res); + econfig.priv = priv; + econfig.dev = dev; ++ econfig.add_legacy_fixed_of_cells = true; + nvmem = devm_nvmem_register(dev, &econfig); + + return PTR_ERR_OR_ZERO(nvmem); +--- a/drivers/nvmem/zynqmp_nvmem.c ++++ b/drivers/nvmem/zynqmp_nvmem.c +@@ -58,6 +58,7 @@ static int zynqmp_nvmem_probe(struct pla + + priv->dev = dev; + econfig.dev = dev; ++ econfig.add_legacy_fixed_of_cells = true; + econfig.reg_read = zynqmp_nvmem_read; + econfig.priv = priv; + +--- a/drivers/rtc/nvmem.c ++++ b/drivers/rtc/nvmem.c +@@ -21,6 +21,7 @@ int devm_rtc_nvmem_register(struct rtc_d + + nvmem_config->dev = dev; + nvmem_config->owner = rtc->owner; ++ nvmem_config->add_legacy_fixed_of_cells = true; + nvmem = devm_nvmem_register(dev, nvmem_config); + if (IS_ERR(nvmem)) + dev_err(dev, "failed to register nvmem device for RTC\n"); +--- a/drivers/w1/slaves/w1_ds250x.c ++++ b/drivers/w1/slaves/w1_ds250x.c +@@ -168,6 +168,7 @@ static int w1_eprom_add_slave(struct w1_ + struct nvmem_device *nvmem; + struct nvmem_config nvmem_cfg = { + .dev = &sl->dev, ++ .add_legacy_fixed_of_cells = true, + .reg_read = w1_nvmem_read, + .type = NVMEM_TYPE_OTP, + .read_only = true, +--- a/include/linux/nvmem-provider.h ++++ b/include/linux/nvmem-provider.h +@@ -82,6 +82,7 @@ struct nvmem_cell_info { + * @owner: Pointer to exporter module. Used for refcounting. + * @cells: Optional array of pre-defined NVMEM cells. + * @ncells: Number of elements in cells. ++ * @add_legacy_fixed_of_cells: Read fixed NVMEM cells from old OF syntax. + * @keepout: Optional array of keepout ranges (sorted ascending by start). + * @nkeepout: Number of elements in the keepout array. + * @type: Type of the nvmem storage +@@ -112,6 +113,7 @@ struct nvmem_config { + struct module *owner; + const struct nvmem_cell_info *cells; + int ncells; ++ bool add_legacy_fixed_of_cells; + const struct nvmem_keepout *keepout; + unsigned int nkeepout; + enum nvmem_type type; diff --git a/target/linux/generic/backport-6.1/816-v6.7-0003-nvmem-Use-device_get_match_data.patch b/target/linux/generic/backport-6.1/816-v6.7-0003-nvmem-Use-device_get_match_data.patch new file mode 100644 index 00000000000000..84c0293982459f --- /dev/null +++ b/target/linux/generic/backport-6.1/816-v6.7-0003-nvmem-Use-device_get_match_data.patch @@ -0,0 +1,77 @@ +From 0720219f4d34a88a9badb4de70cfad7585687d48 Mon Sep 17 00:00:00 2001 +From: Rob Herring +Date: Fri, 20 Oct 2023 11:55:45 +0100 +Subject: [PATCH] nvmem: Use device_get_match_data() + +Use preferred device_get_match_data() instead of of_match_device() to +get the driver match data. With this, adjust the includes to explicitly +include the correct headers. + +Signed-off-by: Rob Herring +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20231020105545.216052-7-srinivas.kandagatla@linaro.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvmem/mxs-ocotp.c | 10 ++++------ + drivers/nvmem/stm32-romem.c | 7 ++++--- + 2 files changed, 8 insertions(+), 9 deletions(-) + +--- a/drivers/nvmem/mxs-ocotp.c ++++ b/drivers/nvmem/mxs-ocotp.c +@@ -13,8 +13,9 @@ + #include + #include + #include +-#include ++#include + #include ++#include + #include + #include + +@@ -140,11 +141,10 @@ static int mxs_ocotp_probe(struct platfo + struct device *dev = &pdev->dev; + const struct mxs_data *data; + struct mxs_ocotp *otp; +- const struct of_device_id *match; + int ret; + +- match = of_match_device(dev->driver->of_match_table, dev); +- if (!match || !match->data) ++ data = device_get_match_data(dev); ++ if (!data) + return -EINVAL; + + otp = devm_kzalloc(dev, sizeof(*otp), GFP_KERNEL); +@@ -169,8 +169,6 @@ static int mxs_ocotp_probe(struct platfo + if (ret) + return ret; + +- data = match->data; +- + ocotp_config.size = data->size; + ocotp_config.priv = otp; + ocotp_config.dev = dev; +--- a/drivers/nvmem/stm32-romem.c ++++ b/drivers/nvmem/stm32-romem.c +@@ -10,7 +10,9 @@ + #include + #include + #include +-#include ++#include ++#include ++#include + #include + + #include "stm32-bsec-optee-ta.h" +@@ -211,8 +213,7 @@ static int stm32_romem_probe(struct plat + + priv->lower = 0; + +- cfg = (const struct stm32_romem_cfg *) +- of_match_device(dev->driver->of_match_table, dev)->data; ++ cfg = device_get_match_data(dev); + if (!cfg) { + priv->cfg.read_only = true; + priv->cfg.size = resource_size(res); diff --git a/target/linux/generic/backport-6.1/816-v6.7-0004-Revert-nvmem-add-new-config-option.patch b/target/linux/generic/backport-6.1/816-v6.7-0004-Revert-nvmem-add-new-config-option.patch new file mode 100644 index 00000000000000..7d80ad37f18bc1 --- /dev/null +++ b/target/linux/generic/backport-6.1/816-v6.7-0004-Revert-nvmem-add-new-config-option.patch @@ -0,0 +1,77 @@ +From f4cf4e5db331a5ce69e3f0b21d322cac0f4e4b5d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 23 Oct 2023 12:27:59 +0200 +Subject: [PATCH] Revert "nvmem: add new config option" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This reverts commit 517f14d9cf3533d5ab4fded195ab6f80a92e378f. + +Config option "no_of_node" is no longer needed since adding a more +explicit and targeted option "add_legacy_fixed_of_cells". + +That "no_of_node" config option was needed *earlier* to help mtd's case. + +DT nodes of MTD partitions (that are also NVMEM devices) may contain +subnodes. Those SHOULD NOT be treated as NVMEM fixed cells. + +To prevent NVMEM core code from parsing subnodes a "no_of_node" option +was added (and set to true in mtd) to make for_each_child_of_node() in +NVMEM a no-op. That was a bit hacky because it was messing with +"of_node" pointer to achieve some side-effect. + +With the introduction of "add_legacy_fixed_of_cells" config option +things got more explicit. MTD subsystem simply tells NVMEM when to look +for fixed cells and there is no need to hack "of_node" pointer anymore. + +Signed-off-by: Rafał Miłecki +Reviewed-by: Miquel Raynal +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20231023102759.31529-1-zajec5@gmail.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mtd/mtdcore.c | 1 - + drivers/nvmem/core.c | 2 +- + include/linux/nvmem-provider.h | 2 -- + 3 files changed, 1 insertion(+), 4 deletions(-) + +--- a/drivers/mtd/mtdcore.c ++++ b/drivers/mtd/mtdcore.c +@@ -531,7 +531,6 @@ static int mtd_nvmem_add(struct mtd_info + config.read_only = true; + config.root_only = true; + config.ignore_wp = true; +- config.no_of_node = !of_device_is_compatible(node, "nvmem-cells"); + config.priv = mtd; + + mtd->nvmem = nvmem_register(&config); +--- a/drivers/nvmem/core.c ++++ b/drivers/nvmem/core.c +@@ -936,7 +936,7 @@ struct nvmem_device *nvmem_register(cons + nvmem->nkeepout = config->nkeepout; + if (config->of_node) + nvmem->dev.of_node = config->of_node; +- else if (!config->no_of_node) ++ else + nvmem->dev.of_node = config->dev->of_node; + + switch (config->id) { +--- a/include/linux/nvmem-provider.h ++++ b/include/linux/nvmem-provider.h +@@ -89,7 +89,6 @@ struct nvmem_cell_info { + * @read_only: Device is read-only. + * @root_only: Device is accessibly to root only. + * @of_node: If given, this will be used instead of the parent's of_node. +- * @no_of_node: Device should not use the parent's of_node even if it's !NULL. + * @reg_read: Callback to read data. + * @reg_write: Callback to write data. + * @size: Device size. +@@ -122,7 +121,6 @@ struct nvmem_config { + bool ignore_wp; + struct nvmem_layout *layout; + struct device_node *of_node; +- bool no_of_node; + nvmem_reg_read_t reg_read; + nvmem_reg_write_t reg_write; + int size; diff --git a/target/linux/generic/backport-6.1/831-v6.7-rtc-rtc7301-Support-byte-addressed-IO.patch b/target/linux/generic/backport-6.1/831-v6.7-rtc-rtc7301-Support-byte-addressed-IO.patch new file mode 100644 index 00000000000000..ddda6e4e783283 --- /dev/null +++ b/target/linux/generic/backport-6.1/831-v6.7-rtc-rtc7301-Support-byte-addressed-IO.patch @@ -0,0 +1,93 @@ +From edd25a77e69b7c546c28077e5dffe72c54c0afe8 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Thu, 21 Sep 2023 22:18:12 +0200 +Subject: [PATCH 2/4] rtc: rtc7301: Support byte-addressed IO + +The old RTC7301 driver in OpenWrt used byte access, but the +current mainline Linux driver uses 32bit word access. + +Make this configurable using device properties using the +standard property "reg-io-width" in e.g. device tree. + +This is needed for the USRobotics USR8200 which has the +chip connected using byte accesses. + +Debugging and testing by Howard Harte. + +Signed-off-by: Linus Walleij +--- + drivers/rtc/rtc-r7301.c | 35 +++++++++++++++++++++++++++++++++-- + 1 file changed, 33 insertions(+), 2 deletions(-) + +--- a/drivers/rtc/rtc-r7301.c ++++ b/drivers/rtc/rtc-r7301.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -55,12 +56,23 @@ struct rtc7301_priv { + u8 bank; + }; + +-static const struct regmap_config rtc7301_regmap_config = { ++/* ++ * When the device is memory-mapped, some platforms pack the registers into ++ * 32-bit access using the lower 8 bits at each 4-byte stride, while others ++ * expose them as simply consecutive bytes. ++ */ ++static const struct regmap_config rtc7301_regmap_32_config = { + .reg_bits = 32, + .val_bits = 8, + .reg_stride = 4, + }; + ++static const struct regmap_config rtc7301_regmap_8_config = { ++ .reg_bits = 8, ++ .val_bits = 8, ++ .reg_stride = 1, ++}; ++ + static u8 rtc7301_read(struct rtc7301_priv *priv, unsigned int reg) + { + int reg_stride = regmap_get_reg_stride(priv->regmap); +@@ -356,7 +368,9 @@ static int __init rtc7301_rtc_probe(stru + void __iomem *regs; + struct rtc7301_priv *priv; + struct rtc_device *rtc; ++ static const struct regmap_config *mapconf; + int ret; ++ u32 val; + + priv = devm_kzalloc(&dev->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) +@@ -366,8 +380,25 @@ static int __init rtc7301_rtc_probe(stru + if (IS_ERR(regs)) + return PTR_ERR(regs); + ++ ret = device_property_read_u32(&dev->dev, "reg-io-width", &val); ++ if (ret) ++ /* Default to 32bit accesses */ ++ val = 4; ++ ++ switch (val) { ++ case 1: ++ mapconf = &rtc7301_regmap_8_config; ++ break; ++ case 4: ++ mapconf = &rtc7301_regmap_32_config; ++ break; ++ default: ++ dev_err(&dev->dev, "invalid reg-io-width %d\n", val); ++ return -EINVAL; ++ } ++ + priv->regmap = devm_regmap_init_mmio(&dev->dev, regs, +- &rtc7301_regmap_config); ++ mapconf); + if (IS_ERR(priv->regmap)) + return PTR_ERR(priv->regmap); + diff --git a/target/linux/generic/backport-6.1/832-v6.7-net-phy-amd-Support-the-Altima-AMI101L.patch b/target/linux/generic/backport-6.1/832-v6.7-net-phy-amd-Support-the-Altima-AMI101L.patch new file mode 100644 index 00000000000000..2969462838c684 --- /dev/null +++ b/target/linux/generic/backport-6.1/832-v6.7-net-phy-amd-Support-the-Altima-AMI101L.patch @@ -0,0 +1,82 @@ +From 49e5663b505070424e18099841943f34342aa405 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Sun, 24 Sep 2023 01:09:01 +0200 +Subject: [PATCH] net: phy: amd: Support the Altima AMI101L + +The Altima AC101L is obviously compatible with the AMD PHY, +as seen by reading the datasheet. + +Datasheet: https://docs.broadcom.com/doc/AC101L-DS05-405-RDS.pdf + +Signed-off-by: Linus Walleij +--- + drivers/net/phy/Kconfig | 4 ++-- + drivers/net/phy/amd.c | 33 +++++++++++++++++++++++---------- + 2 files changed, 25 insertions(+), 12 deletions(-) + +--- a/drivers/net/phy/Kconfig ++++ b/drivers/net/phy/Kconfig +@@ -72,9 +72,9 @@ config SFP + comment "MII PHY device drivers" + + config AMD_PHY +- tristate "AMD PHYs" ++ tristate "AMD and Altima PHYs" + help +- Currently supports the am79c874 ++ Currently supports the AMD am79c874 and Altima AC101L. + + config MESON_GXL_PHY + tristate "Amlogic Meson GXL Internal PHY" +--- a/drivers/net/phy/amd.c ++++ b/drivers/net/phy/amd.c +@@ -13,6 +13,7 @@ + #include + #include + ++#define PHY_ID_AC101L 0x00225520 + #define PHY_ID_AM79C874 0x0022561b + + #define MII_AM79C_IR 17 /* Interrupt Status/Control Register */ +@@ -87,19 +88,31 @@ static irqreturn_t am79c_handle_interrup + return IRQ_HANDLED; + } + +-static struct phy_driver am79c_driver[] = { { +- .phy_id = PHY_ID_AM79C874, +- .name = "AM79C874", +- .phy_id_mask = 0xfffffff0, +- /* PHY_BASIC_FEATURES */ +- .config_init = am79c_config_init, +- .config_intr = am79c_config_intr, +- .handle_interrupt = am79c_handle_interrupt, +-} }; ++static struct phy_driver am79c_drivers[] = { ++ { ++ .phy_id = PHY_ID_AM79C874, ++ .name = "AM79C874", ++ .phy_id_mask = 0xfffffff0, ++ /* PHY_BASIC_FEATURES */ ++ .config_init = am79c_config_init, ++ .config_intr = am79c_config_intr, ++ .handle_interrupt = am79c_handle_interrupt, ++ }, ++ { ++ .phy_id = PHY_ID_AC101L, ++ .name = "AC101L", ++ .phy_id_mask = 0xfffffff0, ++ /* PHY_BASIC_FEATURES */ ++ .config_init = am79c_config_init, ++ .config_intr = am79c_config_intr, ++ .handle_interrupt = am79c_handle_interrupt, ++ }, ++}; + +-module_phy_driver(am79c_driver); ++module_phy_driver(am79c_drivers); + + static struct mdio_device_id __maybe_unused amd_tbl[] = { ++ { PHY_ID_AC101L, 0xfffffff0 }, + { PHY_ID_AM79C874, 0xfffffff0 }, + { } + }; diff --git a/target/linux/generic/backport-6.1/833-v6.8-leds-core-Add-more-colors-from-DT-bindings-to-led_co.patch.patch b/target/linux/generic/backport-6.1/833-v6.8-leds-core-Add-more-colors-from-DT-bindings-to-led_co.patch.patch new file mode 100644 index 00000000000000..b71df6fa5726da --- /dev/null +++ b/target/linux/generic/backport-6.1/833-v6.8-leds-core-Add-more-colors-from-DT-bindings-to-led_co.patch.patch @@ -0,0 +1,29 @@ +From a067943129b4ec6b835e02cfd5fbef01093c1471 Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Sun, 8 Oct 2023 16:40:13 +0200 +Subject: [PATCH] leds: core: Add more colors from DT bindings to led_colors + +The colors are already part of DT bindings. Make sure the kernel is +able to convert them to strings. + +Signed-off-by: Ondrej Jirman +Link: https://lore.kernel.org/r/20231008144014.1180334-1-megi@xff.cz +Signed-off-by: Lee Jones +--- + drivers/leds/led-core.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/leds/led-core.c ++++ b/drivers/leds/led-core.c +@@ -36,6 +36,11 @@ const char * const led_colors[LED_COLOR_ + [LED_COLOR_ID_IR] = "ir", + [LED_COLOR_ID_MULTI] = "multicolor", + [LED_COLOR_ID_RGB] = "rgb", ++ [LED_COLOR_ID_PURPLE] = "purple", ++ [LED_COLOR_ID_ORANGE] = "orange", ++ [LED_COLOR_ID_PINK] = "pink", ++ [LED_COLOR_ID_CYAN] = "cyan", ++ [LED_COLOR_ID_LIME] = "lime", + }; + EXPORT_SYMBOL_GPL(led_colors); + diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index de619f60b68919..bc2509ff47865a 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -3878,6 +3878,7 @@ CONFIG_MTD_SPLIT_FIRMWARE_NAME="firmware" # CONFIG_MTD_SPLIT_LZMA_FW is not set # CONFIG_MTD_SPLIT_MINOR_FW is not set # CONFIG_MTD_SPLIT_SEAMA_FW is not set +# CONFIG_MTD_SPLIT_SEIL_FW is not set CONFIG_MTD_SPLIT_SQUASHFS_ROOT=y CONFIG_MTD_SPLIT_SUPPORT=y # CONFIG_MTD_SPLIT_TPLINK_FW is not set diff --git a/target/linux/generic/config-6.1 b/target/linux/generic/config-6.1 index 5796cbb67c8f96..d11c946dbca028 100644 --- a/target/linux/generic/config-6.1 +++ b/target/linux/generic/config-6.1 @@ -375,6 +375,7 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARM64_ERRATUM_843419 is not set # CONFIG_ARM64_ERRATUM_845719 is not set # CONFIG_ARM64_ERRATUM_858921 is not set +# CONFIG_ARM64_ERRATUM_2966298 is not set # CONFIG_ARM64_HW_AFDBM is not set # CONFIG_ARM64_LSE_ATOMICS is not set CONFIG_ARM64_MODULE_PLTS=y @@ -1478,6 +1479,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 @@ -2751,6 +2753,7 @@ CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 # CONFIG_IMGPDC_WDT is not set # CONFIG_IMG_MDC_DMA is not set # CONFIG_IMX7D_ADC is not set +# CONFIG_IMX8QXP_ADC is not set # CONFIG_IMX_IPUV3_CORE is not set # CONFIG_IMX_THERMAL is not set # CONFIG_INA2XX_ADC is not set @@ -4009,6 +4012,7 @@ CONFIG_MTD_SPLIT_FIRMWARE_NAME="firmware" # CONFIG_MTD_SPLIT_LZMA_FW is not set # CONFIG_MTD_SPLIT_MINOR_FW is not set # CONFIG_MTD_SPLIT_SEAMA_FW is not set +# CONFIG_MTD_SPLIT_SEIL_FW is not set CONFIG_MTD_SPLIT_SQUASHFS_ROOT=y CONFIG_MTD_SPLIT_SUPPORT=y # CONFIG_MTD_SPLIT_TPLINK_FW is not set @@ -6480,6 +6484,7 @@ CONFIG_SND_X86=y # CONFIG_SPI_AX88796C is not set # CONFIG_SPI_AXI_SPI_ENGINE is not set # CONFIG_SPI_BCM2835 is not set +# CONFIG_SPI_BCM63XX_HSSPI is not set # CONFIG_SPI_BCM_QSPI is not set # CONFIG_SPI_BITBANG is not set # CONFIG_SPI_BUTTERFLY is not set @@ -6988,6 +6993,7 @@ CONFIG_TRAD_SIGNALS=y # CONFIG_TRIM_UNUSED_KSYMS is not set # CONFIG_TRUSTED_FOUNDATIONS is not set # CONFIG_TRUSTED_KEYS is not set +# CONFIG_TRUSTED_KEYS_CAAM is not set # CONFIG_TRUSTED_KEYS_TPM is not set # CONFIG_TRUSTED_KEYS_TEE is not set # CONFIG_TSL2583 is not set diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/Kconfig b/target/linux/generic/files/drivers/mtd/mtdsplit/Kconfig index 895150e9cb3b19..17d590890da6e6 100644 --- a/target/linux/generic/files/drivers/mtd/mtdsplit/Kconfig +++ b/target/linux/generic/files/drivers/mtd/mtdsplit/Kconfig @@ -105,3 +105,8 @@ config MTD_SPLIT_H3C_VFS bool "Parser finding rootfs appended to H3C VFS" depends on MTD_SPLIT_SUPPORT select MTD_SPLIT + +config MTD_SPLIT_SEIL_FW + bool "IIJ SEIL firmware parser" + depends on MTD_SPLIT_SUPPORT + select MTD_SPLIT diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/Makefile b/target/linux/generic/files/drivers/mtd/mtdsplit/Makefile index a969c336aaeb98..e9d63c833258ab 100644 --- a/target/linux/generic/files/drivers/mtd/mtdsplit/Makefile +++ b/target/linux/generic/files/drivers/mtd/mtdsplit/Makefile @@ -3,6 +3,7 @@ obj-$(CONFIG_MTD_SPLIT_BCM63XX_FW) += mtdsplit_bcm63xx.o obj-$(CONFIG_MTD_SPLIT_BCM_WFI_FW) += mtdsplit_bcm_wfi.o obj-$(CONFIG_MTD_SPLIT_CFE_BOOTFS) += mtdsplit_cfe_bootfs.o obj-$(CONFIG_MTD_SPLIT_SEAMA_FW) += mtdsplit_seama.o +obj-$(CONFIG_MTD_SPLIT_SEIL_FW) += mtdsplit_seil.o obj-$(CONFIG_MTD_SPLIT_SQUASHFS_ROOT) += mtdsplit_squashfs.o obj-$(CONFIG_MTD_SPLIT_UIMAGE_FW) += mtdsplit_uimage.o obj-$(CONFIG_MTD_SPLIT_FIT_FW) += mtdsplit_fit.o diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seil.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seil.c new file mode 100644 index 00000000000000..e58bb49b23fcb3 --- /dev/null +++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_seil.c @@ -0,0 +1,191 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* a mtdsplit driver for IIJ SEIL devices */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mtdsplit.h" + +#define NR_PARTS 2 +#define SEIL_VFMT 1 +#define LDR_ENV_PART_NAME "bootloader-env" +#define LDR_ENV_KEY_BOOTDEV "BOOTDEV" + +struct seil_header { + uint64_t id; /* Identifier */ + uint8_t copy[80]; /* Copyright */ + uint32_t dcrc; /* Data CRC Checksum */ + uint32_t vfmt; /* Image Version Format */ + uint32_t vmjr; /* Image Version Major */ + uint32_t vmnr; /* Image Version Minor */ + uint8_t vrel[32]; /* Image Version Release */ + uint32_t dxor; /* xor value for Data? */ + uint32_t dlen; /* Data Length */ +}; + +/* + * check whether the current mtd device is active or not + * + * example of BOOTDEV value (IIJ SA-W2): + * - "flash" : primary image on flash + * - "rescue" : secondary image on flash + * - "usb" : usb storage + * - "lan0/1" : network + */ +static bool seil_bootdev_is_active(struct device_node *np) +{ + struct mtd_info *env_mtd; + char *buf, *var, *value, *eq; + const char *devnm; + size_t rdlen; + int ret; + + /* + * read bootdev name of the partition + * if doesn't exist, return true and skip checking of active device + */ + ret = of_property_read_string(np, "iij,bootdev-name", &devnm); + if (ret == -EINVAL) + return true; + else if (ret < 0) + return false; + + env_mtd = get_mtd_device_nm(LDR_ENV_PART_NAME); + if (IS_ERR(env_mtd)) { + pr_err("failed to get mtd device \"%s\"", LDR_ENV_PART_NAME); + return false; + } + + buf = vmalloc(env_mtd->size); + if (!buf) + return false; + + ret = mtd_read(env_mtd, 0, env_mtd->size, &rdlen, buf); + if (ret || rdlen != env_mtd->size) { + pr_err("failed to read from mtd (%d)\n", ret); + ret = 0; + goto exit_vfree; + } + + for (var = buf, ret = false; + var < buf + env_mtd->size && *var; + var = value + strlen(value) + 1) { + eq = strchr(var, '='); + if (!eq) + break; + *eq = '\0'; + value = eq + 1; + + pr_debug("ENV: %s=%s\n", var, value); + if (!strcmp(var, LDR_ENV_KEY_BOOTDEV)) { + ret = !strcmp(devnm, value); + break; + } + } + +exit_vfree: + vfree(buf); + + return ret; +} + +static int mtdsplit_parse_seil_fw(struct mtd_info *master, + const struct mtd_partition **pparts, + struct mtd_part_parser_data *data) +{ + struct device_node *np = mtd_get_of_node(master); + struct mtd_partition *parts; + struct seil_header header; + size_t image_size = 0; + size_t rootfs_offset; + size_t hdrlen = sizeof(header); + size_t retlen; + int ret; + u64 id; + + if (!seil_bootdev_is_active(np)) + return -ENODEV; + + ret = of_property_read_u64(np, "iij,seil-id", &id); + if (ret) { + pr_err("failed to get iij,seil-id from dt\n"); + return ret; + } + pr_debug("got seil-id=0x%016llx from dt\n", id); + + parts = kcalloc(NR_PARTS, sizeof(*parts), GFP_KERNEL); + if (!parts) + return -ENOMEM; + + ret = mtd_read(master, 0, hdrlen, &retlen, (void *)&header); + if (ret) + goto err_free_parts; + + if (retlen != hdrlen) { + ret = -EIO; + goto err_free_parts; + } + + if (be64_to_cpu(header.id) != id || + be32_to_cpu(header.vfmt) != SEIL_VFMT) { + pr_debug("no valid seil image found in \"%s\"\n", master->name); + ret = -ENODEV; + goto err_free_parts; + } + + image_size = hdrlen + be32_to_cpu(header.dlen); + if (image_size > master->size) { + pr_err("seil image exceeds MTD device \"%s\"\n", master->name); + ret = -EINVAL; + goto err_free_parts; + } + + /* find the roots after the seil image */ + ret = mtd_find_rootfs_from(master, image_size, + master->size, &rootfs_offset, NULL); + if (ret || (master->size - rootfs_offset) == 0) { + pr_debug("no rootfs after seil image in \"%s\"\n", + master->name); + ret = -ENODEV; + goto err_free_parts; + } + + parts[0].name = KERNEL_PART_NAME; + parts[0].offset = 0; + parts[0].size = rootfs_offset; + + parts[1].name = ROOTFS_PART_NAME; + parts[1].offset = rootfs_offset; + parts[1].size = master->size - rootfs_offset; + + *pparts = parts; + return NR_PARTS; + +err_free_parts: + kfree(parts); + return ret; +} + +static const struct of_device_id mtdsplit_seil_fw_of_match_table[] = { + { .compatible = "iij,seil-firmware" }, + {}, +}; +MODULE_DEVICE_TABLE(of, mtdsplit_seil_fw_of_match_table); + +static struct mtd_part_parser mtdsplit_seil_fw_parser = { + .owner = THIS_MODULE, + .name = "seil-fw", + .of_match_table = mtdsplit_seil_fw_of_match_table, + .parse_fn = mtdsplit_parse_seil_fw, + .type = MTD_PARSER_TYPE_FIRMWARE, +}; + +module_mtd_part_parser(mtdsplit_seil_fw_parser); diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c index e8375e514787e6..028b9916e78eb8 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c @@ -590,7 +590,7 @@ static int rtl8366_set_pvid(struct rtl8366_smi *smi, unsigned port, return -ENOSPC; } -int rtl8366_enable_vlan(struct rtl8366_smi *smi, int enable) +static int rtl8366_smi_enable_vlan(struct rtl8366_smi *smi, int enable) { int err; @@ -607,9 +607,8 @@ int rtl8366_enable_vlan(struct rtl8366_smi *smi, int enable) return err; } -EXPORT_SYMBOL_GPL(rtl8366_enable_vlan); -static int rtl8366_enable_vlan4k(struct rtl8366_smi *smi, int enable) +static int rtl8366_smi_enable_vlan4k(struct rtl8366_smi *smi, int enable) { int err; @@ -629,7 +628,7 @@ static int rtl8366_enable_vlan4k(struct rtl8366_smi *smi, int enable) return 0; } -int rtl8366_enable_all_ports(struct rtl8366_smi *smi, int enable) +static int rtl8366_smi_enable_all_ports(struct rtl8366_smi *smi, int enable) { int port; int err; @@ -642,16 +641,15 @@ int rtl8366_enable_all_ports(struct rtl8366_smi *smi, int enable) return 0; } -EXPORT_SYMBOL_GPL(rtl8366_enable_all_ports); -int rtl8366_reset_vlan(struct rtl8366_smi *smi) +static int rtl8366_smi_reset_vlan(struct rtl8366_smi *smi) { struct rtl8366_vlan_mc vlanmc; int err; int i; - rtl8366_enable_vlan(smi, 0); - rtl8366_enable_vlan4k(smi, 0); + rtl8366_smi_enable_vlan(smi, 0); + rtl8366_smi_enable_vlan4k(smi, 0); /* clear VLAN member configurations */ vlanmc.vid = 0; @@ -667,14 +665,13 @@ int rtl8366_reset_vlan(struct rtl8366_smi *smi) return 0; } -EXPORT_SYMBOL_GPL(rtl8366_reset_vlan); static int rtl8366_init_vlan(struct rtl8366_smi *smi) { int port; int err; - err = rtl8366_reset_vlan(smi); + err = rtl8366_smi_reset_vlan(smi); if (err) return err; @@ -695,7 +692,7 @@ static int rtl8366_init_vlan(struct rtl8366_smi *smi) return err; } - return rtl8366_enable_vlan(smi, 1); + return rtl8366_smi_enable_vlan(smi, 1); } #ifdef CONFIG_RTL8366_SMI_DEBUG_FS @@ -1073,15 +1070,15 @@ int rtl8366_sw_reset_switch(struct switch_dev *dev) if (err) return err; - err = rtl8366_reset_vlan(smi); + err = rtl8366_smi_reset_vlan(smi); if (err) return err; - err = rtl8366_enable_vlan(smi, 1); + err = rtl8366_smi_enable_vlan(smi, 1); if (err) return err; - return rtl8366_enable_all_ports(smi, 1); + return rtl8366_smi_enable_all_ports(smi, 1); } EXPORT_SYMBOL_GPL(rtl8366_sw_reset_switch); @@ -1343,9 +1340,9 @@ int rtl8366_sw_set_vlan_enable(struct switch_dev *dev, return -EINVAL; if (attr->ofs == 1) - err = rtl8366_enable_vlan(smi, val->value.i); + err = rtl8366_smi_enable_vlan(smi, val->value.i); else - err = rtl8366_enable_vlan4k(smi, val->value.i); + err = rtl8366_smi_enable_vlan4k(smi, val->value.i); return err; } @@ -1494,7 +1491,7 @@ int rtl8366_smi_init(struct rtl8366_smi *smi) goto err_free_sck; } - err = rtl8366_enable_all_ports(smi, 1); + err = rtl8366_smi_enable_all_ports(smi, 1); if (err) goto err_free_sck; diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h index d1d988a3727b7a..fabc9402780d60 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h +++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h @@ -115,10 +115,6 @@ int rtl8366_smi_write_reg_noack(struct rtl8366_smi *smi, u32 addr, u32 data); int rtl8366_smi_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data); int rtl8366_smi_rmwr(struct rtl8366_smi *smi, u32 addr, u32 mask, u32 data); -int rtl8366_reset_vlan(struct rtl8366_smi *smi); -int rtl8366_enable_vlan(struct rtl8366_smi *smi, int enable); -int rtl8366_enable_all_ports(struct rtl8366_smi *smi, int enable); - #ifdef CONFIG_RTL8366_SMI_DEBUG_FS int rtl8366_debugfs_open(struct inode *inode, struct file *file); #endif diff --git a/target/linux/generic/hack-5.15/259-regmap_dynamic.patch b/target/linux/generic/hack-5.15/259-regmap_dynamic.patch index 76a5ace6f31536..e0820ccfc0dbf3 100644 --- a/target/linux/generic/hack-5.15/259-regmap_dynamic.patch +++ b/target/linux/generic/hack-5.15/259-regmap_dynamic.patch @@ -125,7 +125,7 @@ Signed-off-by: Felix Fietkau #include #include #include -@@ -3358,3 +3359,5 @@ static int __init regmap_initcall(void) +@@ -3360,3 +3361,5 @@ static int __init regmap_initcall(void) return 0; } postcore_initcall(regmap_initcall); diff --git a/target/linux/generic/hack-5.15/402-mtd-blktrans-call-add-disks-after-mtd-device.patch b/target/linux/generic/hack-5.15/402-mtd-blktrans-call-add-disks-after-mtd-device.patch index 32a7fb6266422f..1df6f2f18bfcfb 100644 --- a/target/linux/generic/hack-5.15/402-mtd-blktrans-call-add-disks-after-mtd-device.patch +++ b/target/linux/generic/hack-5.15/402-mtd-blktrans-call-add-disks-after-mtd-device.patch @@ -77,7 +77,7 @@ Signed-off-by: Daniel Golle #include "mtdcore.h" -@@ -1082,6 +1083,8 @@ int mtd_device_parse_register(struct mtd +@@ -1106,6 +1107,8 @@ int mtd_device_parse_register(struct mtd register_reboot_notifier(&mtd->reboot_notifier); } diff --git a/target/linux/generic/hack-5.15/420-mtd-support-OpenWrt-s-MTD_ROOTFS_ROOT_DEV.patch b/target/linux/generic/hack-5.15/420-mtd-support-OpenWrt-s-MTD_ROOTFS_ROOT_DEV.patch index 947b2c262f3390..ed46301b0ee77c 100644 --- a/target/linux/generic/hack-5.15/420-mtd-support-OpenWrt-s-MTD_ROOTFS_ROOT_DEV.patch +++ b/target/linux/generic/hack-5.15/420-mtd-support-OpenWrt-s-MTD_ROOTFS_ROOT_DEV.patch @@ -12,7 +12,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c -@@ -761,7 +761,8 @@ int add_mtd_device(struct mtd_info *mtd) +@@ -784,7 +784,8 @@ int add_mtd_device(struct mtd_info *mtd) mutex_unlock(&mtd_table_mutex); diff --git a/target/linux/generic/hack-5.15/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch b/target/linux/generic/hack-5.15/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch index a63bb25f1a5adf..b2278069ddbbe8 100644 --- a/target/linux/generic/hack-5.15/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch +++ b/target/linux/generic/hack-5.15/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch @@ -9,7 +9,7 @@ Subject: [PATCH] net/dsa/mv88e6xxx: disable ATU violation --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -3015,6 +3015,9 @@ static int mv88e6xxx_setup_port(struct m +@@ -3017,6 +3017,9 @@ static int mv88e6xxx_setup_port(struct m else reg = 1 << port; diff --git a/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch b/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch index fcaed01cad194d..ac9a161b5f5915 100644 --- a/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch +++ b/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch @@ -116,7 +116,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3577,6 +3577,11 @@ static int xmit_one(struct sk_buff *skb, +@@ -3597,6 +3597,11 @@ static int xmit_one(struct sk_buff *skb, if (dev_nit_active(dev)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/hack-5.15/760-net-usb-r8152-add-LED-configuration-from-OF.patch b/target/linux/generic/hack-5.15/760-net-usb-r8152-add-LED-configuration-from-OF.patch index 383dfe397ff432..26c5af8510e53c 100644 --- a/target/linux/generic/hack-5.15/760-net-usb-r8152-add-LED-configuration-from-OF.patch +++ b/target/linux/generic/hack-5.15/760-net-usb-r8152-add-LED-configuration-from-OF.patch @@ -22,7 +22,7 @@ Signed-off-by: David Bauer #include #include #include -@@ -6889,6 +6890,22 @@ static void rtl_tally_reset(struct r8152 +@@ -6980,6 +6981,22 @@ static void rtl_tally_reset(struct r8152 ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data); } @@ -45,7 +45,7 @@ Signed-off-by: David Bauer static void r8152b_init(struct r8152 *tp) { u32 ocp_data; -@@ -6930,6 +6947,8 @@ static void r8152b_init(struct r8152 *tp +@@ -7021,6 +7038,8 @@ static void r8152b_init(struct r8152 *tp ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN); ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); @@ -54,7 +54,7 @@ Signed-off-by: David Bauer } static void r8153_init(struct r8152 *tp) -@@ -7070,6 +7089,8 @@ static void r8153_init(struct r8152 *tp) +@@ -7161,6 +7180,8 @@ static void r8153_init(struct r8152 *tp) tp->coalesce = COALESCE_SLOW; break; } @@ -63,7 +63,7 @@ Signed-off-by: David Bauer } static void r8153b_init(struct r8152 *tp) -@@ -7152,6 +7173,8 @@ static void r8153b_init(struct r8152 *tp +@@ -7243,6 +7264,8 @@ static void r8153b_init(struct r8152 *tp rtl_tally_reset(tp); tp->coalesce = 15000; /* 15 us */ diff --git a/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch b/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch index 5c1dbd69d3cdc7..60f02f71436e6c 100644 --- a/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch +++ b/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch @@ -10,26 +10,52 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c -@@ -1086,6 +1086,7 @@ static const struct usb_device_id produc +@@ -1080,12 +1080,18 @@ static const struct usb_device_id produc + USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7), + .driver_info = (unsigned long)&qmi_wwan_info, + }, ++ { /* Meiglink SGM828 */ ++ USB_DEVICE_AND_INTERFACE_INFO(0x2dee, 0x4d49, USB_CLASS_VENDOR_SPEC, 0x10, 0x05), ++ .driver_info = (unsigned long)&qmi_wwan_info, ++ }, ++ + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */ + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0620)}, /* Quectel EM160R-GL */ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0801)}, /* Quectel RM520N */ -+ {QMI_MATCH_FF_FF_FF(0x05c6, 0xf601)}, /* MeigLink SLM750 */ ++ {QMI_MATCH_FF_FF_FF(0x05c6, 0xf601)}, /* MeigLink SLM750 */ /* 3. Combined interface devices matching on interface number */ {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */ --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c -@@ -244,6 +244,8 @@ static void option_instat_callback(struc +@@ -247,6 +247,11 @@ static void option_instat_callback(struc #define UBLOX_PRODUCT_R410M 0x90b2 /* These Yuga products use Qualcomm's vendor ID */ #define YUGA_PRODUCT_CLM920_NC5 0x9625 +/* These MeigLink products use Qualcomm's vendor ID */ +#define MEIGLINK_PRODUCT_SLM750 0xf601 ++ ++#define MEIGLINK_VENDOR_ID 0x2dee ++#define MEIGLINK_PRODUCT_SLM828 0x4d49 #define QUECTEL_VENDOR_ID 0x2c7c /* These Quectel products use Quectel's vendor ID */ -@@ -1180,6 +1182,11 @@ static const struct usb_device_id option +@@ -1146,6 +1151,11 @@ static const struct usb_device_id option + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000), /* SIMCom SIM5218 */ + .driver_info = NCTRL(0) | NCTRL(1) | NCTRL(2) | NCTRL(3) | RSVD(4) }, ++ /* MeiG */ ++ { USB_DEVICE_AND_INTERFACE_INFO(MEIGLINK_VENDOR_ID, MEIGLINK_PRODUCT_SLM828, USB_CLASS_VENDOR_SPEC, 0x10, 0x01) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(MEIGLINK_VENDOR_ID, MEIGLINK_PRODUCT_SLM828, USB_CLASS_VENDOR_SPEC, 0x10, 0x02) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(MEIGLINK_VENDOR_ID, MEIGLINK_PRODUCT_SLM828, USB_CLASS_VENDOR_SPEC, 0x10, 0x03) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(MEIGLINK_VENDOR_ID, MEIGLINK_PRODUCT_SLM828, USB_CLASS_VENDOR_SPEC, 0x10, 0x04) }, + /* Quectel products using Qualcomm vendor ID */ + { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)}, + { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20), +@@ -1187,6 +1197,11 @@ static const struct usb_device_id option .driver_info = ZLP }, { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), .driver_info = RSVD(4) }, diff --git a/target/linux/generic/hack-5.15/781-usb-net-rndis-support-asr.patch b/target/linux/generic/hack-5.15/781-usb-net-rndis-support-asr.patch new file mode 100644 index 00000000000000..9934bb8078efe4 --- /dev/null +++ b/target/linux/generic/hack-5.15/781-usb-net-rndis-support-asr.patch @@ -0,0 +1,56 @@ +--- a/drivers/net/usb/rndis_host.c ++++ b/drivers/net/usb/rndis_host.c +@@ -630,6 +630,16 @@ static const struct driver_info zte_rndi + .tx_fixup = rndis_tx_fixup, + }; + ++static const struct driver_info asr_rndis_info = { ++ .description = "Asr RNDIS device", ++ .flags = FLAG_WWAN | FLAG_POINTTOPOINT | FLAG_FRAMING_RN | FLAG_NO_SETINT | FLAG_NOARP, ++ .bind = rndis_bind, ++ .unbind = rndis_unbind, ++ .status = rndis_status, ++ .rx_fixup = rndis_rx_fixup, ++ .tx_fixup = rndis_tx_fixup, ++}; ++ + /*-------------------------------------------------------------------------*/ + + static const struct usb_device_id products [] = { +@@ -666,6 +676,36 @@ static const struct usb_device_id produc + USB_INTERFACE_INFO(USB_CLASS_WIRELESS_CONTROLLER, 1, 3), + .driver_info = (unsigned long) &rndis_info, + }, { ++ /* Quectel EG060V rndis device */ ++ USB_DEVICE_AND_INTERFACE_INFO(0x2c7c, 0x6004, ++ USB_CLASS_WIRELESS_CONTROLLER, 1, 3), ++ .driver_info = (unsigned long) &asr_rndis_info, ++}, { ++ /* Quectel EC200A rndis device */ ++ USB_DEVICE_AND_INTERFACE_INFO(0x2c7c, 0x6005, ++ USB_CLASS_WIRELESS_CONTROLLER, 1, 3), ++ .driver_info = (unsigned long) &asr_rndis_info, ++}, { ++ /* Quectel EC200T rndis device */ ++ USB_DEVICE_AND_INTERFACE_INFO(0x2c7c, 0x6026, ++ USB_CLASS_WIRELESS_CONTROLLER, 1, 3), ++ .driver_info = (unsigned long) &asr_rndis_info, ++}, { ++ /* Simcom A7906E rndis device */ ++ USB_DEVICE_AND_INTERFACE_INFO(0x1e0e, 0x9011, ++ USB_CLASS_WIRELESS_CONTROLLER, 1, 3), ++ .driver_info = (unsigned long) &asr_rndis_info, ++}, { ++ /* Meig SLM770A */ ++ USB_DEVICE_AND_INTERFACE_INFO(0x2dee, 0x4d57, ++ USB_CLASS_WIRELESS_CONTROLLER, 1, 3), ++ .driver_info = (unsigned long) &asr_rndis_info, ++}, { ++ /* Meig SLM828 */ ++ USB_DEVICE_AND_INTERFACE_INFO(0x2dee, 0x4d49, ++ USB_CLASS_WIRELESS_CONTROLLER, 1, 3), ++ .driver_info = (unsigned long) &asr_rndis_info, ++}, { + /* Novatel Verizon USB730L */ + USB_INTERFACE_INFO(USB_CLASS_MISC, 4, 1), + .driver_info = (unsigned long) &rndis_info, diff --git a/target/linux/generic/hack-5.15/795-backport-phylink_pcs-helpers.patch b/target/linux/generic/hack-5.15/795-backport-phylink_pcs-helpers.patch index 33c5c271212a3d..a463bf7c4eb4d5 100644 --- a/target/linux/generic/hack-5.15/795-backport-phylink_pcs-helpers.patch +++ b/target/linux/generic/hack-5.15/795-backport-phylink_pcs-helpers.patch @@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle static void phylink_mac_pcs_get_state(struct phylink *pl, struct phylink_link_state *state) { -@@ -3014,6 +3013,52 @@ void phylink_mii_c22_pcs_get_state(struc +@@ -3015,6 +3014,52 @@ void phylink_mii_c22_pcs_get_state(struc EXPORT_SYMBOL_GPL(phylink_mii_c22_pcs_get_state); /** @@ -118,7 +118,7 @@ Signed-off-by: Daniel Golle * phylink_mii_c22_pcs_set_advertisement() - configure the clause 37 PCS * advertisement * @pcs: a pointer to a &struct mdio_device. -@@ -3085,6 +3130,46 @@ int phylink_mii_c22_pcs_set_advertisemen +@@ -3086,6 +3131,46 @@ int phylink_mii_c22_pcs_set_advertisemen EXPORT_SYMBOL_GPL(phylink_mii_c22_pcs_set_advertisement); /** diff --git a/target/linux/generic/hack-5.15/902-debloat_proc.patch b/target/linux/generic/hack-5.15/902-debloat_proc.patch index 58c2026c48e2c8..768d3e1f0cfb76 100644 --- a/target/linux/generic/hack-5.15/902-debloat_proc.patch +++ b/target/linux/generic/hack-5.15/902-debloat_proc.patch @@ -341,7 +341,7 @@ Signed-off-by: Felix Fietkau --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c -@@ -3025,11 +3025,13 @@ static const struct seq_operations fib_r +@@ -3029,11 +3029,13 @@ static const struct seq_operations fib_r int __net_init fib_proc_init(struct net *net) { @@ -357,7 +357,7 @@ Signed-off-by: Felix Fietkau fib_triestat_seq_show, NULL)) goto out2; -@@ -3040,17 +3042,21 @@ int __net_init fib_proc_init(struct net +@@ -3044,17 +3046,21 @@ int __net_init fib_proc_init(struct net return 0; out3: diff --git a/target/linux/generic/hack-5.15/904-debloat_dma_buf.patch b/target/linux/generic/hack-5.15/904-debloat_dma_buf.patch index 0291a5e9bd8c42..71546bf942da4e 100644 --- a/target/linux/generic/hack-5.15/904-debloat_dma_buf.patch +++ b/target/linux/generic/hack-5.15/904-debloat_dma_buf.patch @@ -72,7 +72,7 @@ Signed-off-by: Felix Fietkau +MODULE_LICENSE("GPL"); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -4216,6 +4216,7 @@ int wake_up_state(struct task_struct *p, +@@ -4220,6 +4220,7 @@ int wake_up_state(struct task_struct *p, { return try_to_wake_up(p, state, 0); } diff --git a/target/linux/generic/hack-6.1/212-tools_portability.patch b/target/linux/generic/hack-6.1/212-tools_portability.patch index 4b1c6c49839008..add281991e4eee 100644 --- a/target/linux/generic/hack-6.1/212-tools_portability.patch +++ b/target/linux/generic/hack-6.1/212-tools_portability.patch @@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau static inline uint16_t __get_unaligned_le16(const uint8_t *p) --- /dev/null +++ b/tools/include/tools/linux_types.h -@@ -0,0 +1,26 @@ +@@ -0,0 +1,18 @@ +#ifndef __LINUX_TYPES_H +#define __LINUX_TYPES_H + @@ -47,23 +47,15 @@ Signed-off-by: Felix Fietkau + +typedef int8_t __s8; +typedef uint8_t __u8; -+typedef uint8_t __be8; -+typedef uint8_t __le8; + +typedef int16_t __s16; +typedef uint16_t __u16; -+typedef uint16_t __be16; -+typedef uint16_t __le16; + +typedef int32_t __s32; +typedef uint32_t __u32; -+typedef uint32_t __be32; -+typedef uint32_t __le32; + +typedef int64_t __s64; +typedef uint64_t __u64; -+typedef uint64_t __be64; -+typedef uint64_t __le64; + +#endif --- a/tools/include/linux/types.h @@ -81,6 +73,16 @@ Signed-off-by: Felix Fietkau struct page; struct kmem_cache; +@@ -51,7 +55,9 @@ typedef __s8 s8; + #define __force + #define __user + #define __must_check ++#ifndef __cold + #define __cold ++#endif + + typedef __u16 __bitwise __le16; + typedef __u16 __bitwise __be16; --- a/tools/perf/pmu-events/jevents.py +++ b/tools/perf/pmu-events/jevents.py @@ -684,6 +684,7 @@ def main() -> None: @@ -91,3 +93,250 @@ Signed-off-by: Felix Fietkau #include struct compact_pmu_event { +--- a/tools/arch/x86/include/asm/insn.h ++++ b/tools/arch/x86/include/asm/insn.h +@@ -7,8 +7,8 @@ + * Copyright (C) IBM Corporation, 2009 + */ + +-#include + /* insn_attr_t is defined in inat.h */ ++#include + #include "inat.h" /* __ignore_sync_check__ */ + + #if defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN) +--- a/tools/arch/x86/include/asm/orc_types.h ++++ b/tools/arch/x86/include/asm/orc_types.h +@@ -40,7 +40,6 @@ + #define ORC_REG_MAX 15 + + #ifndef __ASSEMBLY__ +-#include + + /* + * This struct is more or less a vastly simplified version of the DWARF Call +@@ -53,12 +52,12 @@ + struct orc_entry { + s16 sp_offset; + s16 bp_offset; +-#if defined(__LITTLE_ENDIAN_BITFIELD) ++#if __BYTE_ORDER == __LITTLE_ENDIAN + unsigned sp_reg:4; + unsigned bp_reg:4; + unsigned type:2; + unsigned end:1; +-#elif defined(__BIG_ENDIAN_BITFIELD) ++#elif __BYTE_ORDER == __BIG_ENDIAN + unsigned bp_reg:4; + unsigned sp_reg:4; + unsigned unused:5; +--- a/tools/arch/x86/lib/insn.c ++++ b/tools/arch/x86/lib/insn.c +@@ -15,7 +15,11 @@ + #include "../include/asm/insn.h" /* __ignore_sync_check__ */ + #include "../include/asm-generic/unaligned.h" /* __ignore_sync_check__ */ + ++#ifdef __KERNEL__ + #include ++#else ++#include ++#endif + #include + + #include "../include/asm/emulate_prefix.h" /* __ignore_sync_check__ */ +--- a/tools/include/asm-generic/bitops/fls.h ++++ b/tools/include/asm-generic/bitops/fls.h +@@ -2,6 +2,8 @@ + #ifndef _ASM_GENERIC_BITOPS_FLS_H_ + #define _ASM_GENERIC_BITOPS_FLS_H_ + ++#include ++ + /** + * fls - find last (most-significant) bit set + * @x: the word to search +@@ -10,7 +12,7 @@ + * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. + */ + +-static __always_inline int fls(unsigned int x) ++static __always_inline int __generic_fls(unsigned int x) + { + int r = 32; + +@@ -38,5 +40,6 @@ static __always_inline int fls(unsigned + } + return r; + } ++#define fls __generic_fls + + #endif /* _ASM_GENERIC_BITOPS_FLS_H_ */ +--- a/tools/include/asm-generic/bitsperlong.h ++++ b/tools/include/asm-generic/bitsperlong.h +@@ -4,11 +4,13 @@ + + #include + ++#ifndef BITS_PER_LONG + #ifdef __SIZEOF_LONG__ + #define BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__) + #else + #define BITS_PER_LONG __WORDSIZE + #endif ++#endif + + #if BITS_PER_LONG != __BITS_PER_LONG + #error Inconsistent word size. Check asm/bitsperlong.h +--- a/tools/include/linux/rbtree.h ++++ b/tools/include/linux/rbtree.h +@@ -18,7 +18,6 @@ + #define __TOOLS_LINUX_PERF_RBTREE_H + + #include +-#include + + struct rb_node { + unsigned long __rb_parent_color; +--- a/tools/objtool/Makefile ++++ b/tools/objtool/Makefile +@@ -4,7 +4,7 @@ include ../scripts/Makefile.arch + + # always use the host compiler + AR = $(HOSTAR) +-CC = $(HOSTCC) ++CC = $(HOSTCC) $(HOST_EXTRACFLAGS) + LD = $(HOSTLD) + + ifeq ($(srctree),) +@@ -43,6 +43,7 @@ BUILD_ORC := n + + ifeq ($(SRCARCH),x86) + BUILD_ORC := y ++ CFLAGS += -DBUILD_ORC + endif + + export BUILD_ORC +--- a/tools/objtool/check.c ++++ b/tools/objtool/check.c +@@ -1164,11 +1164,12 @@ static int add_ignore_alternatives(struc + return 0; + } + ++#ifndef BUILD_ORC + /* + * Symbols that replace INSN_CALL_DYNAMIC, every (tail) call to such a symbol + * will be added to the .retpoline_sites section. + */ +-__weak bool arch_is_retpoline(struct symbol *sym) ++bool arch_is_retpoline(struct symbol *sym) + { + return false; + } +@@ -1177,7 +1178,7 @@ __weak bool arch_is_retpoline(struct sym + * Symbols that replace INSN_RETURN, every (tail) call to such a symbol + * will be added to the .return_sites section. + */ +-__weak bool arch_is_rethunk(struct symbol *sym) ++bool arch_is_rethunk(struct symbol *sym) + { + return false; + } +@@ -1186,10 +1187,11 @@ __weak bool arch_is_rethunk(struct symbo + * Symbols that are embedded inside other instructions, because sometimes crazy + * code exists. These are mostly ignored for validation purposes. + */ +-__weak bool arch_is_embedded_insn(struct symbol *sym) ++bool arch_is_embedded_insn(struct symbol *sym) + { + return false; + } ++#endif + + #define NEGATIVE_RELOC ((void *)-1L) + +--- a/tools/objtool/include/objtool/objtool.h ++++ b/tools/objtool/include/objtool/objtool.h +@@ -12,7 +12,9 @@ + + #include + ++#ifndef __weak + #define __weak __attribute__((weak)) ++#endif + + struct pv_state { + bool clean; +--- a/tools/objtool/orc_dump.c ++++ b/tools/objtool/orc_dump.c +@@ -5,10 +5,10 @@ + + #include + #include +-#include + #include + #include + #include ++#include + + static const char *reg_name(unsigned int reg) + { +--- a/tools/objtool/orc_gen.c ++++ b/tools/objtool/orc_gen.c +@@ -7,11 +7,11 @@ + #include + + #include +-#include + + #include + #include + #include ++#include + + static int init_orc_entry(struct orc_entry *orc, struct cfi_state *cfi, + struct instruction *insn) +--- a/tools/objtool/special.c ++++ b/tools/objtool/special.c +@@ -54,9 +54,11 @@ struct special_entry entries[] = { + {}, + }; + +-void __weak arch_handle_alternative(unsigned short feature, struct special_alt *alt) ++#ifndef BUILD_ORC ++void arch_handle_alternative(unsigned short feature, struct special_alt *alt) + { + } ++#endif + + static void reloc_to_sec_off(struct reloc *reloc, struct section **sec, + unsigned long *off) +--- a/tools/objtool/weak.c ++++ b/tools/objtool/weak.c +@@ -15,12 +15,14 @@ + return ENOSYS; \ + }) + +-int __weak orc_dump(const char *_objname) ++#ifndef BUILD_ORC ++int orc_dump(const char *_objname) + { + UNSUPPORTED("ORC"); + } + +-int __weak orc_create(struct objtool_file *file) ++int orc_create(struct objtool_file *file) + { + UNSUPPORTED("ORC"); + } ++#endif +--- a/tools/scripts/Makefile.include ++++ b/tools/scripts/Makefile.include +@@ -92,7 +92,7 @@ LLVM_OBJCOPY ?= llvm-objcopy + LLVM_STRIP ?= llvm-strip + + ifeq ($(CC_NO_CLANG), 1) +-EXTRA_WARNINGS += -Wstrict-aliasing=3 ++# EXTRA_WARNINGS += -Wstrict-aliasing=3 + + else ifneq ($(CROSS_COMPILE),) + # Allow userspace to override CLANG_CROSS_FLAGS to specify their own diff --git a/target/linux/generic/hack-6.1/259-regmap_dynamic.patch b/target/linux/generic/hack-6.1/259-regmap_dynamic.patch index 407bc72ac8dbd1..8d25f59ce2823a 100644 --- a/target/linux/generic/hack-6.1/259-regmap_dynamic.patch +++ b/target/linux/generic/hack-6.1/259-regmap_dynamic.patch @@ -125,7 +125,7 @@ Signed-off-by: Felix Fietkau #include #include #include -@@ -3511,3 +3512,5 @@ static int __init regmap_initcall(void) +@@ -3513,3 +3514,5 @@ static int __init regmap_initcall(void) return 0; } postcore_initcall(regmap_initcall); diff --git a/target/linux/generic/hack-6.1/402-mtd-blktrans-call-add-disks-after-mtd-device.patch b/target/linux/generic/hack-6.1/402-mtd-blktrans-call-add-disks-after-mtd-device.patch index c0fa2ddabf4029..c82ca3edd8402e 100644 --- a/target/linux/generic/hack-6.1/402-mtd-blktrans-call-add-disks-after-mtd-device.patch +++ b/target/linux/generic/hack-6.1/402-mtd-blktrans-call-add-disks-after-mtd-device.patch @@ -91,7 +91,7 @@ Signed-off-by: Daniel Golle #include "mtdcore.h" -@@ -1074,6 +1075,8 @@ int mtd_device_parse_register(struct mtd +@@ -1098,6 +1099,8 @@ int mtd_device_parse_register(struct mtd register_reboot_notifier(&mtd->reboot_notifier); } diff --git a/target/linux/generic/hack-6.1/420-mtd-support-OpenWrt-s-MTD_ROOTFS_ROOT_DEV.patch b/target/linux/generic/hack-6.1/420-mtd-support-OpenWrt-s-MTD_ROOTFS_ROOT_DEV.patch index 8e8e5cea8d6af2..7c7e4c814e611b 100644 --- a/target/linux/generic/hack-6.1/420-mtd-support-OpenWrt-s-MTD_ROOTFS_ROOT_DEV.patch +++ b/target/linux/generic/hack-6.1/420-mtd-support-OpenWrt-s-MTD_ROOTFS_ROOT_DEV.patch @@ -12,7 +12,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c -@@ -750,7 +750,8 @@ int add_mtd_device(struct mtd_info *mtd) +@@ -773,7 +773,8 @@ int add_mtd_device(struct mtd_info *mtd) mutex_unlock(&mtd_table_mutex); diff --git a/target/linux/generic/hack-6.1/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch b/target/linux/generic/hack-6.1/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch index 5a8f253c34831a..f09ad117b0d18d 100644 --- a/target/linux/generic/hack-6.1/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch +++ b/target/linux/generic/hack-6.1/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch @@ -9,7 +9,7 @@ Subject: [PATCH] net/dsa/mv88e6xxx: disable ATU violation --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -3486,6 +3486,9 @@ static int mv88e6xxx_setup_port(struct m +@@ -3488,6 +3488,9 @@ static int mv88e6xxx_setup_port(struct m else reg = 1 << port; diff --git a/target/linux/generic/hack-6.1/720-net-phy-add-aqr-phys.patch b/target/linux/generic/hack-6.1/720-net-phy-add-aqr-phys.patch index fd2687d8ba9e52..df04511c81b034 100644 --- a/target/linux/generic/hack-6.1/720-net-phy-add-aqr-phys.patch +++ b/target/linux/generic/hack-6.1/720-net-phy-add-aqr-phys.patch @@ -7,8 +7,8 @@ PHYs AQR113C and AQR813. Signed-off-by: Birger Koblitz ---- a/drivers/net/phy/aquantia_main.c -+++ b/drivers/net/phy/aquantia_main.c +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c @@ -23,6 +23,7 @@ #define PHY_ID_AQCS109 0x03a1b5c2 #define PHY_ID_AQR405 0x03a1b4b0 @@ -17,7 +17,7 @@ Signed-off-by: Birger Koblitz #define MDIO_PHYXS_VEND_IF_STATUS 0xe812 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3) -@@ -415,6 +416,49 @@ static int aqr107_read_rate(struct phy_d +@@ -360,6 +361,49 @@ static int aqr107_read_rate(struct phy_d return 0; } @@ -67,7 +67,7 @@ Signed-off-by: Birger Koblitz static int aqr107_read_status(struct phy_device *phydev) { int val, ret; -@@ -554,7 +598,7 @@ static void aqr107_chip_info(struct phy_ +@@ -499,7 +543,7 @@ static void aqr107_chip_info(struct phy_ build_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID, val); prov_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_PROV_ID, val); @@ -76,7 +76,7 @@ Signed-off-by: Birger Koblitz fw_major, fw_minor, build_id, prov_id); } -@@ -809,7 +853,7 @@ static struct phy_driver aqr_driver[] = +@@ -760,7 +804,7 @@ static struct phy_driver aqr_driver[] = .config_aneg = aqr_config_aneg, .config_intr = aqr_config_intr, .handle_interrupt = aqr_handle_interrupt, @@ -85,7 +85,7 @@ Signed-off-by: Birger Koblitz .get_tunable = aqr107_get_tunable, .set_tunable = aqr107_set_tunable, .suspend = aqr107_suspend, -@@ -819,6 +863,24 @@ static struct phy_driver aqr_driver[] = +@@ -770,6 +814,24 @@ static struct phy_driver aqr_driver[] = .get_stats = aqr107_get_stats, .link_change_notify = aqr107_link_change_notify, }, @@ -110,7 +110,7 @@ Signed-off-by: Birger Koblitz }; module_phy_driver(aqr_driver); -@@ -832,6 +894,7 @@ static struct mdio_device_id __maybe_unu +@@ -783,6 +845,7 @@ static struct mdio_device_id __maybe_unu { PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) }, diff --git a/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch b/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch index dd9ca868a2e7ae..8f940797c58d79 100644 --- a/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch +++ b/target/linux/generic/hack-6.1/721-net-add-packet-mangeling.patch @@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3575,6 +3575,11 @@ static int xmit_one(struct sk_buff *skb, +@@ -3604,6 +3604,11 @@ static int xmit_one(struct sk_buff *skb, if (dev_nit_active(dev)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/hack-6.1/722-net-phy-aquantia-enable-AQR112-and-AQR412.patch b/target/linux/generic/hack-6.1/722-net-phy-aquantia-enable-AQR112-and-AQR412.patch index 77b190464cfb02..3823050e341d7a 100644 --- a/target/linux/generic/hack-6.1/722-net-phy-aquantia-enable-AQR112-and-AQR412.patch +++ b/target/linux/generic/hack-6.1/722-net-phy-aquantia-enable-AQR112-and-AQR412.patch @@ -10,11 +10,11 @@ different firmware on the PHY. Signed-off-by: Alex Marginean --- - drivers/net/phy/aquantia_main.c | 88 +++++++++++++++++++++++++++++++++++++++++ + drivers/net/phy/aquantia/aquantia_main.c | 88 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) ---- a/drivers/net/phy/aquantia_main.c -+++ b/drivers/net/phy/aquantia_main.c +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c @@ -24,6 +24,8 @@ #define PHY_ID_AQR405 0x03a1b4b0 #define PHY_ID_AQR113C 0x31c31c12 @@ -24,7 +24,7 @@ Signed-off-by: Alex Marginean #define MDIO_PHYXS_VEND_IF_STATUS 0xe812 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3) -@@ -151,6 +153,29 @@ +@@ -96,6 +98,29 @@ #define AQR107_OP_IN_PROG_SLEEP 1000 #define AQR107_OP_IN_PROG_TIMEOUT 100000 @@ -54,7 +54,7 @@ Signed-off-by: Alex Marginean struct aqr107_hw_stat { const char *name; int reg; -@@ -282,6 +307,51 @@ static int aqr_config_aneg(struct phy_de +@@ -227,6 +252,51 @@ static int aqr_config_aneg(struct phy_de return genphy_c45_check_and_restart_aneg(phydev, changed); } @@ -106,7 +106,7 @@ Signed-off-by: Alex Marginean static int aqr_config_intr(struct phy_device *phydev) { bool en = phydev->interrupts == PHY_INTERRUPT_ENABLED; -@@ -881,6 +951,30 @@ static struct phy_driver aqr_driver[] = +@@ -832,6 +902,30 @@ static struct phy_driver aqr_driver[] = .get_stats = aqr107_get_stats, .link_change_notify = aqr107_link_change_notify, }, @@ -137,7 +137,7 @@ Signed-off-by: Alex Marginean }; module_phy_driver(aqr_driver); -@@ -895,6 +989,8 @@ static struct mdio_device_id __maybe_unu +@@ -846,6 +940,8 @@ static struct mdio_device_id __maybe_unu { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR813) }, diff --git a/target/linux/generic/hack-6.1/723-net-phy-aquantia-fix-system-side-protocol-mi.patch b/target/linux/generic/hack-6.1/723-net-phy-aquantia-fix-system-side-protocol-mi.patch index 8e204cb146aa93..33b182eab92557 100644 --- a/target/linux/generic/hack-6.1/723-net-phy-aquantia-fix-system-side-protocol-mi.patch +++ b/target/linux/generic/hack-6.1/723-net-phy-aquantia-fix-system-side-protocol-mi.patch @@ -9,12 +9,12 @@ these protocols leads to link issues on system side. Signed-off-by: Alex Marginean --- - drivers/net/phy/aquantia_main.c | 8 +++++++- + drivers/net/phy/aquantia/aquantia_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) ---- a/drivers/net/phy/aquantia_main.c -+++ b/drivers/net/phy/aquantia_main.c -@@ -340,10 +340,16 @@ static int aqr_config_aneg_set_prot(stru +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c +@@ -285,10 +285,16 @@ static int aqr_config_aneg_set_prot(stru phy_write_mmd(phydev, MDIO_MMD_VEND1, AQUANTIA_VND1_GSTART_RATE, aquantia_syscfg[if_type].start_rate); diff --git a/target/linux/generic/hack-6.1/724-net-phy-aquantia-Add-AQR113-driver-support.patch b/target/linux/generic/hack-6.1/724-net-phy-aquantia-Add-AQR113-driver-support.patch index 0a1e97062390ed..f59a88a14705db 100644 --- a/target/linux/generic/hack-6.1/724-net-phy-aquantia-Add-AQR113-driver-support.patch +++ b/target/linux/generic/hack-6.1/724-net-phy-aquantia-Add-AQR113-driver-support.patch @@ -5,11 +5,11 @@ Subject: [PATCH] PONRTSYS-8842: aquantia: Add AQR113 driver support Add a new entry for AQR113 PHY_ID --- - drivers/net/phy/aquantia_main.c | 10 ++++++++++ + drivers/net/phy/aquantia/aquantia_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) ---- a/drivers/net/phy/aquantia_main.c -+++ b/drivers/net/phy/aquantia_main.c +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c @@ -26,6 +26,7 @@ #define PHY_ID_AQR813 0x31c31cb2 #define PHY_ID_AQR112 0x03a1b662 @@ -18,7 +18,7 @@ Add a new entry for AQR113 PHY_ID #define MDIO_PHYXS_VEND_IF_STATUS 0xe812 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3) -@@ -981,6 +982,14 @@ static struct phy_driver aqr_driver[] = +@@ -932,6 +933,14 @@ static struct phy_driver aqr_driver[] = .get_strings = aqr107_get_strings, .get_stats = aqr107_get_stats, }, @@ -33,7 +33,7 @@ Add a new entry for AQR113 PHY_ID }; module_phy_driver(aqr_driver); -@@ -997,6 +1006,7 @@ static struct mdio_device_id __maybe_unu +@@ -948,6 +957,7 @@ static struct mdio_device_id __maybe_unu { PHY_ID_MATCH_MODEL(PHY_ID_AQR813) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR112) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR412) }, diff --git a/target/linux/generic/hack-6.1/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch b/target/linux/generic/hack-6.1/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch index 654fea566112a8..c29c36aa22aad8 100644 --- a/target/linux/generic/hack-6.1/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch +++ b/target/linux/generic/hack-6.1/725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch @@ -7,11 +7,11 @@ As advised by Ian Chang this PHY is used in Puzzle devices. Signed-off-by: Daniel Golle --- - drivers/net/phy/aquantia_main.c | 10 ++++++++++ + drivers/net/phy/aquantia/aquantia_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) ---- a/drivers/net/phy/aquantia_main.c -+++ b/drivers/net/phy/aquantia_main.c +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c @@ -27,6 +27,8 @@ #define PHY_ID_AQR112 0x03a1b662 #define PHY_ID_AQR412 0x03a1b712 @@ -21,7 +21,7 @@ Signed-off-by: Daniel Golle #define MDIO_PHYXS_VEND_IF_STATUS 0xe812 #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK GENMASK(7, 3) -@@ -990,6 +992,30 @@ static struct phy_driver aqr_driver[] = +@@ -941,6 +943,30 @@ static struct phy_driver aqr_driver[] = .handle_interrupt = aqr_handle_interrupt, .read_status = aqr107_read_status, }, @@ -52,7 +52,7 @@ Signed-off-by: Daniel Golle }; module_phy_driver(aqr_driver); -@@ -1007,6 +1033,8 @@ static struct mdio_device_id __maybe_unu +@@ -958,6 +984,8 @@ static struct mdio_device_id __maybe_unu { PHY_ID_MATCH_MODEL(PHY_ID_AQR112) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR412) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR113) }, diff --git a/target/linux/generic/hack-6.1/726-net-phy-aquantia-enable-AQR111-and-AQR111B0.patch b/target/linux/generic/hack-6.1/726-net-phy-aquantia-enable-AQR111-and-AQR111B0.patch index dc25905fee1721..dbae8f52f4796d 100644 --- a/target/linux/generic/hack-6.1/726-net-phy-aquantia-enable-AQR111-and-AQR111B0.patch +++ b/target/linux/generic/hack-6.1/726-net-phy-aquantia-enable-AQR111-and-AQR111B0.patch @@ -10,8 +10,8 @@ This is a 5GbE chip but it reports support for 10G. Implement config_init() to set max speed to 5G. Signed-off-by: Thomas Kupper ---- a/drivers/net/phy/aquantia_main.c -+++ b/drivers/net/phy/aquantia_main.c +--- a/drivers/net/phy/aquantia/aquantia_main.c ++++ b/drivers/net/phy/aquantia/aquantia_main.c @@ -24,6 +24,8 @@ #define PHY_ID_AQR405 0x03a1b4b0 #define PHY_ID_AQR113C 0x31c31c12 @@ -21,7 +21,7 @@ Signed-off-by: Thomas Kupper #define PHY_ID_AQR112 0x03a1b662 #define PHY_ID_AQR412 0x03a1b712 #define PHY_ID_AQR113 0x31c31c40 -@@ -729,6 +731,34 @@ static int aqcs109_config_init(struct ph +@@ -674,6 +676,34 @@ static int aqcs109_config_init(struct ph return aqr107_set_downshift(phydev, MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT); } @@ -56,7 +56,7 @@ Signed-off-by: Thomas Kupper static void aqr107_link_change_notify(struct phy_device *phydev) { u8 fw_major, fw_minor; -@@ -961,6 +991,42 @@ static struct phy_driver aqr_driver[] = +@@ -912,6 +942,42 @@ static struct phy_driver aqr_driver[] = .link_change_notify = aqr107_link_change_notify, }, { @@ -99,7 +99,7 @@ Signed-off-by: Thomas Kupper PHY_ID_MATCH_MODEL(PHY_ID_AQR112), .name = "Aquantia AQR112", .probe = aqr107_probe, -@@ -1030,6 +1096,8 @@ static struct mdio_device_id __maybe_unu +@@ -981,6 +1047,8 @@ static struct mdio_device_id __maybe_unu { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR813) }, diff --git a/target/linux/generic/hack-6.1/760-net-usb-r8152-add-LED-configuration-from-OF.patch b/target/linux/generic/hack-6.1/760-net-usb-r8152-add-LED-configuration-from-OF.patch index 96525089ef5a9e..c842639792f120 100644 --- a/target/linux/generic/hack-6.1/760-net-usb-r8152-add-LED-configuration-from-OF.patch +++ b/target/linux/generic/hack-6.1/760-net-usb-r8152-add-LED-configuration-from-OF.patch @@ -22,7 +22,7 @@ Signed-off-by: David Bauer #include #include #include -@@ -6896,6 +6897,22 @@ static void rtl_tally_reset(struct r8152 +@@ -7020,6 +7021,22 @@ static void rtl_tally_reset(struct r8152 ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data); } @@ -45,7 +45,7 @@ Signed-off-by: David Bauer static void r8152b_init(struct r8152 *tp) { u32 ocp_data; -@@ -6937,6 +6954,8 @@ static void r8152b_init(struct r8152 *tp +@@ -7061,6 +7078,8 @@ static void r8152b_init(struct r8152 *tp ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN); ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); @@ -54,7 +54,7 @@ Signed-off-by: David Bauer } static void r8153_init(struct r8152 *tp) -@@ -7077,6 +7096,8 @@ static void r8153_init(struct r8152 *tp) +@@ -7201,6 +7220,8 @@ static void r8153_init(struct r8152 *tp) tp->coalesce = COALESCE_SLOW; break; } @@ -63,7 +63,7 @@ Signed-off-by: David Bauer } static void r8153b_init(struct r8152 *tp) -@@ -7159,6 +7180,8 @@ static void r8153b_init(struct r8152 *tp +@@ -7283,6 +7304,8 @@ static void r8153b_init(struct r8152 *tp rtl_tally_reset(tp); tp->coalesce = 15000; /* 15 us */ diff --git a/target/linux/generic/hack-6.1/780-usb-net-MeigLink_modem_support.patch b/target/linux/generic/hack-6.1/780-usb-net-MeigLink_modem_support.patch index a68562d0958aa8..481185122feea8 100644 --- a/target/linux/generic/hack-6.1/780-usb-net-MeigLink_modem_support.patch +++ b/target/linux/generic/hack-6.1/780-usb-net-MeigLink_modem_support.patch @@ -10,26 +10,52 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c -@@ -1088,6 +1088,7 @@ static const struct usb_device_id produc +@@ -1082,12 +1082,18 @@ static const struct usb_device_id produc + USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7), + .driver_info = (unsigned long)&qmi_wwan_info, + }, ++ { /* Meiglink SGM828 */ ++ USB_DEVICE_AND_INTERFACE_INFO(0x2dee, 0x4d49, USB_CLASS_VENDOR_SPEC, 0x10, 0x05), ++ .driver_info = (unsigned long)&qmi_wwan_info, ++ }, ++ + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */ + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0620)}, /* Quectel EM160R-GL */ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0801)}, /* Quectel RM520N */ -+ {QMI_MATCH_FF_FF_FF(0x05c6, 0xf601)}, /* MeigLink SLM750 */ ++ {QMI_MATCH_FF_FF_FF(0x05c6, 0xf601)}, /* MeigLink SLM750 */ /* 3. Combined interface devices matching on interface number */ {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */ --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c -@@ -244,6 +244,8 @@ static void option_instat_callback(struc +@@ -247,6 +247,11 @@ static void option_instat_callback(struc #define UBLOX_PRODUCT_R410M 0x90b2 /* These Yuga products use Qualcomm's vendor ID */ #define YUGA_PRODUCT_CLM920_NC5 0x9625 +/* These MeigLink products use Qualcomm's vendor ID */ +#define MEIGLINK_PRODUCT_SLM750 0xf601 ++ ++#define MEIGLINK_VENDOR_ID 0x2dee ++#define MEIGLINK_PRODUCT_SLM828 0x4d49 #define QUECTEL_VENDOR_ID 0x2c7c /* These Quectel products use Quectel's vendor ID */ -@@ -1180,6 +1182,11 @@ static const struct usb_device_id option +@@ -1146,6 +1151,11 @@ static const struct usb_device_id option + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000), /* SIMCom SIM5218 */ + .driver_info = NCTRL(0) | NCTRL(1) | NCTRL(2) | NCTRL(3) | RSVD(4) }, ++ /* MeiG */ ++ { USB_DEVICE_AND_INTERFACE_INFO(MEIGLINK_VENDOR_ID, MEIGLINK_PRODUCT_SLM828, USB_CLASS_VENDOR_SPEC, 0x10, 0x01) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(MEIGLINK_VENDOR_ID, MEIGLINK_PRODUCT_SLM828, USB_CLASS_VENDOR_SPEC, 0x10, 0x02) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(MEIGLINK_VENDOR_ID, MEIGLINK_PRODUCT_SLM828, USB_CLASS_VENDOR_SPEC, 0x10, 0x03) }, ++ { USB_DEVICE_AND_INTERFACE_INFO(MEIGLINK_VENDOR_ID, MEIGLINK_PRODUCT_SLM828, USB_CLASS_VENDOR_SPEC, 0x10, 0x04) }, + /* Quectel products using Qualcomm vendor ID */ + { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)}, + { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20), +@@ -1187,6 +1197,11 @@ static const struct usb_device_id option .driver_info = ZLP }, { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), .driver_info = RSVD(4) }, diff --git a/target/linux/generic/hack-6.1/781-usb-net-rndis-support-asr.patch b/target/linux/generic/hack-6.1/781-usb-net-rndis-support-asr.patch new file mode 100644 index 00000000000000..9934bb8078efe4 --- /dev/null +++ b/target/linux/generic/hack-6.1/781-usb-net-rndis-support-asr.patch @@ -0,0 +1,56 @@ +--- a/drivers/net/usb/rndis_host.c ++++ b/drivers/net/usb/rndis_host.c +@@ -630,6 +630,16 @@ static const struct driver_info zte_rndi + .tx_fixup = rndis_tx_fixup, + }; + ++static const struct driver_info asr_rndis_info = { ++ .description = "Asr RNDIS device", ++ .flags = FLAG_WWAN | FLAG_POINTTOPOINT | FLAG_FRAMING_RN | FLAG_NO_SETINT | FLAG_NOARP, ++ .bind = rndis_bind, ++ .unbind = rndis_unbind, ++ .status = rndis_status, ++ .rx_fixup = rndis_rx_fixup, ++ .tx_fixup = rndis_tx_fixup, ++}; ++ + /*-------------------------------------------------------------------------*/ + + static const struct usb_device_id products [] = { +@@ -666,6 +676,36 @@ static const struct usb_device_id produc + USB_INTERFACE_INFO(USB_CLASS_WIRELESS_CONTROLLER, 1, 3), + .driver_info = (unsigned long) &rndis_info, + }, { ++ /* Quectel EG060V rndis device */ ++ USB_DEVICE_AND_INTERFACE_INFO(0x2c7c, 0x6004, ++ USB_CLASS_WIRELESS_CONTROLLER, 1, 3), ++ .driver_info = (unsigned long) &asr_rndis_info, ++}, { ++ /* Quectel EC200A rndis device */ ++ USB_DEVICE_AND_INTERFACE_INFO(0x2c7c, 0x6005, ++ USB_CLASS_WIRELESS_CONTROLLER, 1, 3), ++ .driver_info = (unsigned long) &asr_rndis_info, ++}, { ++ /* Quectel EC200T rndis device */ ++ USB_DEVICE_AND_INTERFACE_INFO(0x2c7c, 0x6026, ++ USB_CLASS_WIRELESS_CONTROLLER, 1, 3), ++ .driver_info = (unsigned long) &asr_rndis_info, ++}, { ++ /* Simcom A7906E rndis device */ ++ USB_DEVICE_AND_INTERFACE_INFO(0x1e0e, 0x9011, ++ USB_CLASS_WIRELESS_CONTROLLER, 1, 3), ++ .driver_info = (unsigned long) &asr_rndis_info, ++}, { ++ /* Meig SLM770A */ ++ USB_DEVICE_AND_INTERFACE_INFO(0x2dee, 0x4d57, ++ USB_CLASS_WIRELESS_CONTROLLER, 1, 3), ++ .driver_info = (unsigned long) &asr_rndis_info, ++}, { ++ /* Meig SLM828 */ ++ USB_DEVICE_AND_INTERFACE_INFO(0x2dee, 0x4d49, ++ USB_CLASS_WIRELESS_CONTROLLER, 1, 3), ++ .driver_info = (unsigned long) &asr_rndis_info, ++}, { + /* Novatel Verizon USB730L */ + USB_INTERFACE_INFO(USB_CLASS_MISC, 4, 1), + .driver_info = (unsigned long) &rndis_info, diff --git a/target/linux/generic/hack-6.1/902-debloat_proc.patch b/target/linux/generic/hack-6.1/902-debloat_proc.patch index 23de30f4923af1..a5db9b21c1bebe 100644 --- a/target/linux/generic/hack-6.1/902-debloat_proc.patch +++ b/target/linux/generic/hack-6.1/902-debloat_proc.patch @@ -341,7 +341,7 @@ Signed-off-by: Felix Fietkau --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c -@@ -3032,11 +3032,13 @@ static const struct seq_operations fib_r +@@ -3036,11 +3036,13 @@ static const struct seq_operations fib_r int __net_init fib_proc_init(struct net *net) { @@ -357,7 +357,7 @@ Signed-off-by: Felix Fietkau fib_triestat_seq_show, NULL)) goto out2; -@@ -3047,17 +3049,21 @@ int __net_init fib_proc_init(struct net +@@ -3051,17 +3053,21 @@ int __net_init fib_proc_init(struct net return 0; out3: @@ -406,3 +406,14 @@ Signed-off-by: Felix Fietkau return register_pernet_subsys(&ip_rt_proc_ops); } +--- a/net/ipv4/inet_timewait_sock.c ++++ b/net/ipv4/inet_timewait_sock.c +@@ -269,7 +269,7 @@ void __inet_twsk_schedule(struct inet_ti + */ + + if (!rearm) { +- bool kill = timeo <= 4*HZ; ++ bool __maybe_unused kill = timeo <= 4*HZ; + + __NET_INC_STATS(twsk_net(tw), kill ? LINUX_MIB_TIMEWAITKILLED : + LINUX_MIB_TIMEWAITED); diff --git a/target/linux/generic/hack-6.1/904-debloat_dma_buf.patch b/target/linux/generic/hack-6.1/904-debloat_dma_buf.patch index 8b6bd6a7862af4..105eb3da4bb67b 100644 --- a/target/linux/generic/hack-6.1/904-debloat_dma_buf.patch +++ b/target/linux/generic/hack-6.1/904-debloat_dma_buf.patch @@ -73,7 +73,7 @@ Signed-off-by: Felix Fietkau +MODULE_LICENSE("GPL"); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -4363,6 +4363,7 @@ int wake_up_state(struct task_struct *p, +@@ -4367,6 +4367,7 @@ int wake_up_state(struct task_struct *p, { return try_to_wake_up(p, state, 0); } diff --git a/target/linux/generic/pending-5.15/401-mtd-don-t-register-NVMEM-devices-for-partitions-with.patch b/target/linux/generic/pending-5.15/401-mtd-don-t-register-NVMEM-devices-for-partitions-with.patch new file mode 100644 index 00000000000000..650e10a3a5d852 --- /dev/null +++ b/target/linux/generic/pending-5.15/401-mtd-don-t-register-NVMEM-devices-for-partitions-with.patch @@ -0,0 +1,48 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 31 Oct 2023 15:51:01 +0100 +Subject: [PATCH] mtd: don't register NVMEM devices for partitions with custom + drivers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes issue exposed by upstream commit f4cf4e5db331 ("Revert +"nvmem: add new config option""). + +Signed-off-by: Rafał Miłecki +--- + drivers/mtd/mtdcore.c | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +--- a/drivers/mtd/mtdcore.c ++++ b/drivers/mtd/mtdcore.c +@@ -537,6 +537,29 @@ static int mtd_nvmem_add(struct mtd_info + struct device_node *node = mtd_get_of_node(mtd); + struct nvmem_config config = {}; + ++ /* ++ * Do NOT register NVMEM device for any partition that is meant to be ++ * handled by a U-Boot env driver. That would result in associating two ++ * different NVMEM devices with the same OF node. ++ * ++ * An example of unwanted behaviour of above (forwardtrace): ++ * of_get_mac_addr_nvmem() ++ * of_nvmem_cell_get() ++ * __nvmem_device_get() ++ * ++ * We can't have __nvmem_device_get() return "mtdX" NVMEM device instead ++ * of U-Boot env NVMEM device. That would result in failing to find ++ * NVMEM cell. ++ * ++ * This issue seems to affect U-Boot env case only and will go away with ++ * switch to NVMEM layouts. ++ */ ++ if (of_device_is_compatible(node, "u-boot,env") || ++ of_device_is_compatible(node, "u-boot,env-redundant-bool") || ++ of_device_is_compatible(node, "u-boot,env-redundant-count") || ++ of_device_is_compatible(node, "brcm,env")) ++ return 0; ++ + config.id = -1; + config.dev = &mtd->dev; + config.name = dev_name(&mtd->dev); diff --git a/target/linux/generic/pending-5.15/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-5.15/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index 2751da541a0542..e8da36edba5bea 100644 --- a/target/linux/generic/pending-5.15/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-5.15/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1200,6 +1200,73 @@ static struct mtd_info * __init open_mtd +@@ -1207,6 +1207,73 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -82,7 +82,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init(void) { int err, i, k; -@@ -1283,6 +1350,12 @@ static int __init ubi_init(void) +@@ -1290,6 +1357,12 @@ static int __init ubi_init(void) } } diff --git a/target/linux/generic/pending-5.15/530-jffs2_make_lzma_available.patch b/target/linux/generic/pending-5.15/530-jffs2_make_lzma_available.patch index ac784d0b0bb73d..f236657b71602b 100644 --- a/target/linux/generic/pending-5.15/530-jffs2_make_lzma_available.patch +++ b/target/linux/generic/pending-5.15/530-jffs2_make_lzma_available.patch @@ -351,7 +351,7 @@ Signed-off-by: Alexandros C. Couloumbis + LZMA_FREE(address); +} + -+static ISzAlloc lzma_alloc = {p_lzma_malloc, p_lzma_free}; ++static ISzAlloc lzma_alloc = { .Alloc = p_lzma_malloc, .Free = p_lzma_free }; + +#endif --- /dev/null diff --git a/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 351d5864a1f8b1..7aaac9653187b9 100644 --- a/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -66,7 +66,7 @@ Signed-off-by: Jonas Gorski static void rt_fibinfo_free(struct rtable __rcu **rtp) --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c -@@ -2773,6 +2773,7 @@ static const char *const rtn_type_names[ +@@ -2777,6 +2777,7 @@ static const char *const rtn_type_names[ [RTN_THROW] = "THROW", [RTN_NAT] = "NAT", [RTN_XRESOLVE] = "XRESOLVE", diff --git a/target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 71b3aac846967f..46856e1552fa06 100644 --- a/target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau __u8 inner_protocol_type:1; --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6054,6 +6054,9 @@ static enum gro_result dev_gro_receive(s +@@ -6074,6 +6074,9 @@ static enum gro_result dev_gro_receive(s int same_flow; int grow; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau if (netif_elide_gro(skb->dev)) goto normal; -@@ -8068,6 +8071,48 @@ static void __netdev_adjacent_dev_unlink +@@ -8088,6 +8091,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info, -@@ -8119,6 +8164,7 @@ static int __netdev_upper_dev_link(struc +@@ -8139,6 +8184,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -8215,6 +8261,7 @@ static void __netdev_upper_dev_unlink(st +@@ -8235,6 +8281,7 @@ static void __netdev_upper_dev_unlink(st __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); -@@ -9034,6 +9081,7 @@ int dev_set_mac_address(struct net_devic +@@ -9054,6 +9101,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_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 f6ae9f31f1fa5d..73eabf4f37677a 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 f7ef06a14ad560..29144ce8b402ab 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 44d88e31a2e750..c37c4519899e76 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-5.15/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch b/target/linux/generic/pending-5.15/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch index ba847d5f8a982e..8743d7f3671bb6 100644 --- a/target/linux/generic/pending-5.15/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch +++ b/target/linux/generic/pending-5.15/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -7729,7 +7729,7 @@ static int nft_register_flowtable_net_ho +@@ -7708,7 +7708,7 @@ static int nft_register_flowtable_net_ho err = flowtable->data.type->setup(&flowtable->data, hook->ops.dev, FLOW_BLOCK_BIND); diff --git a/target/linux/generic/pending-5.15/760-net-core-add-optional-threading-for-backlog-processi.patch b/target/linux/generic/pending-5.15/760-net-core-add-optional-threading-for-backlog-processi.patch index 8a65cbe021f7a0..62daef91b1506e 100644 --- a/target/linux/generic/pending-5.15/760-net-core-add-optional-threading-for-backlog-processi.patch +++ b/target/linux/generic/pending-5.15/760-net-core-add-optional-threading-for-backlog-processi.patch @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau /** * napi_disable - prevent NAPI from scheduling -@@ -3362,6 +3363,7 @@ struct softnet_data { +@@ -3363,6 +3364,7 @@ struct softnet_data { unsigned int processed; unsigned int time_squeeze; unsigned int received_rps; @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #endif --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4563,7 +4563,7 @@ static int rps_ipi_queued(struct softnet +@@ -4583,7 +4583,7 @@ static int rps_ipi_queued(struct softnet #ifdef CONFIG_RPS struct softnet_data *mysd = this_cpu_ptr(&softnet_data); @@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau sd->rps_ipi_next = mysd->rps_ipi_list; mysd->rps_ipi_list = sd; -@@ -5744,6 +5744,8 @@ static DEFINE_PER_CPU(struct work_struct +@@ -5764,6 +5764,8 @@ static DEFINE_PER_CPU(struct work_struct /* Network device is going away, flush any packets still pending */ static void flush_backlog(struct work_struct *work) { @@ -48,7 +48,7 @@ Signed-off-by: Felix Fietkau struct sk_buff *skb, *tmp; struct softnet_data *sd; -@@ -5759,9 +5761,18 @@ static void flush_backlog(struct work_st +@@ -5779,9 +5781,18 @@ static void flush_backlog(struct work_st input_queue_head_incr(sd); } } @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau skb_queue_walk_safe(&sd->process_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->process_queue); -@@ -5769,7 +5780,18 @@ static void flush_backlog(struct work_st +@@ -5789,7 +5800,18 @@ static void flush_backlog(struct work_st input_queue_head_incr(sd); } } @@ -86,7 +86,7 @@ Signed-off-by: Felix Fietkau } static bool flush_required(int cpu) -@@ -6452,6 +6474,7 @@ static int process_backlog(struct napi_s +@@ -6472,6 +6494,7 @@ static int process_backlog(struct napi_s local_irq_disable(); rps_lock(sd); @@ -94,7 +94,7 @@ Signed-off-by: Felix Fietkau if (skb_queue_empty(&sd->input_pkt_queue)) { /* * Inline a custom version of __napi_complete(). -@@ -6461,7 +6484,8 @@ static int process_backlog(struct napi_s +@@ -6481,7 +6504,8 @@ static int process_backlog(struct napi_s * We can use a plain write instead of clear_bit(), * and we dont need an smp_mb() memory barrier. */ @@ -104,7 +104,7 @@ Signed-off-by: Felix Fietkau again = false; } else { skb_queue_splice_tail_init(&sd->input_pkt_queue, -@@ -6878,6 +6902,57 @@ int dev_set_threaded(struct net_device * +@@ -6898,6 +6922,57 @@ int dev_set_threaded(struct net_device * } EXPORT_SYMBOL(dev_set_threaded); @@ -162,7 +162,7 @@ Signed-off-by: Felix Fietkau void netif_napi_add(struct net_device *dev, struct napi_struct *napi, int (*poll)(struct napi_struct *, int), int weight) { -@@ -11354,6 +11429,9 @@ static int dev_cpu_dead(unsigned int old +@@ -11378,6 +11453,9 @@ static int dev_cpu_dead(unsigned int old raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_enable(); @@ -172,7 +172,7 @@ Signed-off-by: Felix Fietkau #ifdef CONFIG_RPS remsd = oldsd->rps_ipi_list; oldsd->rps_ipi_list = NULL; -@@ -11693,6 +11771,7 @@ static int __init net_dev_init(void) +@@ -11717,6 +11795,7 @@ static int __init net_dev_init(void) sd->cpu = i; #endif diff --git a/target/linux/generic/pending-5.15/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch b/target/linux/generic/pending-5.15/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch index fa9d7ff0b85ba4..092e7933b76274 100644 --- a/target/linux/generic/pending-5.15/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch +++ b/target/linux/generic/pending-5.15/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch @@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -6391,6 +6391,7 @@ static int mv88e6xxx_register_switch(str +@@ -6393,6 +6393,7 @@ static int mv88e6xxx_register_switch(str ds->ops = &mv88e6xxx_switch_ops; ds->ageing_time_min = chip->info->age_time_coeff; ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX; diff --git a/target/linux/generic/pending-5.15/780-ARM-kirkwood-add-missing-linux-if_ether.h-for-ETH_AL.patch b/target/linux/generic/pending-5.15/780-ARM-kirkwood-add-missing-linux-if_ether.h-for-ETH_AL.patch index fcf7892c04e70f..39ba71606ec235 100644 --- a/target/linux/generic/pending-5.15/780-ARM-kirkwood-add-missing-linux-if_ether.h-for-ETH_AL.patch +++ b/target/linux/generic/pending-5.15/780-ARM-kirkwood-add-missing-linux-if_ether.h-for-ETH_AL.patch @@ -51,7 +51,7 @@ Signed-off-by: Daniel Golle --- a/arch/arm/mach-mvebu/kirkwood.c +++ b/arch/arm/mach-mvebu/kirkwood.c -@@ -14,6 +14,7 @@ +@@ -11,6 +11,7 @@ #include #include #include diff --git a/target/linux/generic/pending-5.15/804-nvmem-core-support-mac-base-fixed-layout-cells.patch b/target/linux/generic/pending-5.15/804-nvmem-core-support-mac-base-fixed-layout-cells.patch index 6791b63ac09d90..95f29b1865dd5f 100644 --- a/target/linux/generic/pending-5.15/804-nvmem-core-support-mac-base-fixed-layout-cells.patch +++ b/target/linux/generic/pending-5.15/804-nvmem-core-support-mac-base-fixed-layout-cells.patch @@ -20,10 +20,11 @@ string. --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -7,9 +7,11 @@ +@@ -7,9 +7,12 @@ */ #include ++#include +#include #include #include @@ -32,7 +33,7 @@ string. #include #include #include -@@ -696,6 +698,37 @@ static int nvmem_validate_keepouts(struc +@@ -696,6 +699,62 @@ static int nvmem_validate_keepouts(struc return 0; } @@ -66,25 +67,55 @@ string. + + return 0; +} ++ ++static int nvmem_mac_base_hex_read(void *context, const char *id, int index, unsigned int offset, ++ void *buf, size_t bytes) ++{ ++ u8 mac[ETH_ALEN], *hexstr; ++ int i; ++ ++ if (WARN_ON(bytes != 2 * ETH_ALEN)) ++ return -EINVAL; ++ ++ hexstr = (u8 *)buf; ++ for (i = 0; i < ETH_ALEN; i++) { ++ if (!isxdigit(hexstr[i * 2]) || !isxdigit(hexstr[i * 2 + 1])) ++ return -EINVAL; ++ ++ mac[i] = (hex_to_bin(hexstr[i * 2]) << 4) | hex_to_bin(hexstr[i * 2 + 1]); ++ } ++ ++ if (index) ++ eth_addr_add(mac, index); ++ ++ ether_addr_copy(buf, mac); ++ ++ return 0; ++} + static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np) { struct nvmem_layout *layout = nvmem->layout; -@@ -731,6 +764,20 @@ static int nvmem_add_cells_from_dt(struc +@@ -731,6 +790,25 @@ static int nvmem_add_cells_from_dt(struc if (layout && layout->fixup_cell_info) layout->fixup_cell_info(nvmem, layout, &info); + if (of_device_is_compatible(np, "fixed-layout")) { + if (of_device_is_compatible(child, "mac-base")) { -+ if (info.bytes == 6) { ++ if (info.bytes == ETH_ALEN) { + info.raw_len = info.bytes; + info.bytes = ETH_ALEN; + info.read_post_process = nvmem_mac_base_raw_read; ++ } else if (info.bytes == 2 * ETH_ALEN) { ++ info.raw_len = info.bytes; ++ info.bytes = ETH_ALEN; ++ info.read_post_process = nvmem_mac_base_hex_read; + } else if (info.bytes == 3 * ETH_ALEN - 1) { + info.raw_len = info.bytes; + info.bytes = ETH_ALEN; + info.read_post_process = nvmem_mac_base_ascii_read; + } ++ + } + } + diff --git a/target/linux/generic/pending-5.15/810-pci_disable_common_quirks.patch b/target/linux/generic/pending-5.15/810-pci_disable_common_quirks.patch index 7edbd94f762469..153b5d06cfde42 100644 --- a/target/linux/generic/pending-5.15/810-pci_disable_common_quirks.patch +++ b/target/linux/generic/pending-5.15/810-pci_disable_common_quirks.patch @@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos /* * The Mellanox Tavor device gives false positive parity errors. Disable * parity error reporting. -@@ -3363,6 +3364,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I +@@ -3365,6 +3366,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata); @@ -42,7 +42,7 @@ Signed-off-by: Gabor Juhos /* * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum. * To work around this, query the size it should be configured to by the -@@ -3388,6 +3391,8 @@ static void quirk_intel_ntb(struct pci_d +@@ -3390,6 +3393,8 @@ static void quirk_intel_ntb(struct pci_d DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e08, quirk_intel_ntb); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e0d, quirk_intel_ntb); @@ -51,7 +51,7 @@ Signed-off-by: Gabor Juhos /* * Some BIOS implementations leave the Intel GPU interrupts enabled, even * though no one is handling them (e.g., if the i915 driver is never -@@ -3426,6 +3431,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN +@@ -3428,6 +3433,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq); diff --git a/target/linux/generic/pending-5.15/834-ledtrig-libata.patch b/target/linux/generic/pending-5.15/834-ledtrig-libata.patch index 9c85862a4bd822..d61e28b4c3880f 100644 --- a/target/linux/generic/pending-5.15/834-ledtrig-libata.patch +++ b/target/linux/generic/pending-5.15/834-ledtrig-libata.patch @@ -134,7 +134,7 @@ Signed-off-by: Daniel Golle /* * Define if arch has non-standard setup. This is a _PCI_ standard -@@ -894,6 +897,12 @@ struct ata_port { +@@ -898,6 +901,12 @@ struct ata_port { #ifdef CONFIG_ATA_ACPI struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */ #endif diff --git a/target/linux/generic/pending-5.15/920-mangle_bootargs.patch b/target/linux/generic/pending-5.15/920-mangle_bootargs.patch index 7e1f26d243f027..5f2bb8c37f446a 100644 --- a/target/linux/generic/pending-5.15/920-mangle_bootargs.patch +++ b/target/linux/generic/pending-5.15/920-mangle_bootargs.patch @@ -31,7 +31,7 @@ Signed-off-by: Imre Kaloz help --- a/init/main.c +++ b/init/main.c -@@ -614,6 +614,29 @@ static inline void setup_nr_cpu_ids(void +@@ -618,6 +618,29 @@ static inline void setup_nr_cpu_ids(void static inline void smp_prepare_cpus(unsigned int maxcpus) { } #endif @@ -61,7 +61,7 @@ Signed-off-by: Imre Kaloz /* * We need to store the untouched command line for future reference. * We also need to store the touched command line since the parameter -@@ -953,6 +976,7 @@ asmlinkage __visible void __init __no_sa +@@ -957,6 +980,7 @@ asmlinkage __visible void __init __no_sa pr_notice("%s", linux_banner); early_security_init(); setup_arch(&command_line); diff --git a/target/linux/generic/pending-6.1/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-6.1/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index c381bcf8e1923a..4bf473f9a79745 100644 --- a/target/linux/generic/pending-6.1/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-6.1/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -7911,7 +7911,7 @@ static void __init alloc_node_mem_map(st +@@ -7897,7 +7897,7 @@ static void __init alloc_node_mem_map(st if (pgdat == NODE_DATA(0)) { mem_map = NODE_DATA(0)->node_mem_map; if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/generic/pending-6.1/203-kallsyms_uncompressed.patch b/target/linux/generic/pending-6.1/203-kallsyms_uncompressed.patch index 1b577ec3bb5d25..ce93b73af64e09 100644 --- a/target/linux/generic/pending-6.1/203-kallsyms_uncompressed.patch +++ b/target/linux/generic/pending-6.1/203-kallsyms_uncompressed.patch @@ -65,8 +65,8 @@ Signed-off-by: Felix Fietkau static int absolute_percpu; static int base_relative; static int lto_clang; -@@ -605,6 +606,9 @@ static void write_src(void) - printf("\t.long\t%u\n", table[i]->seq); +@@ -608,6 +609,9 @@ static void write_src(void) + (unsigned char)(table[i]->seq >> 0)); printf("\n"); + if (uncompressed) @@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau output_label("kallsyms_token_table"); off = 0; for (i = 0; i < 256; i++) { -@@ -656,6 +660,9 @@ static unsigned char *find_token(unsigne +@@ -659,6 +663,9 @@ static unsigned char *find_token(unsigne { int i; @@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau for (i = 0; i < len - 1; i++) { if (str[i] == token[0] && str[i+1] == token[1]) return &str[i]; -@@ -728,6 +735,9 @@ static void optimize_result(void) +@@ -731,6 +738,9 @@ static void optimize_result(void) { int i, best; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau /* using the '\0' symbol last allows compress_symbols to use standard * fast string functions */ for (i = 255; i >= 0; i--) { -@@ -889,6 +899,7 @@ int main(int argc, char **argv) +@@ -892,6 +902,7 @@ int main(int argc, char **argv) {"absolute-percpu", no_argument, &absolute_percpu, 1}, {"base-relative", no_argument, &base_relative, 1}, {"lto-clang", no_argument, <o_clang, 1}, diff --git a/target/linux/generic/pending-6.1/401-mtd-don-t-register-NVMEM-devices-for-partitions-with.patch b/target/linux/generic/pending-6.1/401-mtd-don-t-register-NVMEM-devices-for-partitions-with.patch new file mode 100644 index 00000000000000..42b5a564b15e2d --- /dev/null +++ b/target/linux/generic/pending-6.1/401-mtd-don-t-register-NVMEM-devices-for-partitions-with.patch @@ -0,0 +1,48 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 31 Oct 2023 15:51:01 +0100 +Subject: [PATCH] mtd: don't register NVMEM devices for partitions with custom + drivers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes issue exposed by upstream commit f4cf4e5db331 ("Revert +"nvmem: add new config option""). + +Signed-off-by: Rafał Miłecki +--- + drivers/mtd/mtdcore.c | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +--- a/drivers/mtd/mtdcore.c ++++ b/drivers/mtd/mtdcore.c +@@ -519,6 +519,29 @@ static int mtd_nvmem_add(struct mtd_info + struct device_node *node = mtd_get_of_node(mtd); + struct nvmem_config config = {}; + ++ /* ++ * Do NOT register NVMEM device for any partition that is meant to be ++ * handled by a U-Boot env driver. That would result in associating two ++ * different NVMEM devices with the same OF node. ++ * ++ * An example of unwanted behaviour of above (forwardtrace): ++ * of_get_mac_addr_nvmem() ++ * of_nvmem_cell_get() ++ * __nvmem_device_get() ++ * ++ * We can't have __nvmem_device_get() return "mtdX" NVMEM device instead ++ * of U-Boot env NVMEM device. That would result in failing to find ++ * NVMEM cell. ++ * ++ * This issue seems to affect U-Boot env case only and will go away with ++ * switch to NVMEM layouts. ++ */ ++ if (of_device_is_compatible(node, "u-boot,env") || ++ of_device_is_compatible(node, "u-boot,env-redundant-bool") || ++ of_device_is_compatible(node, "u-boot,env-redundant-count") || ++ of_device_is_compatible(node, "brcm,env")) ++ return 0; ++ + config.id = -1; + config.dev = &mtd->dev; + config.name = dev_name(&mtd->dev); diff --git a/target/linux/generic/pending-6.1/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-6.1/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index 99a03e31c373a0..765eecd9d713ff 100644 --- a/target/linux/generic/pending-6.1/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-6.1/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1205,6 +1205,73 @@ static struct mtd_info * __init open_mtd +@@ -1212,6 +1212,73 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -82,7 +82,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init(void) { int err, i, k; -@@ -1289,6 +1356,12 @@ static int __init ubi_init(void) +@@ -1296,6 +1363,12 @@ static int __init ubi_init(void) } } diff --git a/target/linux/generic/pending-6.1/530-jffs2_make_lzma_available.patch b/target/linux/generic/pending-6.1/530-jffs2_make_lzma_available.patch index f17216c52b9aea..27a673399a836f 100644 --- a/target/linux/generic/pending-6.1/530-jffs2_make_lzma_available.patch +++ b/target/linux/generic/pending-6.1/530-jffs2_make_lzma_available.patch @@ -351,7 +351,7 @@ Signed-off-by: Alexandros C. Couloumbis + LZMA_FREE(address); +} + -+static ISzAlloc lzma_alloc = {p_lzma_malloc, p_lzma_free}; ++static ISzAlloc lzma_alloc = { .Alloc = p_lzma_malloc, .Free = p_lzma_free }; + +#endif --- /dev/null diff --git a/target/linux/generic/pending-6.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-6.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index e67b709fde5d83..003a0f20ac810d 100644 --- a/target/linux/generic/pending-6.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-6.1/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -66,7 +66,7 @@ Signed-off-by: Jonas Gorski static void rt_fibinfo_free(struct rtable __rcu **rtp) --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c -@@ -2779,6 +2779,7 @@ static const char *const rtn_type_names[ +@@ -2783,6 +2783,7 @@ static const char *const rtn_type_names[ [RTN_THROW] = "THROW", [RTN_NAT] = "NAT", [RTN_XRESOLVE] = "XRESOLVE", diff --git a/target/linux/generic/pending-6.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-6.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 062b3e82b50209..c6aae3b6cfc862 100644 --- a/target/linux/generic/pending-6.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-6.1/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -7593,6 +7593,48 @@ static void __netdev_adjacent_dev_unlink +@@ -7622,6 +7622,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -93,7 +93,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info, -@@ -7644,6 +7686,7 @@ static int __netdev_upper_dev_link(struc +@@ -7673,6 +7715,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -7740,6 +7783,7 @@ static void __netdev_upper_dev_unlink(st +@@ -7769,6 +7812,7 @@ static void __netdev_upper_dev_unlink(st __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -109,7 +109,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); -@@ -8792,6 +8836,7 @@ int dev_set_mac_address(struct net_devic +@@ -8821,6 +8865,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; 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 f6ae9f31f1fa5d..73eabf4f37677a 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 f7ef06a14ad560..29144ce8b402ab 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 44d88e31a2e750..c37c4519899e76 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/generic/pending-6.1/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch b/target/linux/generic/pending-6.1/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch index 2daa2ee1e49210..8c508e36579639 100644 --- a/target/linux/generic/pending-6.1/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch +++ b/target/linux/generic/pending-6.1/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -7886,7 +7886,7 @@ static int nft_register_flowtable_net_ho +@@ -7883,7 +7883,7 @@ static int nft_register_flowtable_net_ho err = flowtable->data.type->setup(&flowtable->data, hook->ops.dev, FLOW_BLOCK_BIND); diff --git a/target/linux/generic/pending-6.1/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch b/target/linux/generic/pending-6.1/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch index a48a993e2fb3ad..842fef3a9c5b3f 100644 --- a/target/linux/generic/pending-6.1/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch +++ b/target/linux/generic/pending-6.1/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch @@ -10,26 +10,6 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -3155,8 +3155,8 @@ static irqreturn_t mtk_handle_irq_rx(int - - eth->rx_events++; - if (likely(napi_schedule_prep(ð->rx_napi))) { -- __napi_schedule(ð->rx_napi); - mtk_rx_irq_disable(eth, eth->soc->txrx.rx_irq_done_mask); -+ __napi_schedule(ð->rx_napi); - } - - return IRQ_HANDLED; -@@ -3168,8 +3168,8 @@ static irqreturn_t mtk_handle_irq_tx(int - - eth->tx_events++; - if (likely(napi_schedule_prep(ð->tx_napi))) { -- __napi_schedule(ð->tx_napi); - mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); -+ __napi_schedule(ð->tx_napi); - } - - return IRQ_HANDLED; @@ -4941,6 +4941,8 @@ static int mtk_probe(struct platform_dev * for NAPI to work */ diff --git a/target/linux/generic/pending-6.1/711-01-net-dsa-qca8k-implement-lag_fdb_add-del-ops.patch b/target/linux/generic/pending-6.1/711-01-net-dsa-qca8k-implement-lag_fdb_add-del-ops.patch index 04935d0d7a9520..b03bb622d326fa 100644 --- a/target/linux/generic/pending-6.1/711-01-net-dsa-qca8k-implement-lag_fdb_add-del-ops.patch +++ b/target/linux/generic/pending-6.1/711-01-net-dsa-qca8k-implement-lag_fdb_add-del-ops.patch @@ -16,7 +16,7 @@ Signed-off-by: Christian Marangi --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c -@@ -1993,6 +1993,8 @@ static const struct dsa_switch_ops qca8k +@@ -2004,6 +2004,8 @@ static const struct dsa_switch_ops qca8k .port_fdb_add = qca8k_port_fdb_add, .port_fdb_del = qca8k_port_fdb_del, .port_fdb_dump = qca8k_port_fdb_dump, diff --git a/target/linux/generic/pending-6.1/711-02-net-dsa-qca8k-enable-flooding-to-both-CPU-port.patch b/target/linux/generic/pending-6.1/711-02-net-dsa-qca8k-enable-flooding-to-both-CPU-port.patch index 27539b9074ab7a..8ba89ccfa59389 100644 --- a/target/linux/generic/pending-6.1/711-02-net-dsa-qca8k-enable-flooding-to-both-CPU-port.patch +++ b/target/linux/generic/pending-6.1/711-02-net-dsa-qca8k-enable-flooding-to-both-CPU-port.patch @@ -14,7 +14,7 @@ Signed-off-by: Christian Marangi --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c -@@ -1882,15 +1882,12 @@ qca8k_setup(struct dsa_switch *ds) +@@ -1893,15 +1893,12 @@ qca8k_setup(struct dsa_switch *ds) } } diff --git a/target/linux/generic/pending-6.1/711-03-net-dsa-qca8k-add-support-for-port_change_master.patch b/target/linux/generic/pending-6.1/711-03-net-dsa-qca8k-add-support-for-port_change_master.patch index 53a29f547a1ed6..bf1415b939fcb8 100644 --- a/target/linux/generic/pending-6.1/711-03-net-dsa-qca8k-add-support-for-port_change_master.patch +++ b/target/linux/generic/pending-6.1/711-03-net-dsa-qca8k-add-support-for-port_change_master.patch @@ -26,7 +26,7 @@ Signed-off-by: Christian Marangi --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c -@@ -1719,6 +1719,117 @@ qca8k_get_tag_protocol(struct dsa_switch +@@ -1730,6 +1730,117 @@ qca8k_get_tag_protocol(struct dsa_switch return DSA_TAG_PROTO_QCA; } @@ -144,7 +144,7 @@ Signed-off-by: Christian Marangi static void qca8k_master_change(struct dsa_switch *ds, const struct net_device *master, bool operational) -@@ -2005,8 +2116,9 @@ static const struct dsa_switch_ops qca8k +@@ -2016,8 +2127,9 @@ static const struct dsa_switch_ops qca8k .phylink_mac_link_down = qca8k_phylink_mac_link_down, .phylink_mac_link_up = qca8k_phylink_mac_link_up, .get_phy_flags = qca8k_get_phy_flags, diff --git a/target/linux/generic/pending-6.1/712-net-dsa-qca8k-enable-assisted-learning-on-CPU-port.patch b/target/linux/generic/pending-6.1/712-net-dsa-qca8k-enable-assisted-learning-on-CPU-port.patch new file mode 100644 index 00000000000000..4d0b363c379472 --- /dev/null +++ b/target/linux/generic/pending-6.1/712-net-dsa-qca8k-enable-assisted-learning-on-CPU-port.patch @@ -0,0 +1,57 @@ +From 0f6599167c126ce32c85d4f8a1f3d1775a268572 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Fri, 6 Oct 2023 12:44:00 +0200 +Subject: [PATCH] net: dsa: qca8k: enable assisted learning on CPU port + +Enable assisted learning on CPU port. + +It has been verified that there is a problem in packet roaming +from one BSS to another in the same security settings from one +physical R7800 to another physical R7800 where they are in the +same L2 broadcast domain backhauled/linked together via one +of the ethernet ports. +DHCP will fail to complete and traffic cannot flow for around 300 +seconds. + +Signed-off-by: Christian Marangi +--- + drivers/net/dsa/qca/qca8k-8xxx.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +--- a/drivers/net/dsa/qca/qca8k-8xxx.c ++++ b/drivers/net/dsa/qca/qca8k-8xxx.c +@@ -2002,6 +2002,12 @@ qca8k_setup(struct dsa_switch *ds) + dev_err(priv->dev, "failed enabling QCA header mode on port %d", dp->index); + return ret; + } ++ ++ /* Disable learning by default on all ports */ ++ ret = regmap_clear_bits(priv->regmap, QCA8K_PORT_LOOKUP_CTRL(dp->index), ++ QCA8K_PORT_LOOKUP_LEARN); ++ if (ret) ++ return ret; + } + + /* Forward all unknown frames to CPU port for Linux processing */ +@@ -2031,11 +2037,6 @@ qca8k_setup(struct dsa_switch *ds) + if (ret) + return ret; + +- ret = regmap_clear_bits(priv->regmap, QCA8K_PORT_LOOKUP_CTRL(port), +- QCA8K_PORT_LOOKUP_LEARN); +- if (ret) +- return ret; +- + /* For port based vlans to work we need to set the + * default egress vid + */ +@@ -2087,6 +2088,9 @@ qca8k_setup(struct dsa_switch *ds) + /* Set max number of LAGs supported */ + ds->num_lag_ids = QCA8K_NUM_LAGS; + ++ /* HW learn on CPU port is limited and require manual setting */ ++ ds->assisted_learning_on_cpu_port = true; ++ + return 0; + } + diff --git a/target/linux/generic/pending-6.1/760-net-core-add-optional-threading-for-backlog-processi.patch b/target/linux/generic/pending-6.1/760-net-core-add-optional-threading-for-backlog-processi.patch index 1c9ad551aad1cc..0bfc2412b4acf9 100644 --- a/target/linux/generic/pending-6.1/760-net-core-add-optional-threading-for-backlog-processi.patch +++ b/target/linux/generic/pending-6.1/760-net-core-add-optional-threading-for-backlog-processi.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #endif --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4593,7 +4593,7 @@ static int napi_schedule_rps(struct soft +@@ -4622,7 +4622,7 @@ static int napi_schedule_rps(struct soft struct softnet_data *mysd = this_cpu_ptr(&softnet_data); #ifdef CONFIG_RPS @@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau sd->rps_ipi_next = mysd->rps_ipi_list; mysd->rps_ipi_list = sd; -@@ -5774,6 +5774,8 @@ static DEFINE_PER_CPU(struct work_struct +@@ -5803,6 +5803,8 @@ static DEFINE_PER_CPU(struct work_struct /* Network device is going away, flush any packets still pending */ static void flush_backlog(struct work_struct *work) { @@ -48,7 +48,7 @@ Signed-off-by: Felix Fietkau struct sk_buff *skb, *tmp; struct softnet_data *sd; -@@ -5788,8 +5790,17 @@ static void flush_backlog(struct work_st +@@ -5817,8 +5819,17 @@ static void flush_backlog(struct work_st input_queue_head_incr(sd); } } @@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau skb_queue_walk_safe(&sd->process_queue, skb, tmp) { if (skb->dev->reg_state == NETREG_UNREGISTERING) { __skb_unlink(skb, &sd->process_queue); -@@ -5797,7 +5808,16 @@ static void flush_backlog(struct work_st +@@ -5826,7 +5837,16 @@ static void flush_backlog(struct work_st input_queue_head_incr(sd); } } @@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau } static bool flush_required(int cpu) -@@ -5929,6 +5949,7 @@ static int process_backlog(struct napi_s +@@ -5958,6 +5978,7 @@ static int process_backlog(struct napi_s } rps_lock_irq_disable(sd); @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau if (skb_queue_empty(&sd->input_pkt_queue)) { /* * Inline a custom version of __napi_complete(). -@@ -5938,7 +5959,8 @@ static int process_backlog(struct napi_s +@@ -5967,7 +5988,8 @@ static int process_backlog(struct napi_s * We can use a plain write instead of clear_bit(), * and we dont need an smp_mb() memory barrier. */ @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau again = false; } else { skb_queue_splice_tail_init(&sd->input_pkt_queue, -@@ -6354,6 +6376,55 @@ int dev_set_threaded(struct net_device * +@@ -6383,6 +6405,55 @@ int dev_set_threaded(struct net_device * } EXPORT_SYMBOL(dev_set_threaded); @@ -157,7 +157,7 @@ Signed-off-by: Felix Fietkau void netif_napi_add_weight(struct net_device *dev, struct napi_struct *napi, int (*poll)(struct napi_struct *, int), int weight) { -@@ -11126,6 +11197,9 @@ static int dev_cpu_dead(unsigned int old +@@ -11165,6 +11236,9 @@ static int dev_cpu_dead(unsigned int old raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_enable(); @@ -167,7 +167,7 @@ Signed-off-by: Felix Fietkau #ifdef CONFIG_RPS remsd = oldsd->rps_ipi_list; oldsd->rps_ipi_list = NULL; -@@ -11429,6 +11503,7 @@ static int __init net_dev_init(void) +@@ -11468,6 +11542,7 @@ static int __init net_dev_init(void) INIT_CSD(&sd->defer_csd, trigger_rx_softirq, sd); spin_lock_init(&sd->defer_lock); diff --git a/target/linux/generic/pending-6.1/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch b/target/linux/generic/pending-6.1/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch index a32c7d3603ffe6..9556c90b5791b7 100644 --- a/target/linux/generic/pending-6.1/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch +++ b/target/linux/generic/pending-6.1/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch @@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -7023,6 +7023,7 @@ static int mv88e6xxx_register_switch(str +@@ -7025,6 +7025,7 @@ static int mv88e6xxx_register_switch(str ds->ops = &mv88e6xxx_switch_ops; ds->ageing_time_min = chip->info->age_time_coeff; ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX; diff --git a/target/linux/generic/pending-6.1/804-nvmem-core-support-mac-base-fixed-layout-cells.patch b/target/linux/generic/pending-6.1/804-nvmem-core-support-mac-base-fixed-layout-cells.patch index 6791b63ac09d90..95f29b1865dd5f 100644 --- a/target/linux/generic/pending-6.1/804-nvmem-core-support-mac-base-fixed-layout-cells.patch +++ b/target/linux/generic/pending-6.1/804-nvmem-core-support-mac-base-fixed-layout-cells.patch @@ -20,10 +20,11 @@ string. --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c -@@ -7,9 +7,11 @@ +@@ -7,9 +7,12 @@ */ #include ++#include +#include #include #include @@ -32,7 +33,7 @@ string. #include #include #include -@@ -696,6 +698,37 @@ static int nvmem_validate_keepouts(struc +@@ -696,6 +699,62 @@ static int nvmem_validate_keepouts(struc return 0; } @@ -66,25 +67,55 @@ string. + + return 0; +} ++ ++static int nvmem_mac_base_hex_read(void *context, const char *id, int index, unsigned int offset, ++ void *buf, size_t bytes) ++{ ++ u8 mac[ETH_ALEN], *hexstr; ++ int i; ++ ++ if (WARN_ON(bytes != 2 * ETH_ALEN)) ++ return -EINVAL; ++ ++ hexstr = (u8 *)buf; ++ for (i = 0; i < ETH_ALEN; i++) { ++ if (!isxdigit(hexstr[i * 2]) || !isxdigit(hexstr[i * 2 + 1])) ++ return -EINVAL; ++ ++ mac[i] = (hex_to_bin(hexstr[i * 2]) << 4) | hex_to_bin(hexstr[i * 2 + 1]); ++ } ++ ++ if (index) ++ eth_addr_add(mac, index); ++ ++ ether_addr_copy(buf, mac); ++ ++ return 0; ++} + static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np) { struct nvmem_layout *layout = nvmem->layout; -@@ -731,6 +764,20 @@ static int nvmem_add_cells_from_dt(struc +@@ -731,6 +790,25 @@ static int nvmem_add_cells_from_dt(struc if (layout && layout->fixup_cell_info) layout->fixup_cell_info(nvmem, layout, &info); + if (of_device_is_compatible(np, "fixed-layout")) { + if (of_device_is_compatible(child, "mac-base")) { -+ if (info.bytes == 6) { ++ if (info.bytes == ETH_ALEN) { + info.raw_len = info.bytes; + info.bytes = ETH_ALEN; + info.read_post_process = nvmem_mac_base_raw_read; ++ } else if (info.bytes == 2 * ETH_ALEN) { ++ info.raw_len = info.bytes; ++ info.bytes = ETH_ALEN; ++ info.read_post_process = nvmem_mac_base_hex_read; + } else if (info.bytes == 3 * ETH_ALEN - 1) { + info.raw_len = info.bytes; + info.bytes = ETH_ALEN; + info.read_post_process = nvmem_mac_base_ascii_read; + } ++ + } + } + diff --git a/target/linux/generic/pending-6.1/810-pci_disable_common_quirks.patch b/target/linux/generic/pending-6.1/810-pci_disable_common_quirks.patch index 33d2c6254790b4..68ac12f996d11d 100644 --- a/target/linux/generic/pending-6.1/810-pci_disable_common_quirks.patch +++ b/target/linux/generic/pending-6.1/810-pci_disable_common_quirks.patch @@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos /* * The Mellanox Tavor device gives false positive parity errors. Disable * parity error reporting. -@@ -3388,6 +3389,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I +@@ -3390,6 +3391,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata); @@ -42,7 +42,7 @@ Signed-off-by: Gabor Juhos /* * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum. * To work around this, query the size it should be configured to by the -@@ -3413,6 +3416,8 @@ static void quirk_intel_ntb(struct pci_d +@@ -3415,6 +3418,8 @@ static void quirk_intel_ntb(struct pci_d DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e08, quirk_intel_ntb); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e0d, quirk_intel_ntb); @@ -51,7 +51,7 @@ Signed-off-by: Gabor Juhos /* * Some BIOS implementations leave the Intel GPU interrupts enabled, even * though no one is handling them (e.g., if the i915 driver is never -@@ -3451,6 +3456,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN +@@ -3453,6 +3458,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq); diff --git a/target/linux/generic/pending-6.1/834-ledtrig-libata.patch b/target/linux/generic/pending-6.1/834-ledtrig-libata.patch index 57fdb020f812fe..930610c7e51315 100644 --- a/target/linux/generic/pending-6.1/834-ledtrig-libata.patch +++ b/target/linux/generic/pending-6.1/834-ledtrig-libata.patch @@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle /** * ata_build_rw_tf - Build ATA taskfile for given read/write request * @qc: Metadata associated with the taskfile to build -@@ -4622,6 +4635,9 @@ void __ata_qc_complete(struct ata_queued +@@ -4712,6 +4725,9 @@ void __ata_qc_complete(struct ata_queued link->active_tag = ATA_TAG_POISON; ap->nr_active_links--; } @@ -75,7 +75,7 @@ Signed-off-by: Daniel Golle /* clear exclusive status */ if (unlikely(qc->flags & ATA_QCFLAG_CLEAR_EXCL && -@@ -5328,6 +5344,9 @@ struct ata_port *ata_port_alloc(struct a +@@ -5434,6 +5450,9 @@ struct ata_port *ata_port_alloc(struct a ap->stats.unhandled_irq = 1; ap->stats.idle_irq = 1; #endif @@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle ata_sff_port_init(ap); return ap; -@@ -5363,6 +5382,12 @@ static void ata_host_release(struct kref +@@ -5469,6 +5488,12 @@ static void ata_host_release(struct kref kfree(ap->pmp_link); kfree(ap->slave_link); @@ -98,7 +98,7 @@ Signed-off-by: Daniel Golle kfree(ap); host->ports[i] = NULL; } -@@ -5765,7 +5790,23 @@ int ata_host_register(struct ata_host *h +@@ -5871,7 +5896,23 @@ int ata_host_register(struct ata_host *h host->ports[i]->print_id = atomic_inc_return(&ata_print_id); host->ports[i]->local_port_no = i + 1; } @@ -134,7 +134,7 @@ Signed-off-by: Daniel Golle /* * Define if arch has non-standard setup. This is a _PCI_ standard -@@ -861,6 +864,12 @@ struct ata_port { +@@ -864,6 +867,12 @@ struct ata_port { #ifdef CONFIG_ATA_ACPI struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */ #endif diff --git a/target/linux/generic/pending-6.1/920-mangle_bootargs.patch b/target/linux/generic/pending-6.1/920-mangle_bootargs.patch index 1015266084e2a4..db7274e7aadb94 100644 --- a/target/linux/generic/pending-6.1/920-mangle_bootargs.patch +++ b/target/linux/generic/pending-6.1/920-mangle_bootargs.patch @@ -31,7 +31,7 @@ Signed-off-by: Imre Kaloz help --- a/init/main.c +++ b/init/main.c -@@ -607,6 +607,29 @@ static inline void setup_nr_cpu_ids(void +@@ -611,6 +611,29 @@ static inline void setup_nr_cpu_ids(void static inline void smp_prepare_cpus(unsigned int maxcpus) { } #endif @@ -61,7 +61,7 @@ Signed-off-by: Imre Kaloz /* * We need to store the untouched command line for future reference. * We also need to store the touched command line since the parameter -@@ -954,6 +977,7 @@ asmlinkage __visible void __init __no_sa +@@ -958,6 +981,7 @@ asmlinkage __visible void __init __no_sa pr_notice("%s", linux_banner); early_security_init(); setup_arch(&command_line); diff --git a/target/linux/ipq40xx/base-files/etc/board.d/01_leds b/target/linux/ipq40xx/base-files/etc/board.d/01_leds index 1ba5d2b1a77eb5..187bafccb95fa8 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/01_leds +++ b/target/linux/ipq40xx/base-files/etc/board.d/01_leds @@ -20,8 +20,8 @@ asus,rt-ac42u) ucidef_set_led_netdev "wan" "WAN" "blue:wan" "wan" ;; asus,rt-ac58u) - ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1" - ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x1e" + ucidef_set_led_netdev "wan" "WAN" "blue:wan" "wan" + ucidef_set_led_netdev "lan" "LAN" "blue:lan" "br-lan" ;; avm,fritzbox-4040) ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt" "phy1tpt" diff --git a/target/linux/ipq40xx/base-files/etc/uci-defaults/04_led_migration b/target/linux/ipq40xx/base-files/etc/uci-defaults/04_led_migration index e8818a41ed7abe..a8e3cfb86518e4 100644 --- a/target/linux/ipq40xx/base-files/etc/uci-defaults/04_led_migration +++ b/target/linux/ipq40xx/base-files/etc/uci-defaults/04_led_migration @@ -6,6 +6,9 @@ case "$board" in asus,map-ac2200) migrate_leds ':chan=-' ;; +asus,rt-ac58u) + migrate_leds ":status=:power" ":wlan2G=:wlan-2" ":wlan5G=:wlan-5" + ;; engenius,emr3500) migrate_leds "emr3500:=" ;; diff --git a/target/linux/ipq40xx/config-6.1 b/target/linux/ipq40xx/config-6.1 index 2619f3f87c2f8d..f14dd0a4749d35 100644 --- a/target/linux/ipq40xx/config-6.1 +++ b/target/linux/ipq40xx/config-6.1 @@ -74,8 +74,8 @@ CONFIG_CPU_COPY_V6=y CONFIG_CPU_CP15=y CONFIG_CPU_CP15_MMU=y CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y CONFIG_CPU_FREQ_GOV_ATTR_SET=y CONFIG_CPU_FREQ_GOV_COMMON=y # CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set @@ -240,6 +240,7 @@ CONFIG_KMAP_LOCAL=y CONFIG_KMAP_LOCAL_NON_LINEAR_PTE_ARRAY=y # CONFIG_KPSS_XCC is not set # CONFIG_KRAITCC is not set +CONFIG_LED_TRIGGER_PHY=y CONFIG_LEDS_LP5523=y CONFIG_LEDS_LP5562=y CONFIG_LEDS_LP55XX_COMMON=y diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-a42.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-a42.dts index b6ff09a0420066..4cf5d45ff92a60 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-a42.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-a42.dts @@ -149,25 +149,28 @@ /* partitions are passed via bootloader */ partitions { partition-art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; label = "0:ART"; - 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>; - }; + macaddr_gmac0: macaddr@0 { + reg = <0x0 0x6>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts index def0401ac5c9f3..17b67c23788771 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts @@ -197,16 +197,19 @@ label = "ART"; reg = <0x00170000 0x00010000>; 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_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/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts index 22a48c12c44ef4..ea00dd83f51b07 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-cs-w3-wd1200g-eup.dts @@ -199,24 +199,26 @@ reg = <0x00170000 0x00010000>; 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>; - }; - - 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>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ea6350v3.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ea6350v3.dts index cd5b4c6ccc3754..d890e83c8991cc 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ea6350v3.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ea6350v3.dts @@ -226,16 +226,19 @@ label = "ART"; reg = <0x00160000 0x00010000>; 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; u_env@170000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts index a8f24aa00e60e3..778394a96562d0 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-eap1300.dts @@ -176,16 +176,19 @@ label = "0:ART"; reg = <0x00180000 0x00010000>; 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; partition8@190000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts index 3060b7bd1c803c..c5804b4896ef80 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ecw5211.dts @@ -226,16 +226,19 @@ label = "0:ART"; reg = <0x00170000 0x00010000>; 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_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/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi index dc5c25c84ab704..0e1527ad4f6d92 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-ex61x0v2.dtsi @@ -240,17 +240,20 @@ partition7@170000 { label = "ART"; reg = <0x00170000 0x00010000>; - compatible = "nvmem-cells"; read-only; - #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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -267,20 +270,22 @@ }; partition10@1a0000 { - compatible = "nvmem-cells"; label = "dnidata"; reg = <0x001a0000 0x00010000>; read-only; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_dnidata_0: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_dnidata_0: macaddr@0 { + reg = <0x0 0x6>; + }; - macaddr_dnidata_c: macaddr@c { - reg = <0xc 0x6>; + macaddr_dnidata_c: macaddr@c { + reg = <0xc 0x6>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-a1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-a1300.dts index ad3d1ac120a584..a646ec3358f2b2 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-a1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-a1300.dts @@ -176,22 +176,29 @@ label = "ART"; reg = <0x00170000 0x00010000>; read-only; - compatible = "nvmem-cells"; - 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>; - }; + macaddr_gmac0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -300,8 +307,7 @@ label = "lan2"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_gmac0>; - mac-address-increment = <2>; + nvmem-cells = <&macaddr_gmac0 2>; }; &swport4 { @@ -309,7 +315,7 @@ label = "lan1"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_gmac0>; + nvmem-cells = <&macaddr_gmac0 0>; }; &swport5 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-ap1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-ap1300.dts index 6f5d4d8a5784f3..3f3e7cf6833d06 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-ap1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-ap1300.dts @@ -175,24 +175,27 @@ label = "ART"; reg = <0x00170000 0x00010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_art_0: mac-address@0 { - reg = <0x0 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_6: mac-address@6 { - reg = <0x6 0x6>; - }; + macaddr_art_0: mac-address@0 { + reg = <0x0 0x6>; + }; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + macaddr_art_6: mac-address@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/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dtsi index 4d09e86dd66fe2..bb293bb57ea473 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-jalapeno.dtsi @@ -185,16 +185,19 @@ label = "ART"; reg = <0x00170000 0x00010000>; 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_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/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287.dts index 43e39bdf960017..fc4bae6937fb7a 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287.dts @@ -116,16 +116,19 @@ label = "ART"; reg = <0x140000 0x140000>; 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -133,12 +136,17 @@ label = "mac"; reg = <0x280000 0x140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_mac_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287_common.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287_common.dtsi index 52272434679cbf..a688a8aa58664e 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287_common.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287_common.dtsi @@ -129,8 +129,7 @@ &gmac { status = "okay"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_mac_0>; - mac-address-increment = <2>; + nvmem-cells = <&macaddr_mac_0 2>; }; &switch { @@ -180,12 +179,11 @@ &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_mac_0>; + nvmem-cells = <&precal_art_1000>, <&macaddr_mac_0 0>; }; &wifi1 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_mac_0>; - mac-address-increment = <1>; + nvmem-cells = <&precal_art_5000>, <&macaddr_mac_0 1>; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287plus.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287plus.dts index f09a77ff59f985..8eb8ce85036ef9 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287plus.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287plus.dts @@ -116,16 +116,19 @@ label = "ART"; reg = <0x140000 0x140000>; 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -133,12 +136,17 @@ label = "mac"; reg = <0x280000 0x140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_mac_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287pro.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287pro.dts index 4fd44989c5eddc..b4b9451cb2c1e0 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287pro.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-mf287pro.dts @@ -133,16 +133,19 @@ label = "ART"; reg = <0xa0000 0x80000>; 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -150,12 +153,17 @@ label = "mac"; reg = <0x120000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_mac_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts index af4a7b196ba002..30511e3886052f 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-pa1200.dts @@ -141,25 +141,28 @@ /* partitions are passed via bootloader */ partitions { partition-art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; label = "0:ART"; - 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>; - }; + macaddr_gmac0: macaddr@0 { + reg = <0x0 0x6>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts index f705349d871b0a..1d1eaac443a58c 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-rt-ac58u.dts @@ -34,37 +34,50 @@ leds { compatible = "gpio-leds"; - led_power: status { - label = "blue:status"; + led_power: led-0 { + color = ; + function = LED_FUNCTION_POWER; gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + panic-indicator; }; - wan { - label = "blue:wan"; + led-1 { + color = ; + function = LED_FUNCTION_WAN; gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + /* + * linux,default-trigger = "90000.mdio-1:04:link"; + * sadly still lacks rx+tx + */ }; - wlan2G { - label = "blue:wlan2G"; + led-2 { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <2>; gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy0tpt"; }; - wlan5G { - label = "blue:wlan5G"; + led-3 { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <5>; gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy1tpt"; }; - usb { - label = "blue:usb"; + led-4 { + color = ; + function = LED_FUNCTION_USB; gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; trigger-sources = <&usb3_port1>, <&usb3_port2>; linux,default-trigger = "usbport"; }; - lan { - label = "blue:lan"; + led-5 { + color = ; + function = LED_FUNCTION_LAN; gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts index 2dbfaa086ef846..ae0d8524e5216f 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts @@ -263,12 +263,17 @@ label = "0:MANUDATA"; reg = <0x001e0000 0x00010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_manudata_6: macaddr@6 { - reg = <0x6 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_manudata_6: macaddr@6 { + compatible = "mac-base"; + reg = <0x6 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -276,16 +281,19 @@ label = "0:ART"; reg = <0x001f0000 0x00010000>; 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; @@ -367,14 +375,13 @@ &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_manudata_6>; + nvmem-cells = <&precal_art_1000>, <&macaddr_manudata_6 0>; qcom,ath10k-calibration-variant = "Netgear-WAC510"; }; &wifi1 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_manudata_6>; - mac-address-increment = <16>; + nvmem-cells = <&precal_art_5000>, <&macaddr_manudata_6 16>; qcom,ath10k-calibration-variant = "Netgear-WAC510"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-whw01.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-whw01.dts index 5859548254fc43..1f26db586905ef 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-whw01.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-whw01.dts @@ -126,16 +126,18 @@ reg = <0x170000 0x10000>; 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>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts index 4694c568191459..f3c6f34bf4f550 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wrtq-329acn.dts @@ -155,24 +155,27 @@ label = "0:ART"; reg = <0x170000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_art_0: macaddr@0{ - reg = <0x0000 0x0006>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_6: macaddr@6{ - reg = <0x0006 0x0006>; - }; + macaddr_art_0: macaddr@0{ + reg = <0x0000 0x0006>; + }; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + macaddr_art_6: macaddr@6{ + reg = <0x0006 0x0006>; + }; + + 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/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-a62.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-a62.dts index d3481011101454..369b5475d0537d 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-a62.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-a62.dts @@ -156,29 +156,32 @@ /* partitions are passed via bootloader */ partitions { partition-art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; label = "0:ART"; - 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>; - }; + macaddr_gmac0: macaddr@0 { + reg = <0x0 0x6>; + }; - precal_art_9000: precal@9000 { - reg = <0x9000 0x2f20>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_9000: precal@9000 { + reg = <0x9000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts index 1dde17e293fd3c..523fe4e501f4ee 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts @@ -262,24 +262,27 @@ label = "ART"; reg = <0xb00000 0x80000>; 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>; - macaddr_art_1006: macaddr@1006 { - reg = <0x1006 0x6>; - }; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; - }; + macaddr_art_1006: macaddr@1006 { + reg = <0x1006 0x6>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; - macaddr_art_5006: macaddr@5006 { - reg = <0x5006 0x6>; + macaddr_art_5006: macaddr@5006 { + reg = <0x5006 0x6>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts index 70e05c7eef3ab9..243d19fb033da8 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c1.dts @@ -68,24 +68,27 @@ label = "0:ART"; reg = <0x170000 0x10000>; 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>; - }; + macaddr_gmac0: macaddr@0 { + reg = <0x0 0x6>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; partition@180000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c2.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c2.dts index 2ad794e8ecb3a2..9300568986637d 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c2.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-e2600ac-c2.dts @@ -68,24 +68,27 @@ label = "0:ART"; reg = <0x170000 0x10000>; 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>; - }; + macaddr_gmac0: macaddr@0 { + reg = <0x0 0x6>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-eap2200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-eap2200.dts index dc144a15847cbf..63fd66901d8cbc 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-eap2200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-eap2200.dts @@ -146,20 +146,23 @@ label = "0:ART"; reg = <0x00170000 0x00010000>; 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>; + }; - precal_art_9000: precal@9000 { - reg = <0x9000 0x2f20>; + precal_art_9000: precal@9000 { + reg = <0x9000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts index 96ab73962e98ab..5cb5f7ca082fa3 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-gl-b2200.dts @@ -185,20 +185,23 @@ label = "ART"; reg = <0x170000 0x10000>; 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>; + }; - precal_art_9000: precal@9000 { - reg = <0x9000 0x2f20>; + precal_art_9000: precal@9000 { + reg = <0x9000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts index 23a654dcff5a05..d5d00b2eefe8d1 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-habanero-dvk.dts @@ -273,16 +273,19 @@ label = "ART"; reg = <0x00170000 0x00010000>; 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; partition@180000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-le1.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-le1.dts index 282a0eaaa608c2..677b4baa0fabed 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-le1.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-le1.dts @@ -148,16 +148,18 @@ reg = <0x170000 0x10000>; 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>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts index 80d71ac0cc8a71..1b1a697f13b029 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts @@ -238,7 +238,7 @@ &gmac { status = "okay"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 0>; }; &switch { @@ -251,8 +251,7 @@ label = "wan"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_config_0>; - mac-address-increment = <1>; + nvmem-cells = <&macaddr_config_0 1>; }; &swport3 { @@ -282,16 +281,19 @@ label = "ART"; reg = <0xa0000 0x80000>; 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_9000: precal@9000 { - reg = <0x9000 0x2f20>; + precal_art_9000: precal@9000 { + reg = <0x9000 0x2f20>; + }; }; }; @@ -299,12 +301,17 @@ label = "mac"; reg = <0x120000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_config_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -451,8 +458,7 @@ &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_config_0>; - mac-address-increment = <2>; + nvmem-cells = <&precal_art_1000>, <&macaddr_config_0 2>; qcom,ath10k-calibration-variant = "ZTE-MF18A"; }; @@ -472,8 +478,7 @@ wifi2: wifi@1,0 { compatible = "pci168c,0040"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_9000>, <&macaddr_config_0>; - mac-address-increment = <3>; + nvmem-cells = <&precal_art_9000>, <&macaddr_config_0 3>; qcom,ath10k-calibration-variant = "ZTE-MF18A"; reg = <0x00010000 0 0 0 0>; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf282plus.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf282plus.dts index 6688577c079a5e..54353cac58e7d7 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf282plus.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf282plus.dts @@ -223,7 +223,7 @@ &gmac { status = "okay"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 0>; }; &nand { @@ -247,16 +247,19 @@ label = "ART"; reg = <0xa0000 0x80000>; 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -264,12 +267,17 @@ label = "mac"; reg = <0x120000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_config_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -430,8 +438,7 @@ &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_config_0>; - mac-address-increment = <1>; + nvmem-cells = <&precal_art_1000>, <&macaddr_config_0 1>; qcom,ath10k-calibration-variant = "zte,mf286d"; }; @@ -442,7 +449,6 @@ &wifi1 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_config_0>; - mac-address-increment = <1>; + nvmem-cells = <&precal_art_5000>, <&macaddr_config_0 1>; qcom,ath10k-calibration-variant = "zte,mf286d"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts index ff04279a600b1e..61cbdba0d12a8b 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf286d.dts @@ -216,7 +216,7 @@ &gmac { status = "okay"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_config_0>; + nvmem-cells = <&macaddr_config_0 0>; }; &nand { @@ -240,16 +240,19 @@ label = "ART"; reg = <0xa0000 0x80000>; 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -257,12 +260,17 @@ label = "mac"; reg = <0x120000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_config_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -347,8 +355,7 @@ status = "okay"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_config_0>; - mac-address-increment = <1>; + nvmem-cells = <&macaddr_config_0 1>; }; &tlmm { @@ -434,15 +441,13 @@ &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_config_0>; - mac-address-increment = <2>; + nvmem-cells = <&precal_art_1000>, <&macaddr_config_0 2>; qcom,ath10k-calibration-variant = "zte,mf286d"; }; &wifi1 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_config_0>; - mac-address-increment = <3>; + nvmem-cells = <&precal_art_5000>, <&macaddr_config_0 3>; qcom,ath10k-calibration-variant = "zte,mf286d"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf289f.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf289f.dts index 0d9f24ad705924..bbb2cb902a2e5c 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf289f.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf289f.dts @@ -216,16 +216,19 @@ label = "ART"; reg = <0xa0000 0x80000>; 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -233,12 +236,17 @@ label = "mac"; reg = <0x120000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_mac_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -310,7 +318,7 @@ &gmac { status = "okay"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_mac_0>; + nvmem-cells = <&macaddr_mac_0 0>; }; &switch { @@ -323,8 +331,7 @@ label = "wan"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_mac_0>; - mac-address-increment = <1>; + nvmem-cells = <&macaddr_mac_0 1>; }; &swport5 { @@ -401,8 +408,7 @@ &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_mac_0>; - mac-address-increment = <2>; + nvmem-cells = <&precal_art_1000>, <&macaddr_mac_0 2>; qcom,ath10k-calibration-variant = "zte,mf289f"; }; @@ -410,8 +416,7 @@ &wifi1 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_mac_0>; - mac-address-increment = <3>; + nvmem-cells = <&precal_art_5000>, <&macaddr_mac_0 3>; qcom,ath10k-calibration-variant = "zte,mf289f"; }; @@ -430,8 +435,7 @@ wifi2: wifi@1,0 { nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_mac_0>; - mac-address-increment = <4>; + nvmem-cells = <&macaddr_mac_0 4>; compatible = "qcom,ath10k"; reg = <0x00010000 0 0 0 0>; qcom,ath10k-calibration-variant = "zte,mf289f"; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-oap100.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-oap100.dts index beb168eb492117..2080a34e2f864d 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-oap100.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-oap100.dts @@ -263,16 +263,19 @@ label = "0:ART"; reg = <0x00170000 0x00010000>; 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_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/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts index 259ea7bb47abd9..49d399ed1f45d3 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-pa2200.dts @@ -141,29 +141,32 @@ /* partitions are passed via bootloader */ partitions { partition-art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; label = "0:ART"; - 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>; - }; + macaddr_gmac0: macaddr@0 { + reg = <0x0 0x6>; + }; - precal_art_9000: precal@9000 { - reg = <0x9000 0x2f20>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_9000: precal@9000 { + reg = <0x9000 0x2f20>; + }; }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi index d7a987f98dbc11..1566dc39a9dfc2 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-r619ac.dtsi @@ -173,16 +173,19 @@ label = "ART"; reg = <0x170000 0x10000>; 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_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/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts index 4efcdaf394182e..08c55d0c27d3ea 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-u4019-32m.dts @@ -65,16 +65,19 @@ label = "0:ART"; reg = <0x170000 0x10000>; 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; partition@180000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-whw03v2.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-whw03v2.dts index 1f0572b8798f68..963c0915bb3712 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-whw03v2.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-whw03v2.dts @@ -267,7 +267,7 @@ status = "okay"; // RGB LEDs - pca9633: led-controller { + pca9633: led-controller@62 { compatible = "nxp,pca9633"; nxp,hw-blink; reg = <0x62>; @@ -354,29 +354,34 @@ partition@580000 { label = "ART"; reg = <0x580000 0x80000>; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; read-only; - 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>; - }; + macaddr_gmac0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; - precal_art_9000: precal@9000 { - reg = <0x9000 0x2f20>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_9000: precal@9000 { + reg = <0x9000 0x2f20>; + }; }; }; @@ -476,7 +481,7 @@ label = "wan"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_gmac0>; + nvmem-cells = <&macaddr_gmac0 0>; }; &wifi0 { @@ -492,8 +497,7 @@ qcom,ath10k-calibration-variant = "linksys-whw03v2"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_gmac0>; - mac-address-increment = <1>; + nvmem-cells = <&precal_art_1000>, <&macaddr_gmac0 1>; }; &wifi1 { @@ -503,8 +507,7 @@ qcom,ath10k-calibration-variant = "linksys-whw03v2"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_gmac0>; - mac-address-increment = <2>; + nvmem-cells = <&precal_art_5000>, <&macaddr_gmac0 2>; }; &wifi2 { @@ -514,6 +517,5 @@ qcom,ath10k-calibration-variant = "linksys-whw03v2"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_9000>, <&macaddr_gmac0>; - mac-address-increment = <3>; + nvmem-cells = <&precal_art_9000>, <&macaddr_gmac0 3>; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts index ca37884db23e1f..2dc4544433474b 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wpj419.dts @@ -206,16 +206,19 @@ label = "0:ART"; reg = <0x170000 0x010000>; 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_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/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wtr-m2133hp.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wtr-m2133hp.dts index 3260de23bd4089..7d030c489d2fe6 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wtr-m2133hp.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-wtr-m2133hp.dts @@ -331,20 +331,23 @@ label = "ART"; reg = <0x0b00000 0x0080000>; 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>; + }; - precal_art_9000: precal@9000 { - reg = <0x5000 0x2f20>; + precal_art_9000: precal@9000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -358,21 +361,24 @@ label = "ORGDATA"; reg = <0x0c00000 0x0080000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_orgdata_20: macaddr@20 { - reg = <0x20 0x6>; - }; - macaddr_orgdata_26: macaddr@26 { - reg = <0x26 0x6>; - }; - macaddr_orgdata_2c: macaddr@2c { - reg = <0x2c 0x6>; - }; - macaddr_orgdata_32: macaddr@32 { - reg = <0x32 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_orgdata_20: macaddr@20 { + reg = <0x20 0x6>; + }; + macaddr_orgdata_26: macaddr@26 { + reg = <0x26 0x6>; + }; + macaddr_orgdata_2c: macaddr@2c { + reg = <0x2c 0x6>; + }; + macaddr_orgdata_32: macaddr@32 { + reg = <0x32 0x6>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts index 681300c502bf18..3d71593e86cd58 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dts @@ -67,16 +67,19 @@ label = "0:ART"; reg = <0x170000 0x10000>; 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; partition@180000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts index d84d54e39bb868..4b61bbb5aca676 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4028-wpj428.dts @@ -225,24 +225,27 @@ label = "0:ART"; reg = <0x00170000 0x00010000>; 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>; - }; + macaddr_art_e010: mac-address@e010 { + reg = <0xe010 0x6>; + }; - macaddr_art_e010: mac-address@e010 { - reg = <0xe010 0x6>; - }; + macaddr_art_e018: mac-address@e018 { + reg = <0xe018 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - macaddr_art_e018: mac-address@e018 { - reg = <0xe018 0x6>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; partition6@180000 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303.dts index 6cbfa8f37df5f1..7e484db1b5c9c9 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303.dts @@ -118,16 +118,19 @@ label = "ART"; reg = <0xe0000 0x10000>; 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -141,12 +144,17 @@ label = "mfginfo"; reg = <0x1e0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_mfginfo_1d: macaddr@1d { - reg = <0x1d 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mfginfo_1d: macaddr@1d { + compatible = "mac-base"; + reg = <0x1d 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts index 23abb3537cb758..41b42e8f58fbb5 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts @@ -317,16 +317,19 @@ label = "ART"; reg = <0x1f0000 0x10000>; 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -352,16 +355,21 @@ label = "mfginfo"; reg = <0x390000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_mfginfo_1d: macaddr@1d { - reg = <0x1d 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mfginfo_1d: macaddr@1d { + reg = <0x1d 0x6>; + }; - macaddr_mfginfo_45: macaddr@45 { - reg = <0x45 0x6>; + macaddr_mfginfo_45: macaddr@45 { + compatible = "mac-base"; + reg = <0x45 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -459,14 +467,13 @@ &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_mfginfo_45>; + nvmem-cells = <&precal_art_1000>, <&macaddr_mfginfo_45 0>; qcom,ath10k-calibration-variant = "Aruba-AP-303"; }; &wifi1 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_mfginfo_45>; - mac-address-increment = <1>; + nvmem-cells = <&precal_art_5000>, <&macaddr_mfginfo_45 1>; qcom,ath10k-calibration-variant = "Aruba-AP-303"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-365.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-365.dts index 1f7b37d56d6dc4..3477dace727424 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-365.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-365.dts @@ -150,16 +150,19 @@ label = "ART"; reg = <0x1f0000 0x10000>; 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -185,12 +188,17 @@ label = "mfginfo"; reg = <0x390000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_mfginfo_1d: macaddr@1d { - reg = <0x1d 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mfginfo_1d: macaddr@1d { + compatible = "mac-base"; + reg = <0x1d 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi index 41de6bb218b925..4b3b682260e356 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-aruba-glenmorangie.dtsi @@ -259,14 +259,13 @@ &wifi0 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_1000>, <&macaddr_mfginfo_1d>; + nvmem-cells = <&precal_art_1000>, <&macaddr_mfginfo_1d 0>; qcom,ath10k-calibration-variant = "Aruba-AP-303"; }; &wifi1 { status = "okay"; nvmem-cell-names = "pre-calibration", "mac-address"; - nvmem-cells = <&precal_art_5000>, <&macaddr_mfginfo_1d>; - mac-address-increment = <1>; + nvmem-cells = <&precal_art_5000>, <&macaddr_mfginfo_1d 1>; qcom,ath10k-calibration-variant = "Aruba-AP-303"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts index 7e4519a746617d..9694973132f5ea 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-b1300.dts @@ -195,24 +195,29 @@ label = "ART"; reg = <0x170000 0x10000>; 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>; - }; + macaddr_gmac0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_gmac0: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_gmac1: macaddr@6 { + reg = <0x6 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - macaddr_gmac1: macaddr@6 { - reg = <0x6 0x6>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -288,8 +293,7 @@ label = "lan2"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_gmac0>; - mac-address-increment = <2>; + nvmem-cells = <&macaddr_gmac0 2>; }; &swport4 { @@ -297,7 +301,7 @@ label = "lan1"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_gmac0>; + nvmem-cells = <&macaddr_gmac0 0>; }; &swport5 { diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts index 0e7f4c970f474a..1a61b8161de71b 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-gl-s1300.dts @@ -193,16 +193,19 @@ label = "ART"; reg = <0x170000 0x10000>; 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_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/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-insect-common.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-insect-common.dtsi index ebfab171f51cc4..dbf6c14b7246d5 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-insect-common.dtsi +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-insect-common.dtsi @@ -137,7 +137,9 @@ #size-cells = <1>; mac_address: mac-address@66 { + compatible = "mac-base"; reg = <0x66 0x6>; + #nvmem-cell-cells = <1>; }; }; }; @@ -284,9 +286,8 @@ compatible = "qcom,ath10k"; status = "okay"; reg = <0x00010000 0 0 0 0>; - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; @@ -390,22 +391,20 @@ &wifi0 { status = "okay"; qcom,ath10k-calibration-variant = "Meraki-MR33"; - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &wifi1 { status = "okay"; qcom,ath10k-calibration-variant = "Meraki-MR33"; - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; }; &gmac { status = "okay"; - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq40x9-dr40x9.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq40x9-dr40x9.dts index b90b6b28c32e8c..271a97209255a4 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq40x9-dr40x9.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq40x9-dr40x9.dts @@ -236,34 +236,36 @@ label = "0:ART"; reg = <0x00170000 0x00010000>; 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>; - }; + macaddr_art_0: mac-address@0 { + reg = <0x0 0x6>; + }; - macaddr_art_0: mac-address@0 { - reg = <0x0 0x6>; - }; + macaddr_art_6: mac-address@6 { + reg = <0x6 0x6>; + }; - macaddr_art_6: mac-address@6 { - reg = <0x6 0x6>; - }; + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - macaddr_art_1006: mac-address@1006 { - reg = <0x1006 0x6>; - }; + macaddr_art_1006: mac-address@1006 { + reg = <0x1006 0x6>; + }; - macaddr_art_5006: mac-address@5006 { - reg = <0x5006 0x6>; - }; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + macaddr_art_5006: mac-address@5006 { + reg = <0x5006 0x6>; + }; + }; }; partition8@180000 { diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index eadd19f5d6fdb1..7867e65bb3be63 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -68,7 +68,7 @@ define Build/mkmylofw_32m let \ size="$$(stat -c%s $@)" \ - pad="$(subst k,* 1024,$(BLOCKSIZE))" \ + pad="$(call exp_units,$(BLOCKSIZE))" \ pad="(pad - (size % pad)) % pad" \ newsize='size + pad'; \ $(STAGING_DIR_HOST)/bin/mkmylofw \ @@ -366,7 +366,7 @@ endef #TARGET_DEVICES += compex_wpj419 define Device/compex_wpj428 - $(call Device/FitImage) + $(call Device/FitzImage) DEVICE_VENDOR := Compex DEVICE_MODEL := WPJ428 SOC := qcom-ipq4028 @@ -692,6 +692,7 @@ define Device/linksys_ea6350v3 PAGESIZE := 2048 KERNEL_SIZE := 5120k IMAGE_SIZE := 35840k + NAND_SIZE := 128m UBINIZE_OPTS := -E 5 IMAGES += factory.bin IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA6350v3 @@ -706,6 +707,7 @@ define Device/linksys_ea8300 SOC := qcom-ipq4019 KERNEL_SIZE := 5120k IMAGE_SIZE := 84992k + NAND_SIZE := 256m BLOCKSIZE := 128k PAGESIZE := 2048 UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF @@ -723,6 +725,7 @@ define Device/linksys_mr8300 SOC := qcom-ipq4019 KERNEL_SIZE := 5120k IMAGE_SIZE := 84992k + NAND_SIZE := 256m BLOCKSIZE := 128k PAGESIZE := 2048 UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF @@ -740,6 +743,7 @@ define Device/linksys_whw03v2 SOC := qcom-ipq4019 KERNEL_SIZE := 6144k IMAGE_SIZE := 158720k + NAND_SIZE := 512m BLOCKSIZE := 128k PAGESIZE := 2048 UBINIZE_OPTS := -E 5 # EOD marks to "hide" factory sig at EOF @@ -754,7 +758,8 @@ define Device/linksys_whw01 DEVICE_VENDOR := Linksys DEVICE_MODEL := WHW01 KERNEL_SIZE := 6144k - IMAGE_SIZE := 75776K + IMAGE_SIZE := 75776k + NAND_SIZE := 256m SOC := qcom-ipq4018 BLOCKSIZE := 128k PAGESIZE := 2048 diff --git a/target/linux/ipq40xx/patches-6.1/004-v6.7-firmware-qcom_scm-disable-SDI-if-required.patch b/target/linux/ipq40xx/patches-6.1/004-v6.7-firmware-qcom_scm-disable-SDI-if-required.patch index 1ef46d9be378e5..ae7e9f97c07657 100644 --- a/target/linux/ipq40xx/patches-6.1/004-v6.7-firmware-qcom_scm-disable-SDI-if-required.patch +++ b/target/linux/ipq40xx/patches-6.1/004-v6.7-firmware-qcom_scm-disable-SDI-if-required.patch @@ -27,7 +27,7 @@ Signed-off-by: Bjorn Andersson --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c -@@ -400,6 +400,29 @@ int qcom_scm_set_remote_state(u32 state, +@@ -407,6 +407,29 @@ int qcom_scm_set_remote_state(u32 state, } EXPORT_SYMBOL(qcom_scm_set_remote_state); @@ -57,7 +57,7 @@ Signed-off-by: Bjorn Andersson static int __qcom_scm_set_dload_mode(struct device *dev, bool enable) { struct qcom_scm_desc desc = { -@@ -1404,6 +1427,13 @@ static int qcom_scm_probe(struct platfor +@@ -1411,6 +1434,13 @@ static int qcom_scm_probe(struct platfor __get_convention(); diff --git a/target/linux/ipq40xx/patches-6.1/422-firmware-qcom-scm-fix-SCM-cold-boot-address.patch b/target/linux/ipq40xx/patches-6.1/422-firmware-qcom-scm-fix-SCM-cold-boot-address.patch index a92342215e6719..cb06ff353c7cb7 100644 --- a/target/linux/ipq40xx/patches-6.1/422-firmware-qcom-scm-fix-SCM-cold-boot-address.patch +++ b/target/linux/ipq40xx/patches-6.1/422-firmware-qcom-scm-fix-SCM-cold-boot-address.patch @@ -118,7 +118,7 @@ Signed-off-by: Brian Norris } --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c -@@ -305,6 +305,17 @@ static int qcom_scm_set_boot_addr(void * +@@ -312,6 +312,17 @@ static int qcom_scm_set_boot_addr(void * desc.args[0] = flags; desc.args[1] = virt_to_phys(entry); diff --git a/target/linux/ipq40xx/patches-6.1/701-net-dsa-add-out-of-band-tagging-protocol.patch b/target/linux/ipq40xx/patches-6.1/701-net-dsa-add-out-of-band-tagging-protocol.patch index 8f296a6f7b701b..ecf1a05896fac8 100644 --- a/target/linux/ipq40xx/patches-6.1/701-net-dsa-add-out-of-band-tagging-protocol.patch +++ b/target/linux/ipq40xx/patches-6.1/701-net-dsa-add-out-of-band-tagging-protocol.patch @@ -136,7 +136,7 @@ Signed-off-by: Maxime Chevallier #include #include #include -@@ -4515,6 +4519,9 @@ static const u8 skb_ext_type_len[] = { +@@ -4516,6 +4520,9 @@ static const u8 skb_ext_type_len[] = { #if IS_ENABLED(CONFIG_MCTP_FLOWS) [SKB_EXT_MCTP] = SKB_EXT_CHUNKSIZEOF(struct mctp_flow), #endif @@ -146,7 +146,7 @@ Signed-off-by: Maxime Chevallier }; static __always_inline unsigned int skb_ext_total_length(void) -@@ -4535,6 +4542,9 @@ static __always_inline unsigned int skb_ +@@ -4536,6 +4543,9 @@ static __always_inline unsigned int skb_ #if IS_ENABLED(CONFIG_MCTP_FLOWS) skb_ext_type_len[SKB_EXT_MCTP] + #endif diff --git a/target/linux/ipq40xx/patches-6.1/709-net-phy-Add-Qualcom-QCA807x-driver.patch b/target/linux/ipq40xx/patches-6.1/709-net-phy-Add-Qualcom-QCA807x-driver.patch index 9bae6e7b96bc2f..dbf87d4ddebcd7 100644 --- a/target/linux/ipq40xx/patches-6.1/709-net-phy-Add-Qualcom-QCA807x-driver.patch +++ b/target/linux/ipq40xx/patches-6.1/709-net-phy-Add-Qualcom-QCA807x-driver.patch @@ -25,7 +25,7 @@ Signed-off-by: Robert Marko --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -369,6 +369,13 @@ config AT803X_PHY +@@ -366,6 +366,13 @@ config AT803X_PHY Currently supports the AR8030, AR8031, AR8033, AR8035 and internal QCA8337(Internal qca8k PHY) model @@ -41,7 +41,7 @@ Signed-off-by: Robert Marko help --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile -@@ -94,6 +94,7 @@ obj-$(CONFIG_MOTORCOMM_PHY) += motorcomm +@@ -90,6 +90,7 @@ obj-$(CONFIG_MOTORCOMM_PHY) += motorcomm obj-$(CONFIG_NATIONAL_PHY) += national.o obj-$(CONFIG_NXP_C45_TJA11XX_PHY) += nxp-c45-tja11xx.o obj-$(CONFIG_NXP_TJA11XX_PHY) += nxp-tja11xx.o diff --git a/target/linux/ipq40xx/patches-6.1/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch b/target/linux/ipq40xx/patches-6.1/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch index f08ff041378c72..c73e40429c8ae1 100644 --- a/target/linux/ipq40xx/patches-6.1/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch +++ b/target/linux/ipq40xx/patches-6.1/910-Revert-firmware-qcom_scm-Clear-download-bit-during-r.patch @@ -15,7 +15,7 @@ Signed-off-by: Robert Marko --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c -@@ -1459,7 +1459,8 @@ static int qcom_scm_probe(struct platfor +@@ -1466,7 +1466,8 @@ static int qcom_scm_probe(struct platfor static void qcom_scm_shutdown(struct platform_device *pdev) { /* Clean shutdown, disable download mode to allow normal restart */ diff --git a/target/linux/ipq806x/Makefile b/target/linux/ipq806x/Makefile index 1bcea1fa80fdd6..74a0007a4e0199 100644 --- a/target/linux/ipq806x/Makefile +++ b/target/linux/ipq806x/Makefile @@ -21,6 +21,6 @@ DEFAULT_PACKAGES += \ kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \ kmod-phy-qcom-ipq806x-usb kmod-usb3 kmod-usb-dwc3-qcom \ kmod-ath10k-ct wpad-basic-mbedtls \ - uboot-envtools ip-tiny + uboot-envtools $(eval $(call BuildTarget)) 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 0b64bbb4206e7e..0b2ce2b7d5503e 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) @@ -33,6 +33,10 @@ edgecore,ecw5410) ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2g" "phy1tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy0tpt" ;; +extreme,ap3935) + ucidef_set_led_netdev "wan" "wan" "orange:lan1" "eth1" + ucidef_set_led_netdev "lan" "lan" "orange:lan2" "eth0" + ;; meraki,mr52) ucidef_set_led_netdev "eth0" "eth0" "green:lan1" "eth0" ucidef_set_led_netdev "eth1" "eth1" "green:lan2" "eth1" @@ -44,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/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index 3ba3ff79e9e2b7..7fdda7cfec4df3 100644 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -34,12 +34,20 @@ ipq806x_setup_interfaces() tplink,ad7200 |\ zyxel,nbg6817) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" + ucidef_set_network_device_conduit "lan1" "eth1" + ucidef_set_network_device_conduit "lan2" "eth1" + ucidef_set_network_device_conduit "lan3" "eth1" + ucidef_set_network_device_conduit "lan4" "eth1" + ucidef_set_network_device_conduit "wan" "eth0" ;; asus,onhub |\ tplink,onhub) ucidef_set_interfaces_lan_wan "lan1" "wan" + ucidef_set_network_device_conduit "lan1" "eth1" + ucidef_set_network_device_conduit "wan" "eth0" ;; - edgecore,ecw5410) + edgecore,ecw5410 |\ + extreme,ap3935) ucidef_set_interfaces_lan_wan "eth1" "eth0" ;; qcom,ipq8064-ap161) diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 5af3a5b8057df6..ef5fc344a6f3d1 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -15,6 +15,11 @@ case "$board" in ubnt,unifi-ac-hd) macaddr_add $(mtd_get_mac_binary EEPROM 0x6) $(($PHYNBR + 1)) > /sys${DEVPATH}/macaddress ;; + extreme,ap3935) + echo "##### PHYNBR=$PHYNBR DEVPATH=$DEVPATH" + [ "$PHYNBR" = "0" ] && echo $(mtd_get_mac_ascii CFG1 RADIOADDR0) > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && echo $(mtd_get_mac_ascii CFG1 RADIOADDR1) > /sys${DEVPATH}/macaddress + ;; esac OPATH=${DEVPATH##/devices/platform/} diff --git a/target/linux/ipq806x/base-files/etc/init.d/bootcount b/target/linux/ipq806x/base-files/etc/init.d/bootcount index cb32a4ed3568d8..ef3c6894e44adb 100755 --- a/target/linux/ipq806x/base-files/etc/init.d/bootcount +++ b/target/linux/ipq806x/base-files/etc/init.d/bootcount @@ -12,6 +12,9 @@ boot() { edgecore,ecw5410) fw_setenv bootcount 0 ;; + extreme,ap3935) + fw_setenv WATCHDOG_COUNT 0x00000000 + ;; linksys,ea7500-v1 |\ linksys,ea8500) mtd resetbc s_env || true diff --git a/target/linux/ipq806x/base-files/etc/init.d/qca8k_set_port b/target/linux/ipq806x/base-files/etc/init.d/qca8k_set_port deleted file mode 100755 index bf14907b8fbab2..00000000000000 --- a/target/linux/ipq806x/base-files/etc/init.d/qca8k_set_port +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=15 - -set_qca8k_port() { - local port=$1 - local master=$2 - - ip link set $port type dsa conduit $master -} - -boot() { - # Restore original implementation where the eth1 (port 6) was used - # for the lan port and the eth0 (port 0) was used for the wan port - case $(board_name) in - askey,rt4230w-rev6 |\ - asrock,g10 |\ - buffalo,wxr-2533dhp |\ - compex,wpq864 |\ - nec,wg2600hp |\ - nec,wg2600hp3 |\ - netgear,d7800 |\ - netgear,r7500 |\ - netgear,r7500v2 |\ - netgear,r7800 |\ - netgear,xr450 |\ - netgear,xr500 |\ - nokia,ac400i |\ - tplink,ad7200 |\ - tplink,c2600 |\ - tplink,vr2600v |\ - zyxel,nbg6817) - set_qca8k_port lan1 eth1 - set_qca8k_port lan2 eth1 - set_qca8k_port lan3 eth1 - set_qca8k_port lan4 eth1 - set_qca8k_port wan eth0 - ;; - asus,onhub |\ - tplink,onhub) - set_qca8k_port lan1 eth1 - set_qca8k_port wan eth0 - ;; - esac -} diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh index 8eda75b71886b8..7877ecae6bacad 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh @@ -44,6 +44,11 @@ platform_do_upgrade() { fi nand_do_upgrade "$1" ;; + extreme,ap3935) + CI_ROOTPART="nand_flash" + CI_KERNPART="PriImg" + nand_do_upgrade "$1" + ;; linksys,ea7500-v1 |\ linksys,ea8500) platform_do_upgrade_linksys "$1" diff --git a/target/linux/ipq806x/config-6.1 b/target/linux/ipq806x/config-6.1 index c008613713662f..e31e8223800d11 100644 --- a/target/linux/ipq806x/config-6.1 +++ b/target/linux/ipq806x/config-6.1 @@ -318,6 +318,7 @@ CONFIG_NVMEM_QCOM_QFPROM=y # CONFIG_NVMEM_QCOM_SEC_QFPROM is not set # CONFIG_NVMEM_SPMI_SDAM is not set CONFIG_NVMEM_SYSFS=y +CONFIG_NVMEM_U_BOOT_ENV=y CONFIG_OF=y CONFIG_OF_ADDRESS=y CONFIG_OF_EARLY_FLATTREE=y 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 2c181bd8830843..0c669dcbfe62c7 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_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_ART_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_ART_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -451,13 +476,23 @@ reg = <0>; color = ; function = LED_FUNCTION_WAN; + function-enumerator = <1>; default-state = "keep"; }; led@1 { reg = <1>; - color = ; + color = ; function = LED_FUNCTION_WAN; + function-enumerator = <2>; + default-state = "keep"; + }; + + led@2 { + reg = <2>; + color = ; + function = LED_FUNCTION_WAN; + function-enumerator = <3>; default-state = "keep"; }; }; @@ -477,13 +512,23 @@ reg = <0>; color = ; function = LED_FUNCTION_LAN; + function-enumerator = <1>; default-state = "keep"; }; led@1 { reg = <1>; - color = ; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + default-state = "keep"; + }; + + led@2 { + reg = <2>; + color = ; function = LED_FUNCTION_LAN; + function-enumerator = <3>; default-state = "keep"; }; }; @@ -503,13 +548,23 @@ reg = <0>; color = ; function = LED_FUNCTION_LAN; + function-enumerator = <1>; default-state = "keep"; }; led@1 { reg = <1>; - color = ; + color = ; function = LED_FUNCTION_LAN; + function-enumerator = <2>; + default-state = "keep"; + }; + + led@2 { + reg = <2>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; default-state = "keep"; }; }; @@ -529,13 +584,23 @@ reg = <0>; color = ; function = LED_FUNCTION_LAN; + function-enumerator = <1>; default-state = "keep"; }; led@1 { reg = <1>; - color = ; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + default-state = "keep"; + }; + + led@2 { + reg = <2>; + color = ; function = LED_FUNCTION_LAN; + function-enumerator = <3>; default-state = "keep"; }; }; @@ -555,13 +620,23 @@ reg = <0>; color = ; function = LED_FUNCTION_LAN; + function-enumerator = <1>; default-state = "keep"; }; led@1 { reg = <1>; - color = ; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + default-state = "keep"; + }; + + led@2 { + reg = <2>; + color = ; function = LED_FUNCTION_LAN; + function-enumerator = <3>; default-state = "keep"; }; }; @@ -641,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 c425c9cd2ed314..f306201754efb2 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 7e4e0c829c2723..18563c19f7bfda 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-onhub.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi index b84c8512ae91af..5b8de27ad69e51 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 @@ -345,7 +345,6 @@ status = "okay"; phy-mode = "rgmii"; qcom,id = <0>; - phy-handle = <&phy1>; pinctrl-0 = <&rgmii0_pins>; pinctrl-names = "default"; @@ -360,7 +359,6 @@ status = "okay"; phy-mode = "sgmii"; qcom,id = <2>; - phy-handle = <&phy0>; fixed-link { speed = <1000>; @@ -456,6 +454,7 @@ #size-cells = <2>; #address-cells = <3>; device_type = "pci"; + interrupt-controller; ath10k@0,0 { reg = <0 0 0 0 0>; @@ -475,6 +474,7 @@ #size-cells = <2>; #address-cells = <3>; device_type = "pci"; + interrupt-controller; ath10k@0,0 { reg = <0 0 0 0 0>; @@ -494,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 c58c289d35d9f5..41360b4a55b596 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 719a423cad3d69..47f653ac76377e 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 90927ddb856cc8..fac41897d4fcb2 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 8104ce18298439..ac62470df48241 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 87b05b57ba9779..a376eb0e2fe925 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 2d761ee3557d2b..d484ba9c6036d0 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 51ad5ac8eefcbd..4662e2843cb00e 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 bf7c963944b72d..3440c52699e50e 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 5453f9fcb3cbbc..3f5e80759190e4 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 600bcc8421d96f..7679f28eef11c6 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 4353aec7ac0906..1d4e9d36fe4232 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 f584735e155e9f..9eef59eaf3dd2d 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-ap3935.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ap3935.dts new file mode 100644 index 00000000000000..5c75de8f8df870 --- /dev/null +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ap3935.dts @@ -0,0 +1,351 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq8064-v2.0.dtsi" + +#include +#include + +/ { + model = "Extreme Networks AP3935"; + compatible = "extreme,ap3935", "qcom,ipq8064"; + + memory@0 { + reg = <0x41400000 0x3ec00000>; + device_type = "memory"; + }; + + aliases { + serial0 = &gsbi7_serial; + serial1 = &gsbi2_serial; + mdio-gpio0 = &mdio0; + ethernet0 = &gmac0; + ethernet1 = &gmac2; + + led-boot = &led_power_green; + led-failsafe = &led_power_orange; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-override = "ubi.block=0,0 root=/dev/ubiblock0_0"; + }; + + keys { + compatible = "gpio-keys"; + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + + reset { + label = "reset"; + gpios = <&qcom_pinmux 56 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + wakeup-source; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-0 = <&led_pins>; + pinctrl-names = "default"; + + led_power_green: power_green { + label = "green:power"; + gpios = <&qcom_pinmux 22 GPIO_ACTIVE_LOW>; + }; + + led_power_orange: power_orange { + label = "orange:power"; + gpios = <&qcom_pinmux 23 GPIO_ACTIVE_LOW>; + }; + + led_wlan2g_green { + label = "green:wlan2g"; + gpios = <&qcom_pinmux 24 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_wlan5g_green { + label = "green:wlan5g"; + gpios = <&qcom_pinmux 25 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + led_lan1_green { + label = "green:lan1"; + gpios = <&qcom_pinmux 26 GPIO_ACTIVE_LOW>; + }; + + led_lan1_orange { + label = "orange:lan1"; + gpios = <&qcom_pinmux 27 GPIO_ACTIVE_LOW>; + }; + + led_lan2_green { + label = "green:lan2"; + gpios = <&qcom_pinmux 28 GPIO_ACTIVE_LOW>; + }; + + led_lan2_orange { + label = "orange:lan2"; + gpios = <&qcom_pinmux 29 GPIO_ACTIVE_LOW>; + }; + }; +}; + + +&qcom_pinmux { + spi_pins: spi_pins { + mux { + pins = "gpio18", "gpio19"; + function = "gsbi5"; + drive-strength = <10>; + bias-pull-down; + }; + + clk { + pins = "gpio21"; + function = "gsbi5"; + drive-strength = <12>; + bias-pull-down; + }; + + cs { + pins = "gpio20"; + function = "gpio"; + drive-strength = <10>; + bias-pull-up; + }; + }; + + led_pins: led_pins { + mux { + pins = "gpio22", "gpio23", "gpio24", "gpio25", + "gpio26", "gpio27", "gpio28", "gpio29"; + function = "gpio"; + drive-strength = <10>; + bias-pull-up; + }; + }; + + button_pins: button_pins { + mux { + pins = "gpio56"; + function = "gpio"; + bias-pull-up; + }; + }; +}; + +&gsbi2 { + qcom,mode = ; + status = "okay"; + + gsbi2_serial: serial@12490000 { + status = "okay"; + }; +}; + +&gsbi4 { + qcom,mode = ; + status = "okay"; + + serial@16340000 { + status = "disabled"; + }; +}; + +&gsbi7 { + qcom,mode = ; + status = "okay"; + + gsbi7_serial: serial@16640000 { + status = "okay"; + }; +}; + +&gsbi5 { + qcom,mode = ; + status = "okay"; + + spi4: spi@1a280000 { + status = "okay"; + spi-max-frequency = <50000000>; + + pinctrl-0 = <&spi_pins>; + pinctrl-names = "default"; + + cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>; + + flash@0 { + compatible = "jedec,spi-nor"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <50000000>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + + cfg1@02a0000 { + compatible = "u-boot,env-redundant-bool"; + label = "CFG1"; + reg = <0x02a0000 0x0010000>; + + ethaddr: ethaddr { + }; + }; + + bootpri@02b0000 { + label = "BootPRI"; + reg = <0x02b0000 0x0080000>; + }; + + cfg2@0330000 { + label = "CFG2"; + reg = <0x0330000 0x0010000>; + }; + + fs@0340000 { + label = "FS"; + reg = <0x0340000 0x0080000>; + }; + + priimg@03c0000 { + label = "PriImg"; + reg = <0x03c0000 0x0e10000>; + }; + + secimg@11d0000 { + label = "SecImg"; + reg = <0x11d0000 0x0e10000>; + }; + }; + }; + }; +}; + +&pcie0 { + status = "okay"; + + /delete-property/ pinctrl-0; + /delete-property/ pinctrl-names; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "qcom,ath10k"; + status = "okay"; + reg = <0x00010000 0 0 0 0>; + }; + }; +}; + +&pcie1 { + status = "okay"; + + /delete-property/ pinctrl-0; + /delete-property/ pinctrl-names; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "qcom,ath10k"; + status = "okay"; + reg = <0x00010000 0 0 0 0>; + }; + }; +}; + +&nand { + status = "okay"; + + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + + nand@0 { + compatible = "qcom,nandcs"; + + reg = <0>; + + nand-ecc-strength = <8>; + nand-bus-width = <8>; + nand-ecc-step-size = <512>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + ubi@0 { + label = "ubi"; + reg = <0x0000000 0x20000000>; + }; + }; + }; +}; + +&soc { + mdio1: mdio { + compatible = "virtual,mdio-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + status = "okay"; + + pinctrl-0 = <&mdio0_pins>; + pinctrl-names = "default"; + + gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH &qcom_pinmux 0 GPIO_ACTIVE_HIGH>; + + phy1: ethernet-phy@1 { + reg = <1>; + }; + + phy2: ethernet-phy@2 { + reg = <2>; + }; + }; +}; + +&gmac0 { + status = "okay"; + + qcom,id = <0>; + mdiobus = <&mdio1>; + + phy-mode = "rgmii"; + phy-handle = <&phy1>; + + nvmem-cells = <ðaddr>; + nvmem-cell-names = "mac-address"; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&gmac2 { + status = "okay"; + + qcom,id = <2>; + mdiobus = <&mdio1>; + + phy-mode = "sgmii"; + phy-handle = <&phy2>; +}; + +&adm_dma { + status = "okay"; +}; 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 cfbfafb1793a07..d9d284fcfaf913 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 f81e3ef690dcc3..522fa12fd977aa 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/ipq806x/image/generic.mk b/target/linux/ipq806x/image/generic.mk index 0339a612d8e26e..b3743c35e31ac7 100644 --- a/target/linux/ipq806x/image/generic.mk +++ b/target/linux/ipq806x/image/generic.mk @@ -160,6 +160,23 @@ define Device/edgecore_ecw5410 endef TARGET_DEVICES += edgecore_ecw5410 +define Device/extreme_ap3935 + $(call Device/LegacyImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Extreme Networks + DEVICE_MODEL := AP3935 + SOC := qcom-ipq8068 + PAGESIZE := 2048 + BLOCKSIZE := 128k + KERNEL = kernel-bin | append-dtb | uImage none | append-uImage-fakehdr filesystem + KERNEL_LOADADDR = 0x41408000 + KERNEL_SIZE := 14400k + KERNEL_SUFFIX := -uImage + UBINIZE_OPTS := -E 5 + DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct +endef +TARGET_DEVICES += extreme_ap3935 + define Device/linksys_ea7500-v1 $(call Device/LegacyImage) $(Device/kernel-size-migration) diff --git a/target/linux/ipq806x/patches-6.1/0067-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/ipq806x/patches-6.1/0067-generic-Mangle-bootloader-s-kernel-arguments.patch index 0305b7e48437ba..4e47c390a2393b 100644 --- a/target/linux/ipq806x/patches-6.1/0067-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/ipq806x/patches-6.1/0067-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -259,7 +259,7 @@ Signed-off-by: Adrian Panella static int kernel_init(void *); extern void init_IRQ(void); -@@ -991,6 +995,18 @@ asmlinkage __visible void __init __no_sa +@@ -995,6 +999,18 @@ asmlinkage __visible void __init __no_sa pr_notice("Kernel command line: %s\n", saved_command_line); /* parameters may set static keys */ jump_label_init(); diff --git a/target/linux/ipq806x/patches-6.1/700-01-net-introduce-napi_is_scheduled-helper.patch b/target/linux/ipq806x/patches-6.1/700-01-net-introduce-napi_is_scheduled-helper.patch index 9694bf1144fd41..35c0d850cd77a2 100644 --- a/target/linux/ipq806x/patches-6.1/700-01-net-introduce-napi_is_scheduled-helper.patch +++ b/target/linux/ipq806x/patches-6.1/700-01-net-introduce-napi_is_scheduled-helper.patch @@ -66,7 +66,7 @@ Signed-off-by: Christian Marangi /** --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6562,7 +6562,7 @@ static int __napi_poll(struct napi_struc +@@ -6591,7 +6591,7 @@ static int __napi_poll(struct napi_struc * accidentally calling ->poll() when NAPI is not scheduled. */ work = 0; diff --git a/target/linux/ipq806x/patches-6.1/700-02-net-stmmac-move-TX-timer-arm-after-DMA-enable.patch b/target/linux/ipq806x/patches-6.1/700-02-net-stmmac-move-TX-timer-arm-after-DMA-enable.patch index 2b52398425724e..085d38a79a777f 100644 --- a/target/linux/ipq806x/patches-6.1/700-02-net-stmmac-move-TX-timer-arm-after-DMA-enable.patch +++ b/target/linux/ipq806x/patches-6.1/700-02-net-stmmac-move-TX-timer-arm-after-DMA-enable.patch @@ -36,7 +36,7 @@ Signed-off-by: Christian Marangi __netif_tx_unlock_bh(netdev_get_tx_queue(priv->dev, queue)); -@@ -5474,12 +5475,13 @@ static int stmmac_napi_poll_tx(struct na +@@ -5475,12 +5476,13 @@ static int stmmac_napi_poll_tx(struct na struct stmmac_channel *ch = container_of(napi, struct stmmac_channel, tx_napi); struct stmmac_priv *priv = ch->priv_data; @@ -51,7 +51,7 @@ Signed-off-by: Christian Marangi work_done = min(work_done, budget); if (work_done < budget && napi_complete_done(napi, work_done)) { -@@ -5490,6 +5492,10 @@ static int stmmac_napi_poll_tx(struct na +@@ -5491,6 +5493,10 @@ static int stmmac_napi_poll_tx(struct na spin_unlock_irqrestore(&ch->lock, flags); } @@ -62,7 +62,7 @@ Signed-off-by: Christian Marangi return work_done; } -@@ -5499,11 +5505,12 @@ static int stmmac_napi_poll_rxtx(struct +@@ -5500,11 +5506,12 @@ static int stmmac_napi_poll_rxtx(struct container_of(napi, struct stmmac_channel, rxtx_napi); struct stmmac_priv *priv = ch->priv_data; int rx_done, tx_done, rxtx_done; @@ -76,7 +76,7 @@ Signed-off-by: Christian Marangi tx_done = min(tx_done, budget); rx_done = stmmac_rx_zc(priv, budget, chan); -@@ -5528,6 +5535,10 @@ static int stmmac_napi_poll_rxtx(struct +@@ -5529,6 +5536,10 @@ static int stmmac_napi_poll_rxtx(struct spin_unlock_irqrestore(&ch->lock, flags); } diff --git a/target/linux/ixp4xx/Makefile b/target/linux/ixp4xx/Makefile new file mode 100644 index 00000000000000..6cd30877eeeecd --- /dev/null +++ b/target/linux/ixp4xx/Makefile @@ -0,0 +1,28 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2006-2023 OpenWrt.org + +include $(TOPDIR)/rules.mk + +ARCH:=armeb +BOARD:=ixp4xx +BOARDNAME:=Intel XScale IXP4xx +FEATURES:=dt squashfs gpio +CPU_TYPE:=xscale + +KERNEL_PATCHVER:=6.1 + +define Target/Description + Build firmware images for the IXP4xx XScale CPU +endef + +KERNELNAME:=zImage dtbs + +include $(INCLUDE_DIR)/target.mk + +DEFAULT_PACKAGES += fconfig \ + kmod-crypto-hw-ixp4xx \ + kmod-usb-ledtrig-usbport \ + kmod-leds-gpio + +$(eval $(call BuildTarget)) diff --git a/target/linux/ixp4xx/base-files/etc/board.d/02_network b/target/linux/ixp4xx/base-files/etc/board.d/02_network new file mode 100644 index 00000000000000..864328d6bcf19f --- /dev/null +++ b/target/linux/ixp4xx/base-files/etc/board.d/02_network @@ -0,0 +1,26 @@ +# SPDX-License-Identifier: GPL-2.0-only +. /lib/functions/uci-defaults.sh + +board_config_update + +case "$(board_name)" in +gateworks,gw2348|\ +gateworks,gw2358) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ;; +linksys,nslu2) + ucidef_set_interface_lan "eth0" "dhcp" + ;; +usr,usr8200) + # LAN ports connected to eth1 thru the MV88E6060 DSA switch + ucidef_set_interface "eth" device "eth1" protocol "none" + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "eth0" + ;; +*) + ucidef_set_interface_lan "eth0" "dhcp" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/ixp4xx/base-files/lib/preinit/05_set_ether_mac_ixp4xx b/target/linux/ixp4xx/base-files/lib/preinit/05_set_ether_mac_ixp4xx new file mode 100644 index 00000000000000..9e7ff46298301d --- /dev/null +++ b/target/linux/ixp4xx/base-files/lib/preinit/05_set_ether_mac_ixp4xx @@ -0,0 +1,38 @@ +#!/bin/sh +. /lib/functions.sh +. /lib/functions/system.sh + +set_from_redboot () { + for npe in eth0 eth1 eth2 + do + if ip link show dev $npe > /dev/null 2>&1; then + ip link set dev $npe address $(fconfig -s -r -d /dev/$1 -n npe_"$npe"_esa) + fi + done + + # Devices with MAC address set blank: set a dummy value. + if [ "$(ip link show dev eth0 2>/dev/null | grep -c 00:00:00:00:00:00)" = "1" ]; then + ip link set dev eth0 address 00:11:22:33:44:55 + fi + if [ "$(ip link show dev eth1 2>/dev/null | grep -c 00:00:00:00:00:00)" = "1" ]; then + ip link set dev eth0 address 00:11:22:33:44:56 + fi +} + +set_from_sysconf () { + ip link set dev eth0 address $(mtd_get_mac_ascii SysConf hw_addr) +} + +set_ether_mac () { + RBC="$(grep "RedBoot config" /proc/mtd | cut -d: -f1)" + if [ ! -z $RBC ] ; then + set_from_redboot $RBC + else + SYSC="$(grep "SysConf" /proc/mtd | cut -d: -f1)" + if [ ! -z $SYSC ] ; then + set_from_sysconf + fi + fi +} + +boot_hook_add preinit_main set_ether_mac diff --git a/target/linux/ixp4xx/config-6.1 b/target/linux/ixp4xx/config-6.1 new file mode 100644 index 00000000000000..4c4aa11969ea6a --- /dev/null +++ b/target/linux/ixp4xx/config-6.1 @@ -0,0 +1,253 @@ +CONFIG_ALIGNMENT_TRAP=y +CONFIG_AMD_PHY=y +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_IXP4XX=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MULTIPLATFORM=y +CONFIG_ARCH_MULTI_CPU_AUTO=y +# CONFIG_ARCH_MULTI_V4 is not set +# CONFIG_ARCH_MULTI_V4T is not set +CONFIG_ARCH_MULTI_V4_V5=y +CONFIG_ARCH_MULTI_V5=y +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARM=y +CONFIG_ARM_APPENDED_DTB=y +# CONFIG_ARM_ATAG_DTB_COMPAT is not set +CONFIG_ARM_HAS_GROUP_RELOCS=y +CONFIG_ARM_L1_CACHE_SHIFT=5 +CONFIG_ARM_PATCH_PHYS_VIRT=y +CONFIG_ARM_THUMB=y +CONFIG_ARM_UNWIND=y +CONFIG_ATA=y +CONFIG_ATAGS=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_MQ_PCI=y +CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y +CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" +CONFIG_CC_NO_ARRAY_BOUNDS=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV5T=y +CONFIG_CPU_BIG_ENDIAN=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_ENDIAN_BE32=y +CONFIG_CPU_PABRT_LEGACY=y +CONFIG_CPU_THUMB_CAPABLE=y +CONFIG_CPU_TLB_V4WBI=y +CONFIG_CPU_USE_DOMAINS=y +CONFIG_CPU_XSCALE=y +CONFIG_CRC16=y +CONFIG_CRYPTO_AUTHENC=m +CONFIG_CRYPTO_CBC=m +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_DES=m +CONFIG_CRYPTO_DEV_IXP4XX=m +CONFIG_CRYPTO_ECB=m +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_LIB_DES=m +CONFIG_CRYPTO_LIB_SHA1=y +CONFIG_CRYPTO_LIB_UTILS=y +CONFIG_CRYPTO_RNG2=y +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_LL_INCLUDE="debug/8250.S" +CONFIG_DEBUG_UART_8250=y +CONFIG_DEBUG_UART_8250_SHIFT=2 +CONFIG_DEBUG_UART_PHYS=0xc8000003 +CONFIG_DEBUG_UART_VIRT=0xfec00003 +CONFIG_DMA_OPS=y +CONFIG_DTC=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EXCLUSIVE_SYSTEM_RAM=y +CONFIG_EXT4_FS=y +# CONFIG_FARSYNC is not set +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FORCE_PCI=y +CONFIG_FS_IOMAP=y +CONFIG_FS_MBCACHE=y +CONFIG_FWNODE_MDIO=y +CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_FW_LOADER_SYSFS=y +CONFIG_GCC11_NO_ARRAY_BOUNDS=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GLOB=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_CDEV=y +CONFIG_GPIO_GENERIC=y +CONFIG_GPIO_GW_PLD=y +CONFIG_GPIO_IXP4XX=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HDLC=y +CONFIG_HWMON=y +CONFIG_HWMON_VID=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_IXP4XX=y +CONFIG_HZ_FIXED=0 +CONFIG_HZ_PERIODIC=y +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_GPIO=y +CONFIG_I2C_IOP3XX=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INTEL_IXP4XX_EB=y +CONFIG_IRQCHIP=y +CONFIG_IRQSTACKS=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +# CONFIG_IWMMXT is not set +CONFIG_IXP4XX_ETH=y +CONFIG_IXP4XX_HSS=y +CONFIG_IXP4XX_IRQ=y +CONFIG_IXP4XX_NPE=y +CONFIG_IXP4XX_QMGR=y +CONFIG_IXP4XX_TIMER=y +CONFIG_IXP4XX_WATCHDOG=y +CONFIG_JBD2=y +CONFIG_LEDS_GPIO=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_LIBFDT=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_DEVRES=y +CONFIG_MEMFD_CREATE=y +CONFIG_MFD_SYSCON=y +CONFIG_MIGRATION=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MTD_CFI_ADV_OPTIONS=y +# CONFIG_MTD_CFI_GEOMETRY is not set +CONFIG_MTD_OTP=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_PHYSMAP_IXP4XX=y +CONFIG_MTD_REDBOOT_PARTS=y +CONFIG_MTD_SPLIT_FIRMWARE=y +CONFIG_MTD_SPLIT_FIRMWARE_NAME="linux" +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_KUSER_HELPERS=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_NET_DSA=y +CONFIG_NET_DSA_MV88E6060=y +CONFIG_NET_PTP_CLASSIFY=y +CONFIG_NET_SELFTESTS=y +CONFIG_NET_VENDOR_XSCALE=y +CONFIG_NLS=y +CONFIG_NVMEM=y +CONFIG_NVMEM_SYSFS=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_KOBJ=y +CONFIG_OF_MDIO=y +# CONFIG_OLD_SIGACTION is not set +# CONFIG_OLD_SIGSUSPEND3 is not set +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PAGE_POOL=y +CONFIG_PAGE_SIZE_LESS_THAN_256KB=y +CONFIG_PAGE_SIZE_LESS_THAN_64KB=y +CONFIG_PATA_IXP4XX_CF=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DOMAINS_GENERIC=y +CONFIG_PCI_IXP4XX=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_GPIO=y +CONFIG_PREEMPT_NONE_BUILD=y +CONFIG_PTP_1588_CLOCK_OPTIONAL=y +CONFIG_RANDSTRUCT_NONE=y +CONFIG_RATIONAL=y +CONFIG_REALTEK_PHY=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_MMIO=y +CONFIG_RUST_IS_AVAILABLE=y +CONFIG_SCSI=y +CONFIG_SCSI_COMMON=y +# CONFIG_SERIAL_8250_EXAR is not set +# CONFIG_SERIAL_8250_FSL is not set +# CONFIG_SERIAL_8250_PCI is not set +# CONFIG_SERIAL_8250_PERICOM is not set +CONFIG_SERIAL_MCTRL_GPIO=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SG_POOL=y +CONFIG_SOFTIRQ_ON_OWN_STACK=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPLIT_PTLOCK_CPUS=999999 +CONFIG_SRCU=y +CONFIG_SWPHY=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_THREAD_INFO_IN_TASK=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TINY_SRCU=y +CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +CONFIG_UNWINDER_ARM=y +CONFIG_USB=y +CONFIG_USB_COMMON=y +CONFIG_USB_EHCI_BIG_ENDIAN_DESC=y +CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_HCD_PLATFORM=y +CONFIG_USB_EHCI_PCI=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PCI=y +# CONFIG_USB_OHCI_HCD_PLATFORM is not set +CONFIG_USB_PCI=y +CONFIG_USB_STORAGE=y +CONFIG_USB_SUPPORT=y +CONFIG_USB_UHCI_HCD=y +CONFIG_USE_OF=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_WAN=y +CONFIG_WATCHDOG_CORE=y +CONFIG_WATCHDOG_NOWAYOUT=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 diff --git a/target/linux/ixp4xx/image/Makefile b/target/linux/ixp4xx/image/Makefile new file mode 100644 index 00000000000000..c6d4817c966f7c --- /dev/null +++ b/target/linux/ixp4xx/image/Makefile @@ -0,0 +1,90 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2006-2021 OpenWrt.org + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/image.mk + +# Cook a Linksys NSLU2 etc image +define Build/linksys-ixp425-image + touch $@.null-initrd + $(TOPDIR)/scripts/slugimage.pl -L $(STAGING_DIR_IMAGE)/apex/apex-$(1)-armeb.bin -k $@ -r $@.null-initrd -p -o $@.new + mv $@.new $@ +endef + +# Build sysupgrade image +define BuildFirmware/Generic + dd if=$(KDIR)/zImage of=$(KDIR)/zImage.pad bs=64k conv=sync; \ + dd if=$(KDIR)/root.$(1) of=$(KDIR)/root.$(1).pad bs=128k conv=sync; \ + sh $(TOPDIR)/scripts/combined-image.sh \ + $(KDIR)/zImage.pad \ + $(KDIR)/root.$(1).pad \ + $(BIN_DIR)/$(IMG_PREFIX)-$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))-sysupgrade.bin +endef + +define Image/Build + $(call Image/Build/$(1),$(1)) + $(call BuildFirmware/Generic,$(1)) +endef + +define Device/Default + PROFILES := Default + KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) + KERNEL_NAME := zImage + KERNEL := kernel-bin | append-dtb + BLOCKSIZE := 128k +endef + +define Device/gateworks_avila + DEVICE_VENDOR := Gateworks + DEVICE_MODEL := Avila GW2348-4 + DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-ds1672 kmod-eeprom-at24 kmod-hwmon-ad7418 + DEVICE_DTS := intel-ixp42x-gateworks-gw2348 + KERNEL := kernel-bin | append-dtb + IMAGES := kernel.bin rootfs.bin + IMAGE/kernel.bin := append-kernel + IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k +endef +TARGET_DEVICES += gateworks_avila + +define Device/gateworks_cambria + DEVICE_VENDOR := Gateworks + DEVICE_MODEL := Cambria GW2358-4 + DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-ds1672 kmod-eeprom-at24 kmod-hwmon-ad7418 + DEVICE_DTS := intel-ixp43x-gateworks-gw2358 + KERNEL := kernel-bin | append-dtb + IMAGES := kernel.bin rootfs.bin + IMAGE/kernel.bin := append-kernel + IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k +endef +TARGET_DEVICES += gateworks_cambria + +define Device/linksys_nslu2 + DEVICE_VENDOR := Linksys + DEVICE_MODEL := NSLU2 + # USB2 is compiled in and needs no package + DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-x1205 + # Only 32 MB of RAM so not building by default + DEFAULT := n + DEVICE_DTS := intel-ixp42x-linksys-nslu2 + KERNEL := kernel-bin | append-dtb + IMAGES := factory.bin + # This has to boot from harddisk so just append the kernel + IMAGE/factory.bin := append-kernel | linksys-ixp425-image "nslu2" +endef +TARGET_DEVICES += linksys_nslu2 + +define Device/usrobotics_usr8200 + DEVICE_VENDOR := USRobotics + DEVICE_MODEL := USR8200 + # USB2 is compiled in and needs no package + DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-r7301 kmod-firewire kmod-firewire-ohci + DEVICE_DTS := intel-ixp42x-usrobotics-usr8200 + KERNEL := kernel-bin | append-dtb + IMAGES := kernel.bin rootfs.bin + IMAGE/kernel.bin := append-kernel + IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k +endef +TARGET_DEVICES += usrobotics_usr8200 + +$(eval $(call BuildImage)) diff --git a/target/linux/ixp4xx/patches-6.1/0002-gpio-ixp4xx-Handle-clock-output-on-pin-14-and-15.patch b/target/linux/ixp4xx/patches-6.1/0002-gpio-ixp4xx-Handle-clock-output-on-pin-14-and-15.patch new file mode 100644 index 00000000000000..38adecd64fff73 --- /dev/null +++ b/target/linux/ixp4xx/patches-6.1/0002-gpio-ixp4xx-Handle-clock-output-on-pin-14-and-15.patch @@ -0,0 +1,93 @@ +From fc58944733a2082e3290eda240eb3247a00ad73a Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Thu, 21 Sep 2023 00:12:42 +0200 +Subject: [PATCH] gpio: ixp4xx: Handle clock output on pin 14 and 15 + +This makes it possible to provide basic clock output on pins +14 and 15. The clocks are typically used by random electronics, +not modeled in the device tree, so they just need to be provided +on request. + +In order to not disturb old systems that require that the +hardware defaults are kept in the clock setting bits, we only +manipulate these if either device tree property is present. +Once we know a device needs one of the clocks we can set it +in the device tree. + +Signed-off-by: Linus Walleij +--- + drivers/gpio/gpio-ixp4xx.c | 49 +++++++++++++++++++++++++++++++++++++- + 1 file changed, 48 insertions(+), 1 deletion(-) + +--- a/drivers/gpio/gpio-ixp4xx.c ++++ b/drivers/gpio/gpio-ixp4xx.c +@@ -38,6 +38,18 @@ + #define IXP4XX_GPIO_STYLE_MASK GENMASK(2, 0) + #define IXP4XX_GPIO_STYLE_SIZE 3 + ++/* ++ * Clock output control register defines. ++ */ ++#define IXP4XX_GPCLK_CLK0DC_SHIFT 0 ++#define IXP4XX_GPCLK_CLK0TC_SHIFT 4 ++#define IXP4XX_GPCLK_CLK0_MASK GENMASK(7, 0) ++#define IXP4XX_GPCLK_MUX14 BIT(8) ++#define IXP4XX_GPCLK_CLK1DC_SHIFT 16 ++#define IXP4XX_GPCLK_CLK1TC_SHIFT 20 ++#define IXP4XX_GPCLK_CLK1_MASK GENMASK(23, 16) ++#define IXP4XX_GPCLK_MUX15 BIT(24) ++ + /** + * struct ixp4xx_gpio - IXP4 GPIO state container + * @dev: containing device for this instance +@@ -203,6 +215,8 @@ static int ixp4xx_gpio_probe(struct plat + struct ixp4xx_gpio *g; + struct gpio_irq_chip *girq; + struct device_node *irq_parent; ++ bool clk_14, clk_15; ++ u32 val; + int ret; + + g = devm_kzalloc(dev, sizeof(*g), GFP_KERNEL); +@@ -233,7 +247,40 @@ static int ixp4xx_gpio_probe(struct plat + */ + if (of_machine_is_compatible("dlink,dsm-g600-a") || + of_machine_is_compatible("iom,nas-100d")) +- __raw_writel(0x0, g->base + IXP4XX_REG_GPCLK); ++ val = 0; ++ else ++ val = __raw_readl(g->base + IXP4XX_REG_GPCLK); ++ ++ /* ++ * If either clock output is enabled explicitly in the device tree ++ * we take full control of the clock by masking off all bits for ++ * the clock control and selectively enabling them. Otherwise ++ * we leave the hardware default settings. ++ * ++ * Enable clock outputs with default timings of requested clock. ++ * If you need control over TC and DC, add these to the device ++ * tree bindings and use them here. ++ */ ++ clk_14 = of_property_read_bool(np, "intel,ixp4xx-gpio14-clkout"); ++ clk_15 = of_property_read_bool(np, "intel,ixp4xx-gpio15-clkout"); ++ if (clk_14 || clk_15) { ++ val &= ~(IXP4XX_GPCLK_MUX14 | IXP4XX_GPCLK_MUX15); ++ val &= ~IXP4XX_GPCLK_CLK0_MASK; ++ val &= ~IXP4XX_GPCLK_CLK1_MASK; ++ if (clk_14) { ++ val |= (0 << IXP4XX_GPCLK_CLK0DC_SHIFT); ++ val |= (1 << IXP4XX_GPCLK_CLK0TC_SHIFT); ++ val |= IXP4XX_GPCLK_MUX14; ++ } ++ ++ if (clk_15) { ++ val |= (0 << IXP4XX_GPCLK_CLK1DC_SHIFT); ++ val |= (1 << IXP4XX_GPCLK_CLK1TC_SHIFT); ++ val |= IXP4XX_GPCLK_MUX15; ++ } ++ } ++ ++ __raw_writel(val, g->base + IXP4XX_REG_GPCLK); + + /* + * This is a very special big-endian ARM issue: when the IXP4xx is diff --git a/target/linux/ixp4xx/patches-6.1/0004-ARM-dts-ixp4xx-Add-USRobotics-USR8200-device-tree.patch b/target/linux/ixp4xx/patches-6.1/0004-ARM-dts-ixp4xx-Add-USRobotics-USR8200-device-tree.patch new file mode 100644 index 00000000000000..0ae80d170e49f6 --- /dev/null +++ b/target/linux/ixp4xx/patches-6.1/0004-ARM-dts-ixp4xx-Add-USRobotics-USR8200-device-tree.patch @@ -0,0 +1,260 @@ +From 02693ffdb93bffcbe772bd91a399dabd123b8c19 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Tue, 19 Sep 2023 16:02:15 +0200 +Subject: [PATCH 4/4] ARM: dts: ixp4xx: Add USRobotics USR8200 device tree + +This is a USRobotics NAS/Firewall/router that has been supported +by OpenWrt in the past. It had dedicated users so let's get it +properly supported. + +Signed-off-by: Linus Walleij +--- + arch/arm/boot/dts/Makefile | 3 +- + .../dts/intel-ixp42x-usrobotics-usr8200.dts | 229 ++++++++++++++++++ + 2 files changed, 231 insertions(+), 1 deletion(-) + create mode 100644 arch/arm/boot/dts/intel-ixp42x-usrobotics-usr8200.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -292,7 +292,8 @@ dtb-$(CONFIG_ARCH_IXP4XX) += \ + intel-ixp43x-gateworks-gw2358.dtb \ + intel-ixp42x-netgear-wg302v1.dtb \ + intel-ixp42x-arcom-vulcan.dtb \ +- intel-ixp42x-gateway-7001.dtb ++ intel-ixp42x-gateway-7001.dtb \ ++ intel-ixp42x-usrobotics-usr8200.dtb + dtb-$(CONFIG_ARCH_KEYSTONE) += \ + keystone-k2hk-evm.dtb \ + keystone-k2l-evm.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/intel-ixp42x-usrobotics-usr8200.dts +@@ -0,0 +1,229 @@ ++// SPDX-License-Identifier: ISC ++/* ++ * Device Tree file for the USRobotics USR8200 firewall ++ * VPN and NAS. Based on know-how from Peter Denison. ++ * ++ * This machine is based on IXP422, the USR internal codename ++ * is "Jeeves". ++ */ ++ ++/dts-v1/; ++ ++#include "intel-ixp42x.dtsi" ++#include ++ ++/ { ++ model = "USRobotics USR8200"; ++ compatible = "usr,usr8200", "intel,ixp42x"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ memory@0 { ++ device_type = "memory"; ++ reg = <0x00000000 0x4000000>; ++ }; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200n8"; ++ stdout-path = "uart1:115200n8"; ++ }; ++ ++ aliases { ++ /* These are switched around */ ++ serial0 = &uart1; ++ serial1 = &uart0; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ieee1394_led: led-1394 { ++ label = "usr8200:green:1394"; ++ gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; ++ default-state = "off"; ++ }; ++ usb1_led: led-usb1 { ++ label = "usr8200:green:usb1"; ++ gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; ++ default-state = "off"; ++ }; ++ usb2_led: led-usb2 { ++ label = "usr8200:green:usb2"; ++ gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; ++ default-state = "off"; ++ }; ++ wireless_led: led-wireless { ++ /* ++ * This LED is mounted inside the case but cannot be ++ * seen from the outside: probably USR planned at one ++ * point for the device to have a wireless card, then ++ * changed their mind and didn't mount it, leaving the ++ * LED in place. ++ */ ++ label = "usr8200:green:wireless"; ++ gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; ++ default-state = "off"; ++ }; ++ pwr_led: led-pwr { ++ label = "usr8200:green:pwr"; ++ gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ linux,default-trigger = "heartbeat"; ++ }; ++ }; ++ ++ gpio_keys { ++ compatible = "gpio-keys"; ++ ++ button-reset { ++ wakeup-source; ++ linux,code = ; ++ label = "reset"; ++ gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ soc { ++ bus@c4000000 { ++ flash@0,0 { ++ compatible = "intel,ixp4xx-flash", "cfi-flash"; ++ bank-width = <2>; ++ /* Enable writes on the expansion bus */ ++ intel,ixp4xx-eb-write-enable = <1>; ++ /* 16 MB of Flash mapped in at CS0 */ ++ reg = <0 0x00000000 0x1000000>; ++ ++ partitions { ++ compatible = "redboot-fis"; ++ /* Eraseblock at 0x0fe0000 */ ++ fis-index-block = <0x7f>; ++ }; ++ }; ++ rtc@2,0 { ++ /* EPSON RTC7301 DG DIL-capsule */ ++ compatible = "epson,rtc7301dg"; ++ /* ++ * These timing settings were found in the boardfile patch: ++ * IXP4XX_EXP_CS2 = 0x3fff000 | IXP4XX_EXP_BUS_SIZE(0) | IXP4XX_EXP_BUS_WR_EN | ++ * IXP4XX_EXP_BUS_CS_EN | IXP4XX_EXP_BUS_BYTE_EN; ++ */ ++ intel,ixp4xx-eb-t1 = <0>; // no cycles extra address phase ++ intel,ixp4xx-eb-t2 = <0>; // no cycles extra setup phase ++ intel,ixp4xx-eb-t3 = <15>; // 15 cycles extra strobe phase ++ intel,ixp4xx-eb-t4 = <3>; // 3 cycles extra hold phase ++ intel,ixp4xx-eb-t5 = <15>; // 15 cycles extra recovery phase ++ intel,ixp4xx-eb-cycle-type = <0>; // Intel cycle ++ intel,ixp4xx-eb-byte-access-on-halfword = <0>; ++ intel,ixp4xx-eb-mux-address-and-data = <0>; ++ intel,ixp4xx-eb-ahb-split-transfers = <0>; ++ intel,ixp4xx-eb-write-enable = <1>; ++ intel,ixp4xx-eb-byte-access = <1>; ++ /* 512 bytes at CS2 */ ++ reg = <2 0x00000000 0x0000200>; ++ reg-io-width = <1>; ++ native-endian; ++ /* FIXME: try to check if there is an IRQ for the RTC? */ ++ }; ++ }; ++ ++ pci@c0000000 { ++ status = "okay"; ++ ++ /* ++ * Taken from USR8200 boardfile from OpenWrt ++ * ++ * We have 3 slots (IDSEL) with partly swizzled IRQs on slot 16. ++ * We assume the same IRQ for all pins on the remaining slots, that ++ * is what the boardfile was doing. ++ */ ++ #interrupt-cells = <1>; ++ interrupt-map-mask = <0xf800 0 0 7>; ++ interrupt-map = ++ /* IDSEL 14 used for "Wireless" in the board file */ ++ <0x7000 0 0 1 &gpio0 7 IRQ_TYPE_LEVEL_LOW>, /* INT A on slot 14 is irq 7 */ ++ /* IDSEL 15 used for VIA VT6307 IEEE 1394 Firewire */ ++ <0x7800 0 0 1 &gpio0 8 IRQ_TYPE_LEVEL_LOW>, /* INT A on slot 15 is irq 8 */ ++ /* IDSEL 16 used for VIA VT6202 USB 2.0 4+1 */ ++ <0x8000 0 0 1 &gpio0 11 IRQ_TYPE_LEVEL_LOW>, /* INT A on slot 16 is irq 11 */ ++ <0x8000 0 0 2 &gpio0 10 IRQ_TYPE_LEVEL_LOW>, /* INT B on slot 16 is irq 10 */ ++ <0x8000 0 0 3 &gpio0 9 IRQ_TYPE_LEVEL_LOW>; /* INT C on slot 16 is irq 9 */ ++ }; ++ ++ gpio@c8004000 { ++ /* Enable clock out on GPIO 15 */ ++ intel,ixp4xx-gpio15-clkout; ++ }; ++ ++ /* EthB WAN */ ++ ethernet@c8009000 { ++ status = "okay"; ++ queue-rx = <&qmgr 3>; ++ queue-txready = <&qmgr 20>; ++ phy-mode = "rgmii"; ++ phy-handle = <&phy9>; ++ ++ mdio { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ phy9: ethernet-phy@9 { ++ reg = <9>; ++ }; ++ ++ /* The switch uses MDIO addresses 16 thru 31 */ ++ switch@16 { ++ compatible = "marvell,mv88e6060"; ++ reg = <16>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan1"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan2"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan3"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan4"; ++ }; ++ ++ port@5 { ++ /* Port 5 is the CPU port according to the MV88E6060 datasheet */ ++ reg = <5>; ++ phy-mode = "rgmii-id"; ++ ethernet = <ðc>; ++ label = "cpu"; ++ fixed-link { ++ speed = <100>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++ }; ++ }; ++ ++ /* EthC LAN connected to the Marvell DSA Switch */ ++ ethc: ethernet@c800a000 { ++ status = "okay"; ++ queue-rx = <&qmgr 4>; ++ queue-txready = <&qmgr 21>; ++ phy-mode = "rgmii"; ++ fixed-link { ++ speed = <100>; ++ full-duplex; ++ }; ++ }; ++ }; ++}; diff --git a/target/linux/ixp4xx/patches-6.1/0005-net-ixp4xx_eth-Support-changing-the-MTU.patch b/target/linux/ixp4xx/patches-6.1/0005-net-ixp4xx_eth-Support-changing-the-MTU.patch new file mode 100644 index 00000000000000..4abc6cdbe4e087 --- /dev/null +++ b/target/linux/ixp4xx/patches-6.1/0005-net-ixp4xx_eth-Support-changing-the-MTU.patch @@ -0,0 +1,132 @@ +From 6599df775e2cbb4988bdf8239acf4fbec70e5ef9 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Sat, 23 Sep 2023 20:38:22 +0200 +Subject: [PATCH 3/4] net: ixp4xx_eth: Support changing the MTU + +As we don't specify the MTU in the driver, the framework +will fall back to 1500 bytes and this doesn't work very +well when we try to attach a DSA switch: + + eth1: mtu greater than device maximum + ixp4xx_eth c800a000.ethernet eth1: error -22 setting + MTU to 1504 to include DSA overhead + +After locating an out-of-tree patch in OpenWrt I found +suitable code to set the MTU on the interface and ported +it and updated it. Now the MTU gets set properly. + +Reviewed-by: Jacob Keller +Signed-off-by: Linus Walleij +--- + drivers/net/ethernet/xscale/ixp4xx_eth.c | 65 +++++++++++++++++++++++- + 1 file changed, 64 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c ++++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -63,7 +64,15 @@ + + #define POOL_ALLOC_SIZE (sizeof(struct desc) * (RX_DESCS + TX_DESCS)) + #define REGS_SIZE 0x1000 +-#define MAX_MRU 1536 /* 0x600 */ ++ ++/* MRU is said to be 14320 in a code dump, the SW manual says that ++ * MRU/MTU is 16320 and includes VLAN and ethernet headers. ++ * See "IXP400 Software Programmer's Guide" section 10.3.2, page 161. ++ * ++ * FIXME: we have chosen the safe default (14320) but if you can test ++ * jumboframes, experiment with 16320 and see what happens! ++ */ ++#define MAX_MRU (14320 - VLAN_ETH_HLEN) + #define RX_BUFF_SIZE ALIGN((NET_IP_ALIGN) + MAX_MRU, 4) + + #define NAPI_WEIGHT 16 +@@ -1182,6 +1191,54 @@ static void destroy_queues(struct port * + } + } + ++static int ixp4xx_do_change_mtu(struct net_device *dev, int new_mtu) ++{ ++ struct port *port = netdev_priv(dev); ++ struct npe *npe = port->npe; ++ int framesize, chunks; ++ struct msg msg = {}; ++ ++ /* adjust for ethernet headers */ ++ framesize = new_mtu + VLAN_ETH_HLEN; ++ /* max rx/tx 64 byte chunks */ ++ chunks = DIV_ROUND_UP(framesize, 64); ++ ++ msg.cmd = NPE_SETMAXFRAMELENGTHS; ++ msg.eth_id = port->id; ++ ++ /* Firmware wants to know buffer size in 64 byte chunks */ ++ msg.byte2 = chunks << 8; ++ msg.byte3 = chunks << 8; ++ ++ msg.byte4 = msg.byte6 = framesize >> 8; ++ msg.byte5 = msg.byte7 = framesize & 0xff; ++ ++ if (npe_send_recv_message(npe, &msg, "ETH_SET_MAX_FRAME_LENGTH")) ++ return -EIO; ++ netdev_dbg(dev, "set MTU on NPE %s to %d bytes\n", ++ npe_name(npe), new_mtu); ++ ++ return 0; ++} ++ ++static int ixp4xx_eth_change_mtu(struct net_device *dev, int new_mtu) ++{ ++ int ret; ++ ++ /* MTU can only be changed when the interface is up. We also ++ * set the MTU from dev->mtu when opening the device. ++ */ ++ if (dev->flags & IFF_UP) { ++ ret = ixp4xx_do_change_mtu(dev, new_mtu); ++ if (ret < 0) ++ return ret; ++ } ++ ++ dev->mtu = new_mtu; ++ ++ return 0; ++} ++ + static int eth_open(struct net_device *dev) + { + struct port *port = netdev_priv(dev); +@@ -1232,6 +1289,8 @@ static int eth_open(struct net_device *d + if (npe_send_recv_message(port->npe, &msg, "ETH_SET_FIREWALL_MODE")) + return -EIO; + ++ ixp4xx_do_change_mtu(dev, dev->mtu); ++ + if ((err = request_queues(port)) != 0) + return err; + +@@ -1374,6 +1433,7 @@ static int eth_close(struct net_device * + static const struct net_device_ops ixp4xx_netdev_ops = { + .ndo_open = eth_open, + .ndo_stop = eth_close, ++ .ndo_change_mtu = ixp4xx_eth_change_mtu, + .ndo_start_xmit = eth_xmit, + .ndo_set_rx_mode = eth_set_mcast_list, + .ndo_eth_ioctl = eth_ioctl, +@@ -1488,6 +1548,9 @@ static int ixp4xx_eth_probe(struct platf + ndev->dev.dma_mask = dev->dma_mask; + ndev->dev.coherent_dma_mask = dev->coherent_dma_mask; + ++ ndev->min_mtu = ETH_MIN_MTU; ++ ndev->max_mtu = MAX_MRU; ++ + netif_napi_add_weight(ndev, &port->napi, eth_poll, NAPI_WEIGHT); + + if (!(port->npe = npe_request(NPE_ID(port->id)))) diff --git a/target/linux/ixp4xx/patches-6.1/0008-ARM-dts-usr8200-Fix-phy-registers.patch b/target/linux/ixp4xx/patches-6.1/0008-ARM-dts-usr8200-Fix-phy-registers.patch new file mode 100644 index 00000000000000..bf056b89a9e546 --- /dev/null +++ b/target/linux/ixp4xx/patches-6.1/0008-ARM-dts-usr8200-Fix-phy-registers.patch @@ -0,0 +1,67 @@ +From a1ab45966e5a21841af58742adf27725e523d303 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Sat, 14 Oct 2023 19:53:24 +0200 +Subject: [PATCH] ARM: dts: usr8200: Fix phy registers + +The MV88E6060 switch has internal PHY registers at MDIO +addresses 0x00..0x04. Tie each port to the corresponding +PHY. + +Signed-off-by: Linus Walleij +--- + .../dts/intel-ixp42x-usrobotics-usr8200.dts | 22 +++++++++++++++++++ + 1 file changed, 22 insertions(+) + +--- a/arch/arm/boot/dts/intel-ixp42x-usrobotics-usr8200.dts ++++ b/arch/arm/boot/dts/intel-ixp42x-usrobotics-usr8200.dts +@@ -165,6 +165,24 @@ + #address-cells = <1>; + #size-cells = <0>; + ++ /* ++ * PHY 0..4 are internal to the MV88E6060 switch but appear ++ * as independent devices. ++ */ ++ phy0: ethernet-phy@0 { ++ reg = <0>; ++ }; ++ phy1: ethernet-phy@1 { ++ reg = <1>; ++ }; ++ phy2: ethernet-phy@2 { ++ reg = <2>; ++ }; ++ phy3: ethernet-phy@3 { ++ reg = <3>; ++ }; ++ ++ /* Altima AMI101L used by the WAN port */ + phy9: ethernet-phy@9 { + reg = <9>; + }; +@@ -181,21 +199,25 @@ + port@0 { + reg = <0>; + label = "lan1"; ++ phy-handle = <&phy0>; + }; + + port@1 { + reg = <1>; + label = "lan2"; ++ phy-handle = <&phy1>; + }; + + port@2 { + reg = <2>; + label = "lan3"; ++ phy-handle = <&phy2>; + }; + + port@3 { + reg = <3>; + label = "lan4"; ++ phy-handle = <&phy3>; + }; + + port@5 { diff --git a/target/linux/ixp4xx/patches-6.1/301-ARM-dts-ixp4xx-Boot-NSLU2-from-harddrive.patch b/target/linux/ixp4xx/patches-6.1/301-ARM-dts-ixp4xx-Boot-NSLU2-from-harddrive.patch new file mode 100644 index 00000000000000..ffd69a774c3c96 --- /dev/null +++ b/target/linux/ixp4xx/patches-6.1/301-ARM-dts-ixp4xx-Boot-NSLU2-from-harddrive.patch @@ -0,0 +1,24 @@ +From 2792791a19f90b0141ed2e781599ba0a42a8cfd5 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Mon, 29 May 2023 23:32:44 +0200 +Subject: [PATCH] ARM: dts: ixp4xx: Boot NSLU2 from harddrive + +This enforces harddrive boot on the NSLU2. The flash is too small +to hold any rootfs these days. + +Signed-off-by: Linus Walleij +--- + arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts ++++ b/arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts +@@ -21,7 +21,7 @@ + }; + + chosen { +- bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rw rootfstype=squashfs,jffs2 rootwait"; ++ bootargs = "console=ttyS0,115200n8 root=/dev/sda1 rw rootwait"; + stdout-path = "uart0:115200n8"; + }; + 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 c8e67537a94971..ba2b82dd670ae6 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 cd7b29ca6d1d60..b04efd8a846cc4 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 8eaf566b26144a..7e0f157bf323fe 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 b5e4537838bc91..3d56e76c46e77e 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 35caf647a71c0d..72f8c3bc6615cd 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 9a1c8b1bcb218d..775aab4ba96b60 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 650c8872c959ea..182b0c0bb183bf 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 dddf904af4c5d3..4825eb2952eae9 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 bb82da0870f4da..3f957c63a60408 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>; + }; + }; }; }; }; @@ -154,19 +166,8 @@ compatible = "pci1814,3592"; reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; - ralink,mtd-eeprom-swap; - nvmem-cells = <&macaddr_boardconfig_16>; + ralink,eeprom-swap; + 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 9d5595b6075c7d..52ba5e1a3bff42 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>; + }; + }; }; }; }; @@ -178,7 +188,7 @@ compatible = "pci1814,3592"; reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; - ralink,mtd-eeprom-swap; + ralink,eeprom-swap; }; }; @@ -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 a327635c3310d7..fb3363b2e2aab8 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 c48c9c0e7ba671..1f8db69f3096d0 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>; + }; + }; }; }; }; @@ -198,7 +208,7 @@ compatible = "pci0,0"; reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; - ralink,mtd-eeprom-swap; + ralink,eeprom-swap; }; }; @@ -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 12de92ec530522..d67efb4fca5f2f 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 e91c291e9a7571..41a0e1b74a963b 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>; + }; + }; }; }; }; @@ -224,7 +234,7 @@ nvmem-cells = <&macaddr_boardconfig_16>; nvmem-cell-names = "mac-address"; ralink,mtd-eeprom = <&boardconfig 0x410>; - ralink,mtd-eeprom-swap; + ralink,eeprom-swap; }; }; @@ -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 ea932d44b65d2c..4fb135763d5ba5 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>; + }; + }; }; }; }; @@ -242,7 +252,7 @@ compatible = "pci1814,3592"; reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; - ralink,mtd-eeprom-swap; + ralink,eeprom-swap; nvmem-cells = <&macaddr_boardconfig_16>; nvmem-cell-names = "mac-address"; }; @@ -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 83a303b9e821b2..d6a917057d71e5 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 343f3533d8be1a..935aa08cb90605 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 1a7a11db42068b..69685d801b8218 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>; + }; + }; }; }; }; @@ -220,10 +232,9 @@ compatible = "pci1814,3592"; reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; - ralink,mtd-eeprom-swap; - nvmem-cells = <&macaddr_boardconfig_16>; + ralink,eeprom-swap; + 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 381c3fc27e207d..71046cfd58c68a 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>; + }; + }; }; }; }; @@ -238,10 +249,9 @@ compatible = "pci1814,3091"; reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; - ralink,mtd-eeprom-swap; - nvmem-cells = <&macaddr_boardconfig_16>; + ralink,eeprom-swap; + 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 a30746cde2b430..cc15324b56e08b 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 31523eaae00340..cbe6c14c991fdc 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 7995b34971abb3..7929bde6cfe68b 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 5b7c10bb9dd49b..39d7b4908cd46e 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 e37f1ab37c837f..acb54ee80b3172 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/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch b/target/linux/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch index 9cd3b08b8e1231..bf3d848f41d97f 100644 --- a/target/linux/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch +++ b/target/linux/lantiq/patches-5.15/0001-MIPS-lantiq-add-pcie-driver.patch @@ -1470,7 +1470,7 @@ Signed-off-by: John Crispin + --- /dev/null +++ b/arch/mips/pci/ifxmips_pcie_ar10.h -@@ -0,0 +1,290 @@ +@@ -0,0 +1,305 @@ +/**************************************************************************** + Copyright (c) 2010 + Lantiq Deutschland GmbH @@ -1722,6 +1722,21 @@ Signed-off-by: John Crispin + return tbus_number; +} + ++static struct pci_dev *ifx_pci_get_slot(struct pci_bus *bus, unsigned int devfn) ++{ ++ struct pci_dev *dev; ++ ++ list_for_each_entry(dev, &bus->devices, bus_list) { ++ if (dev->devfn == devfn) ++ goto out; ++ } ++ ++ dev = NULL; ++ out: ++ pci_dev_get(dev); ++ return dev; ++} ++ +static inline u32 +ifx_pcie_bus_enum_hack(struct pci_bus *bus, u32 devfn, int where, u32 value, int pcie_port, int read) +{ @@ -1729,7 +1744,7 @@ Signed-off-by: John Crispin + u32 tvalue = value; + + /* Sanity check */ -+ pdev = pci_get_slot(bus, devfn); ++ pdev = ifx_pci_get_slot(bus, devfn); + if (pdev == NULL) { + return tvalue; + } @@ -3860,7 +3875,7 @@ Signed-off-by: John Crispin + --- /dev/null +++ b/arch/mips/pci/ifxmips_pcie_vr9.h -@@ -0,0 +1,269 @@ +@@ -0,0 +1,284 @@ +/**************************************************************************** + Copyright (c) 2010 + Lantiq Deutschland GmbH @@ -4094,6 +4109,21 @@ Signed-off-by: John Crispin + return tbus_number; +} + ++static inline struct pci_dev *ifx_pci_get_slot(struct pci_bus *bus, unsigned int devfn) ++{ ++ struct pci_dev *dev; ++ ++ list_for_each_entry(dev, &bus->devices, bus_list) { ++ if (dev->devfn == devfn) ++ goto out; ++ } ++ ++ dev = NULL; ++ out: ++ pci_dev_get(dev); ++ return dev; ++} ++ +static inline u32 +ifx_pcie_bus_enum_hack(struct pci_bus *bus, u32 devfn, int where, u32 value, int pcie_port, int read) +{ @@ -4101,7 +4131,7 @@ Signed-off-by: John Crispin + u32 tvalue = value; + + /* Sanity check */ -+ pdev = pci_get_slot(bus, devfn); ++ pdev = ifx_pci_get_slot(bus, devfn); + if (pdev == NULL) { + return tvalue; + } @@ -4165,7 +4195,7 @@ Signed-off-by: John Crispin +EXPORT_SYMBOL(pcibios_1st_host_bus_nr); --- /dev/null +++ b/arch/mips/pci/pcie-lantiq.h -@@ -0,0 +1,1301 @@ +@@ -0,0 +1,1316 @@ +/****************************************************************************** +** +** FILE NAME : ifxmips_pcie_reg.h @@ -5431,6 +5461,21 @@ Signed-off-by: John Crispin + return tbus_number; +} + ++static struct pci_dev *ifx_pci_get_slot(struct pci_bus *bus, unsigned int devfn) ++{ ++ struct pci_dev *dev; ++ ++ list_for_each_entry(dev, &bus->devices, bus_list) { ++ if (dev->devfn == devfn) ++ goto out; ++ } ++ ++ dev = NULL; ++ out: ++ pci_dev_get(dev); ++ return dev; ++} ++ +static inline u32 +ifx_pcie_bus_enum_hack(struct pci_bus *bus, u32 devfn, int where, u32 value, int pcie_port, int read) +{ @@ -5438,7 +5483,7 @@ Signed-off-by: John Crispin + u32 tvalue = value; + + /* Sanity check */ -+ pdev = pci_get_slot(bus, devfn); ++ pdev = ifx_pci_get_slot(bus, devfn); + if (pdev == NULL) { + return tvalue; + } @@ -5490,7 +5535,7 @@ Signed-off-by: John Crispin unsigned long type); --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h -@@ -1085,6 +1085,12 @@ +@@ -1086,6 +1086,12 @@ #define PCI_DEVICE_ID_SGI_IOC3 0x0003 #define PCI_DEVICE_ID_SGI_LITHIUM 0x1002 diff --git a/target/linux/lantiq/patches-5.15/0302-mtd-cfi_cmdset_0001-Disable-write-buffer-functions-i.patch b/target/linux/lantiq/patches-5.15/0302-mtd-cfi_cmdset_0001-Disable-write-buffer-functions-i.patch index 741011039eeb21..c43d9d4b355096 100644 --- a/target/linux/lantiq/patches-5.15/0302-mtd-cfi_cmdset_0001-Disable-write-buffer-functions-i.patch +++ b/target/linux/lantiq/patches-5.15/0302-mtd-cfi_cmdset_0001-Disable-write-buffer-functions-i.patch @@ -44,7 +44,7 @@ Signed-off-by: Aleksander Jan Bajkowski /* * Some chips power-up with all sectors locked by default. -@@ -1703,6 +1707,7 @@ static int cfi_intelext_write_words (str +@@ -1719,6 +1723,7 @@ static int cfi_intelext_write_words (str } @@ -52,7 +52,7 @@ Signed-off-by: Aleksander Jan Bajkowski static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, unsigned long adr, const struct kvec **pvec, unsigned long *pvec_seek, int len) -@@ -1931,6 +1936,7 @@ static int cfi_intelext_write_buffers (s +@@ -1947,6 +1952,7 @@ static int cfi_intelext_write_buffers (s return cfi_intelext_writev(mtd, &vec, 1, to, retlen); } diff --git a/target/linux/lantiq/xrx200/target.mk b/target/linux/lantiq/xrx200/target.mk index 6e01fc79e4759c..0f119edd6fa50a 100644 --- a/target/linux/lantiq/xrx200/target.mk +++ b/target/linux/lantiq/xrx200/target.mk @@ -1,7 +1,7 @@ ARCH:=mips SUBTARGET:=xrx200 BOARDNAME:=XRX200 -FEATURES+=atm nand ramdisk source-only +FEATURES+=atm nand ramdisk CPU_TYPE:=24kc DEFAULT_PACKAGES+=kmod-leds-gpio \ diff --git a/target/linux/layerscape/Makefile b/target/linux/layerscape/Makefile index 23672602529ef8..4ddd348d135ca5 100644 --- a/target/linux/layerscape/Makefile +++ b/target/linux/layerscape/Makefile @@ -8,6 +8,7 @@ BOARD:=layerscape BOARDNAME:=NXP Layerscape KERNEL_PATCHVER:=5.15 +KERNEL_TESTING_PATCHVER:=6.1 FEATURES:=squashfs nand usb pcie gpio fpu ubifs ext4 rootfs-part boot-part SUBTARGETS:=armv8_64b armv7 diff --git a/target/linux/layerscape/armv7/config-5.15 b/target/linux/layerscape/armv7/config-5.15 index b5df343f4eb905..121151f58ffbf4 100644 --- a/target/linux/layerscape/armv7/config-5.15 +++ b/target/linux/layerscape/armv7/config-5.15 @@ -562,7 +562,6 @@ CONFIG_SERIAL_XILINX_PS_UART=y CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y CONFIG_SGL_ALLOC=y CONFIG_SG_POOL=y -CONFIG_SLUB_DEBUG=y CONFIG_SMP=y CONFIG_SMP_ON_UP=y CONFIG_SMSC_PHY=y diff --git a/target/linux/layerscape/armv7/config-6.1 b/target/linux/layerscape/armv7/config-6.1 new file mode 100644 index 00000000000000..d60e5824db3935 --- /dev/null +++ b/target/linux/layerscape/armv7/config-6.1 @@ -0,0 +1,699 @@ +CONFIG_AD525X_DPOT=y +CONFIG_AD525X_DPOT_I2C=y +# CONFIG_AD525X_DPOT_SPI is not set +CONFIG_ALIGNMENT_TRAP=y +CONFIG_APDS9802ALS=y +CONFIG_AQUANTIA_PHY=y +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MULTIPLATFORM=y +CONFIG_ARCH_MULTI_V6_V7=y +CONFIG_ARCH_MULTI_V7=y +CONFIG_ARCH_MXC=y +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARM=y +CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y +CONFIG_ARM_CPUIDLE=y +CONFIG_ARM_CPU_SUSPEND=y +CONFIG_ARM_ERRATA_430973=y +CONFIG_ARM_ERRATA_643719=y +CONFIG_ARM_ERRATA_720789=y +CONFIG_ARM_ERRATA_754322=y +CONFIG_ARM_ERRATA_754327=y +CONFIG_ARM_ERRATA_764369=y +CONFIG_ARM_ERRATA_775420=y +CONFIG_ARM_ERRATA_798181=y +CONFIG_ARM_GIC=y +CONFIG_ARM_HAS_GROUP_RELOCS=y +CONFIG_ARM_HEAVY_MB=y +# CONFIG_ARM_HIGHBANK_CPUIDLE is not set +# CONFIG_ARM_IMX8M_DDRC_DEVFREQ is not set +# CONFIG_ARM_IMX_BUS_DEVFREQ is not set +# CONFIG_ARM_IMX_CPUFREQ_DT is not set +CONFIG_ARM_L1_CACHE_SHIFT=6 +CONFIG_ARM_L1_CACHE_SHIFT_6=y +CONFIG_ARM_LPAE=y +CONFIG_ARM_PATCH_IDIV=y +CONFIG_ARM_PATCH_PHYS_VIRT=y +CONFIG_ARM_PSCI=y +CONFIG_ARM_PSCI_FW=y +# CONFIG_ARM_SMMU is not set +CONFIG_ARM_THUMB=y +CONFIG_ARM_THUMBEE=y +CONFIG_ARM_UNWIND=y +CONFIG_ARM_VIRT_EXT=y +CONFIG_ATAGS=y +CONFIG_AUTOFS4_FS=y +CONFIG_AUTOFS_FS=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_BATTERY_SBS=y +CONFIG_BCM_NET_PHYLIB=y +CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y +CONFIG_BLK_DEV_BSG=y +CONFIG_BLK_DEV_BSG_COMMON=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=262144 +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_DEV_SR=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BLK_MQ_VIRTIO=y +CONFIG_BLK_PM=y +CONFIG_BOUNCE=y +CONFIG_BRCMSTB_GISB_ARB=y +CONFIG_BROADCOM_PHY=y +CONFIG_CACHE_L2X0=y +CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y +CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" +CONFIG_CC_NO_ARRAY_BOUNDS=y +CONFIG_CDROM=y +CONFIG_CHECKPOINT_RESTORE=y +CONFIG_CHR_DEV_SG=y +CONFIG_CLKSRC_IMX_GPT=y +CONFIG_CLKSRC_MMIO=y +# CONFIG_CLK_IMX8MM is not set +# CONFIG_CLK_IMX8MN is not set +# CONFIG_CLK_IMX8MP is not set +# CONFIG_CLK_IMX8MQ is not set +# CONFIG_CLK_IMX8ULP is not set +# CONFIG_CLK_IMX93 is not set +CONFIG_CLK_QORIQ=y +# CONFIG_CLK_VEXPRESS_OSC is not set +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMA=y +CONFIG_CMA_ALIGNMENT=8 +CONFIG_CMA_AREAS=7 +# CONFIG_CMA_DEBUG is not set +# CONFIG_CMA_DEBUGFS is not set +CONFIG_CMA_SIZE_MBYTES=64 +# CONFIG_CMA_SIZE_SEL_MAX is not set +CONFIG_CMA_SIZE_SEL_MBYTES=y +# CONFIG_CMA_SIZE_SEL_MIN is not set +# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set +# CONFIG_CMA_SYSFS is not set +CONFIG_CMDLINE_PARTITION=y +CONFIG_COMMON_CLK=y +CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CONFIGFS_FS=y +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_CONTEXT_TRACKING=y +CONFIG_CONTEXT_TRACKING_IDLE=y +CONFIG_CONTIG_ALLOC=y +CONFIG_COREDUMP=y +CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y +CONFIG_CPUFREQ_DT=y +CONFIG_CPUFREQ_DT_PLATDEV=y +CONFIG_CPU_32v6K=y +CONFIG_CPU_32v7=y +CONFIG_CPU_ABRT_EV7=y +CONFIG_CPU_CACHE_V7=y +CONFIG_CPU_CACHE_VIPT=y +CONFIG_CPU_COPY_V6=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +CONFIG_CPU_FREQ_GOV_ATTR_SET=y +CONFIG_CPU_FREQ_GOV_COMMON=y +# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set +CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y +# CONFIG_CPU_FREQ_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_STAT=y +CONFIG_CPU_HAS_ASID=y +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_MENU=y +CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_CPU_PABRT_V7=y +CONFIG_CPU_PM=y +CONFIG_CPU_RMAP=y +CONFIG_CPU_SPECTRE=y +CONFIG_CPU_THERMAL=y +CONFIG_CPU_THUMB_CAPABLE=y +CONFIG_CPU_TLB_V7=y +CONFIG_CPU_V7=y +CONFIG_CRASH_CORE=y +CONFIG_CRC16=y +# CONFIG_CRC32_SARWATE is not set +CONFIG_CRC32_SLICEBY8=y +CONFIG_CROSS_MEMORY_ATTACH=y +CONFIG_CRYPTO_CRC32=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_HASH_INFO=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_LIB_SHA1=y +CONFIG_CRYPTO_LIB_UTILS=y +CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_ZSTD=y +CONFIG_CURRENT_POINTER_IN_TPIDRURO=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DEBUG_ALIGN_RODATA=y +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" +CONFIG_DECOMPRESS_BZIP2=y +CONFIG_DECOMPRESS_GZIP=y +CONFIG_DECOMPRESS_LZMA=y +CONFIG_DECOMPRESS_LZO=y +CONFIG_DECOMPRESS_XZ=y +CONFIG_DETECT_HUNG_TASK=y +# CONFIG_DEVFREQ_GOV_PASSIVE is not set +# CONFIG_DEVFREQ_GOV_PERFORMANCE is not set +# CONFIG_DEVFREQ_GOV_POWERSAVE is not set +# CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND is not set +# CONFIG_DEVFREQ_GOV_USERSPACE is not set +# CONFIG_DEVFREQ_THERMAL is not set +CONFIG_DMADEVICES=y +CONFIG_DMA_CMA=y +CONFIG_DMA_ENGINE=y +CONFIG_DMA_OF=y +CONFIG_DMA_OPS=y +CONFIG_DMA_SHARED_BUFFER=y +CONFIG_DMA_VIRTUAL_CHANNELS=y +CONFIG_DNOTIFY=y +CONFIG_DTC=y +CONFIG_DT_IDLE_STATES=y +CONFIG_DUMMY_CONSOLE=y +CONFIG_DW_DMAC=y +CONFIG_DW_DMAC_CORE=y +CONFIG_DW_WATCHDOG=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EEPROM_93CX6=y +CONFIG_EEPROM_AT24=y +CONFIG_ELF_CORE=y +# CONFIG_ENABLE_DEFAULT_TRACERS is not set +CONFIG_EXCLUSIVE_SYSTEM_RAM=y +CONFIG_EXT4_FS=y +CONFIG_EXT4_FS_POSIX_ACL=y +CONFIG_EXT4_FS_SECURITY=y +CONFIG_F2FS_FS=y +CONFIG_FAILOVER=y +CONFIG_FAT_FS=y +# CONFIG_FEC is not set +CONFIG_FHANDLE=y +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FREEZER=y +# CONFIG_FSL_DPAA2_SWITCH is not set +CONFIG_FSL_EDMA=y +CONFIG_FSL_GUTS=y +CONFIG_FSL_IFC=y +# CONFIG_FSL_PPFE is not set +CONFIG_FSL_PQ_MDIO=y +CONFIG_FSL_RCPM=y +CONFIG_FSL_XGMAC_MDIO=y +CONFIG_FS_IOMAP=y +CONFIG_FS_MBCACHE=y +CONFIG_FS_POSIX_ACL=y +CONFIG_FTRACE=y +# CONFIG_FTRACE_SYSCALLS is not set +CONFIG_FUSE_FS=y +CONFIG_FWNODE_MDIO=y +CONFIG_FW_CACHE=y +CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_FW_LOADER_SYSFS=y +# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set +CONFIG_GCC11_NO_ARRAY_BOUNDS=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ARCH_TOPOLOGY=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_CPU_VULNERABILITIES=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_GETTIMEOFDAY=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MIGRATION=y +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y +CONFIG_GENERIC_MSI_IRQ=y +CONFIG_GENERIC_MSI_IRQ_DOMAIN=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_PINCONF=y +CONFIG_GENERIC_PINCTRL_GROUPS=y +CONFIG_GENERIC_PINMUX_FUNCTIONS=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GENERIC_VDSO_32=y +CONFIG_GIANFAR=y +CONFIG_GLOB=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_CDEV=y +CONFIG_GPIO_GENERIC=y +CONFIG_GPIO_GENERIC_PLATFORM=y +CONFIG_GPIO_MPC8XXX=y +CONFIG_GPIO_MXC=y +CONFIG_GPIO_VF610=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HAVE_SMP=y +CONFIG_HID=y +CONFIG_HID_GENERIC=y +CONFIG_HIGHMEM=y +CONFIG_HIGHPTE=y +# CONFIG_HIST_TRIGGERS is not set +CONFIG_HOTPLUG_CPU=y +CONFIG_HVC_DRIVER=y +CONFIG_HW_CONSOLE=y +CONFIG_HW_RANDOM=y +CONFIG_HZ_FIXED=0 +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_COMPAT=y +CONFIG_I2C_DEMUX_PINCTRL=y +CONFIG_I2C_DESIGNWARE_CORE=y +CONFIG_I2C_DESIGNWARE_PLATFORM=y +CONFIG_I2C_HELPER_AUTO=y +CONFIG_I2C_IMX=y +# CONFIG_I2C_IMX_LPI2C is not set +CONFIG_I2C_MUX=y +CONFIG_I2C_MUX_PCA954x=y +CONFIG_I2C_MUX_PINCTRL=y +CONFIG_I2C_RK3X=y +CONFIG_I2C_SLAVE=y +CONFIG_I2C_SLAVE_EEPROM=y +# CONFIG_I2C_SLAVE_TESTUNIT is not set +CONFIG_I2C_XILINX=y +CONFIG_ICPLUS_PHY=y +CONFIG_ICS932S401=y +CONFIG_IMX2_WDT=y +# CONFIG_IMX7ULP_WDT is not set +# CONFIG_IMX8MM_THERMAL is not set +CONFIG_IMX_DMA=y +# CONFIG_IMX_GPCV2_PM_DOMAINS is not set +CONFIG_IMX_INTMUX=y +# CONFIG_IMX_IRQSTEER is not set +# CONFIG_IMX_MU_MSI is not set +CONFIG_IMX_SDMA=y +# CONFIG_IMX_WEIM is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INPUT=y +# CONFIG_IOMMU_DEBUGFS is not set +# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set +# CONFIG_IOMMU_IO_PGTABLE_LPAE is not set +CONFIG_IOMMU_SUPPORT=y +CONFIG_IPC_NS=y +CONFIG_IRQCHIP=y +CONFIG_IRQSTACKS=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +# CONFIG_ISDN is not set +CONFIG_ISL29003=y +CONFIG_JBD2=y +CONFIG_KALLSYMS=y +CONFIG_KCMP=y +CONFIG_KERNEL_GZIP=y +# CONFIG_KERNEL_XZ is not set +CONFIG_KEXEC=y +CONFIG_KEXEC_CORE=y +CONFIG_KMAP_LOCAL=y +CONFIG_KMAP_LOCAL_NON_LINEAR_PTE_ARRAY=y +CONFIG_LIBFDT=y +CONFIG_LOCALVERSION_AUTO=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_LS_EXTIRQ=y +CONFIG_LS_SCFG_MSI=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_MARVELL_PHY=y +CONFIG_MCPM=y +CONFIG_MDIO_BITBANG=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_DEVRES=y +# CONFIG_MDIO_GPIO is not set +CONFIG_MEMFD_CREATE=y +CONFIG_MEMORY=y +CONFIG_MEMORY_ISOLATION=y +# CONFIG_MFD_HI6421_SPMI is not set +CONFIG_MFD_SYSCON=y +# CONFIG_MFD_VEXPRESS_SYSREG is not set +CONFIG_MICREL_PHY=y +CONFIG_MIGHT_HAVE_CACHE_L2X0=y +CONFIG_MIGRATION=y +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_BLOCK_MINORS=16 +# CONFIG_MMC_MXC is not set +CONFIG_MMC_SDHCI=y +# CONFIG_MMC_SDHCI_ESDHC_IMX is not set +CONFIG_MMC_SDHCI_IO_ACCESSORS=y +CONFIG_MMC_SDHCI_OF_ESDHC=y +# CONFIG_MMC_SDHCI_PCI is not set +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MSDOS_FS=y +CONFIG_MTD_CFI_ADV_OPTIONS=y +CONFIG_MTD_CFI_GEOMETRY=y +CONFIG_MTD_CFI_STAA=y +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_DATAFLASH=y +# CONFIG_MTD_DATAFLASH_OTP is not set +# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set +CONFIG_MTD_NAND_CORE=y +CONFIG_MTD_NAND_ECC=y +CONFIG_MTD_NAND_ECC_SW_HAMMING=y +CONFIG_MTD_NAND_FSL_IFC=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_RAW_NAND=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_SST25L=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=20 +# CONFIG_MTD_UBI_BLOCK is not set +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_MX3_IPU=y +CONFIG_MX3_IPU_IRQS=4 +CONFIG_MXC_CLK=y +# CONFIG_MXS_DMA is not set +CONFIG_NAMESPACES=y +CONFIG_NATIONAL_PHY=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEON=y +CONFIG_NET_FAILOVER=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_NS=y +CONFIG_NET_PTP_CLASSIFY=y +CONFIG_NET_SELFTESTS=y +CONFIG_NET_SWITCHDEV=y +CONFIG_NLS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_UTF8=y +CONFIG_NO_HZ=y +CONFIG_NO_HZ_COMMON=y +CONFIG_NO_HZ_IDLE=y +CONFIG_NR_CPUS=16 +CONFIG_NTFS_FS=y +CONFIG_NVMEM=y +# CONFIG_NVMEM_IMX_IIM is not set +# CONFIG_NVMEM_IMX_OCOTP_ELE is not set +# CONFIG_NVMEM_SNVS_LPGPR is not set +# CONFIG_NVMEM_SPMI_SDAM is not set +CONFIG_NVMEM_SYSFS=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_DYNAMIC=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_KOBJ=y +CONFIG_OF_MDIO=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_OUTER_CACHE=y +CONFIG_OUTER_CACHE_SYNC=y +CONFIG_PACKET_DIAG=y +CONFIG_PADATA=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PAGE_POOL=y +CONFIG_PAGE_SIZE_LESS_THAN_256KB=y +CONFIG_PAGE_SIZE_LESS_THAN_64KB=y +# CONFIG_PANIC_ON_OOPS is not set +CONFIG_PANIC_ON_OOPS_VALUE=0 +CONFIG_PANIC_TIMEOUT=0 +CONFIG_PCI=y +CONFIG_PCIEAER=y +CONFIG_PCIEASPM=y +CONFIG_PCIEASPM_DEFAULT=y +# CONFIG_PCIEASPM_PERFORMANCE is not set +# CONFIG_PCIEASPM_POWERSAVE is not set +# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set +CONFIG_PCIEPORTBUS=y +CONFIG_PCIE_DW=y +CONFIG_PCIE_DW_HOST=y +CONFIG_PCIE_PME=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DOMAINS_GENERIC=y +CONFIG_PCI_ECAM=y +CONFIG_PCI_HOST_COMMON=y +CONFIG_PCI_HOST_GENERIC=y +# CONFIG_PCI_IMX6 is not set +CONFIG_PCI_LAYERSCAPE=y +CONFIG_PCI_MSI=y +CONFIG_PCI_MSI_IRQ_DOMAIN=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=3 +CONFIG_PHYLIB=y +CONFIG_PHYS_ADDR_T_64BIT=y +CONFIG_PID_NS=y +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_IMX8ULP is not set +# CONFIG_PINCTRL_IMX93 is not set +# CONFIG_PINCTRL_IMXRT1050 is not set +# CONFIG_PINCTRL_IMXRT1170 is not set +CONFIG_PL310_ERRATA_588369=y +CONFIG_PL310_ERRATA_727915=y +CONFIG_PL310_ERRATA_753970=y +CONFIG_PL310_ERRATA_769419=y +CONFIG_PM=y +CONFIG_PM_CLK=y +CONFIG_PM_DEVFREQ=y +# CONFIG_PM_DEVFREQ_EVENT is not set +CONFIG_PM_OPP=y +CONFIG_PM_SLEEP=y +CONFIG_PM_SLEEP_SMP=y +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_BRCMKONA=y +CONFIG_POWER_RESET_BRCMSTB=y +CONFIG_POWER_RESET_GPIO=y +CONFIG_POWER_RESET_GPIO_RESTART=y +CONFIG_POWER_RESET_SYSCON=y +CONFIG_POWER_RESET_SYSCON_POWEROFF=y +CONFIG_POWER_RESET_VEXPRESS=y +CONFIG_POWER_SUPPLY=y +CONFIG_PPS=y +CONFIG_PREEMPT_NONE_BUILD=y +CONFIG_PRINTK_TIME=y +CONFIG_PROC_CHILDREN=y +CONFIG_PROC_PAGE_MONITOR=y +CONFIG_PSTORE=y +CONFIG_PSTORE_COMPRESS=y +CONFIG_PSTORE_COMPRESS_DEFAULT="deflate" +CONFIG_PSTORE_CONSOLE=y +CONFIG_PSTORE_DEFLATE_COMPRESS=y +CONFIG_PSTORE_DEFLATE_COMPRESS_DEFAULT=y +CONFIG_PSTORE_PMSG=y +CONFIG_PSTORE_RAM=y +CONFIG_PTP_1588_CLOCK=y +CONFIG_PTP_1588_CLOCK_OPTIONAL=y +CONFIG_PTP_1588_CLOCK_QORIQ=y +CONFIG_QORIQ_CPUFREQ=y +CONFIG_RANDSTRUCT_NONE=y +CONFIG_RAS=y +CONFIG_RATIONAL=y +CONFIG_RD_BZIP2=y +CONFIG_RD_GZIP=y +CONFIG_RD_LZMA=y +CONFIG_RD_LZO=y +CONFIG_RD_XZ=y +CONFIG_REALTEK_PHY=y +CONFIG_REED_SOLOMON=y +CONFIG_REED_SOLOMON_DEC8=y +CONFIG_REED_SOLOMON_ENC8=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGMAP_SPI=y +CONFIG_RESET_CONTROLLER=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_RTC_CLASS=y +# CONFIG_RTC_DRV_CMOS is not set +CONFIG_RTC_DRV_DS1307=y +CONFIG_RTC_DRV_DS3232=y +CONFIG_RTC_DRV_EM3027=y +CONFIG_RTC_DRV_FSL_FTM_ALARM=y +# CONFIG_RTC_DRV_IMXDI is not set +# CONFIG_RTC_DRV_MXC is not set +# CONFIG_RTC_DRV_MXC_V2 is not set +CONFIG_RTC_DRV_PCF2127=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_SCHED_DEBUG=y +CONFIG_SCSI=y +CONFIG_SCSI_COMMON=y +CONFIG_SECCOMP=y +CONFIG_SECCOMP_FILTER=y +# CONFIG_SECURITY_DMESG_RESTRICT is not set +CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y +CONFIG_SERIAL_8250_DW=y +CONFIG_SERIAL_8250_DWLIB=y +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIAL_CONEXANT_DIGICOLOR=y +CONFIG_SERIAL_CONEXANT_DIGICOLOR_CONSOLE=y +CONFIG_SERIAL_FSL_LPUART=y +CONFIG_SERIAL_FSL_LPUART_CONSOLE=y +CONFIG_SERIAL_IMX=y +CONFIG_SERIAL_IMX_CONSOLE=y +CONFIG_SERIAL_IMX_EARLYCON=y +CONFIG_SERIAL_MCTRL_GPIO=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SERIAL_ST_ASC=y +CONFIG_SERIAL_ST_ASC_CONSOLE=y +CONFIG_SERIAL_XILINX_PS_UART=y +CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y +CONFIG_SGL_ALLOC=y +CONFIG_SG_POOL=y +CONFIG_SMP=y +CONFIG_SMP_ON_UP=y +CONFIG_SMSC_PHY=y +CONFIG_SOCK_DIAG=y +CONFIG_SOCK_RX_QUEUE_MAPPING=y +CONFIG_SOC_BRCMSTB=y +CONFIG_SOC_BUS=y +# CONFIG_SOC_IMX50 is not set +# CONFIG_SOC_IMX51 is not set +# CONFIG_SOC_IMX53 is not set +# CONFIG_SOC_IMX6Q is not set +# CONFIG_SOC_IMX6SL is not set +# CONFIG_SOC_IMX6SLL is not set +# CONFIG_SOC_IMX6SX is not set +# CONFIG_SOC_IMX6UL is not set +# CONFIG_SOC_IMX7D is not set +# CONFIG_SOC_IMX7ULP is not set +# CONFIG_SOC_IMX8M is not set +# CONFIG_SOC_IMX9 is not set +CONFIG_SOC_LS1021A=y +# CONFIG_SOC_VF610 is not set +CONFIG_SOFTIRQ_ON_OWN_STACK=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPI=y +CONFIG_SPI_BITBANG=y +CONFIG_SPI_CADENCE=y +CONFIG_SPI_DYNAMIC=y +# CONFIG_SPI_FSL_LPSPI is not set +# CONFIG_SPI_FSL_QUADSPI is not set +# CONFIG_SPI_IMX is not set +CONFIG_SPI_MASTER=y +CONFIG_SPI_MEM=y +CONFIG_SPI_SPIDEV=y +CONFIG_SPI_XILINX=y +CONFIG_SPMI=y +# CONFIG_SPMI_HISI3670 is not set +# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set +CONFIG_SQUASHFS_DECOMP_SINGLE=y +CONFIG_SQUASHFS_FILE_CACHE=y +# CONFIG_SQUASHFS_FILE_DIRECT is not set +CONFIG_SQUASHFS_LZO=y +CONFIG_SQUASHFS_ZLIB=y +CONFIG_SRAM=y +CONFIG_SRAM_EXEC=y +CONFIG_SRCU=y +CONFIG_STACKTRACE=y +CONFIG_STAGING_BOARD=y +# CONFIG_STRIP_ASM_SYMS is not set +CONFIG_SUSPEND=y +CONFIG_SUSPEND_FREEZER=y +CONFIG_SWIOTLB=y +CONFIG_SWPHY=y +CONFIG_SWP_EMULATE=y +CONFIG_SYNC_FILE=y +CONFIG_SYSFS_SYSCALL=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THERMAL_OF=y +CONFIG_THREAD_INFO_IN_TASK=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y +CONFIG_UBIFS_FS=y +# CONFIG_UCLAMP_TASK is not set +CONFIG_UEVENT_HELPER_PATH="" +CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +CONFIG_UNIX_DIAG=y +CONFIG_UNWINDER_ARM=y +CONFIG_USB_SUPPORT=y +CONFIG_USER_NS=y +CONFIG_USE_OF=y +CONFIG_UTS_NS=y +CONFIG_VEXPRESS_CONFIG=y +CONFIG_VFAT_FS=y +CONFIG_VFP=y +CONFIG_VFPv3=y +CONFIG_VIRTIO=y +CONFIG_VIRTIO_ANCHOR=y +CONFIG_VIRTIO_BLK=y +CONFIG_VIRTIO_CONSOLE=y +CONFIG_VIRTIO_MMIO=y +CONFIG_VIRTIO_NET=y +CONFIG_VIRTIO_PCI=y +CONFIG_VIRTIO_PCI_LEGACY=y +CONFIG_VIRTIO_PCI_LIB=y +CONFIG_VIRTIO_PCI_LIB_LEGACY=y +CONFIG_VITESSE_PHY=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_CONSOLE_SLEEP=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_WATCHDOG_CORE=y +# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set +CONFIG_XILINX_WATCHDOG=y +CONFIG_XPS=y +CONFIG_XXHASH=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_ARMTHUMB=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_XZ_DEC_IA64=y +CONFIG_XZ_DEC_POWERPC=y +CONFIG_XZ_DEC_SPARC=y +CONFIG_XZ_DEC_X86=y +CONFIG_ZBOOT_ROM_BSS=0 +CONFIG_ZBOOT_ROM_TEXT=0 +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y +CONFIG_ZSTD_COMMON=y +CONFIG_ZSTD_COMPRESS=y +CONFIG_ZSTD_DECOMPRESS=y diff --git a/target/linux/layerscape/armv8_64b/config-5.15 b/target/linux/layerscape/armv8_64b/config-5.15 index 0e8ab0c25340e4..610da9b18e8f7f 100644 --- a/target/linux/layerscape/armv8_64b/config-5.15 +++ b/target/linux/layerscape/armv8_64b/config-5.15 @@ -102,6 +102,7 @@ CONFIG_CAVIUM_ERRATUM_22375=y CONFIG_CAVIUM_ERRATUM_23144=y CONFIG_CAVIUM_ERRATUM_23154=y CONFIG_CAVIUM_ERRATUM_27456=y +CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y CONFIG_CHECKPOINT_RESTORE=y CONFIG_CHROME_PLATFORMS=y @@ -149,6 +150,7 @@ CONFIG_CPU_FREQ_THERMAL=y CONFIG_CPU_IDLE=y CONFIG_CPU_IDLE_GOV_MENU=y CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y +CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_CPU_PM=y CONFIG_CPU_RMAP=y CONFIG_CPU_THERMAL=y @@ -292,7 +294,6 @@ CONFIG_FSL_MC_BUS=y CONFIG_FSL_MC_DPIO=y CONFIG_FSL_MC_UAPI_SUPPORT=y # CONFIG_FSL_PPFE is not set -# CONFIG_FSL_PPFE_UTIL_DISABLED is not set # CONFIG_FSL_QMAN_TEST is not set CONFIG_FSL_RCPM=y CONFIG_FSL_XGMAC_MDIO=y @@ -342,6 +343,7 @@ CONFIG_GPIO_GENERIC_PLATFORM=y CONFIG_GPIO_MPC8XXX=y CONFIG_GPIO_PCA953X=y CONFIG_GPIO_PCA953X_IRQ=y +CONFIG_GRO_CELLS=y CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y @@ -562,6 +564,7 @@ CONFIG_OF_KOBJ=y CONFIG_OF_MDIO=y CONFIG_OF_NUMA=y CONFIG_PACKET_DIAG=y +CONFIG_PACKING=y CONFIG_PADATA=y CONFIG_PAGE_POOL=y CONFIG_PAGE_REPORTING=y diff --git a/target/linux/layerscape/armv8_64b/config-6.1 b/target/linux/layerscape/armv8_64b/config-6.1 new file mode 100644 index 00000000000000..a2a4a633af23c3 --- /dev/null +++ b/target/linux/layerscape/armv8_64b/config-6.1 @@ -0,0 +1,905 @@ +CONFIG_64BIT=y +CONFIG_AQUANTIA_PHY=y +CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y +CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_HIBERNATION_HEADER=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_LAYERSCAPE=y +CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y +CONFIG_ARCH_MMAP_RND_BITS=18 +CONFIG_ARCH_MMAP_RND_BITS_MAX=33 +CONFIG_ARCH_MMAP_RND_BITS_MIN=18 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_NXP=y +CONFIG_ARCH_PROC_KCORE_TEXT=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_STACKWALK=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_WANTS_NO_INSTR=y +CONFIG_ARCH_WANTS_THP_SWAP=y +CONFIG_ARM64=y +CONFIG_ARM64_4K_PAGES=y +CONFIG_ARM64_CNP=y +CONFIG_ARM64_EPAN=y +CONFIG_ARM64_ERRATUM_1165522=y +CONFIG_ARM64_ERRATUM_1286807=y +CONFIG_ARM64_ERRATUM_2051678=y +CONFIG_ARM64_ERRATUM_2054223=y +CONFIG_ARM64_ERRATUM_2067961=y +CONFIG_ARM64_ERRATUM_2077057=y +CONFIG_ARM64_ERRATUM_2658417=y +CONFIG_ARM64_ERRATUM_819472=y +CONFIG_ARM64_ERRATUM_824069=y +CONFIG_ARM64_ERRATUM_826319=y +CONFIG_ARM64_ERRATUM_827319=y +CONFIG_ARM64_ERRATUM_832075=y +CONFIG_ARM64_ERRATUM_843419=y +CONFIG_ARM64_HW_AFDBM=y +CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y +CONFIG_ARM64_PAGE_SHIFT=12 +CONFIG_ARM64_PAN=y +CONFIG_ARM64_PA_BITS=48 +CONFIG_ARM64_PA_BITS_48=y +CONFIG_ARM64_PTR_AUTH=y +CONFIG_ARM64_PTR_AUTH_KERNEL=y +CONFIG_ARM64_SME=y +CONFIG_ARM64_SVE=y +CONFIG_ARM64_TAGGED_ADDR_ABI=y +CONFIG_ARM64_VA_BITS=48 +# CONFIG_ARM64_VA_BITS_39 is not set +CONFIG_ARM64_VA_BITS_48=y +CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y +CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y +CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT=y +CONFIG_ARM64_WORKAROUND_TSB_FLUSH_FAILURE=y +CONFIG_ARM_AMBA=y +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y +CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND=y +CONFIG_ARM_GIC=y +CONFIG_ARM_GIC_V2M=y +CONFIG_ARM_GIC_V3=y +CONFIG_ARM_GIC_V3_ITS=y +CONFIG_ARM_GIC_V3_ITS_FSL_MC=y +CONFIG_ARM_GIC_V3_ITS_PCI=y +# CONFIG_ARM_PL172_MPMC is not set +CONFIG_ARM_PSCI_CPUIDLE=y +CONFIG_ARM_PSCI_FW=y +CONFIG_ARM_SMMU=y +# CONFIG_ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT is not set +# CONFIG_ARM_SMMU_LEGACY_DT_BINDINGS is not set +CONFIG_ARM_SMMU_V3=y +# CONFIG_ARM_SMMU_V3_SVA is not set +CONFIG_ARM_SP805_WATCHDOG=y +CONFIG_ASM_MODVERSIONS=y +CONFIG_ASN1=y +CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y +CONFIG_ATA=y +CONFIG_AUDIT=y +CONFIG_AUDITSYSCALL=y +CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y +CONFIG_AUDIT_GENERIC=y +CONFIG_AUTOFS4_FS=y +CONFIG_AUTOFS_FS=y +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BALLOON_COMPACTION=y +CONFIG_BATTERY_BQ27XXX=y +# CONFIG_BATTERY_BQ27XXX_DT_UPDATES_NVM is not set +CONFIG_BATTERY_BQ27XXX_I2C=y +CONFIG_BLK_DEV_BSG=y +CONFIG_BLK_DEV_BSGLIB=y +CONFIG_BLK_DEV_BSG_COMMON=y +CONFIG_BLK_DEV_INTEGRITY=y +CONFIG_BLK_DEV_INTEGRITY_T10=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=262144 +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BLK_MQ_VIRTIO=y +CONFIG_BLK_PM=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BSD_PROCESS_ACCT_V3=y +CONFIG_BTRFS_FS=y +# CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set +CONFIG_BTRFS_FS_POSIX_ACL=y +CONFIG_CAVIUM_ERRATUM_22375=y +CONFIG_CAVIUM_ERRATUM_23144=y +CONFIG_CAVIUM_ERRATUM_23154=y +CONFIG_CAVIUM_ERRATUM_27456=y +CONFIG_CC_HAVE_SHADOW_CALL_STACK=y +CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y +CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" +CONFIG_CC_NO_ARRAY_BOUNDS=y +CONFIG_CHECKPOINT_RESTORE=y +CONFIG_CHROME_PLATFORMS=y +CONFIG_CLK_LS1028A_PLLDIG=y +CONFIG_CLK_QORIQ=y +# CONFIG_CLK_VEXPRESS_OSC is not set +CONFIG_CLONE_BACKWARDS=y +CONFIG_CLZ_TAB=y +CONFIG_CMA=y +CONFIG_CMA_ALIGNMENT=8 +CONFIG_CMA_AREAS=7 +# CONFIG_CMA_DEBUG is not set +# CONFIG_CMA_DEBUGFS is not set +CONFIG_CMA_SIZE_MBYTES=16 +# CONFIG_CMA_SIZE_SEL_MAX is not set +CONFIG_CMA_SIZE_SEL_MBYTES=y +# CONFIG_CMA_SIZE_SEL_MIN is not set +# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set +# CONFIG_CMA_SYSFS is not set +CONFIG_COMMON_CLK=y +CONFIG_COMMON_CLK_CS2000_CP=y +CONFIG_COMMON_CLK_FSL_FLEXSPI=y +# CONFIG_COMMON_CLK_FSL_SAI is not set +CONFIG_COMMON_CLK_XGENE=y +CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CONFIGFS_FS=y +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_CONTEXT_TRACKING=y +CONFIG_CONTEXT_TRACKING_IDLE=y +CONFIG_CONTIG_ALLOC=y +CONFIG_COREDUMP=y +CONFIG_CPUFREQ_DT=y +CONFIG_CPUFREQ_DT_PLATDEV=y +CONFIG_CPU_FREQ=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y +CONFIG_CPU_FREQ_GOV_ATTR_SET=y +CONFIG_CPU_FREQ_GOV_COMMON=y +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_STAT=y +CONFIG_CPU_FREQ_THERMAL=y +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_MENU=y +CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y +CONFIG_CPU_LITTLE_ENDIAN=y +CONFIG_CPU_PM=y +CONFIG_CPU_RMAP=y +CONFIG_CPU_THERMAL=y +CONFIG_CRASH_CORE=y +CONFIG_CRC16=y +# CONFIG_CRC32_SARWATE is not set +CONFIG_CRC32_SLICEBY8=y +CONFIG_CRC64=y +CONFIG_CRC64_ROCKSOFT=y +CONFIG_CRC7=y +CONFIG_CRC_ITU_T=y +CONFIG_CRC_T10DIF=y +CONFIG_CROSS_MEMORY_ATTACH=y +# CONFIG_CROS_EC is not set +CONFIG_CRYPTO_AES_ARM64=y +CONFIG_CRYPTO_AES_ARM64_CE=y +CONFIG_CRYPTO_AES_ARM64_CE_BLK=y +CONFIG_CRYPTO_AES_ARM64_CE_CCM=y +CONFIG_CRYPTO_AUTHENC=y +CONFIG_CRYPTO_BLAKE2B=y +CONFIG_CRYPTO_CRC32=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_CRC64_ROCKSOFT=y +CONFIG_CRYPTO_CRCT10DIF=y +CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=y +CONFIG_CRYPTO_CRYPTD=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_DEV_FSL_CAAM=y +CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API=y +CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API_DESC=y +CONFIG_CRYPTO_DEV_FSL_CAAM_COMMON=y +CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y +CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC=y +CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI=y +# CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG is not set +# CONFIG_CRYPTO_DEV_FSL_CAAM_INTC is not set +CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y +CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y +CONFIG_CRYPTO_DEV_FSL_CAAM_PRNG_API=y +CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9 +CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y +CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM=y +CONFIG_CRYPTO_ECB=y +CONFIG_CRYPTO_ENGINE=y +CONFIG_CRYPTO_GHASH_ARM64_CE=y +CONFIG_CRYPTO_HASH_INFO=y +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_LIB_DES=y +CONFIG_CRYPTO_LIB_SHA1=y +CONFIG_CRYPTO_LIB_SHA256=y +CONFIG_CRYPTO_LIB_UTILS=y +CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_RNG=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_RSA=y +CONFIG_CRYPTO_SHA256=y +CONFIG_CRYPTO_SHA256_ARM64=y +CONFIG_CRYPTO_SHA2_ARM64_CE=y +CONFIG_CRYPTO_XTS=y +CONFIG_CRYPTO_XXHASH=y +CONFIG_CRYPTO_ZSTD=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_MEMORY_INIT=y +CONFIG_DECOMPRESS_BZIP2=y +CONFIG_DECOMPRESS_GZIP=y +CONFIG_DECOMPRESS_LZMA=y +CONFIG_DECOMPRESS_LZO=y +CONFIG_DECOMPRESS_XZ=y +CONFIG_DETECT_HUNG_TASK=y +CONFIG_DIMLIB=y +CONFIG_DMADEVICES=y +CONFIG_DMATEST=y +CONFIG_DMA_CMA=y +CONFIG_DMA_DIRECT_REMAP=y +CONFIG_DMA_ENGINE=y +CONFIG_DMA_ENGINE_RAID=y +CONFIG_DMA_OF=y +CONFIG_DMA_OPS=y +CONFIG_DMA_SHARED_BUFFER=y +CONFIG_DMA_VIRTUAL_CHANNELS=y +CONFIG_DNOTIFY=y +CONFIG_DPAA2_CONSOLE=y +CONFIG_DPAA_ERRATUM_A050385=y +CONFIG_DTC=y +CONFIG_DT_IDLE_STATES=y +CONFIG_DUMMY_CONSOLE=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EEPROM_AT24=y +CONFIG_ELF_CORE=y +# CONFIG_EMBEDDED is not set +CONFIG_EXCLUSIVE_SYSTEM_RAM=y +CONFIG_EXT4_FS=y +CONFIG_EXT4_FS_POSIX_ACL=y +CONFIG_EXT4_FS_SECURITY=y +CONFIG_EXTCON=y +CONFIG_EXTCON_USB_GPIO=y +CONFIG_F2FS_FS=y +CONFIG_FAILOVER=y +CONFIG_FANOTIFY=y +CONFIG_FAT_FS=y +CONFIG_FB=y +CONFIG_FB_ARMCLCD=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_CMDLINE=y +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_SYS_COPYAREA=y +CONFIG_FB_SYS_FILLRECT=y +CONFIG_FB_SYS_FOPS=y +CONFIG_FB_SYS_IMAGEBLIT=y +CONFIG_FHANDLE=y +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FONT_8x16=y +CONFIG_FONT_8x8=y +CONFIG_FONT_SUPPORT=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +CONFIG_FRAME_POINTER=y +CONFIG_FREEZER=y +# CONFIG_FSL_BMAN_TEST is not set +CONFIG_FSL_DPAA=y +CONFIG_FSL_DPAA2_ETH=y +CONFIG_FSL_DPAA2_PTP_CLOCK=y +# CONFIG_FSL_DPAA2_QDMA is not set +# CONFIG_FSL_DPAA2_SWITCH is not set +# CONFIG_FSL_DPAA_CHECKING is not set +CONFIG_FSL_DPAA_ETH=y +CONFIG_FSL_EDMA=y +CONFIG_FSL_ENETC=y +CONFIG_FSL_ENETC_IERB=y +CONFIG_FSL_ENETC_MDIO=y +CONFIG_FSL_ENETC_PTP_CLOCK=y +CONFIG_FSL_ENETC_VF=y +CONFIG_FSL_ERRATUM_A008585=y +CONFIG_FSL_FMAN=y +CONFIG_FSL_GUTS=y +CONFIG_FSL_IFC=y +CONFIG_FSL_MC_BUS=y +CONFIG_FSL_MC_DPIO=y +CONFIG_FSL_MC_UAPI_SUPPORT=y +# CONFIG_FSL_PPFE is not set +# CONFIG_FSL_QMAN_TEST is not set +CONFIG_FSL_RCPM=y +CONFIG_FSL_XGMAC_MDIO=y +CONFIG_FS_IOMAP=y +CONFIG_FS_MBCACHE=y +CONFIG_FS_POSIX_ACL=y +CONFIG_FUSE_FS=y +CONFIG_FWNODE_MDIO=y +CONFIG_FW_CACHE=y +CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_FW_LOADER_SYSFS=y +# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set +CONFIG_GARP=y +CONFIG_GCC11_NO_ARRAY_BOUNDS=y +CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ARCH_NUMA=y +CONFIG_GENERIC_ARCH_TOPOLOGY=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_CPU_VULNERABILITIES=y +CONFIG_GENERIC_CSUM=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_GETTIMEOFDAY=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IOREMAP=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MIGRATION=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y +CONFIG_GENERIC_MSI_IRQ=y +CONFIG_GENERIC_MSI_IRQ_DOMAIN=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GENERIC_TIME_VSYSCALL=y +# CONFIG_GIANFAR is not set +CONFIG_GLOB=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_CDEV=y +CONFIG_GPIO_GENERIC=y +CONFIG_GPIO_GENERIC_PLATFORM=y +CONFIG_GPIO_MPC8XXX=y +CONFIG_GPIO_PCA953X=y +CONFIG_GPIO_PCA953X_IRQ=y +CONFIG_GRO_CELLS=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HIBERNATE_CALLBACKS=y +CONFIG_HIBERNATION=y +CONFIG_HIBERNATION_SNAPSHOT_DEV=y +CONFIG_HID=y +CONFIG_HID_A4TECH=y +CONFIG_HID_APPLE=y +CONFIG_HID_BELKIN=y +CONFIG_HID_CHERRY=y +CONFIG_HID_CYPRESS=y +CONFIG_HID_EZKEY=y +CONFIG_HID_GENERIC=y +CONFIG_HID_KENSINGTON=y +CONFIG_HID_MICROSOFT=y +CONFIG_HID_MONTEREY=y +CONFIG_HOTPLUG_CPU=y +CONFIG_HUGETLBFS=y +CONFIG_HUGETLB_PAGE=y +CONFIG_HVC_DRIVER=y +CONFIG_HVC_IRQ=y +CONFIG_HVC_XEN=y +CONFIG_HVC_XEN_FRONTEND=y +CONFIG_HW_CONSOLE=y +CONFIG_HW_RANDOM=y +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_COMPAT=y +CONFIG_I2C_DESIGNWARE_CORE=y +CONFIG_I2C_DESIGNWARE_PLATFORM=y +CONFIG_I2C_HELPER_AUTO=y +CONFIG_I2C_IMX=y +CONFIG_I2C_MUX=y +CONFIG_I2C_MUX_PCA954x=y +CONFIG_I2C_RK3X=y +CONFIG_I2C_SLAVE=y +# CONFIG_I2C_SLAVE_TESTUNIT is not set +CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 +CONFIG_IMX2_WDT=y +CONFIG_INET_DIAG=y +# CONFIG_INET_DIAG_DESTROY is not set +# CONFIG_INET_RAW_DIAG is not set +CONFIG_INET_TCP_DIAG=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INPUT=y +CONFIG_INPUT_EVDEV=y +CONFIG_INPUT_FF_MEMLESS=y +CONFIG_INPUT_KEYBOARD=y +CONFIG_INPUT_MOUSE=y +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +CONFIG_INPUT_VIVALDIFMAP=y +CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y +CONFIG_INTERVAL_TREE=y +CONFIG_IOMMU_API=y +# CONFIG_IOMMU_DEBUGFS is not set +# CONFIG_IOMMU_DEFAULT_DMA_LAZY is not set +# CONFIG_IOMMU_DEFAULT_DMA_STRICT is not set +CONFIG_IOMMU_DEFAULT_PASSTHROUGH=y +CONFIG_IOMMU_DMA=y +CONFIG_IOMMU_IOVA=y +CONFIG_IOMMU_IO_PGTABLE=y +# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set +# CONFIG_IOMMU_IO_PGTABLE_DART is not set +CONFIG_IOMMU_IO_PGTABLE_LPAE=y +# CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set +CONFIG_IOMMU_SUPPORT=y +CONFIG_IPC_NS=y +CONFIG_IRQCHIP=y +CONFIG_IRQ_BYPASS_MANAGER=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_MSI_IOMMU=y +CONFIG_IRQ_WORK=y +# CONFIG_ISDN is not set +CONFIG_JBD2=y +CONFIG_JUMP_LABEL=y +CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y +CONFIG_KCMP=y +CONFIG_KEXEC=y +CONFIG_KEXEC_CORE=y +CONFIG_KEYBOARD_ATKBD=y +CONFIG_KEYBOARD_GPIO=y +CONFIG_KSM=y +CONFIG_LIBCRC32C=y +CONFIG_LIBFDT=y +CONFIG_LOCALVERSION_AUTO=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_LOGO=y +CONFIG_LOGO_LINUX_CLUT224=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +CONFIG_LS_EXTIRQ=y +CONFIG_LS_SCFG_MSI=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_MDIO_BITBANG=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_BUS_MUX=y +CONFIG_MDIO_BUS_MUX_MMIOREG=y +CONFIG_MDIO_BUS_MUX_MULTIPLEXER=y +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_DEVRES=y +# CONFIG_MDIO_GPIO is not set +CONFIG_MEMFD_CREATE=y +CONFIG_MEMORY=y +CONFIG_MEMORY_BALLOON=y +CONFIG_MEMORY_ISOLATION=y +CONFIG_MEMTEST=y +# CONFIG_MFD_HI6421_SPMI is not set +CONFIG_MFD_SYSCON=y +# CONFIG_MFD_VEXPRESS_SYSREG is not set +CONFIG_MICREL_PHY=y +CONFIG_MICROSEMI_PHY=y +CONFIG_MIGRATION=y +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_BLOCK_MINORS=32 +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_IO_ACCESSORS=y +CONFIG_MMC_SDHCI_OF_ESDHC=y +# CONFIG_MMC_SDHCI_PCI is not set +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MMU_NOTIFIER=y +CONFIG_MODULES_USE_ELF_RELA=y +CONFIG_MODULE_FORCE_LOAD=y +CONFIG_MODVERSIONS=y +# CONFIG_MOUSE_BCM5974 is not set +# CONFIG_MOUSE_CYAPA is not set +CONFIG_MOUSE_PS2=y +CONFIG_MOUSE_PS2_ALPS=y +CONFIG_MOUSE_PS2_BYD=y +CONFIG_MOUSE_PS2_CYPRESS=y +# CONFIG_MOUSE_PS2_ELANTECH is not set +CONFIG_MOUSE_PS2_FOCALTECH=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SMBUS=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y +# CONFIG_MOUSE_PS2_TOUCHKIT is not set +CONFIG_MOUSE_PS2_TRACKPOINT=y +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_VSXXXAA is not set +CONFIG_MPILIB=y +CONFIG_MRP=y +CONFIG_MSCC_OCELOT_SWITCH_LIB=y +CONFIG_MTD_CFI_ADV_OPTIONS=y +# CONFIG_MTD_CFI_GEOMETRY is not set +CONFIG_MTD_CFI_STAA=y +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_DATAFLASH=y +# CONFIG_MTD_DATAFLASH_OTP is not set +# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set +CONFIG_MTD_NAND_CORE=y +CONFIG_MTD_NAND_ECC=y +CONFIG_MTD_NAND_ECC_SW_HAMMING=y +CONFIG_MTD_NAND_FSL_IFC=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_RAW_NAND=y +CONFIG_MTD_SPI_NAND=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_SPLIT_FIRMWARE=y +CONFIG_MTD_SPLIT_FIT_FW=y +CONFIG_MTD_SST25L=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=20 +CONFIG_MTD_UBI_BLOCK=y +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MULTIPLEXER=y +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_MUX_MMIO=y +CONFIG_MV_XOR_V2=y +CONFIG_NAMESPACES=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y +CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y +CONFIG_NEED_SG_DMA_LENGTH=y +CONFIG_NET_DEVLINK=y +CONFIG_NET_DSA=y +CONFIG_NET_DSA_MSCC_FELIX=y +CONFIG_NET_DSA_TAG_OCELOT=y +CONFIG_NET_DSA_TAG_OCELOT_8021Q=y +CONFIG_NET_FAILOVER=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_NS=y +CONFIG_NET_PTP_CLASSIFY=y +CONFIG_NET_SELFTESTS=y +CONFIG_NET_SWITCHDEV=y +CONFIG_NLS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NODES_SHIFT=2 +CONFIG_NO_HZ_COMMON=y +CONFIG_NO_HZ_IDLE=y +CONFIG_NR_CPUS=64 +CONFIG_NUMA=y +CONFIG_NUMA_BALANCING=y +CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y +CONFIG_NVMEM=y +CONFIG_NVMEM_LAYERSCAPE_SFP=y +# CONFIG_NVMEM_SPMI_SDAM is not set +CONFIG_NVMEM_SYSFS=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IOMMU=y +CONFIG_OF_IRQ=y +CONFIG_OF_KOBJ=y +CONFIG_OF_MDIO=y +CONFIG_OF_NUMA=y +CONFIG_PACKET_DIAG=y +CONFIG_PACKING=y +CONFIG_PADATA=y +CONFIG_PAGE_POOL=y +CONFIG_PAGE_REPORTING=y +CONFIG_PAGE_SIZE_LESS_THAN_256KB=y +CONFIG_PAGE_SIZE_LESS_THAN_64KB=y +# CONFIG_PANIC_ON_OOPS is not set +CONFIG_PANIC_ON_OOPS_VALUE=0 +CONFIG_PANIC_TIMEOUT=0 +CONFIG_PARAVIRT=y +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_PARTITION_PERCPU=y +CONFIG_PCI=y +CONFIG_PCIEAER=y +CONFIG_PCIEASPM=y +CONFIG_PCIEASPM_DEFAULT=y +# CONFIG_PCIEASPM_PERFORMANCE is not set +# CONFIG_PCIEASPM_POWERSAVE is not set +# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set +CONFIG_PCIEPORTBUS=y +CONFIG_PCIE_DW=y +CONFIG_PCIE_DW_HOST=y +CONFIG_PCIE_LAYERSCAPE_GEN4=y +CONFIG_PCIE_MOBIVEIL=y +CONFIG_PCIE_MOBIVEIL_HOST=y +CONFIG_PCIE_PME=y +CONFIG_PCI_ATS=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DOMAINS_GENERIC=y +CONFIG_PCI_ECAM=y +CONFIG_PCI_HISI=y +CONFIG_PCI_HOST_COMMON=y +CONFIG_PCI_HOST_GENERIC=y +CONFIG_PCI_IOV=y +CONFIG_PCI_LAYERSCAPE=y +CONFIG_PCI_MSI=y +CONFIG_PCI_MSI_IRQ_DOMAIN=y +CONFIG_PCS_LYNX=y +CONFIG_PGTABLE_LEVELS=4 +CONFIG_PHYLIB=y +CONFIG_PHYLINK=y +CONFIG_PHYS_ADDR_T_64BIT=y +# CONFIG_PHY_FSL_LYNX_28G is not set +CONFIG_PHY_XGENE=y +CONFIG_PID_IN_CONTEXTIDR=y +CONFIG_PID_NS=y +CONFIG_PL330_DMA=y +CONFIG_PM=y +CONFIG_PM_CLK=y +CONFIG_PM_OPP=y +CONFIG_PM_SLEEP=y +CONFIG_PM_SLEEP_SMP=y +CONFIG_PM_STD_PARTITION="" +CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_SYSCON=y +CONFIG_POWER_RESET_VEXPRESS=y +CONFIG_POWER_RESET_XGENE=y +CONFIG_POWER_SUPPLY=y +CONFIG_PPS=y +CONFIG_PREEMPT=y +CONFIG_PREEMPTION=y +CONFIG_PREEMPT_BUILD=y +CONFIG_PREEMPT_COUNT=y +# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_RCU=y +CONFIG_PRINTK_TIME=y +CONFIG_PRINT_QUOTA_WARNING=y +CONFIG_PROC_CHILDREN=y +CONFIG_PROFILING=y +CONFIG_PTP_1588_CLOCK=y +CONFIG_PTP_1588_CLOCK_OPTIONAL=y +CONFIG_PTP_1588_CLOCK_QORIQ=y +CONFIG_QCOM_HIDMA=y +CONFIG_QCOM_HIDMA_MGMT=y +CONFIG_QCOM_QDF2400_ERRATUM_0065=y +# CONFIG_QFMT_V2 is not set +CONFIG_QORIQ_CPUFREQ=y +CONFIG_QORIQ_THERMAL=y +CONFIG_QUEUED_RWLOCKS=y +CONFIG_QUEUED_SPINLOCKS=y +CONFIG_QUOTA=y +CONFIG_QUOTACTL=y +CONFIG_RAID6_PQ=y +# CONFIG_RANDOMIZE_KSTACK_OFFSET is not set +CONFIG_RANDSTRUCT_NONE=y +CONFIG_RAS=y +CONFIG_RATIONAL=y +CONFIG_RD_BZIP2=y +CONFIG_RD_GZIP=y +CONFIG_RD_LZMA=y +CONFIG_RD_LZO=y +CONFIG_RD_XZ=y +CONFIG_REALTEK_PHY=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGMAP_SPI=y +CONFIG_RESET_CONTROLLER=y +CONFIG_RFS_ACCEL=y +CONFIG_RODATA_FULL_DEFAULT_ENABLED=y +CONFIG_RPS=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_DS1307=y +CONFIG_RTC_DRV_DS3232=y +CONFIG_RTC_DRV_FSL_FTM_ALARM=y +CONFIG_RTC_DRV_PCF2127=y +CONFIG_RTC_DRV_PL031=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_SCHED_INFO=y +CONFIG_SCHED_MC=y +CONFIG_SCHED_THERMAL_PRESSURE=y +CONFIG_SCSI=y +CONFIG_SCSI_COMMON=y +# CONFIG_SCSI_PROC_FS is not set +# CONFIG_SCSI_SAS_ATA is not set +CONFIG_SCSI_SAS_ATTRS=y +CONFIG_SCSI_SAS_HOST_SMP=y +CONFIG_SCSI_SAS_LIBSAS=y +CONFIG_SECCOMP=y +CONFIG_SECCOMP_FILTER=y +CONFIG_SECRETMEM=y +CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y +CONFIG_SERIAL_8250_DW=y +CONFIG_SERIAL_8250_DWLIB=y +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIAL_8250_SHARE_IRQ=y +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_SERIAL_FSL_LPUART=y +CONFIG_SERIAL_FSL_LPUART_CONSOLE=y +CONFIG_SERIAL_MCTRL_GPIO=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SERIAL_SC16IS7XX=y +CONFIG_SERIAL_SC16IS7XX_CORE=y +# CONFIG_SERIAL_SC16IS7XX_I2C is not set +CONFIG_SERIAL_SC16IS7XX_SPI=y +CONFIG_SERIAL_XILINX_PS_UART=y +CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y +CONFIG_SERIO=y +CONFIG_SERIO_AMBAKMI=y +CONFIG_SERIO_LIBPS2=y +CONFIG_SGL_ALLOC=y +CONFIG_SG_POOL=y +CONFIG_SLAB=y +# CONFIG_SLUB is not set +CONFIG_SMP=y +CONFIG_SOCK_DIAG=y +CONFIG_SOCK_RX_QUEUE_MAPPING=y +CONFIG_SOC_BUS=y +CONFIG_SOFTIRQ_ON_OWN_STACK=y +CONFIG_SPARSEMEM=y +CONFIG_SPARSEMEM_EXTREME=y +CONFIG_SPARSEMEM_VMEMMAP=y +CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPI=y +CONFIG_SPI_FSL_DSPI=y +CONFIG_SPI_FSL_QUADSPI=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_MEM=y +CONFIG_SPI_NXP_FLEXSPI=y +CONFIG_SPI_PL022=y +CONFIG_SPMI=y +# CONFIG_SPMI_HISI3670 is not set +# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set +CONFIG_SQUASHFS_DECOMP_SINGLE=y +CONFIG_SQUASHFS_FILE_CACHE=y +# CONFIG_SQUASHFS_FILE_DIRECT is not set +# CONFIG_SQUASHFS_XZ is not set +CONFIG_SQUASHFS_ZLIB=y +CONFIG_SRAM=y +CONFIG_SRCU=y +# CONFIG_STRIP_ASM_SYMS is not set +CONFIG_SUSPEND=y +CONFIG_SUSPEND_FREEZER=y +CONFIG_SWIOTLB=y +CONFIG_SWIOTLB_XEN=y +CONFIG_SWPHY=y +CONFIG_SYNC_FILE=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_SYSFS_SYSCALL=y +CONFIG_SYS_HYPERVISOR=y +CONFIG_TASKSTATS=y +CONFIG_TASK_DELAY_ACCT=y +CONFIG_TASK_IO_ACCOUNTING=y +CONFIG_TASK_XACCT=y +CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 +CONFIG_THERMAL_EMULATION=y +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THERMAL_OF=y +CONFIG_THP_SWAP=y +CONFIG_THREAD_INFO_IN_TASK=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y +CONFIG_TRANSPARENT_HUGEPAGE=y +CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y +# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set +CONFIG_TRANS_TABLE=y +CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y +# CONFIG_UACCE is not set +CONFIG_UBIFS_FS=y +# CONFIG_UCLAMP_TASK is not set +CONFIG_UIO=y +CONFIG_UIO_AEC=y +CONFIG_UIO_CIF=y +CONFIG_UIO_DMEM_GENIRQ=y +CONFIG_UIO_MF624=y +CONFIG_UIO_NETX=y +CONFIG_UIO_PCI_GENERIC=y +CONFIG_UIO_PDRV_GENIRQ=y +# CONFIG_UIO_PRUSS is not set +CONFIG_UIO_SERCOS3=y +CONFIG_UNINLINE_SPIN_UNLOCK=y +CONFIG_UNIX_DIAG=y +CONFIG_UNMAP_KERNEL_AT_EL0=y +CONFIG_USB_SUPPORT=y +CONFIG_USER_NS=y +CONFIG_USE_PERCPU_NUMA_NODE_ID=y +CONFIG_UTS_NS=y +CONFIG_VEXPRESS_CONFIG=y +CONFIG_VFAT_FS=y +CONFIG_VFIO=y +CONFIG_VFIO_FSL_MC=y +CONFIG_VFIO_IOMMU_TYPE1=y +# CONFIG_VFIO_MDEV is not set +# CONFIG_VFIO_NOIOMMU is not set +CONFIG_VFIO_PCI=y +CONFIG_VFIO_PCI_CORE=y +CONFIG_VFIO_PCI_INTX=y +CONFIG_VFIO_PCI_MMAP=y +CONFIG_VFIO_VIRQFD=y +CONFIG_VGA_ARB=y +CONFIG_VGA_ARB_MAX_GPUS=16 +CONFIG_VIDEOMODE_HELPERS=y +CONFIG_VIRTIO=y +CONFIG_VIRTIO_ANCHOR=y +CONFIG_VIRTIO_BALLOON=y +CONFIG_VIRTIO_BLK=y +CONFIG_VIRTIO_CONSOLE=y +# CONFIG_VIRTIO_IOMMU is not set +CONFIG_VIRTIO_MMIO=y +CONFIG_VIRTIO_NET=y +CONFIG_VIRTIO_PCI=y +CONFIG_VIRTIO_PCI_LEGACY=y +CONFIG_VIRTIO_PCI_LIB=y +CONFIG_VIRTIO_PCI_LIB_LEGACY=y +CONFIG_VITESSE_PHY=y +CONFIG_VLAN_8021Q_GVRP=y +CONFIG_VLAN_8021Q_MVRP=y +CONFIG_VMAP_STACK=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_CONSOLE_SLEEP=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_WATCHDOG_CORE=y +# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set +CONFIG_XARRAY_MULTI=y +CONFIG_XEN=y +CONFIG_XENFS=y +CONFIG_XEN_AUTO_XLATE=y +CONFIG_XEN_BACKEND=y +CONFIG_XEN_BALLOON=y +# CONFIG_XEN_BLKDEV_BACKEND is not set +CONFIG_XEN_BLKDEV_FRONTEND=y +CONFIG_XEN_COMPAT_XENFS=y +CONFIG_XEN_DEV_EVTCHN=y +CONFIG_XEN_DOM0=y +CONFIG_XEN_FBDEV_FRONTEND=y +CONFIG_XEN_GNTDEV=y +CONFIG_XEN_GRANT_DEV_ALLOC=y +# CONFIG_XEN_NETDEV_BACKEND is not set +CONFIG_XEN_NETDEV_FRONTEND=y +# CONFIG_XEN_PCIDEV_STUB is not set +CONFIG_XEN_PRIVCMD=y +# CONFIG_XEN_PVCALLS_BACKEND is not set +# CONFIG_XEN_SCSI_FRONTEND is not set +CONFIG_XEN_SYS_HYPERVISOR=y +# CONFIG_XEN_VIRTIO is not set +# CONFIG_XEN_WDT is not set +CONFIG_XEN_XENBUS_FRONTEND=y +CONFIG_XFS_FS=y +CONFIG_XFS_POSIX_ACL=y +CONFIG_XFS_RT=y +CONFIG_XOR_BLOCKS=y +CONFIG_XPS=y +CONFIG_XXHASH=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_ARMTHUMB=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_XZ_DEC_IA64=y +CONFIG_XZ_DEC_POWERPC=y +CONFIG_XZ_DEC_SPARC=y +CONFIG_XZ_DEC_X86=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y +CONFIG_ZONE_DMA32=y +CONFIG_ZSTD_COMMON=y +CONFIG_ZSTD_COMPRESS=y +CONFIG_ZSTD_DECOMPRESS=y diff --git a/target/linux/layerscape/image/Makefile b/target/linux/layerscape/image/Makefile index dfbda85b3651bf..f2ac9b6f0482ad 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/layerscape/patches-6.1/302-arm64-dts-ls1012a-update-with-ppfe-support.patch b/target/linux/layerscape/patches-6.1/302-arm64-dts-ls1012a-update-with-ppfe-support.patch new file mode 100644 index 00000000000000..70e624a2a9186e --- /dev/null +++ b/target/linux/layerscape/patches-6.1/302-arm64-dts-ls1012a-update-with-ppfe-support.patch @@ -0,0 +1,288 @@ +From 1bb35ff4ce33e65601c8d9c736be52e4aabd6252 Mon Sep 17 00:00:00 2001 +From: Calvin Johnson +Date: Sat, 16 Sep 2017 14:20:23 +0530 +Subject: [PATCH] arm64: dts: freescale: ls1012a: update with ppfe support + +Update ls1012a dtsi and platform dts files with support for ppfe. + +Signed-off-by: Calvin Johnson +Signed-off-by: Anjaneyulu Jagarlmudi +--- + .../boot/dts/freescale/fsl-ls1012a-frdm.dts | 43 +++++++++++++++++ + .../boot/dts/freescale/fsl-ls1012a-frwy.dts | 43 +++++++++++++++++ + .../boot/dts/freescale/fsl-ls1012a-qds.dts | 43 +++++++++++++++++ + .../boot/dts/freescale/fsl-ls1012a-rdb.dts | 47 +++++++++++++++++++ + .../arm64/boot/dts/freescale/fsl-ls1012a.dtsi | 29 ++++++++++++ + 5 files changed, 205 insertions(+) + +--- a/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts +@@ -14,6 +14,11 @@ + model = "LS1012A Freedom Board"; + compatible = "fsl,ls1012a-frdm", "fsl,ls1012a"; + ++ aliases { ++ ethernet0 = &pfe_mac0; ++ ethernet1 = &pfe_mac1; ++ }; ++ + sys_mclk: clock-mclk { + compatible = "fixed-clock"; + #clock-cells = <0>; +@@ -95,6 +100,44 @@ + }; + }; + ++&pfe { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ pfe_mac0: ethernet@0 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x0>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x0>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x2>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x0>; ++ phy-mode = "sgmii"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x1>; /* enabled/disabled */ ++ }; ++ }; ++ ++ pfe_mac1: ethernet@1 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x1>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x1>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x1>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x0>; ++ phy-mode = "sgmii"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x0>; /* enabled/disabled */ ++ }; ++ }; ++}; ++ + &qspi { + status = "okay"; + +--- a/arch/arm64/boot/dts/freescale/fsl-ls1012a-frwy.dts ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-frwy.dts +@@ -14,6 +14,11 @@ + / { + model = "LS1012A FRWY Board"; + compatible = "fsl,ls1012a-frwy", "fsl,ls1012a"; ++ ++ aliases { ++ ethernet0 = &pfe_mac0; ++ ethernet1 = &pfe_mac1; ++ }; + }; + + &duart0 { +@@ -28,6 +33,44 @@ + status = "okay"; + }; + ++&pfe { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ pfe_mac0: ethernet@0 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x0>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x0>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x2>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x0>; ++ phy-mode = "sgmii"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x1>; /* enabled/disabled */ ++ }; ++ }; ++ ++ pfe_mac1: ethernet@1 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x1>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x1>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x1>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x0>; ++ phy-mode = "sgmii"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x0>; /* enabled/disabled */ ++ }; ++ }; ++}; ++ + &qspi { + status = "okay"; + +--- a/arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts +@@ -18,6 +18,11 @@ + mmc1 = &esdhc1; + }; + ++ aliases { ++ ethernet0 = &pfe_mac0; ++ ethernet1 = &pfe_mac1; ++ }; ++ + sys_mclk: clock-mclk { + compatible = "fixed-clock"; + #clock-cells = <0>; +@@ -132,6 +137,44 @@ + }; + }; + }; ++ ++&pfe { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ pfe_mac0: ethernet@0 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x0>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x0>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x1>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x2>; ++ phy-mode = "sgmii-2500"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x1>; /* enabled/disabled */ ++ }; ++ }; ++ ++ pfe_mac1: ethernet@1 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x1>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x1>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x2>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x3>; ++ phy-mode = "sgmii-2500"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x0>; /* enabled/disabled */ ++ }; ++ }; ++}; + + &qspi { + status = "okay"; +--- a/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts +@@ -16,6 +16,8 @@ + + aliases { + serial0 = &duart0; ++ ethernet0 = &pfe_mac0; ++ ethernet1 = &pfe_mac1; + mmc0 = &esdhc0; + mmc1 = &esdhc1; + }; +@@ -86,6 +88,44 @@ + }; + }; + ++&pfe { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ pfe_mac0: ethernet@0 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x0>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x0>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x2>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x0>; ++ phy-mode = "sgmii"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x1>; /* enabled/disabled */ ++ }; ++ }; ++ ++ pfe_mac1: ethernet@1 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x1>; /* GEM_ID */ ++ fsl,gemac-bus-id = < 0x1 >; /* BUS_ID */ ++ fsl,gemac-phy-id = < 0x1 >; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x0>; ++ phy-mode = "rgmii-txid"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x0>; /* enabled/disabled */ ++ }; ++ }; ++}; ++ + &qspi { + status = "okay"; + +--- a/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi +@@ -568,6 +568,35 @@ + }; + }; + ++ reserved-memory { ++ #address-cells = <2>; ++ #size-cells = <2>; ++ ranges; ++ ++ pfe_reserved: packetbuffer@83400000 { ++ reg = <0 0x83400000 0 0xc00000>; ++ }; ++ }; ++ ++ pfe: pfe@04000000 { ++ compatible = "fsl,pfe"; ++ reg = <0x0 0x04000000 0x0 0xc00000>, /* AXI 16M */ ++ <0x0 0x83400000 0x0 0xc00000>; /* PFE DDR 12M */ ++ reg-names = "pfe", "pfe-ddr"; ++ fsl,pfe-num-interfaces = <0x2>; ++ interrupts = <0 172 0x4>, /* HIF interrupt */ ++ <0 173 0x4>, /*HIF_NOCPY interrupt */ ++ <0 174 0x4>; /* WoL interrupt */ ++ interrupt-names = "pfe_hif", "pfe_hif_nocpy", "pfe_wol"; ++ memory-region = <&pfe_reserved>; ++ fsl,pfe-scfg = <&scfg 0>; ++ fsl,rcpm-wakeup = <&rcpm 0xf0000020>; ++ clocks = <&clockgen 4 0>; ++ clock-names = "pfe"; ++ ++ status = "okay"; ++ }; ++ + firmware { + optee { + compatible = "linaro,optee-tz"; diff --git a/target/linux/layerscape/patches-6.1/303-arm64-dts-ls1012a-frdm-workaround-by-updating-qspi-f.patch b/target/linux/layerscape/patches-6.1/303-arm64-dts-ls1012a-frdm-workaround-by-updating-qspi-f.patch new file mode 100644 index 00000000000000..5d19cb92dc0d53 --- /dev/null +++ b/target/linux/layerscape/patches-6.1/303-arm64-dts-ls1012a-frdm-workaround-by-updating-qspi-f.patch @@ -0,0 +1,41 @@ +From 9c5c18dbf8e1845d349ef7020f8af5bc9b56ed1f Mon Sep 17 00:00:00 2001 +From: Pawel Dembicki +Date: Fri, 28 Sep 2022 17:14:32 +0200 +Subject: [PATCH] arm64: dts: ls1012a-frdm/qds: workaround by updating qspi flash to + single mode + +Update rx and tx bus-width to 1 to use single mode to workaround ubifs +issue found with double mode. (The same method as RDB board) + +Signed-off-by: Pawel Dembicki +--- + arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts | 4 ++-- + arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts | 4 ++-- + 2 file changed, 4 insertions(+), 4 deletions(-) + +--- a/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts +@@ -148,8 +148,8 @@ + spi-max-frequency = <50000000>; + m25p,fast-read; + reg = <0>; +- spi-rx-bus-width = <2>; +- spi-tx-bus-width = <2>; ++ spi-rx-bus-width = <1>; ++ spi-tx-bus-width = <1>; + }; + }; + +--- a/arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts +@@ -186,8 +186,8 @@ + spi-max-frequency = <50000000>; + m25p,fast-read; + reg = <0>; +- spi-rx-bus-width = <2>; +- spi-tx-bus-width = <2>; ++ spi-rx-bus-width = <1>; ++ spi-tx-bus-width = <1>; + }; + }; + diff --git a/target/linux/layerscape/patches-6.1/304-arm64-dts-ls1012a-rdb-workaround-by-updating-qspi-fl.patch b/target/linux/layerscape/patches-6.1/304-arm64-dts-ls1012a-rdb-workaround-by-updating-qspi-fl.patch new file mode 100644 index 00000000000000..53cfd193b78672 --- /dev/null +++ b/target/linux/layerscape/patches-6.1/304-arm64-dts-ls1012a-rdb-workaround-by-updating-qspi-fl.patch @@ -0,0 +1,29 @@ +From 9c5c18dbf8e1845d349ef7020f8af5bc9b56ed1f Mon Sep 17 00:00:00 2001 +From: Kuldeep Singh +Date: Tue, 7 Jan 2020 17:14:32 +0530 +Subject: [PATCH] arm64: dts: ls1012a-rdb: workaround by updating qspi flash to + single mode + +Update rx and tx bus-width to 1 to use single mode to workaround ubifs +issue found with double mode. + +[ Leo: Local workaround ] + +Signed-off-by: Kuldeep Singh +--- + arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts +@@ -136,8 +136,8 @@ + spi-max-frequency = <50000000>; + m25p,fast-read; + reg = <0>; +- spi-rx-bus-width = <2>; +- spi-tx-bus-width = <2>; ++ spi-rx-bus-width = <1>; ++ spi-tx-bus-width = <1>; + }; + }; + diff --git a/target/linux/layerscape/patches-6.1/305-arm64-dts-ls1046a-rdb-Update-qspi-spi-rx-bus-width-t.patch b/target/linux/layerscape/patches-6.1/305-arm64-dts-ls1046a-rdb-Update-qspi-spi-rx-bus-width-t.patch new file mode 100644 index 00000000000000..9bc4e2b520afb7 --- /dev/null +++ b/target/linux/layerscape/patches-6.1/305-arm64-dts-ls1046a-rdb-Update-qspi-spi-rx-bus-width-t.patch @@ -0,0 +1,34 @@ +From 38093ebbf25eb60a1aa863f46118a68a0300c56e Mon Sep 17 00:00:00 2001 +From: Kuldeep Singh +Date: Fri, 3 Jan 2020 14:49:07 +0530 +Subject: [PATCH] arm64: dts: ls1046a-rdb: Update qspi spi-rx-bus-width to 1 + +Update rx width from quad mode to single mode as a workaround. + +[Leo: Local workaround ] + +Signed-off-by: Kuldeep Singh +--- + arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts +@@ -104,7 +104,7 @@ + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <50000000>; +- spi-rx-bus-width = <4>; ++ spi-rx-bus-width = <1>; + spi-tx-bus-width = <1>; + reg = <0>; + }; +@@ -114,7 +114,7 @@ + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <50000000>; +- spi-rx-bus-width = <4>; ++ spi-rx-bus-width = <1>; + spi-tx-bus-width = <1>; + reg = <1>; + }; diff --git a/target/linux/layerscape/patches-6.1/400-LF-20-3-mtd-spi-nor-Use-1-bit-mode-of-spansion-s25fs.patch b/target/linux/layerscape/patches-6.1/400-LF-20-3-mtd-spi-nor-Use-1-bit-mode-of-spansion-s25fs.patch new file mode 100644 index 00000000000000..b06c0f8133a12b --- /dev/null +++ b/target/linux/layerscape/patches-6.1/400-LF-20-3-mtd-spi-nor-Use-1-bit-mode-of-spansion-s25fs.patch @@ -0,0 +1,27 @@ +From 20b1193c8c1d81a8d44ae36e579f70e6fbab45b9 Mon Sep 17 00:00:00 2001 +From: Han Xu +Date: Tue, 14 Apr 2020 11:58:44 -0500 +Subject: [PATCH] LF-20-3 mtd: spi-nor: Use 1 bit mode of spansion(s25fs512s) + flash + +This is a workaround patch which uses only single bit mode of s25fs512s +flash + +Signed-off-by: Han Xu +Signed-off-by: Kuldeep Singh +--- + drivers/mtd/spi-nor/spansion.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mtd/spi-nor/spansion.c ++++ b/drivers/mtd/spi-nor/spansion.c +@@ -398,8 +398,8 @@ static const struct flash_info spansion_ + MFR_FLAGS(USE_CLSR) + }, + { "s25fs512s", INFO6(0x010220, 0x4d0081, 256 * 1024, 256) +- NO_SFDP_FLAGS(SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) + MFR_FLAGS(USE_CLSR) ++ FIXUP_FLAGS(SPI_NOR_4B_OPCODES) + .fixups = &s25fs_s_nor_fixups, }, + { "s25sl12800", INFO(0x012018, 0x0300, 256 * 1024, 64) }, + { "s25sl12801", INFO(0x012018, 0x0301, 64 * 1024, 256) }, diff --git a/target/linux/layerscape/patches-6.1/701-staging-add-fsl_ppfe-driver.patch b/target/linux/layerscape/patches-6.1/701-staging-add-fsl_ppfe-driver.patch new file mode 100644 index 00000000000000..a52ac6201fdf47 --- /dev/null +++ b/target/linux/layerscape/patches-6.1/701-staging-add-fsl_ppfe-driver.patch @@ -0,0 +1,11808 @@ +From 4bb50554937246443767e89d32e54df7a12396ca Mon Sep 17 00:00:00 2001 +From: Calvin Johnson +Date: Sat, 16 Sep 2017 07:05:49 +0530 +Subject: [PATCH] staging: add fsl_ppfe driver +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This is squash of all commits with ppfe driver taken from NXP 6.1 tree: +https://github.com/nxp-qoriq/linux/tree/lf-6.1.y + +List of original commits: + +net: fsl_ppfe: dts binding for ppfe + +Signed-off-by: Calvin Johnson +Signed-off-by: Anjaneyulu Jagarlmudi + +staging: fsl_ppfe/eth: header files for pfe driver + +This patch has all pfe header files. + +Signed-off-by: Calvin Johnson +Signed-off-by: Anjaneyulu Jagarlmudi + +staging: fsl_ppfe/eth: introduce pfe driver + + This patch introduces Linux support for NXP's LS1012A Packet +Forwarding Engine (pfe_eth). LS1012A uses hardware packet forwarding +engine to provide high performance Ethernet interfaces. The device +includes two Ethernet ports. + +Signed-off-by: Calvin Johnson +Signed-off-by: Anjaneyulu Jagarlmudi + +staging: fsl_ppfe/eth: fix RGMII tx delay issue + +Recently logic to enable RGMII tx delay was changed by +below patch. + +https://patchwork.kernel.org/patch/9447581/ + +Based on the patch, appropriate change is made in PFE driver. + +Signed-off-by: Calvin Johnson +Signed-off-by: Anjaneyulu Jagarlmudi + +staging: fsl_ppfe/eth: remove unused functions + +Remove unused functions hif_xmit_pkt & hif_lib_xmit_pkt. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: fix read/write/ack idx issue + +While fixing checkpatch errors some of the index increments +were commented out. They are enabled. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: Make phy_ethtool_ksettings_get return void + +Make return value void since function never return meaningful value + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: add function to update tmu credits + +__hif_lib_update_credit function is used to update the tmu credits. +If tx_qos is set, tmu credit is updated based on the number of packets +transmitted by tmu. + +Signed-off-by: Calvin Johnson +Signed-off-by: Anjaneyulu Jagarlmudi + +staging: fsl_ppfe/eth: Avoid packet drop at TMU queues + +Added flow control between TMU queues and PFE Linux driver, +based on TMU credits availability. +Added tx_qos module parameter to control this behavior. +Use queue-0 as default queue to transmit packets. + +Signed-off-by: Calvin Johnson +Signed-off-by: Akhila Kavi +Signed-off-by: Anjaneyulu Jagarlmudi + +staging: fsl_ppfe/eth: Enable PFE in clause 45 mode + +when we opearate in clause 45 mode, we need to call +the function get_phy_device() with its 3rd argument as +"true" and then the resultant phy device needs to be +register with phy layer via phy_device_register() + +Signed-off-by: Bhaskar Upadhaya + +staging: fsl_ppfe/eth: Disable autonegotiation for 2.5G SGMII + +PCS initialization sequence for 2.5G SGMII interface governs +auto negotiation to be in disabled mode + +Signed-off-by: Bhaskar Upadhaya + +staging: fsl_ppfe/eth: calculate PFE_PKT_SIZE with SKB_DATA_ALIGN + +pfe packet size was calculated without considering skb data alignment +and this resulted in jumbo frames crashing kernel when the +cacheline size increased from 64 to 128 bytes with +commit 97303480753e ("arm64: Increase the max granular size"). + +Modify pfe packet size caclulation to include skb data alignment of +sizeof(struct skb_shared_info). + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: support for userspace networking + +This patch adds the userspace mode support to fsl_ppfe network driver. +In the new mode, basic hardware initialization is performed in kernel, while +the datapath and HIF handling is the responsibility of the userspace. + +The new command line parameter is added to initialize the ppfe module +in userspace mode. By default the module remains in kernelspace networking +mode. +To enable userspace mode, use "insmod pfe.ko us=1" + +Signed-off-by: Akhil Goyal +Signed-off-by: Gagandeep Singh + +staging: fsl_ppfe/eth: unregister netdev after pfe_phy_exit + +rmmod pfe.ko throws below warning: + +kernfs: can not remove 'phydev', no directory +------------[ cut here ]------------ +WARNING: CPU: 0 PID: 2230 at fs/kernfs/dir.c:1481 +kernfs_remove_by_name_ns+0x90/0xa0 + +This is caused when the unregistered netdev structure is accessed to +disconnect phy. + +Resolve the issue by unregistering netdev after disconnecting phy. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: HW parse results for DPDK + +HW Parse results are included in the packet headroom. +Length and Offset calculation now accommodates parse info size. + +Signed-off-by: Archana Madhavan + +staging: fsl_ppfe/eth: reorganize pfe_netdev_ops + +Reorganize members of struct pfe_netdev_ops to match with the order +of members in struct net_device_ops defined in include/linux/netdevice.h + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: use mask for rx max frame len + +Define and use PFE_RCR_MAX_FL_MASK to properly set Rx max frame +length of MAC Receive Control Register. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: define pfe ndo_change_mtu function + +Define ndo_change_mtu function for pfe. This sets the max Rx frame +length to the new mtu. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: remove jumbo frame enable from gemac init + +MAC Receive Control Register was configured to allow jumbo frames. +This is removed as jumbo frames can be supported anytime by changing +mtu which will in turn modify MAX_FL field of MAC RCR. +Jumbo frames caused pfe to hang on LS1012A rev 1.0 Silicon due to +erratum A-010897. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: disable CRC removal + +Disable CRC removal from the packet, so that packets are forwarded +as is to Linux. +CRC configuration in MAC will be reflected in the packet received +to Linux. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: handle ls1012a errata_a010897 + +On LS1012A rev 1.0, Jumbo frames are not supported as it causes +the PFE controller to hang. A reset of the entire chip is required +to resume normal operation. + +To handle this errata, frames with length > 1900 are truncated for +rev 1.0 of LS1012A. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: replace magic numbers + +Replace magic numbers and some cosmetic changes. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: resolve indentation warning + +Resolve the following indentation warning: + +drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c: +In function ‘pfe_get_gemac_if_proprties’: +drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c:96:2: +warning: this ‘else’ clause does not guard... +[-Wmisleading-indentation] + else + ^~~~ +drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c:98:3: +note: ...this statement, but the latter is misleadingly indented as +if it were guarded by the ‘else’ + pdata->ls1012a_eth_pdata[port].mdio_muxval = phy_id; + ^~~~~ + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: add fixed-link support + +In cases where MAC is not connected to a normal MDIO-managed PHY +device, and instead to a switch, it is configured as a "fixed-link". +Code to handle this scenario is added here. + +phy_node in the dtb is checked to identify a fixed-link. +On identification of a fixed-link, it is registered and connected. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe: add support for a char dev for link status + +Read and IOCTL support is added. Application would need to open, +read/ioctl the /dev/pfe_us_cdev device. +select is pending as it requires a wait_queue. + +Signed-off-by: Shreyansh Jain +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe: enable hif event from userspace + +HIF interrupts are enabled using ioctl from user space, +and epoll wait from user space wakes up when there is an HIF +interrupt. + +Signed-off-by: Akhil Goyal + +staging: fsl_ppfe: performance tuning for user space + +interrupt coalescing of 100 usec is added. + +Signed-off-by: Akhil Goyal +Signed-off-by: Sachin Saxena + +staging: fsl_ppfe/eth: Update to use SPDX identifiers + +Replace license text with corresponding SPDX identifiers and update the +format of existing SPDX identifiers to follow the new guideline +Documentation/process/license-rules.rst. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: misc clean up + +- remove redundant hwfeature init +- remove unused vars from ls1012a_eth_platform_data +- To handle ls1012a errata_a010897, PPFE driver requires GUTS driver +to be compiled in. Select FSL_GUTS when PPFE driver is compiled. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: reorganize platform phy parameters + +- Use "phy-handle" and of_* functions to get phy node and fixed-link +parameters + +- Reorganize phy parameters and initialize them only if phy-handle +or fixed-link is defined in the dtb. + +- correct typo pfe_get_gemac_if_proprties to pfe_get_gemac_if_properties + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: support single interface initialization + +- arrange members of struct mii_bus in sequence matching phy.h +- if mdio node is defined, use of_mdiobus_register to register + child nodes (phy devices) available on the mdio bus. +- remove of_phy_register_fixed_link from pfe_phy_init as it is being + handled in pfe_get_gemac_if_properties +- remove mdio enabled check +- skip phy init, if no PHY or fixed-link + +Signed-off-by: Calvin Johnson + +net: fsl_ppfe: update dts properties for phy + +Use commonly used phy-handle property and mdio subnode to handle +phy properties. + +Deprecate bindings fsl,gemac-phy-id & fsl,pfe-phy-if-flags. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: remove unused code + +- remove gemac-bus-id related code that is unused. +- remove unused prototype gemac_set_mdc_div. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: separate mdio init from mac init + +- separate mdio initialization from mac initialization +- Define pfe_mdio_priv_s structure to hold mii_bus structure and other + related data. +- Modify functions to work with the separted mdio init model. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: adapt to link mode based phydev changes + +Setting link mode bits have changed with the integration of +commit (3c1bcc8 net: ethernet: Convert phydev advertize and +supported from u32 to link mode). Adapt to the new method of +setting and clearing the link mode bits. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: use generic soc_device infra instead of fsl_guts_get_svr() + +Commit ("soc: fsl: guts: make fsl_guts_get_svr() static") has +made fsl_guts_get_svr() static and hence use generic soc_device +infrastructure to check SoC revision. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: use memremap() to map RAM area used by PFE + +RAM area used by PFE should be mapped using memremap() instead of +directly traslating physical addr to virtual. This will ensure proper +checks are done before the area is used. + +Signed-off-by: Calvin Johnson + +staging: fsl_ppfe/eth: remove 'fallback' argument from dev->ndo_select_queue() + +To be consistent with upstream API change. + +Signed-off-by: Li Yang + +staging: fsl_ppfe/eth: prefix header search paths with $(srctree)/ + +Currently, the rules for configuring search paths in Kbuild have +changed: https://lkml.org/lkml/2019/5/13/37 + +This will lead the below error: + +fatal error: pfe/pfe.h: No such file or directory + +Fix it by adding $(srctree)/ prefix to the search paths. + +Signed-off-by: Ting Liu + +staging: fsl_ppfe/eth: add pfe support to Kconfig and Makefile + +Signed-off-by: Calvin Johnson +[ Aisheng: fix minor conflict due to removed VBOXSF_FS ] +Signed-off-by: Dong Aisheng + +staging: fsl_ppfe/eth: Disable termination of CRC fwd. + +LS1012A MAC PCS block has an erratum that is seen with specific PHY AR803x. +The issue is triggered by the (spec-compliant) operation of the AR803x PHY +on the LS1012A-FRWY board.Due to this, good FCS packet is reported as error +packet by MAC, so for these error packets FCS should be validated and +discard only real error packets in PFE Rx packet path. + +Signed-off-by: Nagesh Koneti +Signed-off-by: Nagesh Koneti <“koneti.nagesh@nxp.com”> + +net: ppfe: Cope with of_get_phy_mode() API change + +Signed-off-by: Li Yang + +staging: fsl_ppfe/eth: Enhance error checking in platform probe + +Fix the kernel crash when MAC addr is not passed in dtb. + +Signed-off-by: Anji Jagarlmudi + +staging: fsl_ppfe/eth: reject unsupported coalescing params + +Set ethtool_ops->supported_coalesce_params to let +the core reject unsupported coalescing parameters. + +Signed-off-by: Anji Jagarlmudi + +staging: fsl_ppfe/eth:check "reg" property before pfe_get_gemac_if_properties() + +It has been observed that the function pfe_get_gemac_if_properties() is +been called blindly for the next two child nodes. There might be some +cases where it may go wrong and that lead to missing interfaces. +with these changes it is ensured thats not the case. + +Signed-off-by: Chaitanya Sakinam +Signed-off-by: Anji J + +staging: fsl_ppfe/eth: "struct firmware" dereference is reduced in many functions + +firmware structure's data variable is the actual elf data. It has been +dereferenced in multiple functions and this has been reduced. + +Signed-off-by: Chaitanya Sakinam +Signed-off-by: Anji J + +staging: fsl_ppfe/eth: LF-27 load pfe binaries from FDT + +FDT prepared in uboot now has pfe firmware part of it. +These changes will read the firmware by default from it and tries to load +the elf into the PFE PEs. This help build the pfe driver pasrt of kernel. + +Signed-off-by: Chaitanya Sakinam +Signed-off-by: Anji J + +staging: fsl_ppfe/eth: proper handling for RGMII delay mode + +The correct setting for the RGMII ports on LS1012ARDB is to +enable delay on both Tx and Rx. So the phy mode to be matched +is PHY_INTERFACE_MODE_RGMII_ID. + +Signed-off-by: Chaitanya Sakinam +Signed-off-by: Anji Jagarlmudi + +LF-1762-2 staging: fsl_ppfe: replace '---help---' in Kconfig files with 'help' + +Update Kconfig to cope with upstream change +commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over +'---help---'"). + +Signed-off-by: Dong Aisheng + +staging: fsl_ppfe/eth: Nesting level does not match indentation + +corrected nesting level +LF-1661 and Coverity CID: 8879316 + +Signed-off-by: Chaitanya Sakinam + +staging: fsl_ppfe/eth: Initialized scalar variable + +Proper initialization of scalar variable +LF-1657 and Coverity CID: 3335133 + +Signed-off-by: Chaitanya Sakinam + +staging: fsl_ppfe/eth: misspelt variable name + +variable name corrected +LF-1656 and Coverity CID: 3335119 + +Signed-off-by: Chaitanya Sakinam + +staging: fsl_ppfe/eth: Avoiding out-of-bound writes + +avoid out-of-bound writes with proper error handling +LF-1654, LF-1652 and Coverity CID: 3335106, 3335090 + +Signed-off-by: Chaitanya Sakinam + +staging: fsl_ppfe/eth: Initializing scalar variable + +proper initialization of scalar variable. +LF-1653 and Coverity CID: 3335101 + +Signed-off-by: Chaitanya Sakinam + +staging: fsl_ppfe/eth: checking return value + +proper checks added and handled for return value. +LF-1644 and Coverity CID: 241888 + +Signed-off-by: Chaitanya Sakinam + +staging: fsl_ppfe/eth: Avoid out-of-bound access + +proper handling to avoid out-of-bound access +LF-1642, LF-1641 and Coverity CID: 240910, 240891 + +Signed-off-by: Chaitanya Sakinam + +staging: fsl_ppfe/eth: Avoiding out-of-bound writes + +avoid out-of-bound writes with proper error handling +LF-1654, LF-1652 and Coverity CID: 3335106, 3335090 + +Signed-off-by: Chaitanya Sakinam + +staging: fsl_ppfe/eth: return value init in error case + +proper err return in error case. +LF-1806 and Coverity CID: 10468592 + +Signed-off-by: Chaitanya Sakinam + +staging: fsl_ppfe/eth: Avoid recursion in header inclusion + +Avoiding header inclusions that are not necessary and also that are +causing header inclusion recursion. + +LF-2102 and Coverity CID: 240838 + +Signed-off-by: Chaitanya Sakinam + +staging: fsl_ppfe/eth: Avoiding return value overwrite + +avoid return value overwrite at the end of function. +LF-2136, LF-2137 and Coverity CID: 8879341, 8879364 + +Signed-off-by: Chaitanya Sakinam + +staging: fsl_ppfe/eth: LF-27 enabling PFE firmware load from FDT + +The macro, "LOAD_PFEFIRMWARE_FROM_FILESYSTEM" is been disabled to load +the firmware from FDT by default. Enabling the macro will load the +firmware from filesystem. + +Also, the Makefile is now tuned to build pfe as per the config option + +Signed-off-by: Chaitanya Sakinam + +staging: fsl_ppfe/eth: Ethtool stats correction for IEEE_rx_drop counter + +Due to carrier extended bug the phy counter IEEE_rx_drop counter is +incremented some times and phy reports the packet has crc error. +Because of this PFE revalidates all the packets that are marked crc +error by phy. Now, the counter phy reports is till bogus and this +patch decrements the counter by pfe revalidated (and are crc ok) +counter amount. + +Signed-off-by: Chaitanya Sakinam + +staging: fsl_ppfe/eth: PFE firmware load enhancements + +PFE driver enhancements to load the PE firmware from filesystem +when the firmware is not found in FDT. + +Signed-off-by: Chaitanya Sakinam + +staging: fsl_ppfe: deal with upstream API change of of_get_mac_address() + +Uptream commit 83216e398 changed the of_get_mac_address() API, update +the user accordingly. + +Signed-off-by: Li Yang + +staging: fsl_ppfe: update coalesce setting uAPI usage + +API changed since: +f3ccfda19319 ("ethtool: extend coalesce setting uAPI with CQE mode") + +Signed-off-by: Dong Aisheng + +staging: fsl_ppfe: Addressed build warnings + +Signed-off-by: Chaitanya Sakinam + +staging: fsl_ppfe: Addressed build warnings + +Signed-off-by: Chaitanya Sakinam + +Signed-off-by: Pawel Dembicki +--- + .../devicetree/bindings/net/fsl_ppfe/pfe.txt | 199 ++ + MAINTAINERS | 8 + + drivers/staging/Kconfig | 2 + + drivers/staging/Makefile | 1 + + drivers/staging/fsl_ppfe/Kconfig | 21 + + drivers/staging/fsl_ppfe/Makefile | 20 + + drivers/staging/fsl_ppfe/TODO | 2 + + drivers/staging/fsl_ppfe/include/pfe/cbus.h | 78 + + .../staging/fsl_ppfe/include/pfe/cbus/bmu.h | 55 + + .../fsl_ppfe/include/pfe/cbus/class_csr.h | 289 ++ + .../fsl_ppfe/include/pfe/cbus/emac_mtip.h | 242 ++ + .../staging/fsl_ppfe/include/pfe/cbus/gpi.h | 86 + + .../staging/fsl_ppfe/include/pfe/cbus/hif.h | 100 + + .../fsl_ppfe/include/pfe/cbus/hif_nocpy.h | 50 + + .../fsl_ppfe/include/pfe/cbus/tmu_csr.h | 168 ++ + .../fsl_ppfe/include/pfe/cbus/util_csr.h | 61 + + drivers/staging/fsl_ppfe/include/pfe/pfe.h | 372 +++ + drivers/staging/fsl_ppfe/pfe_cdev.c | 258 ++ + drivers/staging/fsl_ppfe/pfe_cdev.h | 41 + + drivers/staging/fsl_ppfe/pfe_ctrl.c | 226 ++ + drivers/staging/fsl_ppfe/pfe_ctrl.h | 100 + + drivers/staging/fsl_ppfe/pfe_debugfs.c | 99 + + drivers/staging/fsl_ppfe/pfe_debugfs.h | 13 + + drivers/staging/fsl_ppfe/pfe_eth.c | 2588 +++++++++++++++++ + drivers/staging/fsl_ppfe/pfe_eth.h | 175 ++ + drivers/staging/fsl_ppfe/pfe_firmware.c | 398 +++ + drivers/staging/fsl_ppfe/pfe_firmware.h | 21 + + drivers/staging/fsl_ppfe/pfe_hal.c | 1517 ++++++++++ + drivers/staging/fsl_ppfe/pfe_hif.c | 1063 +++++++ + drivers/staging/fsl_ppfe/pfe_hif.h | 199 ++ + drivers/staging/fsl_ppfe/pfe_hif_lib.c | 628 ++++ + drivers/staging/fsl_ppfe/pfe_hif_lib.h | 229 ++ + drivers/staging/fsl_ppfe/pfe_hw.c | 164 ++ + drivers/staging/fsl_ppfe/pfe_hw.h | 15 + + .../staging/fsl_ppfe/pfe_ls1012a_platform.c | 383 +++ + drivers/staging/fsl_ppfe/pfe_mod.c | 158 + + drivers/staging/fsl_ppfe/pfe_mod.h | 103 + + drivers/staging/fsl_ppfe/pfe_perfmon.h | 26 + + drivers/staging/fsl_ppfe/pfe_sysfs.c | 840 ++++++ + drivers/staging/fsl_ppfe/pfe_sysfs.h | 17 + + 40 files changed, 11015 insertions(+) + create mode 100644 Documentation/devicetree/bindings/net/fsl_ppfe/pfe.txt + create mode 100644 drivers/staging/fsl_ppfe/Kconfig + create mode 100644 drivers/staging/fsl_ppfe/Makefile + create mode 100644 drivers/staging/fsl_ppfe/TODO + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/bmu.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/class_csr.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/emac_mtip.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/gpi.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/hif.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/hif_nocpy.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/tmu_csr.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/util_csr.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/pfe.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_cdev.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_cdev.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_ctrl.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_ctrl.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_debugfs.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_debugfs.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_eth.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_eth.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_firmware.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_firmware.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_hal.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_hif.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_hif.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_hif_lib.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_hif_lib.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_hw.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_hw.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_mod.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_mod.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_perfmon.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_sysfs.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_sysfs.h + +--- /dev/null ++++ b/Documentation/devicetree/bindings/net/fsl_ppfe/pfe.txt +@@ -0,0 +1,199 @@ ++============================================================================= ++NXP Programmable Packet Forwarding Engine Device Bindings ++ ++CONTENTS ++ - PFE Node ++ - Ethernet Node ++ ++============================================================================= ++PFE Node ++ ++DESCRIPTION ++ ++PFE Node has all the properties associated with Packet Forwarding Engine block. ++ ++PROPERTIES ++ ++- compatible ++ Usage: required ++ Value type: ++ Definition: Must include "fsl,pfe" ++ ++- reg ++ Usage: required ++ Value type: ++ Definition: A standard property. ++ Specifies the offset of the following registers: ++ - PFE configuration registers ++ - DDR memory used by PFE ++ ++- fsl,pfe-num-interfaces ++ Usage: required ++ Value type: ++ Definition: Must be present. Value can be either one or two. ++ ++- interrupts ++ Usage: required ++ Value type: ++ Definition: Three interrupts are specified in this property. ++ - HIF interrupt ++ - HIF NO COPY interrupt ++ - Wake On LAN interrupt ++ ++- interrupt-names ++ Usage: required ++ Value type: ++ Definition: Following strings are defined for the 3 interrupts. ++ "pfe_hif" - HIF interrupt ++ "pfe_hif_nocpy" - HIF NO COPY interrupt ++ "pfe_wol" - Wake On LAN interrupt ++ ++- memory-region ++ Usage: required ++ Value type: ++ Definition: phandle to a node describing reserved memory used by pfe. ++ Refer:- Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt ++ ++- fsl,pfe-scfg ++ Usage: required ++ Value type: ++ Definition: phandle for scfg. ++ ++- fsl,rcpm-wakeup ++ Usage: required ++ Value type: ++ Definition: phandle for rcpm. ++ ++- clocks ++ Usage: required ++ Value type: ++ Definition: phandle for clockgen. ++ ++- clock-names ++ Usage: required ++ Value type: ++ Definition: phandle for clock name. ++ ++EXAMPLE ++ ++pfe: pfe@04000000 { ++ compatible = "fsl,pfe"; ++ reg = <0x0 0x04000000 0x0 0xc00000>, /* AXI 16M */ ++ <0x0 0x83400000 0x0 0xc00000>; /* PFE DDR 12M */ ++ reg-names = "pfe", "pfe-ddr"; ++ fsl,pfe-num-interfaces = <0x2>; ++ interrupts = <0 172 0x4>, /* HIF interrupt */ ++ <0 173 0x4>, /*HIF_NOCPY interrupt */ ++ <0 174 0x4>; /* WoL interrupt */ ++ interrupt-names = "pfe_hif", "pfe_hif_nocpy", "pfe_wol"; ++ memory-region = <&pfe_reserved>; ++ fsl,pfe-scfg = <&scfg 0>; ++ fsl,rcpm-wakeup = <&rcpm 0xf0000020>; ++ clocks = <&clockgen 4 0>; ++ clock-names = "pfe"; ++ ++ status = "okay"; ++ pfe_mac0: ethernet@0 { ++ }; ++ ++ pfe_mac1: ethernet@1 { ++ }; ++}; ++ ++============================================================================= ++Ethernet Node ++ ++DESCRIPTION ++ ++Ethernet Node has all the properties associated with PFE used by platforms to ++connect to PHY: ++ ++PROPERTIES ++ ++- compatible ++ Usage: required ++ Value type: ++ Definition: Must include "fsl,pfe-gemac-port" ++ ++- reg ++ Usage: required ++ Value type: ++ Definition: A standard property. ++ Specifies the gemacid of the interface. ++ ++- fsl,gemac-bus-id ++ Usage: required ++ Value type: ++ Definition: Must be present. Value should be the id of the bus ++ connected to gemac. ++ ++- fsl,gemac-phy-id (deprecated binding) ++ Usage: required ++ Value type: ++ Definition: This binding shouldn't be used with new platforms. ++ Must be present. Value should be the id of the phy ++ connected to gemac. ++ ++- fsl,mdio-mux-val ++ Usage: required ++ Value type: ++ Definition: Must be present. Value can be either 0 or 2 or 3. ++ This value is used to configure the mux to enable mdio. ++ ++- phy-mode ++ Usage: required ++ Value type: ++ Definition: Must include "sgmii" ++ ++- fsl,pfe-phy-if-flags (deprecated binding) ++ Usage: required ++ Value type: ++ Definition: This binding shouldn't be used with new platforms. ++ Must be present. Value should be 0 by default. ++ If there is not phy connected, this need to be 1. ++ ++- phy-handle ++ Usage: optional ++ Value type: ++ Definition: phandle to the PHY device connected to this device. ++ ++- mdio : A required subnode which specifies the mdio bus in the PFE and used as ++a container for phy nodes according to ../phy.txt. ++ ++EXAMPLE ++ ++ethernet@0 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x0>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x0>; /* BUS_ID */ ++ fsl,mdio-mux-val = <0x0>; ++ phy-mode = "sgmii"; ++ phy-handle = <&sgmii_phy1>; ++}; ++ ++ ++ethernet@1 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x1>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x1>; /* BUS_ID */ ++ fsl,mdio-mux-val = <0x0>; ++ phy-mode = "sgmii"; ++ phy-handle = <&sgmii_phy2>; ++}; ++ ++mdio@0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ sgmii_phy1: ethernet-phy@2 { ++ reg = <0x2>; ++ }; ++ ++ sgmii_phy2: ethernet-phy@1 { ++ reg = <0x1>; ++ }; ++}; +--- a/MAINTAINERS ++++ b/MAINTAINERS +@@ -8255,6 +8255,14 @@ F: drivers/ptp/ptp_qoriq.c + F: drivers/ptp/ptp_qoriq_debugfs.c + F: include/linux/fsl/ptp_qoriq.h + ++FREESCALE QORIQ PPFE ETHERNET DRIVER ++M: Anji Jagarlmudi ++M: Calvin Johnson ++L: netdev@vger.kernel.org ++S: Maintained ++F: drivers/staging/fsl_ppfe ++F: Documentation/devicetree/bindings/net/fsl_ppfe/pfe.txt ++ + FREESCALE QUAD SPI DRIVER + M: Han Xu + L: linux-spi@vger.kernel.org +--- a/drivers/staging/Kconfig ++++ b/drivers/staging/Kconfig +@@ -80,4 +80,6 @@ source "drivers/staging/qlge/Kconfig" + + source "drivers/staging/vme_user/Kconfig" + ++source "drivers/staging/fsl_ppfe/Kconfig" ++ + endif # STAGING +--- a/drivers/staging/Makefile ++++ b/drivers/staging/Makefile +@@ -29,3 +29,4 @@ obj-$(CONFIG_PI433) += pi433/ + obj-$(CONFIG_XIL_AXIS_FIFO) += axis-fifo/ + obj-$(CONFIG_FIELDBUS_DEV) += fieldbus/ + obj-$(CONFIG_QLGE) += qlge/ ++obj-$(CONFIG_FSL_PPFE) += fsl_ppfe/ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/Kconfig +@@ -0,0 +1,21 @@ ++# ++# Freescale Programmable Packet Forwarding Engine driver ++# ++config FSL_PPFE ++ tristate "Freescale PPFE Driver" ++ select FSL_GUTS ++ default n ++ help ++ Freescale LS1012A SoC has a Programmable Packet Forwarding Engine. ++ It provides two high performance ethernet interfaces. ++ This driver initializes, programs and controls the PPFE. ++ Use this driver to enable network connectivity on LS1012A platforms. ++ ++if FSL_PPFE ++ ++config FSL_PPFE_UTIL_DISABLED ++ bool "Disable PPFE UTIL Processor Engine" ++ help ++ UTIL PE has to be enabled only if required. ++ ++endif # FSL_PPFE +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/Makefile +@@ -0,0 +1,20 @@ ++# ++# Makefile for Freesecale PPFE driver ++# ++ ++ccflags-y += -I $(srctree)/$(src)/include -I $(srctree)/$(src) ++ ++obj-$(CONFIG_FSL_PPFE) += pfe.o ++ ++pfe-y += pfe_mod.o \ ++ pfe_hw.o \ ++ pfe_firmware.o \ ++ pfe_ctrl.o \ ++ pfe_hif.o \ ++ pfe_hif_lib.o\ ++ pfe_eth.o \ ++ pfe_sysfs.o \ ++ pfe_debugfs.o \ ++ pfe_ls1012a_platform.o \ ++ pfe_hal.o \ ++ pfe_cdev.o +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/TODO +@@ -0,0 +1,2 @@ ++TODO: ++ - provide pfe pe monitoring support +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus.h +@@ -0,0 +1,78 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _CBUS_H_ ++#define _CBUS_H_ ++ ++#define EMAC1_BASE_ADDR (CBUS_BASE_ADDR + 0x200000) ++#define EGPI1_BASE_ADDR (CBUS_BASE_ADDR + 0x210000) ++#define EMAC2_BASE_ADDR (CBUS_BASE_ADDR + 0x220000) ++#define EGPI2_BASE_ADDR (CBUS_BASE_ADDR + 0x230000) ++#define BMU1_BASE_ADDR (CBUS_BASE_ADDR + 0x240000) ++#define BMU2_BASE_ADDR (CBUS_BASE_ADDR + 0x250000) ++#define ARB_BASE_ADDR (CBUS_BASE_ADDR + 0x260000) ++#define DDR_CONFIG_BASE_ADDR (CBUS_BASE_ADDR + 0x270000) ++#define HIF_BASE_ADDR (CBUS_BASE_ADDR + 0x280000) ++#define HGPI_BASE_ADDR (CBUS_BASE_ADDR + 0x290000) ++#define LMEM_BASE_ADDR (CBUS_BASE_ADDR + 0x300000) ++#define LMEM_SIZE 0x10000 ++#define LMEM_END (LMEM_BASE_ADDR + LMEM_SIZE) ++#define TMU_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x310000) ++#define CLASS_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x320000) ++#define HIF_NOCPY_BASE_ADDR (CBUS_BASE_ADDR + 0x350000) ++#define UTIL_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x360000) ++#define CBUS_GPT_BASE_ADDR (CBUS_BASE_ADDR + 0x370000) ++ ++/* ++ * defgroup XXX_MEM_ACCESS_ADDR PE memory access through CSR ++ * XXX_MEM_ACCESS_ADDR register bit definitions. ++ */ ++#define PE_MEM_ACCESS_WRITE BIT(31) /* Internal Memory Write. */ ++#define PE_MEM_ACCESS_IMEM BIT(15) ++#define PE_MEM_ACCESS_DMEM BIT(16) ++ ++/* Byte Enables of the Internal memory access. These are interpred in BE */ ++#define PE_MEM_ACCESS_BYTE_ENABLE(offset, size) \ ++ ({ typeof(size) size_ = (size); \ ++ (((BIT(size_) - 1) << (4 - (offset) - (size_))) & 0xf) << 24; }) ++ ++#include "cbus/emac_mtip.h" ++#include "cbus/gpi.h" ++#include "cbus/bmu.h" ++#include "cbus/hif.h" ++#include "cbus/tmu_csr.h" ++#include "cbus/class_csr.h" ++#include "cbus/hif_nocpy.h" ++#include "cbus/util_csr.h" ++ ++/* PFE cores states */ ++#define CORE_DISABLE 0x00000000 ++#define CORE_ENABLE 0x00000001 ++#define CORE_SW_RESET 0x00000002 ++ ++/* LMEM defines */ ++#define LMEM_HDR_SIZE 0x0010 ++#define LMEM_BUF_SIZE_LN2 0x7 ++#define LMEM_BUF_SIZE BIT(LMEM_BUF_SIZE_LN2) ++ ++/* DDR defines */ ++#define DDR_HDR_SIZE 0x0100 ++#define DDR_BUF_SIZE_LN2 0xb ++#define DDR_BUF_SIZE BIT(DDR_BUF_SIZE_LN2) ++ ++#endif /* _CBUS_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/bmu.h +@@ -0,0 +1,55 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _BMU_H_ ++#define _BMU_H_ ++ ++#define BMU_VERSION 0x000 ++#define BMU_CTRL 0x004 ++#define BMU_UCAST_CONFIG 0x008 ++#define BMU_UCAST_BASE_ADDR 0x00c ++#define BMU_BUF_SIZE 0x010 ++#define BMU_BUF_CNT 0x014 ++#define BMU_THRES 0x018 ++#define BMU_INT_SRC 0x020 ++#define BMU_INT_ENABLE 0x024 ++#define BMU_ALLOC_CTRL 0x030 ++#define BMU_FREE_CTRL 0x034 ++#define BMU_FREE_ERR_ADDR 0x038 ++#define BMU_CURR_BUF_CNT 0x03c ++#define BMU_MCAST_CNT 0x040 ++#define BMU_MCAST_ALLOC_CTRL 0x044 ++#define BMU_REM_BUF_CNT 0x048 ++#define BMU_LOW_WATERMARK 0x050 ++#define BMU_HIGH_WATERMARK 0x054 ++#define BMU_INT_MEM_ACCESS 0x100 ++ ++struct BMU_CFG { ++ unsigned long baseaddr; ++ u32 count; ++ u32 size; ++ u32 low_watermark; ++ u32 high_watermark; ++}; ++ ++#define BMU1_BUF_SIZE LMEM_BUF_SIZE_LN2 ++#define BMU2_BUF_SIZE DDR_BUF_SIZE_LN2 ++ ++#define BMU2_MCAST_ALLOC_CTRL (BMU2_BASE_ADDR + BMU_MCAST_ALLOC_CTRL) ++ ++#endif /* _BMU_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/class_csr.h +@@ -0,0 +1,289 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _CLASS_CSR_H_ ++#define _CLASS_CSR_H_ ++ ++/* @file class_csr.h. ++ * class_csr - block containing all the classifier control and status register. ++ * Mapped on CBUS and accessible from all PE's and ARM. ++ */ ++#define CLASS_VERSION (CLASS_CSR_BASE_ADDR + 0x000) ++#define CLASS_TX_CTRL (CLASS_CSR_BASE_ADDR + 0x004) ++#define CLASS_INQ_PKTPTR (CLASS_CSR_BASE_ADDR + 0x010) ++ ++/* (ddr_hdr_size[24:16], lmem_hdr_size[5:0]) */ ++#define CLASS_HDR_SIZE (CLASS_CSR_BASE_ADDR + 0x014) ++ ++/* LMEM header size for the Classifier block.\ Data in the LMEM ++ * is written from this offset. ++ */ ++#define CLASS_HDR_SIZE_LMEM(off) ((off) & 0x3f) ++ ++/* DDR header size for the Classifier block.\ Data in the DDR ++ * is written from this offset. ++ */ ++#define CLASS_HDR_SIZE_DDR(off) (((off) & 0x1ff) << 16) ++ ++#define CLASS_PE0_QB_DM_ADDR0 (CLASS_CSR_BASE_ADDR + 0x020) ++ ++/* DMEM address of first [15:0] and second [31:16] buffers on QB side. */ ++#define CLASS_PE0_QB_DM_ADDR1 (CLASS_CSR_BASE_ADDR + 0x024) ++ ++/* DMEM address of third [15:0] and fourth [31:16] buffers on QB side. */ ++#define CLASS_PE0_RO_DM_ADDR0 (CLASS_CSR_BASE_ADDR + 0x060) ++ ++/* DMEM address of first [15:0] and second [31:16] buffers on RO side. */ ++#define CLASS_PE0_RO_DM_ADDR1 (CLASS_CSR_BASE_ADDR + 0x064) ++ ++/* DMEM address of third [15:0] and fourth [31:16] buffers on RO side. */ ++ ++/* @name Class PE memory access. Allows external PE's and HOST to ++ * read/write PMEM/DMEM memory ranges for each classifier PE. ++ */ ++/* {sr_pe_mem_cmd[31], csr_pe_mem_wren[27:24], csr_pe_mem_addr[23:0]}, ++ * See \ref XXX_MEM_ACCESS_ADDR for details. ++ */ ++#define CLASS_MEM_ACCESS_ADDR (CLASS_CSR_BASE_ADDR + 0x100) ++ ++/* Internal Memory Access Write Data [31:0] */ ++#define CLASS_MEM_ACCESS_WDATA (CLASS_CSR_BASE_ADDR + 0x104) ++ ++/* Internal Memory Access Read Data [31:0] */ ++#define CLASS_MEM_ACCESS_RDATA (CLASS_CSR_BASE_ADDR + 0x108) ++#define CLASS_TM_INQ_ADDR (CLASS_CSR_BASE_ADDR + 0x114) ++#define CLASS_PE_STATUS (CLASS_CSR_BASE_ADDR + 0x118) ++ ++#define CLASS_PHY1_RX_PKTS (CLASS_CSR_BASE_ADDR + 0x11c) ++#define CLASS_PHY1_TX_PKTS (CLASS_CSR_BASE_ADDR + 0x120) ++#define CLASS_PHY1_LP_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x124) ++#define CLASS_PHY1_INTF_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x128) ++#define CLASS_PHY1_INTF_MATCH_PKTS (CLASS_CSR_BASE_ADDR + 0x12c) ++#define CLASS_PHY1_L3_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x130) ++#define CLASS_PHY1_V4_PKTS (CLASS_CSR_BASE_ADDR + 0x134) ++#define CLASS_PHY1_V6_PKTS (CLASS_CSR_BASE_ADDR + 0x138) ++#define CLASS_PHY1_CHKSUM_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x13c) ++#define CLASS_PHY1_TTL_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x140) ++#define CLASS_PHY2_RX_PKTS (CLASS_CSR_BASE_ADDR + 0x144) ++#define CLASS_PHY2_TX_PKTS (CLASS_CSR_BASE_ADDR + 0x148) ++#define CLASS_PHY2_LP_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x14c) ++#define CLASS_PHY2_INTF_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x150) ++#define CLASS_PHY2_INTF_MATCH_PKTS (CLASS_CSR_BASE_ADDR + 0x154) ++#define CLASS_PHY2_L3_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x158) ++#define CLASS_PHY2_V4_PKTS (CLASS_CSR_BASE_ADDR + 0x15c) ++#define CLASS_PHY2_V6_PKTS (CLASS_CSR_BASE_ADDR + 0x160) ++#define CLASS_PHY2_CHKSUM_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x164) ++#define CLASS_PHY2_TTL_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x168) ++#define CLASS_PHY3_RX_PKTS (CLASS_CSR_BASE_ADDR + 0x16c) ++#define CLASS_PHY3_TX_PKTS (CLASS_CSR_BASE_ADDR + 0x170) ++#define CLASS_PHY3_LP_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x174) ++#define CLASS_PHY3_INTF_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x178) ++#define CLASS_PHY3_INTF_MATCH_PKTS (CLASS_CSR_BASE_ADDR + 0x17c) ++#define CLASS_PHY3_L3_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x180) ++#define CLASS_PHY3_V4_PKTS (CLASS_CSR_BASE_ADDR + 0x184) ++#define CLASS_PHY3_V6_PKTS (CLASS_CSR_BASE_ADDR + 0x188) ++#define CLASS_PHY3_CHKSUM_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x18c) ++#define CLASS_PHY3_TTL_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x190) ++#define CLASS_PHY1_ICMP_PKTS (CLASS_CSR_BASE_ADDR + 0x194) ++#define CLASS_PHY1_IGMP_PKTS (CLASS_CSR_BASE_ADDR + 0x198) ++#define CLASS_PHY1_TCP_PKTS (CLASS_CSR_BASE_ADDR + 0x19c) ++#define CLASS_PHY1_UDP_PKTS (CLASS_CSR_BASE_ADDR + 0x1a0) ++#define CLASS_PHY2_ICMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1a4) ++#define CLASS_PHY2_IGMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1a8) ++#define CLASS_PHY2_TCP_PKTS (CLASS_CSR_BASE_ADDR + 0x1ac) ++#define CLASS_PHY2_UDP_PKTS (CLASS_CSR_BASE_ADDR + 0x1b0) ++#define CLASS_PHY3_ICMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1b4) ++#define CLASS_PHY3_IGMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1b8) ++#define CLASS_PHY3_TCP_PKTS (CLASS_CSR_BASE_ADDR + 0x1bc) ++#define CLASS_PHY3_UDP_PKTS (CLASS_CSR_BASE_ADDR + 0x1c0) ++#define CLASS_PHY4_ICMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1c4) ++#define CLASS_PHY4_IGMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1c8) ++#define CLASS_PHY4_TCP_PKTS (CLASS_CSR_BASE_ADDR + 0x1cc) ++#define CLASS_PHY4_UDP_PKTS (CLASS_CSR_BASE_ADDR + 0x1d0) ++#define CLASS_PHY4_RX_PKTS (CLASS_CSR_BASE_ADDR + 0x1d4) ++#define CLASS_PHY4_TX_PKTS (CLASS_CSR_BASE_ADDR + 0x1d8) ++#define CLASS_PHY4_LP_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x1dc) ++#define CLASS_PHY4_INTF_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x1e0) ++#define CLASS_PHY4_INTF_MATCH_PKTS (CLASS_CSR_BASE_ADDR + 0x1e4) ++#define CLASS_PHY4_L3_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x1e8) ++#define CLASS_PHY4_V4_PKTS (CLASS_CSR_BASE_ADDR + 0x1ec) ++#define CLASS_PHY4_V6_PKTS (CLASS_CSR_BASE_ADDR + 0x1f0) ++#define CLASS_PHY4_CHKSUM_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x1f4) ++#define CLASS_PHY4_TTL_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x1f8) ++ ++#define CLASS_PE_SYS_CLK_RATIO (CLASS_CSR_BASE_ADDR + 0x200) ++#define CLASS_AFULL_THRES (CLASS_CSR_BASE_ADDR + 0x204) ++#define CLASS_GAP_BETWEEN_READS (CLASS_CSR_BASE_ADDR + 0x208) ++#define CLASS_MAX_BUF_CNT (CLASS_CSR_BASE_ADDR + 0x20c) ++#define CLASS_TSQ_FIFO_THRES (CLASS_CSR_BASE_ADDR + 0x210) ++#define CLASS_TSQ_MAX_CNT (CLASS_CSR_BASE_ADDR + 0x214) ++#define CLASS_IRAM_DATA_0 (CLASS_CSR_BASE_ADDR + 0x218) ++#define CLASS_IRAM_DATA_1 (CLASS_CSR_BASE_ADDR + 0x21c) ++#define CLASS_IRAM_DATA_2 (CLASS_CSR_BASE_ADDR + 0x220) ++#define CLASS_IRAM_DATA_3 (CLASS_CSR_BASE_ADDR + 0x224) ++ ++#define CLASS_BUS_ACCESS_ADDR (CLASS_CSR_BASE_ADDR + 0x228) ++ ++#define CLASS_BUS_ACCESS_WDATA (CLASS_CSR_BASE_ADDR + 0x22c) ++#define CLASS_BUS_ACCESS_RDATA (CLASS_CSR_BASE_ADDR + 0x230) ++ ++/* (route_entry_size[9:0], route_hash_size[23:16] ++ * (this is actually ln2(size))) ++ */ ++#define CLASS_ROUTE_HASH_ENTRY_SIZE (CLASS_CSR_BASE_ADDR + 0x234) ++ ++#define CLASS_ROUTE_ENTRY_SIZE(size) ((size) & 0x1ff) ++#define CLASS_ROUTE_HASH_SIZE(hash_bits) (((hash_bits) & 0xff) << 16) ++ ++#define CLASS_ROUTE_TABLE_BASE (CLASS_CSR_BASE_ADDR + 0x238) ++ ++#define CLASS_ROUTE_MULTI (CLASS_CSR_BASE_ADDR + 0x23c) ++#define CLASS_SMEM_OFFSET (CLASS_CSR_BASE_ADDR + 0x240) ++#define CLASS_LMEM_BUF_SIZE (CLASS_CSR_BASE_ADDR + 0x244) ++#define CLASS_VLAN_ID (CLASS_CSR_BASE_ADDR + 0x248) ++#define CLASS_BMU1_BUF_FREE (CLASS_CSR_BASE_ADDR + 0x24c) ++#define CLASS_USE_TMU_INQ (CLASS_CSR_BASE_ADDR + 0x250) ++#define CLASS_VLAN_ID1 (CLASS_CSR_BASE_ADDR + 0x254) ++ ++#define CLASS_BUS_ACCESS_BASE (CLASS_CSR_BASE_ADDR + 0x258) ++#define CLASS_BUS_ACCESS_BASE_MASK (0xFF000000) ++/* bit 31:24 of PE peripheral address are stored in CLASS_BUS_ACCESS_BASE */ ++ ++#define CLASS_HIF_PARSE (CLASS_CSR_BASE_ADDR + 0x25c) ++ ++#define CLASS_HOST_PE0_GP (CLASS_CSR_BASE_ADDR + 0x260) ++#define CLASS_PE0_GP (CLASS_CSR_BASE_ADDR + 0x264) ++#define CLASS_HOST_PE1_GP (CLASS_CSR_BASE_ADDR + 0x268) ++#define CLASS_PE1_GP (CLASS_CSR_BASE_ADDR + 0x26c) ++#define CLASS_HOST_PE2_GP (CLASS_CSR_BASE_ADDR + 0x270) ++#define CLASS_PE2_GP (CLASS_CSR_BASE_ADDR + 0x274) ++#define CLASS_HOST_PE3_GP (CLASS_CSR_BASE_ADDR + 0x278) ++#define CLASS_PE3_GP (CLASS_CSR_BASE_ADDR + 0x27c) ++#define CLASS_HOST_PE4_GP (CLASS_CSR_BASE_ADDR + 0x280) ++#define CLASS_PE4_GP (CLASS_CSR_BASE_ADDR + 0x284) ++#define CLASS_HOST_PE5_GP (CLASS_CSR_BASE_ADDR + 0x288) ++#define CLASS_PE5_GP (CLASS_CSR_BASE_ADDR + 0x28c) ++ ++#define CLASS_PE_INT_SRC (CLASS_CSR_BASE_ADDR + 0x290) ++#define CLASS_PE_INT_ENABLE (CLASS_CSR_BASE_ADDR + 0x294) ++ ++#define CLASS_TPID0_TPID1 (CLASS_CSR_BASE_ADDR + 0x298) ++#define CLASS_TPID2 (CLASS_CSR_BASE_ADDR + 0x29c) ++ ++#define CLASS_L4_CHKSUM_ADDR (CLASS_CSR_BASE_ADDR + 0x2a0) ++ ++#define CLASS_PE0_DEBUG (CLASS_CSR_BASE_ADDR + 0x2a4) ++#define CLASS_PE1_DEBUG (CLASS_CSR_BASE_ADDR + 0x2a8) ++#define CLASS_PE2_DEBUG (CLASS_CSR_BASE_ADDR + 0x2ac) ++#define CLASS_PE3_DEBUG (CLASS_CSR_BASE_ADDR + 0x2b0) ++#define CLASS_PE4_DEBUG (CLASS_CSR_BASE_ADDR + 0x2b4) ++#define CLASS_PE5_DEBUG (CLASS_CSR_BASE_ADDR + 0x2b8) ++ ++#define CLASS_STATE (CLASS_CSR_BASE_ADDR + 0x2bc) ++ ++/* CLASS defines */ ++#define CLASS_PBUF_SIZE 0x100 /* Fixed by hardware */ ++#define CLASS_PBUF_HEADER_OFFSET 0x80 /* Can be configured */ ++ ++/* Can be configured */ ++#define CLASS_PBUF0_BASE_ADDR 0x000 ++/* Can be configured */ ++#define CLASS_PBUF1_BASE_ADDR (CLASS_PBUF0_BASE_ADDR + CLASS_PBUF_SIZE) ++/* Can be configured */ ++#define CLASS_PBUF2_BASE_ADDR (CLASS_PBUF1_BASE_ADDR + CLASS_PBUF_SIZE) ++/* Can be configured */ ++#define CLASS_PBUF3_BASE_ADDR (CLASS_PBUF2_BASE_ADDR + CLASS_PBUF_SIZE) ++ ++#define CLASS_PBUF0_HEADER_BASE_ADDR (CLASS_PBUF0_BASE_ADDR + \ ++ CLASS_PBUF_HEADER_OFFSET) ++#define CLASS_PBUF1_HEADER_BASE_ADDR (CLASS_PBUF1_BASE_ADDR + \ ++ CLASS_PBUF_HEADER_OFFSET) ++#define CLASS_PBUF2_HEADER_BASE_ADDR (CLASS_PBUF2_BASE_ADDR + \ ++ CLASS_PBUF_HEADER_OFFSET) ++#define CLASS_PBUF3_HEADER_BASE_ADDR (CLASS_PBUF3_BASE_ADDR + \ ++ CLASS_PBUF_HEADER_OFFSET) ++ ++#define CLASS_PE0_RO_DM_ADDR0_VAL ((CLASS_PBUF1_BASE_ADDR << 16) | \ ++ CLASS_PBUF0_BASE_ADDR) ++#define CLASS_PE0_RO_DM_ADDR1_VAL ((CLASS_PBUF3_BASE_ADDR << 16) | \ ++ CLASS_PBUF2_BASE_ADDR) ++ ++#define CLASS_PE0_QB_DM_ADDR0_VAL ((CLASS_PBUF1_HEADER_BASE_ADDR << 16) |\ ++ CLASS_PBUF0_HEADER_BASE_ADDR) ++#define CLASS_PE0_QB_DM_ADDR1_VAL ((CLASS_PBUF3_HEADER_BASE_ADDR << 16) |\ ++ CLASS_PBUF2_HEADER_BASE_ADDR) ++ ++#define CLASS_ROUTE_SIZE 128 ++#define CLASS_MAX_ROUTE_SIZE 256 ++#define CLASS_ROUTE_HASH_BITS 20 ++#define CLASS_ROUTE_HASH_MASK (BIT(CLASS_ROUTE_HASH_BITS) - 1) ++ ++/* Can be configured */ ++#define CLASS_ROUTE0_BASE_ADDR 0x400 ++/* Can be configured */ ++#define CLASS_ROUTE1_BASE_ADDR (CLASS_ROUTE0_BASE_ADDR + CLASS_ROUTE_SIZE) ++/* Can be configured */ ++#define CLASS_ROUTE2_BASE_ADDR (CLASS_ROUTE1_BASE_ADDR + CLASS_ROUTE_SIZE) ++/* Can be configured */ ++#define CLASS_ROUTE3_BASE_ADDR (CLASS_ROUTE2_BASE_ADDR + CLASS_ROUTE_SIZE) ++ ++#define CLASS_SA_SIZE 128 ++#define CLASS_IPSEC_SA0_BASE_ADDR 0x600 ++/* not used */ ++#define CLASS_IPSEC_SA1_BASE_ADDR (CLASS_IPSEC_SA0_BASE_ADDR + CLASS_SA_SIZE) ++/* not used */ ++#define CLASS_IPSEC_SA2_BASE_ADDR (CLASS_IPSEC_SA1_BASE_ADDR + CLASS_SA_SIZE) ++/* not used */ ++#define CLASS_IPSEC_SA3_BASE_ADDR (CLASS_IPSEC_SA2_BASE_ADDR + CLASS_SA_SIZE) ++ ++/* generic purpose free dmem buffer, last portion of 2K dmem pbuf */ ++#define CLASS_GP_DMEM_BUF_SIZE (2048 - (CLASS_PBUF_SIZE * 4) - \ ++ (CLASS_ROUTE_SIZE * 4) - (CLASS_SA_SIZE)) ++#define CLASS_GP_DMEM_BUF ((void *)(CLASS_IPSEC_SA0_BASE_ADDR + \ ++ CLASS_SA_SIZE)) ++ ++#define TWO_LEVEL_ROUTE BIT(0) ++#define PHYNO_IN_HASH BIT(1) ++#define HW_ROUTE_FETCH BIT(3) ++#define HW_BRIDGE_FETCH BIT(5) ++#define IP_ALIGNED BIT(6) ++#define ARC_HIT_CHECK_EN BIT(7) ++#define CLASS_TOE BIT(11) ++#define HASH_NORMAL (0 << 12) ++#define HASH_CRC_PORT BIT(12) ++#define HASH_CRC_IP (2 << 12) ++#define HASH_CRC_PORT_IP (3 << 12) ++#define QB2BUS_LE BIT(15) ++ ++#define TCP_CHKSUM_DROP BIT(0) ++#define UDP_CHKSUM_DROP BIT(1) ++#define IPV4_CHKSUM_DROP BIT(9) ++ ++/*CLASS_HIF_PARSE bits*/ ++#define HIF_PKT_CLASS_EN BIT(0) ++#define HIF_PKT_OFFSET(ofst) (((ofst) & 0xF) << 1) ++ ++struct class_cfg { ++ u32 toe_mode; ++ unsigned long route_table_baseaddr; ++ u32 route_table_hash_bits; ++ u32 pe_sys_clk_ratio; ++ u32 resume; ++}; ++ ++#endif /* _CLASS_CSR_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/emac_mtip.h +@@ -0,0 +1,242 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _EMAC_H_ ++#define _EMAC_H_ ++ ++#include ++ ++#define EMAC_IEVENT_REG 0x004 ++#define EMAC_IMASK_REG 0x008 ++#define EMAC_R_DES_ACTIVE_REG 0x010 ++#define EMAC_X_DES_ACTIVE_REG 0x014 ++#define EMAC_ECNTRL_REG 0x024 ++#define EMAC_MII_DATA_REG 0x040 ++#define EMAC_MII_CTRL_REG 0x044 ++#define EMAC_MIB_CTRL_STS_REG 0x064 ++#define EMAC_RCNTRL_REG 0x084 ++#define EMAC_TCNTRL_REG 0x0C4 ++#define EMAC_PHY_ADDR_LOW 0x0E4 ++#define EMAC_PHY_ADDR_HIGH 0x0E8 ++#define EMAC_GAUR 0x120 ++#define EMAC_GALR 0x124 ++#define EMAC_TFWR_STR_FWD 0x144 ++#define EMAC_RX_SECTION_FULL 0x190 ++#define EMAC_RX_SECTION_EMPTY 0x194 ++#define EMAC_TX_SECTION_EMPTY 0x1A0 ++#define EMAC_TRUNC_FL 0x1B0 ++ ++#define RMON_T_DROP 0x200 /* Count of frames not cntd correctly */ ++#define RMON_T_PACKETS 0x204 /* RMON TX packet count */ ++#define RMON_T_BC_PKT 0x208 /* RMON TX broadcast pkts */ ++#define RMON_T_MC_PKT 0x20c /* RMON TX multicast pkts */ ++#define RMON_T_CRC_ALIGN 0x210 /* RMON TX pkts with CRC align err */ ++#define RMON_T_UNDERSIZE 0x214 /* RMON TX pkts < 64 bytes, good CRC */ ++#define RMON_T_OVERSIZE 0x218 /* RMON TX pkts > MAX_FL bytes good CRC */ ++#define RMON_T_FRAG 0x21c /* RMON TX pkts < 64 bytes, bad CRC */ ++#define RMON_T_JAB 0x220 /* RMON TX pkts > MAX_FL bytes, bad CRC */ ++#define RMON_T_COL 0x224 /* RMON TX collision count */ ++#define RMON_T_P64 0x228 /* RMON TX 64 byte pkts */ ++#define RMON_T_P65TO127 0x22c /* RMON TX 65 to 127 byte pkts */ ++#define RMON_T_P128TO255 0x230 /* RMON TX 128 to 255 byte pkts */ ++#define RMON_T_P256TO511 0x234 /* RMON TX 256 to 511 byte pkts */ ++#define RMON_T_P512TO1023 0x238 /* RMON TX 512 to 1023 byte pkts */ ++#define RMON_T_P1024TO2047 0x23c /* RMON TX 1024 to 2047 byte pkts */ ++#define RMON_T_P_GTE2048 0x240 /* RMON TX pkts > 2048 bytes */ ++#define RMON_T_OCTETS 0x244 /* RMON TX octets */ ++#define IEEE_T_DROP 0x248 /* Count of frames not counted crtly */ ++#define IEEE_T_FRAME_OK 0x24c /* Frames tx'd OK */ ++#define IEEE_T_1COL 0x250 /* Frames tx'd with single collision */ ++#define IEEE_T_MCOL 0x254 /* Frames tx'd with multiple collision */ ++#define IEEE_T_DEF 0x258 /* Frames tx'd after deferral delay */ ++#define IEEE_T_LCOL 0x25c /* Frames tx'd with late collision */ ++#define IEEE_T_EXCOL 0x260 /* Frames tx'd with excesv collisions */ ++#define IEEE_T_MACERR 0x264 /* Frames tx'd with TX FIFO underrun */ ++#define IEEE_T_CSERR 0x268 /* Frames tx'd with carrier sense err */ ++#define IEEE_T_SQE 0x26c /* Frames tx'd with SQE err */ ++#define IEEE_T_FDXFC 0x270 /* Flow control pause frames tx'd */ ++#define IEEE_T_OCTETS_OK 0x274 /* Octet count for frames tx'd w/o err */ ++#define RMON_R_PACKETS 0x284 /* RMON RX packet count */ ++#define RMON_R_BC_PKT 0x288 /* RMON RX broadcast pkts */ ++#define RMON_R_MC_PKT 0x28c /* RMON RX multicast pkts */ ++#define RMON_R_CRC_ALIGN 0x290 /* RMON RX pkts with CRC alignment err */ ++#define RMON_R_UNDERSIZE 0x294 /* RMON RX pkts < 64 bytes, good CRC */ ++#define RMON_R_OVERSIZE 0x298 /* RMON RX pkts > MAX_FL bytes good CRC */ ++#define RMON_R_FRAG 0x29c /* RMON RX pkts < 64 bytes, bad CRC */ ++#define RMON_R_JAB 0x2a0 /* RMON RX pkts > MAX_FL bytes, bad CRC */ ++#define RMON_R_RESVD_O 0x2a4 /* Reserved */ ++#define RMON_R_P64 0x2a8 /* RMON RX 64 byte pkts */ ++#define RMON_R_P65TO127 0x2ac /* RMON RX 65 to 127 byte pkts */ ++#define RMON_R_P128TO255 0x2b0 /* RMON RX 128 to 255 byte pkts */ ++#define RMON_R_P256TO511 0x2b4 /* RMON RX 256 to 511 byte pkts */ ++#define RMON_R_P512TO1023 0x2b8 /* RMON RX 512 to 1023 byte pkts */ ++#define RMON_R_P1024TO2047 0x2bc /* RMON RX 1024 to 2047 byte pkts */ ++#define RMON_R_P_GTE2048 0x2c0 /* RMON RX pkts > 2048 bytes */ ++#define RMON_R_OCTETS 0x2c4 /* RMON RX octets */ ++#define IEEE_R_DROP 0x2c8 /* Count frames not counted correctly */ ++#define IEEE_R_FRAME_OK 0x2cc /* Frames rx'd OK */ ++#define IEEE_R_CRC 0x2d0 /* Frames rx'd with CRC err */ ++#define IEEE_R_ALIGN 0x2d4 /* Frames rx'd with alignment err */ ++#define IEEE_R_MACERR 0x2d8 /* Receive FIFO overflow count */ ++#define IEEE_R_FDXFC 0x2dc /* Flow control pause frames rx'd */ ++#define IEEE_R_OCTETS_OK 0x2e0 /* Octet cnt for frames rx'd w/o err */ ++ ++#define EMAC_SMAC_0_0 0x500 /*Supplemental MAC Address 0 (RW).*/ ++#define EMAC_SMAC_0_1 0x504 /*Supplemental MAC Address 0 (RW).*/ ++ ++/* GEMAC definitions and settings */ ++ ++#define EMAC_PORT_0 0 ++#define EMAC_PORT_1 1 ++ ++/* GEMAC Bit definitions */ ++#define EMAC_IEVENT_HBERR 0x80000000 ++#define EMAC_IEVENT_BABR 0x40000000 ++#define EMAC_IEVENT_BABT 0x20000000 ++#define EMAC_IEVENT_GRA 0x10000000 ++#define EMAC_IEVENT_TXF 0x08000000 ++#define EMAC_IEVENT_TXB 0x04000000 ++#define EMAC_IEVENT_RXF 0x02000000 ++#define EMAC_IEVENT_RXB 0x01000000 ++#define EMAC_IEVENT_MII 0x00800000 ++#define EMAC_IEVENT_EBERR 0x00400000 ++#define EMAC_IEVENT_LC 0x00200000 ++#define EMAC_IEVENT_RL 0x00100000 ++#define EMAC_IEVENT_UN 0x00080000 ++ ++#define EMAC_IMASK_HBERR 0x80000000 ++#define EMAC_IMASK_BABR 0x40000000 ++#define EMAC_IMASKT_BABT 0x20000000 ++#define EMAC_IMASK_GRA 0x10000000 ++#define EMAC_IMASKT_TXF 0x08000000 ++#define EMAC_IMASK_TXB 0x04000000 ++#define EMAC_IMASKT_RXF 0x02000000 ++#define EMAC_IMASK_RXB 0x01000000 ++#define EMAC_IMASK_MII 0x00800000 ++#define EMAC_IMASK_EBERR 0x00400000 ++#define EMAC_IMASK_LC 0x00200000 ++#define EMAC_IMASKT_RL 0x00100000 ++#define EMAC_IMASK_UN 0x00080000 ++ ++#define EMAC_RCNTRL_MAX_FL_SHIFT 16 ++#define EMAC_RCNTRL_LOOP 0x00000001 ++#define EMAC_RCNTRL_DRT 0x00000002 ++#define EMAC_RCNTRL_MII_MODE 0x00000004 ++#define EMAC_RCNTRL_PROM 0x00000008 ++#define EMAC_RCNTRL_BC_REJ 0x00000010 ++#define EMAC_RCNTRL_FCE 0x00000020 ++#define EMAC_RCNTRL_RGMII 0x00000040 ++#define EMAC_RCNTRL_SGMII 0x00000080 ++#define EMAC_RCNTRL_RMII 0x00000100 ++#define EMAC_RCNTRL_RMII_10T 0x00000200 ++#define EMAC_RCNTRL_CRC_FWD 0x00004000 ++ ++#define EMAC_TCNTRL_GTS 0x00000001 ++#define EMAC_TCNTRL_HBC 0x00000002 ++#define EMAC_TCNTRL_FDEN 0x00000004 ++#define EMAC_TCNTRL_TFC_PAUSE 0x00000008 ++#define EMAC_TCNTRL_RFC_PAUSE 0x00000010 ++ ++#define EMAC_ECNTRL_RESET 0x00000001 /* reset the EMAC */ ++#define EMAC_ECNTRL_ETHER_EN 0x00000002 /* enable the EMAC */ ++#define EMAC_ECNTRL_MAGIC_ENA 0x00000004 ++#define EMAC_ECNTRL_SLEEP 0x00000008 ++#define EMAC_ECNTRL_SPEED 0x00000020 ++#define EMAC_ECNTRL_DBSWAP 0x00000100 ++ ++#define EMAC_X_WMRK_STRFWD 0x00000100 ++ ++#define EMAC_X_DES_ACTIVE_TDAR 0x01000000 ++#define EMAC_R_DES_ACTIVE_RDAR 0x01000000 ++ ++#define EMAC_RX_SECTION_EMPTY_V 0x00010006 ++/* ++ * The possible operating speeds of the MAC, currently supporting 10, 100 and ++ * 1000Mb modes. ++ */ ++enum mac_speed {SPEED_10M, SPEED_100M, SPEED_1000M, SPEED_1000M_PCS}; ++ ++/* MII-related definitios */ ++#define EMAC_MII_DATA_ST 0x40000000 /* Start of frame delimiter */ ++#define EMAC_MII_DATA_OP_RD 0x20000000 /* Perform a read operation */ ++#define EMAC_MII_DATA_OP_CL45_RD 0x30000000 /* Perform a read operation */ ++#define EMAC_MII_DATA_OP_WR 0x10000000 /* Perform a write operation */ ++#define EMAC_MII_DATA_OP_CL45_WR 0x10000000 /* Perform a write operation */ ++#define EMAC_MII_DATA_PA_MSK 0x0f800000 /* PHY Address field mask */ ++#define EMAC_MII_DATA_RA_MSK 0x007c0000 /* PHY Register field mask */ ++#define EMAC_MII_DATA_TA 0x00020000 /* Turnaround */ ++#define EMAC_MII_DATA_DATAMSK 0x0000ffff /* PHY data field */ ++ ++#define EMAC_MII_DATA_RA_SHIFT 18 /* MII Register address bits */ ++#define EMAC_MII_DATA_RA_MASK 0x1F /* MII Register address mask */ ++#define EMAC_MII_DATA_PA_SHIFT 23 /* MII PHY address bits */ ++#define EMAC_MII_DATA_PA_MASK 0x1F /* MII PHY address mask */ ++ ++#define EMAC_MII_DATA_RA(v) (((v) & EMAC_MII_DATA_RA_MASK) << \ ++ EMAC_MII_DATA_RA_SHIFT) ++#define EMAC_MII_DATA_PA(v) (((v) & EMAC_MII_DATA_RA_MASK) << \ ++ EMAC_MII_DATA_PA_SHIFT) ++#define EMAC_MII_DATA(v) ((v) & 0xffff) ++ ++#define EMAC_MII_SPEED_SHIFT 1 ++#define EMAC_HOLDTIME_SHIFT 8 ++#define EMAC_HOLDTIME_MASK 0x7 ++#define EMAC_HOLDTIME(v) (((v) & EMAC_HOLDTIME_MASK) << \ ++ EMAC_HOLDTIME_SHIFT) ++ ++/* ++ * The Address organisation for the MAC device. All addresses are split into ++ * two 32-bit register fields. The first one (bottom) is the lower 32-bits of ++ * the address and the other field are the high order bits - this may be 16-bits ++ * in the case of MAC addresses, or 32-bits for the hash address. ++ * In terms of memory storage, the first item (bottom) is assumed to be at a ++ * lower address location than 'top'. i.e. top should be at address location of ++ * 'bottom' + 4 bytes. ++ */ ++struct pfe_mac_addr { ++ u32 bottom; /* Lower 32-bits of address. */ ++ u32 top; /* Upper 32-bits of address. */ ++}; ++ ++/* ++ * The following is the organisation of the address filters section of the MAC ++ * registers. The Cadence MAC contains four possible specific address match ++ * addresses, if an incoming frame corresponds to any one of these four ++ * addresses then the frame will be copied to memory. ++ * It is not necessary for all four of the address match registers to be ++ * programmed, this is application dependent. ++ */ ++struct spec_addr { ++ struct pfe_mac_addr one; /* Specific address register 1. */ ++ struct pfe_mac_addr two; /* Specific address register 2. */ ++ struct pfe_mac_addr three; /* Specific address register 3. */ ++ struct pfe_mac_addr four; /* Specific address register 4. */ ++}; ++ ++struct gemac_cfg { ++ u32 mode; ++ u32 speed; ++ u32 duplex; ++}; ++ ++/* EMAC Hash size */ ++#define EMAC_HASH_REG_BITS 64 ++ ++#define EMAC_SPEC_ADDR_MAX 4 ++ ++#endif /* _EMAC_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/gpi.h +@@ -0,0 +1,86 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _GPI_H_ ++#define _GPI_H_ ++ ++#define GPI_VERSION 0x00 ++#define GPI_CTRL 0x04 ++#define GPI_RX_CONFIG 0x08 ++#define GPI_HDR_SIZE 0x0c ++#define GPI_BUF_SIZE 0x10 ++#define GPI_LMEM_ALLOC_ADDR 0x14 ++#define GPI_LMEM_FREE_ADDR 0x18 ++#define GPI_DDR_ALLOC_ADDR 0x1c ++#define GPI_DDR_FREE_ADDR 0x20 ++#define GPI_CLASS_ADDR 0x24 ++#define GPI_DRX_FIFO 0x28 ++#define GPI_TRX_FIFO 0x2c ++#define GPI_INQ_PKTPTR 0x30 ++#define GPI_DDR_DATA_OFFSET 0x34 ++#define GPI_LMEM_DATA_OFFSET 0x38 ++#define GPI_TMLF_TX 0x4c ++#define GPI_DTX_ASEQ 0x50 ++#define GPI_FIFO_STATUS 0x54 ++#define GPI_FIFO_DEBUG 0x58 ++#define GPI_TX_PAUSE_TIME 0x5c ++#define GPI_LMEM_SEC_BUF_DATA_OFFSET 0x60 ++#define GPI_DDR_SEC_BUF_DATA_OFFSET 0x64 ++#define GPI_TOE_CHKSUM_EN 0x68 ++#define GPI_OVERRUN_DROPCNT 0x6c ++#define GPI_CSR_MTIP_PAUSE_REG 0x74 ++#define GPI_CSR_MTIP_PAUSE_QUANTUM 0x78 ++#define GPI_CSR_RX_CNT 0x7c ++#define GPI_CSR_TX_CNT 0x80 ++#define GPI_CSR_DEBUG1 0x84 ++#define GPI_CSR_DEBUG2 0x88 ++ ++struct gpi_cfg { ++ u32 lmem_rtry_cnt; ++ u32 tmlf_txthres; ++ u32 aseq_len; ++ u32 mtip_pause_reg; ++}; ++ ++/* GPI commons defines */ ++#define GPI_LMEM_BUF_EN 0x1 ++#define GPI_DDR_BUF_EN 0x1 ++ ++/* EGPI 1 defines */ ++#define EGPI1_LMEM_RTRY_CNT 0x40 ++#define EGPI1_TMLF_TXTHRES 0xBC ++#define EGPI1_ASEQ_LEN 0x50 ++ ++/* EGPI 2 defines */ ++#define EGPI2_LMEM_RTRY_CNT 0x40 ++#define EGPI2_TMLF_TXTHRES 0xBC ++#define EGPI2_ASEQ_LEN 0x40 ++ ++/* EGPI 3 defines */ ++#define EGPI3_LMEM_RTRY_CNT 0x40 ++#define EGPI3_TMLF_TXTHRES 0xBC ++#define EGPI3_ASEQ_LEN 0x40 ++ ++/* HGPI defines */ ++#define HGPI_LMEM_RTRY_CNT 0x40 ++#define HGPI_TMLF_TXTHRES 0xBC ++#define HGPI_ASEQ_LEN 0x40 ++ ++#define EGPI_PAUSE_TIME 0x000007D0 ++#define EGPI_PAUSE_ENABLE 0x40000000 ++#endif /* _GPI_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/hif.h +@@ -0,0 +1,100 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _HIF_H_ ++#define _HIF_H_ ++ ++/* @file hif.h. ++ * hif - PFE hif block control and status register. ++ * Mapped on CBUS and accessible from all PE's and ARM. ++ */ ++#define HIF_VERSION (HIF_BASE_ADDR + 0x00) ++#define HIF_TX_CTRL (HIF_BASE_ADDR + 0x04) ++#define HIF_TX_CURR_BD_ADDR (HIF_BASE_ADDR + 0x08) ++#define HIF_TX_ALLOC (HIF_BASE_ADDR + 0x0c) ++#define HIF_TX_BDP_ADDR (HIF_BASE_ADDR + 0x10) ++#define HIF_TX_STATUS (HIF_BASE_ADDR + 0x14) ++#define HIF_RX_CTRL (HIF_BASE_ADDR + 0x20) ++#define HIF_RX_BDP_ADDR (HIF_BASE_ADDR + 0x24) ++#define HIF_RX_STATUS (HIF_BASE_ADDR + 0x30) ++#define HIF_INT_SRC (HIF_BASE_ADDR + 0x34) ++#define HIF_INT_ENABLE (HIF_BASE_ADDR + 0x38) ++#define HIF_POLL_CTRL (HIF_BASE_ADDR + 0x3c) ++#define HIF_RX_CURR_BD_ADDR (HIF_BASE_ADDR + 0x40) ++#define HIF_RX_ALLOC (HIF_BASE_ADDR + 0x44) ++#define HIF_TX_DMA_STATUS (HIF_BASE_ADDR + 0x48) ++#define HIF_RX_DMA_STATUS (HIF_BASE_ADDR + 0x4c) ++#define HIF_INT_COAL (HIF_BASE_ADDR + 0x50) ++ ++/* HIF_INT_SRC/ HIF_INT_ENABLE control bits */ ++#define HIF_INT BIT(0) ++#define HIF_RXBD_INT BIT(1) ++#define HIF_RXPKT_INT BIT(2) ++#define HIF_TXBD_INT BIT(3) ++#define HIF_TXPKT_INT BIT(4) ++ ++/* HIF_TX_CTRL bits */ ++#define HIF_CTRL_DMA_EN BIT(0) ++#define HIF_CTRL_BDP_POLL_CTRL_EN BIT(1) ++#define HIF_CTRL_BDP_CH_START_WSTB BIT(2) ++ ++/* HIF_RX_STATUS bits */ ++#define BDP_CSR_RX_DMA_ACTV BIT(16) ++ ++/* HIF_INT_ENABLE bits */ ++#define HIF_INT_EN BIT(0) ++#define HIF_RXBD_INT_EN BIT(1) ++#define HIF_RXPKT_INT_EN BIT(2) ++#define HIF_TXBD_INT_EN BIT(3) ++#define HIF_TXPKT_INT_EN BIT(4) ++ ++/* HIF_POLL_CTRL bits*/ ++#define HIF_RX_POLL_CTRL_CYCLE 0x0400 ++#define HIF_TX_POLL_CTRL_CYCLE 0x0400 ++ ++/* HIF_INT_COAL bits*/ ++#define HIF_INT_COAL_ENABLE BIT(31) ++ ++/* Buffer descriptor control bits */ ++#define BD_CTRL_BUFLEN_MASK 0x3fff ++#define BD_BUF_LEN(x) ((x) & BD_CTRL_BUFLEN_MASK) ++#define BD_CTRL_CBD_INT_EN BIT(16) ++#define BD_CTRL_PKT_INT_EN BIT(17) ++#define BD_CTRL_LIFM BIT(18) ++#define BD_CTRL_LAST_BD BIT(19) ++#define BD_CTRL_DIR BIT(20) ++#define BD_CTRL_LMEM_CPY BIT(21) /* Valid only for HIF_NOCPY */ ++#define BD_CTRL_PKT_XFER BIT(24) ++#define BD_CTRL_DESC_EN BIT(31) ++#define BD_CTRL_PARSE_DISABLE BIT(25) ++#define BD_CTRL_BRFETCH_DISABLE BIT(26) ++#define BD_CTRL_RTFETCH_DISABLE BIT(27) ++ ++/* Buffer descriptor status bits*/ ++#define BD_STATUS_CONN_ID(x) ((x) & 0xffff) ++#define BD_STATUS_DIR_PROC_ID BIT(16) ++#define BD_STATUS_CONN_ID_EN BIT(17) ++#define BD_STATUS_PE2PROC_ID(x) (((x) & 7) << 18) ++#define BD_STATUS_LE_DATA BIT(21) ++#define BD_STATUS_CHKSUM_EN BIT(22) ++ ++/* HIF Buffer descriptor status bits */ ++#define DIR_PROC_ID BIT(16) ++#define PROC_ID(id) ((id) << 18) ++ ++#endif /* _HIF_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/hif_nocpy.h +@@ -0,0 +1,50 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _HIF_NOCPY_H_ ++#define _HIF_NOCPY_H_ ++ ++#define HIF_NOCPY_VERSION (HIF_NOCPY_BASE_ADDR + 0x00) ++#define HIF_NOCPY_TX_CTRL (HIF_NOCPY_BASE_ADDR + 0x04) ++#define HIF_NOCPY_TX_CURR_BD_ADDR (HIF_NOCPY_BASE_ADDR + 0x08) ++#define HIF_NOCPY_TX_ALLOC (HIF_NOCPY_BASE_ADDR + 0x0c) ++#define HIF_NOCPY_TX_BDP_ADDR (HIF_NOCPY_BASE_ADDR + 0x10) ++#define HIF_NOCPY_TX_STATUS (HIF_NOCPY_BASE_ADDR + 0x14) ++#define HIF_NOCPY_RX_CTRL (HIF_NOCPY_BASE_ADDR + 0x20) ++#define HIF_NOCPY_RX_BDP_ADDR (HIF_NOCPY_BASE_ADDR + 0x24) ++#define HIF_NOCPY_RX_STATUS (HIF_NOCPY_BASE_ADDR + 0x30) ++#define HIF_NOCPY_INT_SRC (HIF_NOCPY_BASE_ADDR + 0x34) ++#define HIF_NOCPY_INT_ENABLE (HIF_NOCPY_BASE_ADDR + 0x38) ++#define HIF_NOCPY_POLL_CTRL (HIF_NOCPY_BASE_ADDR + 0x3c) ++#define HIF_NOCPY_RX_CURR_BD_ADDR (HIF_NOCPY_BASE_ADDR + 0x40) ++#define HIF_NOCPY_RX_ALLOC (HIF_NOCPY_BASE_ADDR + 0x44) ++#define HIF_NOCPY_TX_DMA_STATUS (HIF_NOCPY_BASE_ADDR + 0x48) ++#define HIF_NOCPY_RX_DMA_STATUS (HIF_NOCPY_BASE_ADDR + 0x4c) ++#define HIF_NOCPY_RX_INQ0_PKTPTR (HIF_NOCPY_BASE_ADDR + 0x50) ++#define HIF_NOCPY_RX_INQ1_PKTPTR (HIF_NOCPY_BASE_ADDR + 0x54) ++#define HIF_NOCPY_TX_PORT_NO (HIF_NOCPY_BASE_ADDR + 0x60) ++#define HIF_NOCPY_LMEM_ALLOC_ADDR (HIF_NOCPY_BASE_ADDR + 0x64) ++#define HIF_NOCPY_CLASS_ADDR (HIF_NOCPY_BASE_ADDR + 0x68) ++#define HIF_NOCPY_TMU_PORT0_ADDR (HIF_NOCPY_BASE_ADDR + 0x70) ++#define HIF_NOCPY_TMU_PORT1_ADDR (HIF_NOCPY_BASE_ADDR + 0x74) ++#define HIF_NOCPY_TMU_PORT2_ADDR (HIF_NOCPY_BASE_ADDR + 0x7c) ++#define HIF_NOCPY_TMU_PORT3_ADDR (HIF_NOCPY_BASE_ADDR + 0x80) ++#define HIF_NOCPY_TMU_PORT4_ADDR (HIF_NOCPY_BASE_ADDR + 0x84) ++#define HIF_NOCPY_INT_COAL (HIF_NOCPY_BASE_ADDR + 0x90) ++ ++#endif /* _HIF_NOCPY_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/tmu_csr.h +@@ -0,0 +1,168 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _TMU_CSR_H_ ++#define _TMU_CSR_H_ ++ ++#define TMU_VERSION (TMU_CSR_BASE_ADDR + 0x000) ++#define TMU_INQ_WATERMARK (TMU_CSR_BASE_ADDR + 0x004) ++#define TMU_PHY_INQ_PKTPTR (TMU_CSR_BASE_ADDR + 0x008) ++#define TMU_PHY_INQ_PKTINFO (TMU_CSR_BASE_ADDR + 0x00c) ++#define TMU_PHY_INQ_FIFO_CNT (TMU_CSR_BASE_ADDR + 0x010) ++#define TMU_SYS_GENERIC_CONTROL (TMU_CSR_BASE_ADDR + 0x014) ++#define TMU_SYS_GENERIC_STATUS (TMU_CSR_BASE_ADDR + 0x018) ++#define TMU_SYS_GEN_CON0 (TMU_CSR_BASE_ADDR + 0x01c) ++#define TMU_SYS_GEN_CON1 (TMU_CSR_BASE_ADDR + 0x020) ++#define TMU_SYS_GEN_CON2 (TMU_CSR_BASE_ADDR + 0x024) ++#define TMU_SYS_GEN_CON3 (TMU_CSR_BASE_ADDR + 0x028) ++#define TMU_SYS_GEN_CON4 (TMU_CSR_BASE_ADDR + 0x02c) ++#define TMU_TEQ_DISABLE_DROPCHK (TMU_CSR_BASE_ADDR + 0x030) ++#define TMU_TEQ_CTRL (TMU_CSR_BASE_ADDR + 0x034) ++#define TMU_TEQ_QCFG (TMU_CSR_BASE_ADDR + 0x038) ++#define TMU_TEQ_DROP_STAT (TMU_CSR_BASE_ADDR + 0x03c) ++#define TMU_TEQ_QAVG (TMU_CSR_BASE_ADDR + 0x040) ++#define TMU_TEQ_WREG_PROB (TMU_CSR_BASE_ADDR + 0x044) ++#define TMU_TEQ_TRANS_STAT (TMU_CSR_BASE_ADDR + 0x048) ++#define TMU_TEQ_HW_PROB_CFG0 (TMU_CSR_BASE_ADDR + 0x04c) ++#define TMU_TEQ_HW_PROB_CFG1 (TMU_CSR_BASE_ADDR + 0x050) ++#define TMU_TEQ_HW_PROB_CFG2 (TMU_CSR_BASE_ADDR + 0x054) ++#define TMU_TEQ_HW_PROB_CFG3 (TMU_CSR_BASE_ADDR + 0x058) ++#define TMU_TEQ_HW_PROB_CFG4 (TMU_CSR_BASE_ADDR + 0x05c) ++#define TMU_TEQ_HW_PROB_CFG5 (TMU_CSR_BASE_ADDR + 0x060) ++#define TMU_TEQ_HW_PROB_CFG6 (TMU_CSR_BASE_ADDR + 0x064) ++#define TMU_TEQ_HW_PROB_CFG7 (TMU_CSR_BASE_ADDR + 0x068) ++#define TMU_TEQ_HW_PROB_CFG8 (TMU_CSR_BASE_ADDR + 0x06c) ++#define TMU_TEQ_HW_PROB_CFG9 (TMU_CSR_BASE_ADDR + 0x070) ++#define TMU_TEQ_HW_PROB_CFG10 (TMU_CSR_BASE_ADDR + 0x074) ++#define TMU_TEQ_HW_PROB_CFG11 (TMU_CSR_BASE_ADDR + 0x078) ++#define TMU_TEQ_HW_PROB_CFG12 (TMU_CSR_BASE_ADDR + 0x07c) ++#define TMU_TEQ_HW_PROB_CFG13 (TMU_CSR_BASE_ADDR + 0x080) ++#define TMU_TEQ_HW_PROB_CFG14 (TMU_CSR_BASE_ADDR + 0x084) ++#define TMU_TEQ_HW_PROB_CFG15 (TMU_CSR_BASE_ADDR + 0x088) ++#define TMU_TEQ_HW_PROB_CFG16 (TMU_CSR_BASE_ADDR + 0x08c) ++#define TMU_TEQ_HW_PROB_CFG17 (TMU_CSR_BASE_ADDR + 0x090) ++#define TMU_TEQ_HW_PROB_CFG18 (TMU_CSR_BASE_ADDR + 0x094) ++#define TMU_TEQ_HW_PROB_CFG19 (TMU_CSR_BASE_ADDR + 0x098) ++#define TMU_TEQ_HW_PROB_CFG20 (TMU_CSR_BASE_ADDR + 0x09c) ++#define TMU_TEQ_HW_PROB_CFG21 (TMU_CSR_BASE_ADDR + 0x0a0) ++#define TMU_TEQ_HW_PROB_CFG22 (TMU_CSR_BASE_ADDR + 0x0a4) ++#define TMU_TEQ_HW_PROB_CFG23 (TMU_CSR_BASE_ADDR + 0x0a8) ++#define TMU_TEQ_HW_PROB_CFG24 (TMU_CSR_BASE_ADDR + 0x0ac) ++#define TMU_TEQ_HW_PROB_CFG25 (TMU_CSR_BASE_ADDR + 0x0b0) ++#define TMU_TDQ_IIFG_CFG (TMU_CSR_BASE_ADDR + 0x0b4) ++/* [9:0] Scheduler Enable for each of the scheduler in the TDQ. ++ * This is a global Enable for all schedulers in PHY0 ++ */ ++#define TMU_TDQ0_SCH_CTRL (TMU_CSR_BASE_ADDR + 0x0b8) ++ ++#define TMU_LLM_CTRL (TMU_CSR_BASE_ADDR + 0x0bc) ++#define TMU_LLM_BASE_ADDR (TMU_CSR_BASE_ADDR + 0x0c0) ++#define TMU_LLM_QUE_LEN (TMU_CSR_BASE_ADDR + 0x0c4) ++#define TMU_LLM_QUE_HEADPTR (TMU_CSR_BASE_ADDR + 0x0c8) ++#define TMU_LLM_QUE_TAILPTR (TMU_CSR_BASE_ADDR + 0x0cc) ++#define TMU_LLM_QUE_DROPCNT (TMU_CSR_BASE_ADDR + 0x0d0) ++#define TMU_INT_EN (TMU_CSR_BASE_ADDR + 0x0d4) ++#define TMU_INT_SRC (TMU_CSR_BASE_ADDR + 0x0d8) ++#define TMU_INQ_STAT (TMU_CSR_BASE_ADDR + 0x0dc) ++#define TMU_CTRL (TMU_CSR_BASE_ADDR + 0x0e0) ++ ++/* [31] Mem Access Command. 0 = Internal Memory Read, 1 = Internal memory ++ * Write [27:24] Byte Enables of the Internal memory access [23:0] Address of ++ * the internal memory. This address is used to access both the PM and DM of ++ * all the PE's ++ */ ++#define TMU_MEM_ACCESS_ADDR (TMU_CSR_BASE_ADDR + 0x0e4) ++ ++/* Internal Memory Access Write Data */ ++#define TMU_MEM_ACCESS_WDATA (TMU_CSR_BASE_ADDR + 0x0e8) ++/* Internal Memory Access Read Data. The commands are blocked ++ * at the mem_access only ++ */ ++#define TMU_MEM_ACCESS_RDATA (TMU_CSR_BASE_ADDR + 0x0ec) ++ ++/* [31:0] PHY0 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY0_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x0f0) ++/* [31:0] PHY1 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY1_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x0f4) ++/* [31:0] PHY2 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY2_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x0f8) ++/* [31:0] PHY3 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY3_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x0fc) ++#define TMU_BMU_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x100) ++#define TMU_TX_CTRL (TMU_CSR_BASE_ADDR + 0x104) ++ ++#define TMU_BUS_ACCESS_WDATA (TMU_CSR_BASE_ADDR + 0x108) ++#define TMU_BUS_ACCESS (TMU_CSR_BASE_ADDR + 0x10c) ++#define TMU_BUS_ACCESS_RDATA (TMU_CSR_BASE_ADDR + 0x110) ++ ++#define TMU_PE_SYS_CLK_RATIO (TMU_CSR_BASE_ADDR + 0x114) ++#define TMU_PE_STATUS (TMU_CSR_BASE_ADDR + 0x118) ++#define TMU_TEQ_MAX_THRESHOLD (TMU_CSR_BASE_ADDR + 0x11c) ++/* [31:0] PHY4 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY4_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x134) ++/* [9:0] Scheduler Enable for each of the scheduler in the TDQ. ++ * This is a global Enable for all schedulers in PHY1 ++ */ ++#define TMU_TDQ1_SCH_CTRL (TMU_CSR_BASE_ADDR + 0x138) ++/* [9:0] Scheduler Enable for each of the scheduler in the TDQ. ++ * This is a global Enable for all schedulers in PHY2 ++ */ ++#define TMU_TDQ2_SCH_CTRL (TMU_CSR_BASE_ADDR + 0x13c) ++/* [9:0] Scheduler Enable for each of the scheduler in the TDQ. ++ * This is a global Enable for all schedulers in PHY3 ++ */ ++#define TMU_TDQ3_SCH_CTRL (TMU_CSR_BASE_ADDR + 0x140) ++#define TMU_BMU_BUF_SIZE (TMU_CSR_BASE_ADDR + 0x144) ++/* [31:0] PHY5 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY5_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x148) ++ ++#define SW_RESET BIT(0) /* Global software reset */ ++#define INQ_RESET BIT(2) ++#define TEQ_RESET BIT(3) ++#define TDQ_RESET BIT(4) ++#define PE_RESET BIT(5) ++#define MEM_INIT BIT(6) ++#define MEM_INIT_DONE BIT(7) ++#define LLM_INIT BIT(8) ++#define LLM_INIT_DONE BIT(9) ++#define ECC_MEM_INIT_DONE BIT(10) ++ ++struct tmu_cfg { ++ u32 pe_sys_clk_ratio; ++ unsigned long llm_base_addr; ++ u32 llm_queue_len; ++}; ++ ++/* Not HW related for pfe_ctrl / pfe common defines */ ++#define DEFAULT_MAX_QDEPTH 80 ++#define DEFAULT_Q0_QDEPTH 511 /*We keep one large queue for host tx qos */ ++#define DEFAULT_TMU3_QDEPTH 127 ++ ++#endif /* _TMU_CSR_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/util_csr.h +@@ -0,0 +1,61 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _UTIL_CSR_H_ ++#define _UTIL_CSR_H_ ++ ++#define UTIL_VERSION (UTIL_CSR_BASE_ADDR + 0x000) ++#define UTIL_TX_CTRL (UTIL_CSR_BASE_ADDR + 0x004) ++#define UTIL_INQ_PKTPTR (UTIL_CSR_BASE_ADDR + 0x010) ++ ++#define UTIL_HDR_SIZE (UTIL_CSR_BASE_ADDR + 0x014) ++ ++#define UTIL_PE0_QB_DM_ADDR0 (UTIL_CSR_BASE_ADDR + 0x020) ++#define UTIL_PE0_QB_DM_ADDR1 (UTIL_CSR_BASE_ADDR + 0x024) ++#define UTIL_PE0_RO_DM_ADDR0 (UTIL_CSR_BASE_ADDR + 0x060) ++#define UTIL_PE0_RO_DM_ADDR1 (UTIL_CSR_BASE_ADDR + 0x064) ++ ++#define UTIL_MEM_ACCESS_ADDR (UTIL_CSR_BASE_ADDR + 0x100) ++#define UTIL_MEM_ACCESS_WDATA (UTIL_CSR_BASE_ADDR + 0x104) ++#define UTIL_MEM_ACCESS_RDATA (UTIL_CSR_BASE_ADDR + 0x108) ++ ++#define UTIL_TM_INQ_ADDR (UTIL_CSR_BASE_ADDR + 0x114) ++#define UTIL_PE_STATUS (UTIL_CSR_BASE_ADDR + 0x118) ++ ++#define UTIL_PE_SYS_CLK_RATIO (UTIL_CSR_BASE_ADDR + 0x200) ++#define UTIL_AFULL_THRES (UTIL_CSR_BASE_ADDR + 0x204) ++#define UTIL_GAP_BETWEEN_READS (UTIL_CSR_BASE_ADDR + 0x208) ++#define UTIL_MAX_BUF_CNT (UTIL_CSR_BASE_ADDR + 0x20c) ++#define UTIL_TSQ_FIFO_THRES (UTIL_CSR_BASE_ADDR + 0x210) ++#define UTIL_TSQ_MAX_CNT (UTIL_CSR_BASE_ADDR + 0x214) ++#define UTIL_IRAM_DATA_0 (UTIL_CSR_BASE_ADDR + 0x218) ++#define UTIL_IRAM_DATA_1 (UTIL_CSR_BASE_ADDR + 0x21c) ++#define UTIL_IRAM_DATA_2 (UTIL_CSR_BASE_ADDR + 0x220) ++#define UTIL_IRAM_DATA_3 (UTIL_CSR_BASE_ADDR + 0x224) ++ ++#define UTIL_BUS_ACCESS_ADDR (UTIL_CSR_BASE_ADDR + 0x228) ++#define UTIL_BUS_ACCESS_WDATA (UTIL_CSR_BASE_ADDR + 0x22c) ++#define UTIL_BUS_ACCESS_RDATA (UTIL_CSR_BASE_ADDR + 0x230) ++ ++#define UTIL_INQ_AFULL_THRES (UTIL_CSR_BASE_ADDR + 0x234) ++ ++struct util_cfg { ++ u32 pe_sys_clk_ratio; ++}; ++ ++#endif /* _UTIL_CSR_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/pfe.h +@@ -0,0 +1,372 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _PFE_H_ ++#define _PFE_H_ ++ ++#include "cbus.h" ++ ++#define CLASS_DMEM_BASE_ADDR(i) (0x00000000 | ((i) << 20)) ++/* ++ * Only valid for mem access register interface ++ */ ++#define CLASS_IMEM_BASE_ADDR(i) (0x00000000 | ((i) << 20)) ++#define CLASS_DMEM_SIZE 0x00002000 ++#define CLASS_IMEM_SIZE 0x00008000 ++ ++#define TMU_DMEM_BASE_ADDR(i) (0x00000000 + ((i) << 20)) ++/* ++ * Only valid for mem access register interface ++ */ ++#define TMU_IMEM_BASE_ADDR(i) (0x00000000 + ((i) << 20)) ++#define TMU_DMEM_SIZE 0x00000800 ++#define TMU_IMEM_SIZE 0x00002000 ++ ++#define UTIL_DMEM_BASE_ADDR 0x00000000 ++#define UTIL_DMEM_SIZE 0x00002000 ++ ++#define PE_LMEM_BASE_ADDR 0xc3010000 ++#define PE_LMEM_SIZE 0x8000 ++#define PE_LMEM_END (PE_LMEM_BASE_ADDR + PE_LMEM_SIZE) ++ ++#define DMEM_BASE_ADDR 0x00000000 ++#define DMEM_SIZE 0x2000 /* TMU has less... */ ++#define DMEM_END (DMEM_BASE_ADDR + DMEM_SIZE) ++ ++#define PMEM_BASE_ADDR 0x00010000 ++#define PMEM_SIZE 0x8000 /* TMU has less... */ ++#define PMEM_END (PMEM_BASE_ADDR + PMEM_SIZE) ++ ++/* These check memory ranges from PE point of view/memory map */ ++#define IS_DMEM(addr, len) \ ++ ({ typeof(addr) addr_ = (addr); \ ++ ((unsigned long)(addr_) >= DMEM_BASE_ADDR) && \ ++ (((unsigned long)(addr_) + (len)) <= DMEM_END); }) ++ ++#define IS_PMEM(addr, len) \ ++ ({ typeof(addr) addr_ = (addr); \ ++ ((unsigned long)(addr_) >= PMEM_BASE_ADDR) && \ ++ (((unsigned long)(addr_) + (len)) <= PMEM_END); }) ++ ++#define IS_PE_LMEM(addr, len) \ ++ ({ typeof(addr) addr_ = (addr); \ ++ ((unsigned long)(addr_) >= \ ++ PE_LMEM_BASE_ADDR) && \ ++ (((unsigned long)(addr_) + \ ++ (len)) <= PE_LMEM_END); }) ++ ++#define IS_PFE_LMEM(addr, len) \ ++ ({ typeof(addr) addr_ = (addr); \ ++ ((unsigned long)(addr_) >= \ ++ CBUS_VIRT_TO_PFE(LMEM_BASE_ADDR)) && \ ++ (((unsigned long)(addr_) + (len)) <= \ ++ CBUS_VIRT_TO_PFE(LMEM_END)); }) ++ ++#define __IS_PHYS_DDR(addr, len) \ ++ ({ typeof(addr) addr_ = (addr); \ ++ ((unsigned long)(addr_) >= \ ++ DDR_PHYS_BASE_ADDR) && \ ++ (((unsigned long)(addr_) + (len)) <= \ ++ DDR_PHYS_END); }) ++ ++#define IS_PHYS_DDR(addr, len) __IS_PHYS_DDR(DDR_PFE_TO_PHYS(addr), len) ++ ++/* ++ * If using a run-time virtual address for the cbus base address use this code ++ */ ++extern void *cbus_base_addr; ++extern void *ddr_base_addr; ++extern unsigned long ddr_phys_base_addr; ++extern unsigned int ddr_size; ++ ++#define CBUS_BASE_ADDR cbus_base_addr ++#define DDR_PHYS_BASE_ADDR ddr_phys_base_addr ++#define DDR_BASE_ADDR ddr_base_addr ++#define DDR_SIZE ddr_size ++ ++#define DDR_PHYS_END (DDR_PHYS_BASE_ADDR + DDR_SIZE) ++ ++#define LS1012A_PFE_RESET_WA /* ++ * PFE doesn't have global reset and re-init ++ * should takecare few things to make PFE ++ * functional after reset ++ */ ++#define PFE_CBUS_PHYS_BASE_ADDR 0xc0000000 /* CBUS physical base address ++ * as seen by PE's. ++ */ ++/* CBUS physical base address as seen by PE's. */ ++#define PFE_CBUS_PHYS_BASE_ADDR_FROM_PFE 0xc0000000 ++ ++#define DDR_PHYS_TO_PFE(p) (((unsigned long int)(p)) & 0x7FFFFFFF) ++#define DDR_PFE_TO_PHYS(p) (((unsigned long int)(p)) | 0x80000000) ++#define CBUS_PHYS_TO_PFE(p) (((p) - PFE_CBUS_PHYS_BASE_ADDR) + \ ++ PFE_CBUS_PHYS_BASE_ADDR_FROM_PFE) ++/* Translates to PFE address map */ ++ ++#define DDR_PHYS_TO_VIRT(p) (((p) - DDR_PHYS_BASE_ADDR) + DDR_BASE_ADDR) ++#define DDR_VIRT_TO_PHYS(v) (((v) - DDR_BASE_ADDR) + DDR_PHYS_BASE_ADDR) ++#define DDR_VIRT_TO_PFE(p) (DDR_PHYS_TO_PFE(DDR_VIRT_TO_PHYS(p))) ++ ++#define CBUS_VIRT_TO_PFE(v) (((v) - CBUS_BASE_ADDR) + \ ++ PFE_CBUS_PHYS_BASE_ADDR) ++#define CBUS_PFE_TO_VIRT(p) (((unsigned long int)(p) - \ ++ PFE_CBUS_PHYS_BASE_ADDR) + CBUS_BASE_ADDR) ++ ++/* The below part of the code is used in QOS control driver from host */ ++#define TMU_APB_BASE_ADDR 0xc1000000 /* TMU base address seen by ++ * pe's ++ */ ++ ++enum { ++ CLASS0_ID = 0, ++ CLASS1_ID, ++ CLASS2_ID, ++ CLASS3_ID, ++ CLASS4_ID, ++ CLASS5_ID, ++ TMU0_ID, ++ TMU1_ID, ++ TMU2_ID, ++ TMU3_ID, ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ UTIL_ID, ++#endif ++ MAX_PE ++}; ++ ++#define CLASS_MASK (BIT(CLASS0_ID) | BIT(CLASS1_ID) |\ ++ BIT(CLASS2_ID) | BIT(CLASS3_ID) |\ ++ BIT(CLASS4_ID) | BIT(CLASS5_ID)) ++#define CLASS_MAX_ID CLASS5_ID ++ ++#define TMU_MASK (BIT(TMU0_ID) | BIT(TMU1_ID) |\ ++ BIT(TMU3_ID)) ++ ++#define TMU_MAX_ID TMU3_ID ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++#define UTIL_MASK BIT(UTIL_ID) ++#endif ++ ++struct pe_status { ++ u32 cpu_state; ++ u32 activity_counter; ++ u32 rx; ++ union { ++ u32 tx; ++ u32 tmu_qstatus; ++ }; ++ u32 drop; ++#if defined(CFG_PE_DEBUG) ++ u32 debug_indicator; ++ u32 debug[16]; ++#endif ++} __aligned(16); ++ ++struct pe_sync_mailbox { ++ u32 stop; ++ u32 stopped; ++}; ++ ++/* Drop counter definitions */ ++ ++#define CLASS_NUM_DROP_COUNTERS 13 ++#define UTIL_NUM_DROP_COUNTERS 8 ++ ++/* PE information. ++ * Structure containing PE's specific information. It is used to create ++ * generic C functions common to all PE's. ++ * Before using the library functions this structure needs to be initialized ++ * with the different registers virtual addresses ++ * (according to the ARM MMU mmaping). The default initialization supports a ++ * virtual == physical mapping. ++ */ ++struct pe_info { ++ u32 dmem_base_addr; /* PE's dmem base address */ ++ u32 pmem_base_addr; /* PE's pmem base address */ ++ u32 pmem_size; /* PE's pmem size */ ++ ++ void *mem_access_wdata; /* PE's _MEM_ACCESS_WDATA register ++ * address ++ */ ++ void *mem_access_addr; /* PE's _MEM_ACCESS_ADDR register ++ * address ++ */ ++ void *mem_access_rdata; /* PE's _MEM_ACCESS_RDATA register ++ * address ++ */ ++}; ++ ++void pe_lmem_read(u32 *dst, u32 len, u32 offset); ++void pe_lmem_write(u32 *src, u32 len, u32 offset); ++ ++void pe_dmem_memcpy_to32(int id, u32 dst, const void *src, unsigned int len); ++void pe_pmem_memcpy_to32(int id, u32 dst, const void *src, unsigned int len); ++ ++u32 pe_pmem_read(int id, u32 addr, u8 size); ++ ++void pe_dmem_write(int id, u32 val, u32 addr, u8 size); ++u32 pe_dmem_read(int id, u32 addr, u8 size); ++void class_pe_lmem_memcpy_to32(u32 dst, const void *src, unsigned int len); ++void class_pe_lmem_memset(u32 dst, int val, unsigned int len); ++void class_bus_write(u32 val, u32 addr, u8 size); ++u32 class_bus_read(u32 addr, u8 size); ++ ++#define class_bus_readl(addr) class_bus_read(addr, 4) ++#define class_bus_readw(addr) class_bus_read(addr, 2) ++#define class_bus_readb(addr) class_bus_read(addr, 1) ++ ++#define class_bus_writel(val, addr) class_bus_write(val, addr, 4) ++#define class_bus_writew(val, addr) class_bus_write(val, addr, 2) ++#define class_bus_writeb(val, addr) class_bus_write(val, addr, 1) ++ ++#define pe_dmem_readl(id, addr) pe_dmem_read(id, addr, 4) ++#define pe_dmem_readw(id, addr) pe_dmem_read(id, addr, 2) ++#define pe_dmem_readb(id, addr) pe_dmem_read(id, addr, 1) ++ ++#define pe_dmem_writel(id, val, addr) pe_dmem_write(id, val, addr, 4) ++#define pe_dmem_writew(id, val, addr) pe_dmem_write(id, val, addr, 2) ++#define pe_dmem_writeb(id, val, addr) pe_dmem_write(id, val, addr, 1) ++ ++/*int pe_load_elf_section(int id, const void *data, elf32_shdr *shdr); */ ++int pe_load_elf_section(int id, const void *data, struct elf32_shdr *shdr, ++ struct device *dev); ++ ++void pfe_lib_init(void *cbus_base, void *ddr_base, unsigned long ddr_phys_base, ++ unsigned int ddr_size); ++void bmu_init(void *base, struct BMU_CFG *cfg); ++void bmu_reset(void *base); ++void bmu_enable(void *base); ++void bmu_disable(void *base); ++void bmu_set_config(void *base, struct BMU_CFG *cfg); ++ ++/* ++ * An enumerated type for loopback values. This can be one of three values, no ++ * loopback -normal operation, local loopback with internal loopback module of ++ * MAC or PHY loopback which is through the external PHY. ++ */ ++#ifndef __MAC_LOOP_ENUM__ ++#define __MAC_LOOP_ENUM__ ++enum mac_loop {LB_NONE, LB_EXT, LB_LOCAL}; ++#endif ++ ++void gemac_init(void *base, void *config); ++void gemac_disable_rx_checksum_offload(void *base); ++void gemac_enable_rx_checksum_offload(void *base); ++void gemac_set_speed(void *base, enum mac_speed gem_speed); ++void gemac_set_duplex(void *base, int duplex); ++void gemac_set_mode(void *base, int mode); ++void gemac_enable(void *base); ++void gemac_tx_disable(void *base); ++void gemac_tx_enable(void *base); ++void gemac_disable(void *base); ++void gemac_reset(void *base); ++void gemac_set_address(void *base, struct spec_addr *addr); ++struct spec_addr gemac_get_address(void *base); ++void gemac_set_loop(void *base, enum mac_loop gem_loop); ++void gemac_set_laddr1(void *base, struct pfe_mac_addr *address); ++void gemac_set_laddr2(void *base, struct pfe_mac_addr *address); ++void gemac_set_laddr3(void *base, struct pfe_mac_addr *address); ++void gemac_set_laddr4(void *base, struct pfe_mac_addr *address); ++void gemac_set_laddrN(void *base, struct pfe_mac_addr *address, ++ unsigned int entry_index); ++void gemac_clear_laddr1(void *base); ++void gemac_clear_laddr2(void *base); ++void gemac_clear_laddr3(void *base); ++void gemac_clear_laddr4(void *base); ++void gemac_clear_laddrN(void *base, unsigned int entry_index); ++struct pfe_mac_addr gemac_get_hash(void *base); ++void gemac_set_hash(void *base, struct pfe_mac_addr *hash); ++struct pfe_mac_addr gem_get_laddr1(void *base); ++struct pfe_mac_addr gem_get_laddr2(void *base); ++struct pfe_mac_addr gem_get_laddr3(void *base); ++struct pfe_mac_addr gem_get_laddr4(void *base); ++struct pfe_mac_addr gem_get_laddrN(void *base, unsigned int entry_index); ++void gemac_set_config(void *base, struct gemac_cfg *cfg); ++void gemac_allow_broadcast(void *base); ++void gemac_no_broadcast(void *base); ++void gemac_enable_1536_rx(void *base); ++void gemac_disable_1536_rx(void *base); ++void gemac_set_rx_max_fl(void *base, int mtu); ++void gemac_enable_rx_jmb(void *base); ++void gemac_disable_rx_jmb(void *base); ++void gemac_enable_stacked_vlan(void *base); ++void gemac_disable_stacked_vlan(void *base); ++void gemac_enable_pause_rx(void *base); ++void gemac_disable_pause_rx(void *base); ++void gemac_enable_copy_all(void *base); ++void gemac_disable_copy_all(void *base); ++void gemac_set_bus_width(void *base, int width); ++void gemac_set_wol(void *base, u32 wol_conf); ++ ++void gpi_init(void *base, struct gpi_cfg *cfg); ++void gpi_reset(void *base); ++void gpi_enable(void *base); ++void gpi_disable(void *base); ++void gpi_set_config(void *base, struct gpi_cfg *cfg); ++ ++void class_init(struct class_cfg *cfg); ++void class_reset(void); ++void class_enable(void); ++void class_disable(void); ++void class_set_config(struct class_cfg *cfg); ++ ++void tmu_reset(void); ++void tmu_init(struct tmu_cfg *cfg); ++void tmu_enable(u32 pe_mask); ++void tmu_disable(u32 pe_mask); ++u32 tmu_qstatus(u32 if_id); ++u32 tmu_pkts_processed(u32 if_id); ++ ++void util_init(struct util_cfg *cfg); ++void util_reset(void); ++void util_enable(void); ++void util_disable(void); ++ ++void hif_init(void); ++void hif_tx_enable(void); ++void hif_tx_disable(void); ++void hif_rx_enable(void); ++void hif_rx_disable(void); ++ ++/* Get Chip Revision level ++ * ++ */ ++static inline unsigned int CHIP_REVISION(void) ++{ ++ /*For LS1012A return always 1 */ ++ return 1; ++} ++ ++/* Start HIF rx DMA ++ * ++ */ ++static inline void hif_rx_dma_start(void) ++{ ++ writel(HIF_CTRL_DMA_EN | HIF_CTRL_BDP_CH_START_WSTB, HIF_RX_CTRL); ++} ++ ++/* Start HIF tx DMA ++ * ++ */ ++static inline void hif_tx_dma_start(void) ++{ ++ writel(HIF_CTRL_DMA_EN | HIF_CTRL_BDP_CH_START_WSTB, HIF_TX_CTRL); ++} ++ ++#endif /* _PFE_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_cdev.c +@@ -0,0 +1,258 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright 2018 NXP ++ */ ++ ++/* @pfe_cdev.c. ++ * Dummy device representing the PFE US in userspace. ++ * - used for interacting with the kernel layer for link status ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include "pfe_cdev.h" ++#include "pfe_mod.h" ++ ++static int pfe_majno; ++static struct class *pfe_char_class; ++static struct device *pfe_char_dev; ++struct eventfd_ctx *g_trigger; ++ ++struct pfe_shared_info link_states[PFE_CDEV_ETH_COUNT]; ++ ++static int pfe_cdev_open(struct inode *inp, struct file *fp) ++{ ++ pr_debug("PFE CDEV device opened.\n"); ++ return 0; ++} ++ ++static ssize_t pfe_cdev_read(struct file *fp, char *buf, ++ size_t len, loff_t *off) ++{ ++ int ret = 0; ++ ++ pr_info("PFE CDEV attempt copying (%lu) size of user.\n", ++ sizeof(link_states)); ++ ++ pr_debug("Dump link_state on screen before copy_to_user\n"); ++ for (; ret < PFE_CDEV_ETH_COUNT; ret++) { ++ pr_debug("%u %u", link_states[ret].phy_id, ++ link_states[ret].state); ++ pr_debug("\n"); ++ } ++ ++ /* Copy to user the value in buffer sized len */ ++ ret = copy_to_user(buf, &link_states, sizeof(link_states)); ++ if (ret != 0) { ++ pr_err("Failed to send (%d)bytes of (%lu) requested.\n", ++ ret, len); ++ return -EFAULT; ++ } ++ ++ /* offset set back to 0 as there is contextual reading offset */ ++ *off = 0; ++ pr_debug("Read of (%lu) bytes performed.\n", sizeof(link_states)); ++ ++ return sizeof(link_states); ++} ++ ++/** ++ * This function is for getting some commands from user through non-IOCTL ++ * channel. It can used to configure the device. ++ * TODO: To be filled in future, if require duplex communication with user ++ * space. ++ */ ++static ssize_t pfe_cdev_write(struct file *fp, const char *buf, ++ size_t len, loff_t *off) ++{ ++ pr_info("PFE CDEV Write operation not supported!\n"); ++ ++ return -EFAULT; ++} ++ ++static int pfe_cdev_release(struct inode *inp, struct file *fp) ++{ ++ if (g_trigger) { ++ free_irq(pfe->hif_irq, g_trigger); ++ eventfd_ctx_put(g_trigger); ++ g_trigger = NULL; ++ } ++ ++ pr_info("PFE_CDEV: Device successfully closed\n"); ++ return 0; ++} ++ ++/* ++ * hif_us_isr- ++ * This ISR routine processes Rx/Tx done interrupts from the HIF hardware block ++ */ ++static irqreturn_t hif_us_isr(int irq, void *arg) ++{ ++ struct eventfd_ctx *trigger = (struct eventfd_ctx *)arg; ++ int int_status; ++ int int_enable_mask; ++ ++ /*Read hif interrupt source register */ ++ int_status = readl_relaxed(HIF_INT_SRC); ++ int_enable_mask = readl_relaxed(HIF_INT_ENABLE); ++ ++ if ((int_status & HIF_INT) == 0) ++ return IRQ_NONE; ++ ++ if (int_status & HIF_RXPKT_INT) { ++ int_enable_mask &= ~(HIF_RXPKT_INT); ++ /* Disable interrupts, they will be enabled after ++ * they are serviced ++ */ ++ writel_relaxed(int_enable_mask, HIF_INT_ENABLE); ++ ++ eventfd_signal(trigger, 1); ++ } ++ ++ return IRQ_HANDLED; ++} ++ ++#define PFE_INTR_COAL_USECS 100 ++static long pfe_cdev_ioctl(struct file *fp, unsigned int cmd, ++ unsigned long arg) ++{ ++ int ret = -EFAULT; ++ int __user *argp = (int __user *)arg; ++ ++ pr_debug("PFE CDEV IOCTL Called with cmd=(%u)\n", cmd); ++ ++ switch (cmd) { ++ case PFE_CDEV_ETH0_STATE_GET: ++ /* Return an unsigned int (link state) for ETH0 */ ++ *argp = link_states[0].state; ++ pr_debug("Returning state=%d for ETH0\n", *argp); ++ ret = 0; ++ break; ++ case PFE_CDEV_ETH1_STATE_GET: ++ /* Return an unsigned int (link state) for ETH0 */ ++ *argp = link_states[1].state; ++ pr_debug("Returning state=%d for ETH1\n", *argp); ++ ret = 0; ++ break; ++ case PFE_CDEV_HIF_INTR_EN: ++ /* Return success/failure */ ++ g_trigger = eventfd_ctx_fdget(*argp); ++ if (IS_ERR(g_trigger)) ++ return PTR_ERR(g_trigger); ++ ret = request_irq(pfe->hif_irq, hif_us_isr, 0, "pfe_hif", ++ g_trigger); ++ if (ret) { ++ pr_err("%s: failed to get the hif IRQ = %d\n", ++ __func__, pfe->hif_irq); ++ eventfd_ctx_put(g_trigger); ++ g_trigger = NULL; ++ } ++ writel((PFE_INTR_COAL_USECS * (pfe->ctrl.sys_clk / 1000)) | ++ HIF_INT_COAL_ENABLE, HIF_INT_COAL); ++ ++ pr_debug("request_irq for hif interrupt: %d\n", pfe->hif_irq); ++ ret = 0; ++ break; ++ default: ++ pr_info("Unsupport cmd (%d) for PFE CDEV.\n", cmd); ++ break; ++ }; ++ ++ return ret; ++} ++ ++static unsigned int pfe_cdev_poll(struct file *fp, ++ struct poll_table_struct *wait) ++{ ++ pr_info("PFE CDEV poll method not supported\n"); ++ return 0; ++} ++ ++static const struct file_operations pfe_cdev_fops = { ++ .open = pfe_cdev_open, ++ .read = pfe_cdev_read, ++ .write = pfe_cdev_write, ++ .release = pfe_cdev_release, ++ .unlocked_ioctl = pfe_cdev_ioctl, ++ .poll = pfe_cdev_poll, ++}; ++ ++int pfe_cdev_init(void) ++{ ++ int ret; ++ ++ pr_debug("PFE CDEV initialization begin\n"); ++ ++ /* Register the major number for the device */ ++ pfe_majno = register_chrdev(0, PFE_CDEV_NAME, &pfe_cdev_fops); ++ if (pfe_majno < 0) { ++ pr_err("Unable to register PFE CDEV. PFE CDEV not available\n"); ++ ret = pfe_majno; ++ goto cleanup; ++ } ++ ++ pr_debug("PFE CDEV assigned major number: %d\n", pfe_majno); ++ ++ /* Register the class for the device */ ++ pfe_char_class = class_create(THIS_MODULE, PFE_CLASS_NAME); ++ if (IS_ERR(pfe_char_class)) { ++ pr_err( ++ "Failed to init class for PFE CDEV. PFE CDEV not available.\n"); ++ ret = PTR_ERR(pfe_char_class); ++ goto cleanup; ++ } ++ ++ pr_debug("PFE CDEV Class created successfully.\n"); ++ ++ /* Create the device without any parent and without any callback data */ ++ pfe_char_dev = device_create(pfe_char_class, NULL, ++ MKDEV(pfe_majno, 0), NULL, ++ PFE_CDEV_NAME); ++ if (IS_ERR(pfe_char_dev)) { ++ pr_err("Unable to PFE CDEV device. PFE CDEV not available.\n"); ++ ret = PTR_ERR(pfe_char_dev); ++ goto cleanup; ++ } ++ ++ /* Information structure being shared with the userspace */ ++ memset(link_states, 0, sizeof(struct pfe_shared_info) * ++ PFE_CDEV_ETH_COUNT); ++ ++ pr_info("PFE CDEV created: %s\n", PFE_CDEV_NAME); ++ ++ ret = 0; ++ return ret; ++ ++cleanup: ++ if (!IS_ERR(pfe_char_class)) ++ class_destroy(pfe_char_class); ++ ++ if (pfe_majno > 0) ++ unregister_chrdev(pfe_majno, PFE_CDEV_NAME); ++ ++ return ret; ++} ++ ++void pfe_cdev_exit(void) ++{ ++ if (!IS_ERR(pfe_char_dev)) ++ device_destroy(pfe_char_class, MKDEV(pfe_majno, 0)); ++ ++ if (!IS_ERR(pfe_char_class)) { ++ class_unregister(pfe_char_class); ++ class_destroy(pfe_char_class); ++ } ++ ++ if (pfe_majno > 0) ++ unregister_chrdev(pfe_majno, PFE_CDEV_NAME); ++ ++ /* reset the variables */ ++ pfe_majno = 0; ++ pfe_char_class = NULL; ++ pfe_char_dev = NULL; ++ ++ pr_info("PFE CDEV Removed.\n"); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_cdev.h +@@ -0,0 +1,41 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright 2018 NXP ++ */ ++ ++#ifndef _PFE_CDEV_H_ ++#define _PFE_CDEV_H_ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define PFE_CDEV_NAME "pfe_us_cdev" ++#define PFE_CLASS_NAME "ppfe_us" ++ ++/* Extracted from ls1012a_pfe_platform_data, there are 3 interfaces which are ++ * supported by PFE driver. Should be updated if number of eth devices are ++ * changed. ++ */ ++#define PFE_CDEV_ETH_COUNT 3 ++ ++struct pfe_shared_info { ++ uint32_t phy_id; /* Link phy ID */ ++ uint8_t state; /* Has either 0 or 1 */ ++}; ++ ++extern struct pfe_shared_info link_states[PFE_CDEV_ETH_COUNT]; ++ ++/* IOCTL Commands */ ++#define PFE_CDEV_ETH0_STATE_GET _IOR('R', 0, int) ++#define PFE_CDEV_ETH1_STATE_GET _IOR('R', 1, int) ++#define PFE_CDEV_HIF_INTR_EN _IOWR('R', 2, int) ++ ++int pfe_cdev_init(void); ++void pfe_cdev_exit(void); ++ ++#endif /* _PFE_CDEV_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_ctrl.c +@@ -0,0 +1,226 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "pfe_mod.h" ++#include "pfe_ctrl.h" ++ ++#define TIMEOUT_MS 1000 ++ ++int relax(unsigned long end) ++{ ++ if (time_after(jiffies, end)) { ++ if (time_after(jiffies, end + (TIMEOUT_MS * HZ) / 1000)) ++ return -1; ++ ++ if (need_resched()) ++ schedule(); ++ } ++ ++ return 0; ++} ++ ++void pfe_ctrl_suspend(struct pfe_ctrl *ctrl) ++{ ++ int id; ++ ++ mutex_lock(&ctrl->mutex); ++ ++ for (id = CLASS0_ID; id <= CLASS_MAX_ID; id++) ++ pe_dmem_write(id, cpu_to_be32(0x1), CLASS_DM_RESUME, 4); ++ ++ for (id = TMU0_ID; id <= TMU_MAX_ID; id++) { ++ if (id == TMU2_ID) ++ continue; ++ pe_dmem_write(id, cpu_to_be32(0x1), TMU_DM_RESUME, 4); ++ } ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ pe_dmem_write(UTIL_ID, cpu_to_be32(0x1), UTIL_DM_RESUME, 4); ++#endif ++ mutex_unlock(&ctrl->mutex); ++} ++ ++void pfe_ctrl_resume(struct pfe_ctrl *ctrl) ++{ ++ int pe_mask = CLASS_MASK | TMU_MASK; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ pe_mask |= UTIL_MASK; ++#endif ++ mutex_lock(&ctrl->mutex); ++ pe_start(&pfe->ctrl, pe_mask); ++ mutex_unlock(&ctrl->mutex); ++} ++ ++/* PE sync stop. ++ * Stops packet processing for a list of PE's (specified using a bitmask). ++ * The caller must hold ctrl->mutex. ++ * ++ * @param ctrl Control context ++ * @param pe_mask Mask of PE id's to stop ++ * ++ */ ++int pe_sync_stop(struct pfe_ctrl *ctrl, int pe_mask) ++{ ++ struct pe_sync_mailbox *mbox; ++ int pe_stopped = 0; ++ unsigned long end = jiffies + 2; ++ int i; ++ ++ pe_mask &= 0x2FF; /*Exclude Util + TMU2 */ ++ ++ for (i = 0; i < MAX_PE; i++) ++ if (pe_mask & (1 << i)) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ pe_dmem_write(i, cpu_to_be32(0x1), (unsigned ++ long)&mbox->stop, 4); ++ } ++ ++ while (pe_stopped != pe_mask) { ++ for (i = 0; i < MAX_PE; i++) ++ if ((pe_mask & (1 << i)) && !(pe_stopped & (1 << i))) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ if (pe_dmem_read(i, (unsigned ++ long)&mbox->stopped, 4) & ++ cpu_to_be32(0x1)) ++ pe_stopped |= (1 << i); ++ } ++ ++ if (relax(end) < 0) ++ goto err; ++ } ++ ++ return 0; ++ ++err: ++ pr_err("%s: timeout, %x %x\n", __func__, pe_mask, pe_stopped); ++ ++ for (i = 0; i < MAX_PE; i++) ++ if (pe_mask & (1 << i)) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ pe_dmem_write(i, cpu_to_be32(0x0), (unsigned ++ long)&mbox->stop, 4); ++ } ++ ++ return -EIO; ++} ++ ++/* PE start. ++ * Starts packet processing for a list of PE's (specified using a bitmask). ++ * The caller must hold ctrl->mutex. ++ * ++ * @param ctrl Control context ++ * @param pe_mask Mask of PE id's to start ++ * ++ */ ++void pe_start(struct pfe_ctrl *ctrl, int pe_mask) ++{ ++ struct pe_sync_mailbox *mbox; ++ int i; ++ ++ for (i = 0; i < MAX_PE; i++) ++ if (pe_mask & (1 << i)) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ pe_dmem_write(i, cpu_to_be32(0x0), (unsigned ++ long)&mbox->stop, 4); ++ } ++} ++ ++/* This function will ensure all PEs are put in to idle state */ ++int pe_reset_all(struct pfe_ctrl *ctrl) ++{ ++ struct pe_sync_mailbox *mbox; ++ int pe_stopped = 0; ++ unsigned long end = jiffies + 2; ++ int i; ++ int pe_mask = CLASS_MASK | TMU_MASK; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ pe_mask |= UTIL_MASK; ++#endif ++ ++ for (i = 0; i < MAX_PE; i++) ++ if (pe_mask & (1 << i)) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ pe_dmem_write(i, cpu_to_be32(0x2), (unsigned ++ long)&mbox->stop, 4); ++ } ++ ++ while (pe_stopped != pe_mask) { ++ for (i = 0; i < MAX_PE; i++) ++ if ((pe_mask & (1 << i)) && !(pe_stopped & (1 << i))) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ if (pe_dmem_read(i, (unsigned long) ++ &mbox->stopped, 4) & ++ cpu_to_be32(0x1)) ++ pe_stopped |= (1 << i); ++ } ++ ++ if (relax(end) < 0) ++ goto err; ++ } ++ ++ return 0; ++ ++err: ++ pr_err("%s: timeout, %x %x\n", __func__, pe_mask, pe_stopped); ++ return -EIO; ++} ++ ++int pfe_ctrl_init(struct pfe *pfe) ++{ ++ struct pfe_ctrl *ctrl = &pfe->ctrl; ++ int id; ++ ++ pr_info("%s\n", __func__); ++ ++ mutex_init(&ctrl->mutex); ++ spin_lock_init(&ctrl->lock); ++ ++ for (id = CLASS0_ID; id <= CLASS_MAX_ID; id++) { ++ ctrl->sync_mailbox_baseaddr[id] = CLASS_DM_SYNC_MBOX; ++ ctrl->msg_mailbox_baseaddr[id] = CLASS_DM_MSG_MBOX; ++ } ++ ++ for (id = TMU0_ID; id <= TMU_MAX_ID; id++) { ++ if (id == TMU2_ID) ++ continue; ++ ctrl->sync_mailbox_baseaddr[id] = TMU_DM_SYNC_MBOX; ++ ctrl->msg_mailbox_baseaddr[id] = TMU_DM_MSG_MBOX; ++ } ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ ctrl->sync_mailbox_baseaddr[UTIL_ID] = UTIL_DM_SYNC_MBOX; ++ ctrl->msg_mailbox_baseaddr[UTIL_ID] = UTIL_DM_MSG_MBOX; ++#endif ++ ++ ctrl->hash_array_baseaddr = pfe->ddr_baseaddr + ROUTE_TABLE_BASEADDR; ++ ctrl->hash_array_phys_baseaddr = pfe->ddr_phys_baseaddr + ++ ROUTE_TABLE_BASEADDR; ++ ++ ctrl->dev = pfe->dev; ++ ++ pr_info("%s finished\n", __func__); ++ ++ return 0; ++} ++ ++void pfe_ctrl_exit(struct pfe *pfe) ++{ ++ pr_info("%s\n", __func__); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_ctrl.h +@@ -0,0 +1,100 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#ifndef _PFE_CTRL_H_ ++#define _PFE_CTRL_H_ ++ ++#include ++ ++#include "pfe/pfe.h" ++ ++#define DMA_BUF_SIZE_128 0x80 /* enough for 1 conntracks */ ++#define DMA_BUF_SIZE_256 0x100 ++/* enough for 2 conntracks, 1 bridge entry or 1 multicast entry */ ++#define DMA_BUF_SIZE_512 0x200 ++/* 512bytes dma allocated buffers used by rtp relay feature */ ++#define DMA_BUF_MIN_ALIGNMENT 8 ++#define DMA_BUF_BOUNDARY (4 * 1024) ++/* bursts can not cross 4k boundary */ ++ ++#define CMD_TX_ENABLE 0x0501 ++#define CMD_TX_DISABLE 0x0502 ++ ++#define CMD_RX_LRO 0x0011 ++#define CMD_PKTCAP_ENABLE 0x0d01 ++#define CMD_QM_EXPT_RATE 0x020c ++ ++#define CLASS_DM_SH_STATIC (0x800) ++#define CLASS_DM_CPU_TICKS (CLASS_DM_SH_STATIC) ++#define CLASS_DM_SYNC_MBOX (0x808) ++#define CLASS_DM_MSG_MBOX (0x810) ++#define CLASS_DM_DROP_CNTR (0x820) ++#define CLASS_DM_RESUME (0x854) ++#define CLASS_DM_PESTATUS (0x860) ++#define CLASS_DM_CRC_VALIDATED (0x14b0) ++ ++#define TMU_DM_SH_STATIC (0x80) ++#define TMU_DM_CPU_TICKS (TMU_DM_SH_STATIC) ++#define TMU_DM_SYNC_MBOX (0x88) ++#define TMU_DM_MSG_MBOX (0x90) ++#define TMU_DM_RESUME (0xA0) ++#define TMU_DM_PESTATUS (0xB0) ++#define TMU_DM_CONTEXT (0x300) ++#define TMU_DM_TX_TRANS (0x480) ++ ++#define UTIL_DM_SH_STATIC (0x0) ++#define UTIL_DM_CPU_TICKS (UTIL_DM_SH_STATIC) ++#define UTIL_DM_SYNC_MBOX (0x8) ++#define UTIL_DM_MSG_MBOX (0x10) ++#define UTIL_DM_DROP_CNTR (0x20) ++#define UTIL_DM_RESUME (0x40) ++#define UTIL_DM_PESTATUS (0x50) ++ ++struct pfe_ctrl { ++ struct mutex mutex; /* to serialize pfe control access */ ++ spinlock_t lock; ++ ++ void *dma_pool; ++ void *dma_pool_512; ++ void *dma_pool_128; ++ ++ struct device *dev; ++ ++ void *hash_array_baseaddr; /* ++ * Virtual base address of ++ * the conntrack hash array ++ */ ++ unsigned long hash_array_phys_baseaddr; /* ++ * Physical base address of ++ * the conntrack hash array ++ */ ++ ++ int (*event_cb)(u16, u16, u16*); ++ ++ unsigned long sync_mailbox_baseaddr[MAX_PE]; /* ++ * Sync mailbox PFE ++ * internal address, ++ * initialized ++ * when parsing elf images ++ */ ++ unsigned long msg_mailbox_baseaddr[MAX_PE]; /* ++ * Msg mailbox PFE internal ++ * address, initialized ++ * when parsing elf images ++ */ ++ unsigned int sys_clk; /* AXI clock value, in KHz */ ++}; ++ ++int pfe_ctrl_init(struct pfe *pfe); ++void pfe_ctrl_exit(struct pfe *pfe); ++int pe_sync_stop(struct pfe_ctrl *ctrl, int pe_mask); ++void pe_start(struct pfe_ctrl *ctrl, int pe_mask); ++int pe_reset_all(struct pfe_ctrl *ctrl); ++void pfe_ctrl_suspend(struct pfe_ctrl *ctrl); ++void pfe_ctrl_resume(struct pfe_ctrl *ctrl); ++int relax(unsigned long end); ++ ++#endif /* _PFE_CTRL_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_debugfs.c +@@ -0,0 +1,99 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#include ++#include ++#include ++ ++#include "pfe_mod.h" ++ ++static int dmem_show(struct seq_file *s, void *unused) ++{ ++ u32 dmem_addr, val; ++ int id = (long int)s->private; ++ int i; ++ ++ for (dmem_addr = 0; dmem_addr < CLASS_DMEM_SIZE; dmem_addr += 8 * 4) { ++ seq_printf(s, "%04x:", dmem_addr); ++ ++ for (i = 0; i < 8; i++) { ++ val = pe_dmem_read(id, dmem_addr + i * 4, 4); ++ seq_printf(s, " %02x %02x %02x %02x", val & 0xff, ++ (val >> 8) & 0xff, (val >> 16) & 0xff, ++ (val >> 24) & 0xff); ++ } ++ ++ seq_puts(s, "\n"); ++ } ++ ++ return 0; ++} ++ ++static int dmem_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, dmem_show, inode->i_private); ++} ++ ++static const struct file_operations dmem_fops = { ++ .open = dmem_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = single_release, ++}; ++ ++int pfe_debugfs_init(struct pfe *pfe) ++{ ++ struct dentry *d; ++ ++ pr_info("%s\n", __func__); ++ ++ pfe->dentry = debugfs_create_dir("pfe", NULL); ++ if (IS_ERR_OR_NULL(pfe->dentry)) ++ goto err_dir; ++ ++ d = debugfs_create_file("pe0_dmem", 0444, pfe->dentry, (void *)0, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ d = debugfs_create_file("pe1_dmem", 0444, pfe->dentry, (void *)1, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ d = debugfs_create_file("pe2_dmem", 0444, pfe->dentry, (void *)2, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ d = debugfs_create_file("pe3_dmem", 0444, pfe->dentry, (void *)3, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ d = debugfs_create_file("pe4_dmem", 0444, pfe->dentry, (void *)4, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ d = debugfs_create_file("pe5_dmem", 0444, pfe->dentry, (void *)5, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ return 0; ++ ++err_pe: ++ debugfs_remove_recursive(pfe->dentry); ++ ++err_dir: ++ return -1; ++} ++ ++void pfe_debugfs_exit(struct pfe *pfe) ++{ ++ debugfs_remove_recursive(pfe->dentry); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_debugfs.h +@@ -0,0 +1,13 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#ifndef _PFE_DEBUGFS_H_ ++#define _PFE_DEBUGFS_H_ ++ ++int pfe_debugfs_init(struct pfe *pfe); ++void pfe_debugfs_exit(struct pfe *pfe); ++ ++#endif /* _PFE_DEBUGFS_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_eth.c +@@ -0,0 +1,2588 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++/* @pfe_eth.c. ++ * Ethernet driver for to handle exception path for PFE. ++ * - uses HIF functions to send/receive packets. ++ * - uses ctrl function to start/stop interfaces. ++ * - uses direct register accesses to control phy operation. ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#if defined(CONFIG_NF_CONNTRACK_MARK) ++#include ++#endif ++ ++#include "pfe_mod.h" ++#include "pfe_eth.h" ++#include "pfe_cdev.h" ++ ++#define LS1012A_REV_1_0 0x87040010 ++ ++bool pfe_use_old_dts_phy; ++bool pfe_errata_a010897; ++ ++static void *cbus_emac_base[3]; ++static void *cbus_gpi_base[3]; ++ ++/* Forward Declaration */ ++static void pfe_eth_exit_one(struct pfe_eth_priv_s *priv); ++static void pfe_eth_flush_tx(struct pfe_eth_priv_s *priv); ++static void pfe_eth_flush_txQ(struct pfe_eth_priv_s *priv, int tx_q_num, int ++ from_tx, int n_desc); ++ ++/* MDIO registers */ ++#define MDIO_SGMII_CR 0x00 ++#define MDIO_SGMII_SR 0x01 ++#define MDIO_SGMII_DEV_ABIL_SGMII 0x04 ++#define MDIO_SGMII_LINK_TMR_L 0x12 ++#define MDIO_SGMII_LINK_TMR_H 0x13 ++#define MDIO_SGMII_IF_MODE 0x14 ++ ++/* SGMII Control defines */ ++#define SGMII_CR_RST 0x8000 ++#define SGMII_CR_AN_EN 0x1000 ++#define SGMII_CR_RESTART_AN 0x0200 ++#define SGMII_CR_FD 0x0100 ++#define SGMII_CR_SPEED_SEL1_1G 0x0040 ++#define SGMII_CR_DEF_VAL (SGMII_CR_AN_EN | SGMII_CR_FD | \ ++ SGMII_CR_SPEED_SEL1_1G) ++ ++/* SGMII IF Mode */ ++#define SGMII_DUPLEX_HALF 0x10 ++#define SGMII_SPEED_10MBPS 0x00 ++#define SGMII_SPEED_100MBPS 0x04 ++#define SGMII_SPEED_1GBPS 0x08 ++#define SGMII_USE_SGMII_AN 0x02 ++#define SGMII_EN 0x01 ++ ++/* SGMII Device Ability for SGMII */ ++#define SGMII_DEV_ABIL_ACK 0x4000 ++#define SGMII_DEV_ABIL_EEE_CLK_STP_EN 0x0100 ++#define SGMII_DEV_ABIL_SGMII 0x0001 ++ ++unsigned int gemac_regs[] = { ++ 0x0004, /* Interrupt event */ ++ 0x0008, /* Interrupt mask */ ++ 0x0024, /* Ethernet control */ ++ 0x0064, /* MIB Control/Status */ ++ 0x0084, /* Receive control/status */ ++ 0x00C4, /* Transmit control */ ++ 0x00E4, /* Physical address low */ ++ 0x00E8, /* Physical address high */ ++ 0x0144, /* Transmit FIFO Watermark and Store and Forward Control*/ ++ 0x0190, /* Receive FIFO Section Full Threshold */ ++ 0x01A0, /* Transmit FIFO Section Empty Threshold */ ++ 0x01B0, /* Frame Truncation Length */ ++}; ++ ++const struct soc_device_attribute ls1012a_rev1_soc_attr[] = { ++ { .family = "QorIQ LS1012A", ++ .soc_id = "svr:0x87040010", ++ .revision = "1.0", ++ .data = NULL }, ++ { }, ++}; ++ ++/********************************************************************/ ++/* SYSFS INTERFACE */ ++/********************************************************************/ ++ ++#ifdef PFE_ETH_NAPI_STATS ++/* ++ * pfe_eth_show_napi_stats ++ */ ++static ssize_t pfe_eth_show_napi_stats(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ ssize_t len = 0; ++ ++ len += sprintf(buf + len, "sched: %u\n", ++ priv->napi_counters[NAPI_SCHED_COUNT]); ++ len += sprintf(buf + len, "poll: %u\n", ++ priv->napi_counters[NAPI_POLL_COUNT]); ++ len += sprintf(buf + len, "packet: %u\n", ++ priv->napi_counters[NAPI_PACKET_COUNT]); ++ len += sprintf(buf + len, "budget: %u\n", ++ priv->napi_counters[NAPI_FULL_BUDGET_COUNT]); ++ len += sprintf(buf + len, "desc: %u\n", ++ priv->napi_counters[NAPI_DESC_COUNT]); ++ ++ return len; ++} ++ ++/* ++ * pfe_eth_set_napi_stats ++ */ ++static ssize_t pfe_eth_set_napi_stats(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ ++ memset(priv->napi_counters, 0, sizeof(priv->napi_counters)); ++ ++ return count; ++} ++#endif ++#ifdef PFE_ETH_TX_STATS ++/* pfe_eth_show_tx_stats ++ * ++ */ ++static ssize_t pfe_eth_show_tx_stats(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ ssize_t len = 0; ++ int i; ++ ++ len += sprintf(buf + len, "TX queues stats:\n"); ++ ++ for (i = 0; i < emac_txq_cnt; i++) { ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ i); ++ ++ len += sprintf(buf + len, "\n"); ++ __netif_tx_lock_bh(tx_queue); ++ ++ hif_tx_lock(&pfe->hif); ++ len += sprintf(buf + len, ++ "Queue %2d : credits = %10d\n" ++ , i, hif_lib_tx_credit_avail(pfe, priv->id, i)); ++ len += sprintf(buf + len, ++ " tx packets = %10d\n" ++ , pfe->tmu_credit.tx_packets[priv->id][i]); ++ hif_tx_unlock(&pfe->hif); ++ ++ /* Don't output additionnal stats if queue never used */ ++ if (!pfe->tmu_credit.tx_packets[priv->id][i]) ++ goto skip; ++ ++ len += sprintf(buf + len, ++ " clean_fail = %10d\n" ++ , priv->clean_fail[i]); ++ len += sprintf(buf + len, ++ " stop_queue = %10d\n" ++ , priv->stop_queue_total[i]); ++ len += sprintf(buf + len, ++ " stop_queue_hif = %10d\n" ++ , priv->stop_queue_hif[i]); ++ len += sprintf(buf + len, ++ " stop_queue_hif_client = %10d\n" ++ , priv->stop_queue_hif_client[i]); ++ len += sprintf(buf + len, ++ " stop_queue_credit = %10d\n" ++ , priv->stop_queue_credit[i]); ++skip: ++ __netif_tx_unlock_bh(tx_queue); ++ } ++ return len; ++} ++ ++/* pfe_eth_set_tx_stats ++ * ++ */ ++static ssize_t pfe_eth_set_tx_stats(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ int i; ++ ++ for (i = 0; i < emac_txq_cnt; i++) { ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ i); ++ ++ __netif_tx_lock_bh(tx_queue); ++ priv->clean_fail[i] = 0; ++ priv->stop_queue_total[i] = 0; ++ priv->stop_queue_hif[i] = 0; ++ priv->stop_queue_hif_client[i] = 0; ++ priv->stop_queue_credit[i] = 0; ++ __netif_tx_unlock_bh(tx_queue); ++ } ++ ++ return count; ++} ++#endif ++/* pfe_eth_show_txavail ++ * ++ */ ++static ssize_t pfe_eth_show_txavail(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ ssize_t len = 0; ++ int i; ++ ++ for (i = 0; i < emac_txq_cnt; i++) { ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ i); ++ ++ __netif_tx_lock_bh(tx_queue); ++ ++ len += sprintf(buf + len, "%d", ++ hif_lib_tx_avail(&priv->client, i)); ++ ++ __netif_tx_unlock_bh(tx_queue); ++ ++ if (i == (emac_txq_cnt - 1)) ++ len += sprintf(buf + len, "\n"); ++ else ++ len += sprintf(buf + len, " "); ++ } ++ ++ return len; ++} ++ ++/* pfe_eth_show_default_priority ++ * ++ */ ++static ssize_t pfe_eth_show_default_priority(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ unsigned long flags; ++ int rc; ++ ++ spin_lock_irqsave(&priv->lock, flags); ++ rc = sprintf(buf, "%d\n", priv->default_priority); ++ spin_unlock_irqrestore(&priv->lock, flags); ++ ++ return rc; ++} ++ ++/* pfe_eth_set_default_priority ++ * ++ */ ++ ++static ssize_t pfe_eth_set_default_priority(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ unsigned long flags; ++ ++ spin_lock_irqsave(&priv->lock, flags); ++ priv->default_priority = kstrtoul(buf, 0, 0); ++ spin_unlock_irqrestore(&priv->lock, flags); ++ ++ return count; ++} ++ ++static DEVICE_ATTR(txavail, 0444, pfe_eth_show_txavail, NULL); ++static DEVICE_ATTR(default_priority, 0644, pfe_eth_show_default_priority, ++ pfe_eth_set_default_priority); ++ ++#ifdef PFE_ETH_NAPI_STATS ++static DEVICE_ATTR(napi_stats, 0644, pfe_eth_show_napi_stats, ++ pfe_eth_set_napi_stats); ++#endif ++ ++#ifdef PFE_ETH_TX_STATS ++static DEVICE_ATTR(tx_stats, 0644, pfe_eth_show_tx_stats, ++ pfe_eth_set_tx_stats); ++#endif ++ ++/* ++ * pfe_eth_sysfs_init ++ * ++ */ ++static int pfe_eth_sysfs_init(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int err; ++ ++ /* Initialize the default values */ ++ ++ /* ++ * By default, packets without conntrack will use this default low ++ * priority queue ++ */ ++ priv->default_priority = 0; ++ ++ /* Create our sysfs files */ ++ err = device_create_file(&ndev->dev, &dev_attr_default_priority); ++ if (err) { ++ netdev_err(ndev, ++ "failed to create default_priority sysfs files\n"); ++ goto err_priority; ++ } ++ ++ err = device_create_file(&ndev->dev, &dev_attr_txavail); ++ if (err) { ++ netdev_err(ndev, ++ "failed to create default_priority sysfs files\n"); ++ goto err_txavail; ++ } ++ ++#ifdef PFE_ETH_NAPI_STATS ++ err = device_create_file(&ndev->dev, &dev_attr_napi_stats); ++ if (err) { ++ netdev_err(ndev, "failed to create napi stats sysfs files\n"); ++ goto err_napi; ++ } ++#endif ++ ++#ifdef PFE_ETH_TX_STATS ++ err = device_create_file(&ndev->dev, &dev_attr_tx_stats); ++ if (err) { ++ netdev_err(ndev, "failed to create tx stats sysfs files\n"); ++ goto err_tx; ++ } ++#endif ++ ++ return 0; ++ ++#ifdef PFE_ETH_TX_STATS ++err_tx: ++#endif ++#ifdef PFE_ETH_NAPI_STATS ++ device_remove_file(&ndev->dev, &dev_attr_napi_stats); ++ ++err_napi: ++#endif ++ device_remove_file(&ndev->dev, &dev_attr_txavail); ++ ++err_txavail: ++ device_remove_file(&ndev->dev, &dev_attr_default_priority); ++ ++err_priority: ++ return -1; ++} ++ ++/* pfe_eth_sysfs_exit ++ * ++ */ ++void pfe_eth_sysfs_exit(struct net_device *ndev) ++{ ++#ifdef PFE_ETH_TX_STATS ++ device_remove_file(&ndev->dev, &dev_attr_tx_stats); ++#endif ++ ++#ifdef PFE_ETH_NAPI_STATS ++ device_remove_file(&ndev->dev, &dev_attr_napi_stats); ++#endif ++ device_remove_file(&ndev->dev, &dev_attr_txavail); ++ device_remove_file(&ndev->dev, &dev_attr_default_priority); ++} ++ ++/*************************************************************************/ ++/* ETHTOOL INTERCAE */ ++/*************************************************************************/ ++ ++/*MTIP GEMAC */ ++static const struct fec_stat { ++ char name[ETH_GSTRING_LEN]; ++ u16 offset; ++} fec_stats[] = { ++ /* RMON TX */ ++ { "tx_dropped", RMON_T_DROP }, ++ { "tx_packets", RMON_T_PACKETS }, ++ { "tx_broadcast", RMON_T_BC_PKT }, ++ { "tx_multicast", RMON_T_MC_PKT }, ++ { "tx_crc_errors", RMON_T_CRC_ALIGN }, ++ { "tx_undersize", RMON_T_UNDERSIZE }, ++ { "tx_oversize", RMON_T_OVERSIZE }, ++ { "tx_fragment", RMON_T_FRAG }, ++ { "tx_jabber", RMON_T_JAB }, ++ { "tx_collision", RMON_T_COL }, ++ { "tx_64byte", RMON_T_P64 }, ++ { "tx_65to127byte", RMON_T_P65TO127 }, ++ { "tx_128to255byte", RMON_T_P128TO255 }, ++ { "tx_256to511byte", RMON_T_P256TO511 }, ++ { "tx_512to1023byte", RMON_T_P512TO1023 }, ++ { "tx_1024to2047byte", RMON_T_P1024TO2047 }, ++ { "tx_GTE2048byte", RMON_T_P_GTE2048 }, ++ { "tx_octets", RMON_T_OCTETS }, ++ ++ /* IEEE TX */ ++ { "IEEE_tx_drop", IEEE_T_DROP }, ++ { "IEEE_tx_frame_ok", IEEE_T_FRAME_OK }, ++ { "IEEE_tx_1col", IEEE_T_1COL }, ++ { "IEEE_tx_mcol", IEEE_T_MCOL }, ++ { "IEEE_tx_def", IEEE_T_DEF }, ++ { "IEEE_tx_lcol", IEEE_T_LCOL }, ++ { "IEEE_tx_excol", IEEE_T_EXCOL }, ++ { "IEEE_tx_macerr", IEEE_T_MACERR }, ++ { "IEEE_tx_cserr", IEEE_T_CSERR }, ++ { "IEEE_tx_sqe", IEEE_T_SQE }, ++ { "IEEE_tx_fdxfc", IEEE_T_FDXFC }, ++ { "IEEE_tx_octets_ok", IEEE_T_OCTETS_OK }, ++ ++ /* RMON RX */ ++ { "rx_packets", RMON_R_PACKETS }, ++ { "rx_broadcast", RMON_R_BC_PKT }, ++ { "rx_multicast", RMON_R_MC_PKT }, ++ { "rx_crc_errors", RMON_R_CRC_ALIGN }, ++ { "rx_undersize", RMON_R_UNDERSIZE }, ++ { "rx_oversize", RMON_R_OVERSIZE }, ++ { "rx_fragment", RMON_R_FRAG }, ++ { "rx_jabber", RMON_R_JAB }, ++ { "rx_64byte", RMON_R_P64 }, ++ { "rx_65to127byte", RMON_R_P65TO127 }, ++ { "rx_128to255byte", RMON_R_P128TO255 }, ++ { "rx_256to511byte", RMON_R_P256TO511 }, ++ { "rx_512to1023byte", RMON_R_P512TO1023 }, ++ { "rx_1024to2047byte", RMON_R_P1024TO2047 }, ++ { "rx_GTE2048byte", RMON_R_P_GTE2048 }, ++ { "rx_octets", RMON_R_OCTETS }, ++ ++ /* IEEE RX */ ++ { "IEEE_rx_drop", IEEE_R_DROP }, ++ { "IEEE_rx_frame_ok", IEEE_R_FRAME_OK }, ++ { "IEEE_rx_crc", IEEE_R_CRC }, ++ { "IEEE_rx_align", IEEE_R_ALIGN }, ++ { "IEEE_rx_macerr", IEEE_R_MACERR }, ++ { "IEEE_rx_fdxfc", IEEE_R_FDXFC }, ++ { "IEEE_rx_octets_ok", IEEE_R_OCTETS_OK }, ++}; ++ ++static void pfe_eth_fill_stats(struct net_device *ndev, struct ethtool_stats ++ *stats, u64 *data) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int i; ++ u64 pfe_crc_validated = 0; ++ int id; ++ ++ for (id = CLASS0_ID; id <= CLASS_MAX_ID; id++) { ++ pfe_crc_validated += be32_to_cpu(pe_dmem_read(id, ++ CLASS_DM_CRC_VALIDATED + (priv->id * 4), 4)); ++ } ++ ++ for (i = 0; i < ARRAY_SIZE(fec_stats); i++) { ++ data[i] = readl(priv->EMAC_baseaddr + fec_stats[i].offset); ++ ++ if (fec_stats[i].offset == IEEE_R_DROP) ++ data[i] -= pfe_crc_validated; ++ } ++} ++ ++static void pfe_eth_gstrings(struct net_device *netdev, ++ u32 stringset, u8 *data) ++{ ++ int i; ++ ++ switch (stringset) { ++ case ETH_SS_STATS: ++ for (i = 0; i < ARRAY_SIZE(fec_stats); i++) ++ memcpy(data + i * ETH_GSTRING_LEN, ++ fec_stats[i].name, ETH_GSTRING_LEN); ++ break; ++ } ++} ++ ++static int pfe_eth_stats_count(struct net_device *ndev, int sset) ++{ ++ switch (sset) { ++ case ETH_SS_STATS: ++ return ARRAY_SIZE(fec_stats); ++ default: ++ return -EOPNOTSUPP; ++ } ++} ++ ++/* ++ * pfe_eth_gemac_reglen - Return the length of the register structure. ++ * ++ */ ++static int pfe_eth_gemac_reglen(struct net_device *ndev) ++{ ++ pr_info("%s()\n", __func__); ++ return (sizeof(gemac_regs) / sizeof(u32)); ++} ++ ++/* ++ * pfe_eth_gemac_get_regs - Return the gemac register structure. ++ * ++ */ ++static void pfe_eth_gemac_get_regs(struct net_device *ndev, struct ethtool_regs ++ *regs, void *regbuf) ++{ ++ int i; ++ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ u32 *buf = (u32 *)regbuf; ++ ++ pr_info("%s()\n", __func__); ++ for (i = 0; i < sizeof(gemac_regs) / sizeof(u32); i++) ++ buf[i] = readl(priv->EMAC_baseaddr + gemac_regs[i]); ++} ++ ++/* ++ * pfe_eth_set_wol - Set the magic packet option, in WoL register. ++ * ++ */ ++static int pfe_eth_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ if (wol->wolopts & ~WAKE_MAGIC) ++ return -EOPNOTSUPP; ++ ++ /* for MTIP we store wol->wolopts */ ++ priv->wol = wol->wolopts; ++ ++ device_set_wakeup_enable(&ndev->dev, wol->wolopts & WAKE_MAGIC); ++ ++ return 0; ++} ++ ++/* ++ * ++ * pfe_eth_get_wol - Get the WoL options. ++ * ++ */ ++static void pfe_eth_get_wol(struct net_device *ndev, struct ethtool_wolinfo ++ *wol) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ wol->supported = WAKE_MAGIC; ++ wol->wolopts = 0; ++ ++ if (priv->wol & WAKE_MAGIC) ++ wol->wolopts = WAKE_MAGIC; ++ ++ memset(&wol->sopass, 0, sizeof(wol->sopass)); ++} ++ ++/* ++ * pfe_eth_get_drvinfo - Fills in the drvinfo structure with some basic info ++ * ++ */ ++static void pfe_eth_get_drvinfo(struct net_device *ndev, struct ethtool_drvinfo ++ *drvinfo) ++{ ++ strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver)); ++ strlcpy(drvinfo->version, DRV_VERSION, sizeof(drvinfo->version)); ++ strlcpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version)); ++ strlcpy(drvinfo->bus_info, "N/A", sizeof(drvinfo->bus_info)); ++} ++ ++/* ++ * pfe_eth_set_settings - Used to send commands to PHY. ++ * ++ */ ++static int pfe_eth_set_settings(struct net_device *ndev, ++ const struct ethtool_link_ksettings *cmd) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct phy_device *phydev = priv->phydev; ++ ++ if (!phydev) ++ return -ENODEV; ++ ++ return phy_ethtool_ksettings_set(phydev, cmd); ++} ++ ++/* ++ * pfe_eth_getsettings - Return the current settings in the ethtool_cmd ++ * structure. ++ * ++ */ ++static int pfe_eth_get_settings(struct net_device *ndev, ++ struct ethtool_link_ksettings *cmd) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct phy_device *phydev = priv->phydev; ++ ++ if (!phydev) ++ return -ENODEV; ++ ++ phy_ethtool_ksettings_get(phydev, cmd); ++ ++ return 0; ++} ++ ++/* ++ * pfe_eth_get_msglevel - Gets the debug message mask. ++ * ++ */ ++static uint32_t pfe_eth_get_msglevel(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ return priv->msg_enable; ++} ++ ++/* ++ * pfe_eth_set_msglevel - Sets the debug message mask. ++ * ++ */ ++static void pfe_eth_set_msglevel(struct net_device *ndev, uint32_t data) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ priv->msg_enable = data; ++} ++ ++#define HIF_RX_COAL_MAX_CLKS (~(1 << 31)) ++#define HIF_RX_COAL_CLKS_PER_USEC (pfe->ctrl.sys_clk / 1000) ++#define HIF_RX_COAL_MAX_USECS (HIF_RX_COAL_MAX_CLKS / \ ++ HIF_RX_COAL_CLKS_PER_USEC) ++ ++/* ++ * pfe_eth_set_coalesce - Sets rx interrupt coalescing timer. ++ * ++ */ ++static int pfe_eth_set_coalesce(struct net_device *ndev, ++ struct ethtool_coalesce *ec, ++ struct kernel_ethtool_coalesce *kernel_coal, ++ struct netlink_ext_ack *extack) ++{ ++ if (ec->rx_coalesce_usecs > HIF_RX_COAL_MAX_USECS) ++ return -EINVAL; ++ ++ if (!ec->rx_coalesce_usecs) { ++ writel(0, HIF_INT_COAL); ++ return 0; ++ } ++ ++ writel((ec->rx_coalesce_usecs * HIF_RX_COAL_CLKS_PER_USEC) | ++ HIF_INT_COAL_ENABLE, HIF_INT_COAL); ++ ++ return 0; ++} ++ ++/* ++ * pfe_eth_get_coalesce - Gets rx interrupt coalescing timer value. ++ * ++ */ ++static int pfe_eth_get_coalesce(struct net_device *ndev, ++ struct ethtool_coalesce *ec, ++ struct kernel_ethtool_coalesce *kernel_coal, ++ struct netlink_ext_ack *extack) ++{ ++ int reg_val = readl(HIF_INT_COAL); ++ ++ if (reg_val & HIF_INT_COAL_ENABLE) ++ ec->rx_coalesce_usecs = (reg_val & HIF_RX_COAL_MAX_CLKS) / ++ HIF_RX_COAL_CLKS_PER_USEC; ++ else ++ ec->rx_coalesce_usecs = 0; ++ ++ return 0; ++} ++ ++/* ++ * pfe_eth_set_pauseparam - Sets pause parameters ++ * ++ */ ++static int pfe_eth_set_pauseparam(struct net_device *ndev, ++ struct ethtool_pauseparam *epause) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ if (epause->tx_pause != epause->rx_pause) { ++ netdev_info(ndev, ++ "hardware only support enable/disable both tx and rx\n"); ++ return -EINVAL; ++ } ++ ++ priv->pause_flag = 0; ++ priv->pause_flag |= epause->rx_pause ? PFE_PAUSE_FLAG_ENABLE : 0; ++ priv->pause_flag |= epause->autoneg ? PFE_PAUSE_FLAG_AUTONEG : 0; ++ ++ if (epause->rx_pause || epause->autoneg) { ++ gemac_enable_pause_rx(priv->EMAC_baseaddr); ++ writel((readl(priv->GPI_baseaddr + GPI_TX_PAUSE_TIME) | ++ EGPI_PAUSE_ENABLE), ++ priv->GPI_baseaddr + GPI_TX_PAUSE_TIME); ++ if (priv->phydev) { ++ linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, ++ priv->phydev->supported); ++ linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, ++ priv->phydev->supported); ++ linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, ++ priv->phydev->advertising); ++ linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, ++ priv->phydev->advertising); ++ } ++ } else { ++ gemac_disable_pause_rx(priv->EMAC_baseaddr); ++ writel((readl(priv->GPI_baseaddr + GPI_TX_PAUSE_TIME) & ++ ~EGPI_PAUSE_ENABLE), ++ priv->GPI_baseaddr + GPI_TX_PAUSE_TIME); ++ if (priv->phydev) { ++ linkmode_clear_bit(ETHTOOL_LINK_MODE_Pause_BIT, ++ priv->phydev->supported); ++ linkmode_clear_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, ++ priv->phydev->supported); ++ linkmode_clear_bit(ETHTOOL_LINK_MODE_Pause_BIT, ++ priv->phydev->advertising); ++ linkmode_clear_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, ++ priv->phydev->advertising); ++ } ++ } ++ ++ return 0; ++} ++ ++/* ++ * pfe_eth_get_pauseparam - Gets pause parameters ++ * ++ */ ++static void pfe_eth_get_pauseparam(struct net_device *ndev, ++ struct ethtool_pauseparam *epause) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ epause->autoneg = (priv->pause_flag & PFE_PAUSE_FLAG_AUTONEG) != 0; ++ epause->tx_pause = (priv->pause_flag & PFE_PAUSE_FLAG_ENABLE) != 0; ++ epause->rx_pause = epause->tx_pause; ++} ++ ++/* ++ * pfe_eth_get_hash ++ */ ++#define PFE_HASH_BITS 6 /* #bits in hash */ ++#define CRC32_POLY 0xEDB88320 ++ ++static int pfe_eth_get_hash(u8 *addr) ++{ ++ unsigned int i, bit, data, crc, hash; ++ ++ /* calculate crc32 value of mac address */ ++ crc = 0xffffffff; ++ ++ for (i = 0; i < 6; i++) { ++ data = addr[i]; ++ for (bit = 0; bit < 8; bit++, data >>= 1) { ++ crc = (crc >> 1) ^ ++ (((crc ^ data) & 1) ? CRC32_POLY : 0); ++ } ++ } ++ ++ /* ++ * only upper 6 bits (PFE_HASH_BITS) are used ++ * which point to specific bit in the hash registers ++ */ ++ hash = (crc >> (32 - PFE_HASH_BITS)) & 0x3f; ++ ++ return hash; ++} ++ ++const struct ethtool_ops pfe_ethtool_ops = { ++ .supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS, ++ .get_drvinfo = pfe_eth_get_drvinfo, ++ .get_regs_len = pfe_eth_gemac_reglen, ++ .get_regs = pfe_eth_gemac_get_regs, ++ .get_link = ethtool_op_get_link, ++ .get_wol = pfe_eth_get_wol, ++ .set_wol = pfe_eth_set_wol, ++ .set_pauseparam = pfe_eth_set_pauseparam, ++ .get_pauseparam = pfe_eth_get_pauseparam, ++ .get_strings = pfe_eth_gstrings, ++ .get_sset_count = pfe_eth_stats_count, ++ .get_ethtool_stats = pfe_eth_fill_stats, ++ .get_msglevel = pfe_eth_get_msglevel, ++ .set_msglevel = pfe_eth_set_msglevel, ++ .set_coalesce = pfe_eth_set_coalesce, ++ .get_coalesce = pfe_eth_get_coalesce, ++ .get_link_ksettings = pfe_eth_get_settings, ++ .set_link_ksettings = pfe_eth_set_settings, ++}; ++ ++/* pfe_eth_mdio_reset ++ */ ++int pfe_eth_mdio_reset(struct mii_bus *bus) ++{ ++ struct pfe_mdio_priv_s *priv = (struct pfe_mdio_priv_s *)bus->priv; ++ u32 phy_speed; ++ ++ ++ mutex_lock(&bus->mdio_lock); ++ ++ /* ++ * Set MII speed to 2.5 MHz (= clk_get_rate() / 2 * phy_speed) ++ * ++ * The formula for FEC MDC is 'ref_freq / (MII_SPEED x 2)' while ++ * for ENET-MAC is 'ref_freq / ((MII_SPEED + 1) x 2)'. ++ */ ++ phy_speed = (DIV_ROUND_UP((pfe->ctrl.sys_clk * 1000), 4000000) ++ << EMAC_MII_SPEED_SHIFT); ++ phy_speed |= EMAC_HOLDTIME(0x5); ++ __raw_writel(phy_speed, priv->mdio_base + EMAC_MII_CTRL_REG); ++ ++ mutex_unlock(&bus->mdio_lock); ++ ++ return 0; ++} ++ ++/* pfe_eth_mdio_timeout ++ * ++ */ ++static int pfe_eth_mdio_timeout(struct pfe_mdio_priv_s *priv, int timeout) ++{ ++ while (!(__raw_readl(priv->mdio_base + EMAC_IEVENT_REG) & ++ EMAC_IEVENT_MII)) { ++ if (timeout-- <= 0) ++ return -1; ++ usleep_range(10, 20); ++ } ++ __raw_writel(EMAC_IEVENT_MII, priv->mdio_base + EMAC_IEVENT_REG); ++ return 0; ++} ++ ++static int pfe_eth_mdio_mux(u8 muxval) ++{ ++ struct i2c_adapter *a; ++ struct i2c_msg msg; ++ unsigned char buf[2]; ++ int ret; ++ ++ a = i2c_get_adapter(0); ++ if (!a) ++ return -ENODEV; ++ ++ /* set bit 1 (the second bit) of chip at 0x09, register 0x13 */ ++ buf[0] = 0x54; /* reg number */ ++ buf[1] = (muxval << 6) | 0x3; /* data */ ++ msg.addr = 0x66; ++ msg.buf = buf; ++ msg.len = 2; ++ msg.flags = 0; ++ ret = i2c_transfer(a, &msg, 1); ++ i2c_put_adapter(a); ++ if (ret != 1) ++ return -ENODEV; ++ return 0; ++} ++ ++static int pfe_eth_mdio_write_addr(struct mii_bus *bus, int mii_id, ++ int dev_addr, int regnum) ++{ ++ struct pfe_mdio_priv_s *priv = (struct pfe_mdio_priv_s *)bus->priv; ++ ++ __raw_writel(EMAC_MII_DATA_PA(mii_id) | ++ EMAC_MII_DATA_RA(dev_addr) | ++ EMAC_MII_DATA_TA | EMAC_MII_DATA(regnum), ++ priv->mdio_base + EMAC_MII_DATA_REG); ++ ++ if (pfe_eth_mdio_timeout(priv, EMAC_MDIO_TIMEOUT)) { ++ dev_err(&bus->dev, "phy MDIO address write timeout\n"); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++static int pfe_eth_mdio_write(struct mii_bus *bus, int mii_id, int regnum, ++ u16 value) ++{ ++ struct pfe_mdio_priv_s *priv = (struct pfe_mdio_priv_s *)bus->priv; ++ ++ /*To access external PHYs on QDS board mux needs to be configured*/ ++ if ((mii_id) && (pfe->mdio_muxval[mii_id])) ++ pfe_eth_mdio_mux(pfe->mdio_muxval[mii_id]); ++ ++ if (regnum & MII_ADDR_C45) { ++ pfe_eth_mdio_write_addr(bus, mii_id, (regnum >> 16) & 0x1f, ++ regnum & 0xffff); ++ __raw_writel(EMAC_MII_DATA_OP_CL45_WR | ++ EMAC_MII_DATA_PA(mii_id) | ++ EMAC_MII_DATA_RA((regnum >> 16) & 0x1f) | ++ EMAC_MII_DATA_TA | EMAC_MII_DATA(value), ++ priv->mdio_base + EMAC_MII_DATA_REG); ++ } else { ++ /* start a write op */ ++ __raw_writel(EMAC_MII_DATA_ST | EMAC_MII_DATA_OP_WR | ++ EMAC_MII_DATA_PA(mii_id) | ++ EMAC_MII_DATA_RA(regnum) | ++ EMAC_MII_DATA_TA | EMAC_MII_DATA(value), ++ priv->mdio_base + EMAC_MII_DATA_REG); ++ } ++ ++ if (pfe_eth_mdio_timeout(priv, EMAC_MDIO_TIMEOUT)) { ++ dev_err(&bus->dev, "%s: phy MDIO write timeout\n", __func__); ++ return -1; ++ } ++ return 0; ++} ++ ++static int pfe_eth_mdio_read(struct mii_bus *bus, int mii_id, int regnum) ++{ ++ struct pfe_mdio_priv_s *priv = (struct pfe_mdio_priv_s *)bus->priv; ++ u16 value = 0; ++ ++ /*To access external PHYs on QDS board mux needs to be configured*/ ++ if ((mii_id) && (pfe->mdio_muxval[mii_id])) ++ pfe_eth_mdio_mux(pfe->mdio_muxval[mii_id]); ++ ++ if (regnum & MII_ADDR_C45) { ++ pfe_eth_mdio_write_addr(bus, mii_id, (regnum >> 16) & 0x1f, ++ regnum & 0xffff); ++ __raw_writel(EMAC_MII_DATA_OP_CL45_RD | ++ EMAC_MII_DATA_PA(mii_id) | ++ EMAC_MII_DATA_RA((regnum >> 16) & 0x1f) | ++ EMAC_MII_DATA_TA, ++ priv->mdio_base + EMAC_MII_DATA_REG); ++ } else { ++ /* start a read op */ ++ __raw_writel(EMAC_MII_DATA_ST | EMAC_MII_DATA_OP_RD | ++ EMAC_MII_DATA_PA(mii_id) | ++ EMAC_MII_DATA_RA(regnum) | ++ EMAC_MII_DATA_TA, priv->mdio_base + ++ EMAC_MII_DATA_REG); ++ } ++ ++ if (pfe_eth_mdio_timeout(priv, EMAC_MDIO_TIMEOUT)) { ++ dev_err(&bus->dev, "%s: phy MDIO read timeout\n", __func__); ++ return -1; ++ } ++ ++ value = EMAC_MII_DATA(__raw_readl(priv->mdio_base + ++ EMAC_MII_DATA_REG)); ++ return value; ++} ++ ++static int pfe_eth_mdio_init(struct pfe *pfe, ++ struct ls1012a_pfe_platform_data *pfe_info, ++ int ii) ++{ ++ struct pfe_mdio_priv_s *priv = NULL; ++ struct ls1012a_mdio_platform_data *mdio_info; ++ struct mii_bus *bus; ++ struct device_node *mdio_node; ++ int rc = 0; ++ ++ mdio_info = (struct ls1012a_mdio_platform_data *) ++ pfe_info->ls1012a_mdio_pdata; ++ mdio_info->id = ii; ++ ++ bus = mdiobus_alloc_size(sizeof(struct pfe_mdio_priv_s)); ++ if (!bus) { ++ pr_err("mdiobus_alloc() failed\n"); ++ rc = -ENOMEM; ++ goto err_mdioalloc; ++ } ++ ++ bus->name = "ls1012a MDIO Bus"; ++ snprintf(bus->id, MII_BUS_ID_SIZE, "ls1012a-%x", mdio_info->id); ++ ++ bus->read = &pfe_eth_mdio_read; ++ bus->write = &pfe_eth_mdio_write; ++ bus->reset = &pfe_eth_mdio_reset; ++ bus->parent = pfe->dev; ++ bus->phy_mask = mdio_info->phy_mask; ++ bus->irq[0] = mdio_info->irq[0]; ++ priv = bus->priv; ++ priv->mdio_base = cbus_emac_base[ii]; ++ ++ priv->mdc_div = mdio_info->mdc_div; ++ if (!priv->mdc_div) ++ priv->mdc_div = 64; ++ ++ dev_info(bus->parent, "%s: mdc_div: %d, phy_mask: %x\n", ++ __func__, priv->mdc_div, bus->phy_mask); ++ mdio_node = of_get_child_by_name(pfe->dev->of_node, "mdio"); ++ if ((mdio_info->id == 0) && mdio_node) { ++ rc = of_mdiobus_register(bus, mdio_node); ++ of_node_put(mdio_node); ++ } else { ++ rc = mdiobus_register(bus); ++ } ++ ++ if (rc) { ++ dev_err(bus->parent, "mdiobus_register(%s) failed\n", ++ bus->name); ++ goto err_mdioregister; ++ } ++ ++ priv->mii_bus = bus; ++ pfe->mdio.mdio_priv[ii] = priv; ++ ++ pfe_eth_mdio_reset(bus); ++ ++ return 0; ++ ++err_mdioregister: ++ mdiobus_free(bus); ++err_mdioalloc: ++ return rc; ++} ++ ++/* pfe_eth_mdio_exit ++ */ ++static void pfe_eth_mdio_exit(struct pfe *pfe, ++ int ii) ++{ ++ struct pfe_mdio_priv_s *mdio_priv = pfe->mdio.mdio_priv[ii]; ++ struct mii_bus *bus = mdio_priv->mii_bus; ++ ++ if (!bus) ++ return; ++ mdiobus_unregister(bus); ++ mdiobus_free(bus); ++} ++ ++/* pfe_get_phydev_speed ++ */ ++static int pfe_get_phydev_speed(struct phy_device *phydev) ++{ ++ switch (phydev->speed) { ++ case 10: ++ return SPEED_10M; ++ case 100: ++ return SPEED_100M; ++ case 1000: ++ default: ++ return SPEED_1000M; ++ } ++} ++ ++/* pfe_set_rgmii_speed ++ */ ++#define RGMIIPCR 0x434 ++/* RGMIIPCR bit definitions*/ ++#define SCFG_RGMIIPCR_EN_AUTO (0x00000008) ++#define SCFG_RGMIIPCR_SETSP_1000M (0x00000004) ++#define SCFG_RGMIIPCR_SETSP_100M (0x00000000) ++#define SCFG_RGMIIPCR_SETSP_10M (0x00000002) ++#define SCFG_RGMIIPCR_SETFD (0x00000001) ++ ++#define MDIOSELCR 0x484 ++#define MDIOSEL_SERDES 0x0 ++#define MDIOSEL_EXTPHY 0x80000000 ++ ++static void pfe_set_rgmii_speed(struct phy_device *phydev) ++{ ++ u32 rgmii_pcr; ++ ++ regmap_read(pfe->scfg, RGMIIPCR, &rgmii_pcr); ++ rgmii_pcr &= ~(SCFG_RGMIIPCR_SETSP_1000M | SCFG_RGMIIPCR_SETSP_10M); ++ ++ switch (phydev->speed) { ++ case 10: ++ rgmii_pcr |= SCFG_RGMIIPCR_SETSP_10M; ++ break; ++ case 1000: ++ rgmii_pcr |= SCFG_RGMIIPCR_SETSP_1000M; ++ break; ++ case 100: ++ default: ++ /* Default is 100M */ ++ break; ++ } ++ regmap_write(pfe->scfg, RGMIIPCR, rgmii_pcr); ++} ++ ++/* pfe_get_phydev_duplex ++ */ ++static int pfe_get_phydev_duplex(struct phy_device *phydev) ++{ ++ /*return (phydev->duplex == DUPLEX_HALF) ? DUP_HALF:DUP_FULL ; */ ++ return DUPLEX_FULL; ++} ++ ++/* pfe_eth_adjust_link ++ */ ++static void pfe_eth_adjust_link(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ unsigned long flags; ++ struct phy_device *phydev = priv->phydev; ++ int new_state = 0; ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ ++ spin_lock_irqsave(&priv->lock, flags); ++ ++ if (phydev->link) { ++ /* ++ * Now we make sure that we can be in full duplex mode. ++ * If not, we operate in half-duplex mode. ++ */ ++ if (phydev->duplex != priv->oldduplex) { ++ new_state = 1; ++ gemac_set_duplex(priv->EMAC_baseaddr, ++ pfe_get_phydev_duplex(phydev)); ++ priv->oldduplex = phydev->duplex; ++ } ++ ++ if (phydev->speed != priv->oldspeed) { ++ new_state = 1; ++ gemac_set_speed(priv->EMAC_baseaddr, ++ pfe_get_phydev_speed(phydev)); ++ if (priv->einfo->mii_config == ++ PHY_INTERFACE_MODE_RGMII_ID) ++ pfe_set_rgmii_speed(phydev); ++ priv->oldspeed = phydev->speed; ++ } ++ ++ if (!priv->oldlink) { ++ new_state = 1; ++ priv->oldlink = 1; ++ } ++ ++ } else if (priv->oldlink) { ++ new_state = 1; ++ priv->oldlink = 0; ++ priv->oldspeed = 0; ++ priv->oldduplex = -1; ++ } ++ ++ if (new_state && netif_msg_link(priv)) ++ phy_print_status(phydev); ++ ++ spin_unlock_irqrestore(&priv->lock, flags); ++ ++ /* Now, dump the details to the cdev. ++ * XXX: Locking would be required? (uniprocess arch) ++ * Or, maybe move it in spinlock above ++ */ ++ if (us && priv->einfo->gem_id < PFE_CDEV_ETH_COUNT) { ++ pr_debug("Changing link state from (%u) to (%u) for ID=(%u)\n", ++ link_states[priv->einfo->gem_id].state, ++ phydev->link, ++ priv->einfo->gem_id); ++ link_states[priv->einfo->gem_id].phy_id = priv->einfo->gem_id; ++ link_states[priv->einfo->gem_id].state = phydev->link; ++ } ++} ++ ++/* pfe_phy_exit ++ */ ++static void pfe_phy_exit(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ ++ phy_disconnect(priv->phydev); ++ priv->phydev = NULL; ++} ++ ++/* pfe_eth_stop ++ */ ++static void pfe_eth_stop(struct net_device *ndev, int wake) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ ++ if (wake) { ++ gemac_tx_disable(priv->EMAC_baseaddr); ++ } else { ++ gemac_disable(priv->EMAC_baseaddr); ++ gpi_disable(priv->GPI_baseaddr); ++ ++ if (priv->phydev) ++ phy_stop(priv->phydev); ++ } ++} ++ ++/* pfe_eth_start ++ */ ++static int pfe_eth_start(struct pfe_eth_priv_s *priv) ++{ ++ netif_info(priv, drv, priv->ndev, "%s\n", __func__); ++ ++ if (priv->phydev) ++ phy_start(priv->phydev); ++ ++ gpi_enable(priv->GPI_baseaddr); ++ gemac_enable(priv->EMAC_baseaddr); ++ ++ return 0; ++} ++ ++/* ++ * Configure on chip serdes through mdio ++ */ ++static void ls1012a_configure_serdes(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *eth_priv = netdev_priv(ndev); ++ struct pfe_mdio_priv_s *mdio_priv = pfe->mdio.mdio_priv[eth_priv->id]; ++ int sgmii_2500 = 0; ++ struct mii_bus *bus = mdio_priv->mii_bus; ++ u16 value = 0; ++ ++ if (eth_priv->einfo->mii_config == PHY_INTERFACE_MODE_2500SGMII) ++ sgmii_2500 = 1; ++ ++ netif_info(eth_priv, drv, ndev, "%s\n", __func__); ++ /* PCS configuration done with corresponding GEMAC */ ++ ++ pfe_eth_mdio_read(bus, 0, MDIO_SGMII_CR); ++ pfe_eth_mdio_read(bus, 0, MDIO_SGMII_SR); ++ ++ pfe_eth_mdio_write(bus, 0, MDIO_SGMII_CR, SGMII_CR_RST); ++ ++ if (sgmii_2500) { ++ pfe_eth_mdio_write(bus, 0, MDIO_SGMII_IF_MODE, SGMII_SPEED_1GBPS ++ | SGMII_EN); ++ pfe_eth_mdio_write(bus, 0, MDIO_SGMII_DEV_ABIL_SGMII, ++ SGMII_DEV_ABIL_ACK | SGMII_DEV_ABIL_SGMII); ++ pfe_eth_mdio_write(bus, 0, MDIO_SGMII_LINK_TMR_L, 0xa120); ++ pfe_eth_mdio_write(bus, 0, MDIO_SGMII_LINK_TMR_H, 0x7); ++ /* Autonegotiation need to be disabled for 2.5G SGMII mode*/ ++ value = SGMII_CR_FD | SGMII_CR_SPEED_SEL1_1G; ++ pfe_eth_mdio_write(bus, 0, MDIO_SGMII_CR, value); ++ } else { ++ pfe_eth_mdio_write(bus, 0, MDIO_SGMII_IF_MODE, ++ SGMII_SPEED_1GBPS ++ | SGMII_USE_SGMII_AN ++ | SGMII_EN); ++ pfe_eth_mdio_write(bus, 0, MDIO_SGMII_DEV_ABIL_SGMII, ++ SGMII_DEV_ABIL_EEE_CLK_STP_EN ++ | 0xa0 ++ | SGMII_DEV_ABIL_SGMII); ++ pfe_eth_mdio_write(bus, 0, MDIO_SGMII_LINK_TMR_L, 0x400); ++ pfe_eth_mdio_write(bus, 0, MDIO_SGMII_LINK_TMR_H, 0x0); ++ value = SGMII_CR_AN_EN | SGMII_CR_FD | SGMII_CR_SPEED_SEL1_1G; ++ pfe_eth_mdio_write(bus, 0, MDIO_SGMII_CR, value); ++ } ++} ++ ++/* ++ * pfe_phy_init ++ * ++ */ ++static int pfe_phy_init(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct phy_device *phydev; ++ char phy_id[MII_BUS_ID_SIZE + 3]; ++ char bus_id[MII_BUS_ID_SIZE]; ++ phy_interface_t interface; ++ ++ priv->oldlink = 0; ++ priv->oldspeed = 0; ++ priv->oldduplex = -1; ++ ++ snprintf(bus_id, MII_BUS_ID_SIZE, "ls1012a-%d", 0); ++ snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id, ++ priv->einfo->phy_id); ++ netif_info(priv, drv, ndev, "%s: %s\n", __func__, phy_id); ++ interface = priv->einfo->mii_config; ++ if ((interface == PHY_INTERFACE_MODE_SGMII) || ++ (interface == PHY_INTERFACE_MODE_2500SGMII)) { ++ /*Configure SGMII PCS */ ++ if (pfe->scfg) { ++ /* Config MDIO from serdes */ ++ regmap_write(pfe->scfg, MDIOSELCR, MDIOSEL_SERDES); ++ } ++ ls1012a_configure_serdes(ndev); ++ } ++ ++ if (pfe->scfg) { ++ /*Config MDIO from PAD */ ++ regmap_write(pfe->scfg, MDIOSELCR, MDIOSEL_EXTPHY); ++ } ++ ++ priv->oldlink = 0; ++ priv->oldspeed = 0; ++ priv->oldduplex = -1; ++ pr_info("%s interface %x\n", __func__, interface); ++ ++ if (priv->phy_node) { ++ phydev = of_phy_connect(ndev, priv->phy_node, ++ pfe_eth_adjust_link, 0, ++ priv->einfo->mii_config); ++ if (!(phydev)) { ++ netdev_err(ndev, "Unable to connect to phy\n"); ++ return -ENODEV; ++ } ++ ++ } else { ++ phydev = phy_connect(ndev, phy_id, ++ &pfe_eth_adjust_link, interface); ++ if (IS_ERR(phydev)) { ++ netdev_err(ndev, "Unable to connect to phy\n"); ++ return PTR_ERR(phydev); ++ } ++ } ++ ++ priv->phydev = phydev; ++ phydev->irq = PHY_POLL; ++ ++ return 0; ++} ++ ++/* pfe_gemac_init ++ */ ++static int pfe_gemac_init(struct pfe_eth_priv_s *priv) ++{ ++ struct gemac_cfg cfg; ++ ++ netif_info(priv, ifup, priv->ndev, "%s\n", __func__); ++ ++ cfg.mode = 0; ++ cfg.speed = SPEED_1000M; ++ cfg.duplex = DUPLEX_FULL; ++ ++ gemac_set_config(priv->EMAC_baseaddr, &cfg); ++ gemac_allow_broadcast(priv->EMAC_baseaddr); ++ gemac_enable_1536_rx(priv->EMAC_baseaddr); ++ gemac_enable_stacked_vlan(priv->EMAC_baseaddr); ++ gemac_enable_pause_rx(priv->EMAC_baseaddr); ++ gemac_set_bus_width(priv->EMAC_baseaddr, 64); ++ ++ /*GEM will perform checksum verifications*/ ++ if (priv->ndev->features & NETIF_F_RXCSUM) ++ gemac_enable_rx_checksum_offload(priv->EMAC_baseaddr); ++ else ++ gemac_disable_rx_checksum_offload(priv->EMAC_baseaddr); ++ ++ return 0; ++} ++ ++/* pfe_eth_event_handler ++ */ ++static int pfe_eth_event_handler(void *data, int event, int qno) ++{ ++ struct pfe_eth_priv_s *priv = data; ++ ++ switch (event) { ++ case EVENT_RX_PKT_IND: ++ ++ if (qno == 0) { ++ if (napi_schedule_prep(&priv->high_napi)) { ++ netif_info(priv, intr, priv->ndev, ++ "%s: schedule high prio poll\n" ++ , __func__); ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_SCHED_COUNT]++; ++#endif ++ ++ __napi_schedule(&priv->high_napi); ++ } ++ } else if (qno == 1) { ++ if (napi_schedule_prep(&priv->low_napi)) { ++ netif_info(priv, intr, priv->ndev, ++ "%s: schedule low prio poll\n" ++ , __func__); ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_SCHED_COUNT]++; ++#endif ++ __napi_schedule(&priv->low_napi); ++ } ++ } else if (qno == 2) { ++ if (napi_schedule_prep(&priv->lro_napi)) { ++ netif_info(priv, intr, priv->ndev, ++ "%s: schedule lro prio poll\n" ++ , __func__); ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_SCHED_COUNT]++; ++#endif ++ __napi_schedule(&priv->lro_napi); ++ } ++ } ++ ++ break; ++ ++ case EVENT_TXDONE_IND: ++ pfe_eth_flush_tx(priv); ++ hif_lib_event_handler_start(&priv->client, EVENT_TXDONE_IND, 0); ++ break; ++ case EVENT_HIGH_RX_WM: ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ ++static int pfe_eth_change_mtu(struct net_device *ndev, int new_mtu) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ ndev->mtu = new_mtu; ++ new_mtu += ETH_HLEN + ETH_FCS_LEN; ++ gemac_set_rx_max_fl(priv->EMAC_baseaddr, new_mtu); ++ ++ return 0; ++} ++ ++/* pfe_eth_open ++ */ ++static int pfe_eth_open(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct hif_client_s *client; ++ int rc; ++ ++ netif_info(priv, ifup, ndev, "%s\n", __func__); ++ ++ /* Register client driver with HIF */ ++ client = &priv->client; ++ memset(client, 0, sizeof(*client)); ++ client->id = PFE_CL_GEM0 + priv->id; ++ client->tx_qn = emac_txq_cnt; ++ client->rx_qn = EMAC_RXQ_CNT; ++ client->priv = priv; ++ client->pfe = priv->pfe; ++ client->event_handler = pfe_eth_event_handler; ++ ++ client->tx_qsize = EMAC_TXQ_DEPTH; ++ client->rx_qsize = EMAC_RXQ_DEPTH; ++ ++ rc = hif_lib_client_register(client); ++ if (rc) { ++ netdev_err(ndev, "%s: hif_lib_client_register(%d) failed\n", ++ __func__, client->id); ++ goto err0; ++ } ++ ++ netif_info(priv, drv, ndev, "%s: registered client: %p\n", __func__, ++ client); ++ ++ pfe_gemac_init(priv); ++ ++ if (!is_valid_ether_addr(ndev->dev_addr)) { ++ netdev_err(ndev, "%s: invalid MAC address\n", __func__); ++ rc = -EADDRNOTAVAIL; ++ goto err1; ++ } ++ ++ gemac_set_laddrN(priv->EMAC_baseaddr, ++ (struct pfe_mac_addr *)ndev->dev_addr, 1); ++ ++ napi_enable(&priv->high_napi); ++ napi_enable(&priv->low_napi); ++ napi_enable(&priv->lro_napi); ++ ++ rc = pfe_eth_start(priv); ++ ++ netif_tx_wake_all_queues(ndev); ++ ++ return rc; ++ ++err1: ++ hif_lib_client_unregister(&priv->client); ++ ++err0: ++ return rc; ++} ++ ++/* ++ * pfe_eth_shutdown ++ */ ++int pfe_eth_shutdown(struct net_device *ndev, int wake) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int i, qstatus, id; ++ unsigned long next_poll = jiffies + 1, end = jiffies + ++ (TX_POLL_TIMEOUT_MS * HZ) / 1000; ++ int tx_pkts, prv_tx_pkts; ++ ++ netif_info(priv, ifdown, ndev, "%s\n", __func__); ++ ++ for (i = 0; i < emac_txq_cnt; i++) ++ hrtimer_cancel(&priv->fast_tx_timeout[i].timer); ++ ++ netif_tx_stop_all_queues(ndev); ++ ++ do { ++ tx_pkts = 0; ++ pfe_eth_flush_tx(priv); ++ ++ for (i = 0; i < emac_txq_cnt; i++) ++ tx_pkts += hif_lib_tx_pending(&priv->client, i); ++ ++ if (tx_pkts) { ++ /*Don't wait forever, break if we cross max timeout */ ++ if (time_after(jiffies, end)) { ++ pr_err( ++ "(%s)Tx is not complete after %dmsec\n", ++ ndev->name, TX_POLL_TIMEOUT_MS); ++ break; ++ } ++ ++ pr_info("%s : (%s) Waiting for tx packets to free. Pending tx pkts = %d.\n" ++ , __func__, ndev->name, tx_pkts); ++ if (need_resched()) ++ schedule(); ++ } ++ ++ } while (tx_pkts); ++ ++ end = jiffies + (TX_POLL_TIMEOUT_MS * HZ) / 1000; ++ ++ prv_tx_pkts = tmu_pkts_processed(priv->id); ++ /* ++ * Wait till TMU transmits all pending packets ++ * poll tmu_qstatus and pkts processed by TMU for every 10ms ++ * Consider TMU is busy, If we see TMU qeueu pending or any packets ++ * processed by TMU ++ */ ++ while (1) { ++ if (time_after(jiffies, next_poll)) { ++ tx_pkts = tmu_pkts_processed(priv->id); ++ qstatus = tmu_qstatus(priv->id) & 0x7ffff; ++ ++ if (!qstatus && (tx_pkts == prv_tx_pkts)) ++ break; ++ /* Don't wait forever, break if we cross max ++ * timeout(TX_POLL_TIMEOUT_MS) ++ */ ++ if (time_after(jiffies, end)) { ++ pr_err("TMU%d is busy after %dmsec\n", ++ priv->id, TX_POLL_TIMEOUT_MS); ++ break; ++ } ++ prv_tx_pkts = tx_pkts; ++ next_poll++; ++ } ++ if (need_resched()) ++ schedule(); ++ } ++ /* Wait for some more time to complete transmitting packet if any */ ++ next_poll = jiffies + 1; ++ while (1) { ++ if (time_after(jiffies, next_poll)) ++ break; ++ if (need_resched()) ++ schedule(); ++ } ++ ++ pfe_eth_stop(ndev, wake); ++ ++ napi_disable(&priv->lro_napi); ++ napi_disable(&priv->low_napi); ++ napi_disable(&priv->high_napi); ++ ++ for (id = CLASS0_ID; id <= CLASS_MAX_ID; id++) { ++ pe_dmem_write(id, 0, CLASS_DM_CRC_VALIDATED ++ + (priv->id * 4), 4); ++ } ++ ++ hif_lib_client_unregister(&priv->client); ++ ++ return 0; ++} ++ ++/* pfe_eth_close ++ * ++ */ ++static int pfe_eth_close(struct net_device *ndev) ++{ ++ pfe_eth_shutdown(ndev, 0); ++ ++ return 0; ++} ++ ++/* pfe_eth_suspend ++ * ++ * return value : 1 if netdevice is configured to wakeup system ++ * 0 otherwise ++ */ ++int pfe_eth_suspend(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int retval = 0; ++ ++ if (priv->wol) { ++ gemac_set_wol(priv->EMAC_baseaddr, priv->wol); ++ retval = 1; ++ } ++ pfe_eth_shutdown(ndev, priv->wol); ++ ++ return retval; ++} ++ ++/* pfe_eth_resume ++ * ++ */ ++int pfe_eth_resume(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ if (priv->wol) ++ gemac_set_wol(priv->EMAC_baseaddr, 0); ++ gemac_tx_enable(priv->EMAC_baseaddr); ++ ++ return pfe_eth_open(ndev); ++} ++ ++/* pfe_eth_get_queuenum ++ */ ++static int pfe_eth_get_queuenum(struct pfe_eth_priv_s *priv, struct sk_buff ++ *skb) ++{ ++ int queuenum = 0; ++ unsigned long flags; ++ ++ /* Get the Fast Path queue number */ ++ /* ++ * Use conntrack mark (if conntrack exists), then packet mark (if any), ++ * then fallback to default ++ */ ++#if defined(CONFIG_IP_NF_CONNTRACK_MARK) || defined(CONFIG_NF_CONNTRACK_MARK) ++ if (skb->_nfct) { ++ enum ip_conntrack_info cinfo; ++ struct nf_conn *ct; ++ ++ ct = nf_ct_get(skb, &cinfo); ++ ++ if (ct) { ++ u32 connmark; ++ ++ connmark = ct->mark; ++ ++ if ((connmark & 0x80000000) && priv->id != 0) ++ connmark >>= 16; ++ ++ queuenum = connmark & EMAC_QUEUENUM_MASK; ++ } ++ } else {/* continued after #endif ... */ ++#endif ++ if (skb->mark) { ++ queuenum = skb->mark & EMAC_QUEUENUM_MASK; ++ } else { ++ spin_lock_irqsave(&priv->lock, flags); ++ queuenum = priv->default_priority & EMAC_QUEUENUM_MASK; ++ spin_unlock_irqrestore(&priv->lock, flags); ++ } ++#if defined(CONFIG_IP_NF_CONNTRACK_MARK) || defined(CONFIG_NF_CONNTRACK_MARK) ++ } ++#endif ++ return queuenum; ++} ++ ++/* pfe_eth_might_stop_tx ++ * ++ */ ++static int pfe_eth_might_stop_tx(struct pfe_eth_priv_s *priv, int queuenum, ++ struct netdev_queue *tx_queue, ++ unsigned int n_desc, ++ unsigned int n_segs) ++{ ++ ktime_t kt; ++ int tried = 0; ++ ++try_again: ++ if (unlikely((__hif_tx_avail(&pfe->hif) < n_desc) || ++ (hif_lib_tx_avail(&priv->client, queuenum) < n_desc) || ++ (hif_lib_tx_credit_avail(pfe, priv->id, queuenum) < n_segs))) { ++ if (!tried) { ++ __hif_lib_update_credit(&priv->client, queuenum); ++ tried = 1; ++ goto try_again; ++ } ++#ifdef PFE_ETH_TX_STATS ++ if (__hif_tx_avail(&pfe->hif) < n_desc) { ++ priv->stop_queue_hif[queuenum]++; ++ } else if (hif_lib_tx_avail(&priv->client, queuenum) < n_desc) { ++ priv->stop_queue_hif_client[queuenum]++; ++ } else if (hif_lib_tx_credit_avail(pfe, priv->id, queuenum) < ++ n_segs) { ++ priv->stop_queue_credit[queuenum]++; ++ } ++ priv->stop_queue_total[queuenum]++; ++#endif ++ netif_tx_stop_queue(tx_queue); ++ ++ kt = ktime_set(0, LS1012A_TX_FAST_RECOVERY_TIMEOUT_MS * ++ NSEC_PER_MSEC); ++ hrtimer_start(&priv->fast_tx_timeout[queuenum].timer, kt, ++ HRTIMER_MODE_REL); ++ return -1; ++ } else { ++ return 0; ++ } ++} ++ ++#define SA_MAX_OP 2 ++/* pfe_hif_send_packet ++ * ++ * At this level if TX fails we drop the packet ++ */ ++static void pfe_hif_send_packet(struct sk_buff *skb, struct pfe_eth_priv_s ++ *priv, int queuenum) ++{ ++ struct skb_shared_info *sh = skb_shinfo(skb); ++ unsigned int nr_frags; ++ u32 ctrl = 0; ++ ++ netif_info(priv, tx_queued, priv->ndev, "%s\n", __func__); ++ ++ if (skb_is_gso(skb)) { ++ priv->stats.tx_dropped++; ++ return; ++ } ++ ++ if (skb->ip_summed == CHECKSUM_PARTIAL) ++ ctrl = HIF_CTRL_TX_CHECKSUM; ++ ++ nr_frags = sh->nr_frags; ++ ++ if (nr_frags) { ++ skb_frag_t *f; ++ int i; ++ ++ __hif_lib_xmit_pkt(&priv->client, queuenum, skb->data, ++ skb_headlen(skb), ctrl, HIF_FIRST_BUFFER, ++ skb); ++ ++ for (i = 0; i < nr_frags - 1; i++) { ++ f = &sh->frags[i]; ++ __hif_lib_xmit_pkt(&priv->client, queuenum, ++ skb_frag_address(f), ++ skb_frag_size(f), ++ 0x0, 0x0, skb); ++ } ++ ++ f = &sh->frags[i]; ++ ++ __hif_lib_xmit_pkt(&priv->client, queuenum, ++ skb_frag_address(f), skb_frag_size(f), ++ 0x0, HIF_LAST_BUFFER | HIF_DATA_VALID, ++ skb); ++ ++ netif_info(priv, tx_queued, priv->ndev, ++ "%s: pkt sent successfully skb:%p nr_frags:%d len:%d\n", ++ __func__, skb, nr_frags, skb->len); ++ } else { ++ __hif_lib_xmit_pkt(&priv->client, queuenum, skb->data, ++ skb->len, ctrl, HIF_FIRST_BUFFER | ++ HIF_LAST_BUFFER | HIF_DATA_VALID, ++ skb); ++ netif_info(priv, tx_queued, priv->ndev, ++ "%s: pkt sent successfully skb:%p len:%d\n", ++ __func__, skb, skb->len); ++ } ++ hif_tx_dma_start(); ++ priv->stats.tx_packets++; ++ priv->stats.tx_bytes += skb->len; ++ hif_lib_tx_credit_use(pfe, priv->id, queuenum, 1); ++} ++ ++/* pfe_eth_flush_txQ ++ */ ++static void pfe_eth_flush_txQ(struct pfe_eth_priv_s *priv, int tx_q_num, int ++ from_tx, int n_desc) ++{ ++ struct sk_buff *skb; ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ tx_q_num); ++ unsigned int flags; ++ ++ netif_info(priv, tx_done, priv->ndev, "%s\n", __func__); ++ ++ if (!from_tx) ++ __netif_tx_lock_bh(tx_queue); ++ ++ /* Clean HIF and client queue */ ++ while ((skb = hif_lib_tx_get_next_complete(&priv->client, ++ tx_q_num, &flags, ++ HIF_TX_DESC_NT))) { ++ if (flags & HIF_DATA_VALID) ++ dev_kfree_skb_any(skb); ++ } ++ if (!from_tx) ++ __netif_tx_unlock_bh(tx_queue); ++} ++ ++/* pfe_eth_flush_tx ++ */ ++static void pfe_eth_flush_tx(struct pfe_eth_priv_s *priv) ++{ ++ int ii; ++ ++ netif_info(priv, tx_done, priv->ndev, "%s\n", __func__); ++ ++ for (ii = 0; ii < emac_txq_cnt; ii++) { ++ pfe_eth_flush_txQ(priv, ii, 0, 0); ++ __hif_lib_update_credit(&priv->client, ii); ++ } ++} ++ ++void pfe_tx_get_req_desc(struct sk_buff *skb, unsigned int *n_desc, unsigned int ++ *n_segs) ++{ ++ struct skb_shared_info *sh = skb_shinfo(skb); ++ ++ /* Scattered data */ ++ if (sh->nr_frags) { ++ *n_desc = sh->nr_frags + 1; ++ *n_segs = 1; ++ /* Regular case */ ++ } else { ++ *n_desc = 1; ++ *n_segs = 1; ++ } ++} ++ ++/* pfe_eth_send_packet ++ */ ++static int pfe_eth_send_packet(struct sk_buff *skb, struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int tx_q_num = skb_get_queue_mapping(skb); ++ int n_desc, n_segs; ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ tx_q_num); ++ ++ netif_info(priv, tx_queued, ndev, "%s\n", __func__); ++ ++ if ((!skb_is_gso(skb)) && (skb_headroom(skb) < (PFE_PKT_HEADER_SZ + ++ sizeof(unsigned long)))) { ++ netif_warn(priv, tx_err, priv->ndev, "%s: copying skb\n", ++ __func__); ++ ++ if (pskb_expand_head(skb, (PFE_PKT_HEADER_SZ + sizeof(unsigned ++ long)), 0, GFP_ATOMIC)) { ++ /* No need to re-transmit, no way to recover*/ ++ kfree_skb(skb); ++ priv->stats.tx_dropped++; ++ return NETDEV_TX_OK; ++ } ++ } ++ ++ pfe_tx_get_req_desc(skb, &n_desc, &n_segs); ++ ++ hif_tx_lock(&pfe->hif); ++ if (unlikely(pfe_eth_might_stop_tx(priv, tx_q_num, tx_queue, n_desc, ++ n_segs))) { ++#ifdef PFE_ETH_TX_STATS ++ if (priv->was_stopped[tx_q_num]) { ++ priv->clean_fail[tx_q_num]++; ++ priv->was_stopped[tx_q_num] = 0; ++ } ++#endif ++ hif_tx_unlock(&pfe->hif); ++ return NETDEV_TX_BUSY; ++ } ++ ++ pfe_hif_send_packet(skb, priv, tx_q_num); ++ ++ hif_tx_unlock(&pfe->hif); ++ ++ tx_queue->trans_start = jiffies; ++ ++#ifdef PFE_ETH_TX_STATS ++ priv->was_stopped[tx_q_num] = 0; ++#endif ++ ++ return NETDEV_TX_OK; ++} ++ ++/* pfe_eth_select_queue ++ * ++ */ ++static u16 pfe_eth_select_queue(struct net_device *ndev, struct sk_buff *skb, ++ struct net_device *sb_dev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ return pfe_eth_get_queuenum(priv, skb); ++} ++ ++/* pfe_eth_get_stats ++ */ ++static struct net_device_stats *pfe_eth_get_stats(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ ++ return &priv->stats; ++} ++ ++/* pfe_eth_set_mac_address ++ */ ++static int pfe_eth_set_mac_address(struct net_device *ndev, void *addr) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct sockaddr *sa = addr; ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ ++ if (!is_valid_ether_addr(sa->sa_data)) ++ return -EADDRNOTAVAIL; ++ ++ dev_addr_set(ndev, sa->sa_data); ++ ++ gemac_set_laddrN(priv->EMAC_baseaddr, ++ (struct pfe_mac_addr *)ndev->dev_addr, 1); ++ ++ return 0; ++} ++ ++/* pfe_eth_enet_addr_byte_mac ++ */ ++int pfe_eth_enet_addr_byte_mac(u8 *enet_byte_addr, ++ struct pfe_mac_addr *enet_addr) ++{ ++ if (!enet_byte_addr || !enet_addr) { ++ return -1; ++ ++ } else { ++ enet_addr->bottom = enet_byte_addr[0] | ++ (enet_byte_addr[1] << 8) | ++ (enet_byte_addr[2] << 16) | ++ (enet_byte_addr[3] << 24); ++ enet_addr->top = enet_byte_addr[4] | ++ (enet_byte_addr[5] << 8); ++ return 0; ++ } ++} ++ ++/* pfe_eth_set_multi ++ */ ++static void pfe_eth_set_multi(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct pfe_mac_addr hash_addr; /* hash register structure */ ++ /* specific mac address register structure */ ++ struct pfe_mac_addr spec_addr; ++ int result; /* index into hash register to set.. */ ++ int uc_count = 0; ++ struct netdev_hw_addr *ha; ++ ++ if (ndev->flags & IFF_PROMISC) { ++ netif_info(priv, drv, ndev, "entering promiscuous mode\n"); ++ ++ priv->promisc = 1; ++ gemac_enable_copy_all(priv->EMAC_baseaddr); ++ } else { ++ priv->promisc = 0; ++ gemac_disable_copy_all(priv->EMAC_baseaddr); ++ } ++ ++ /* Enable broadcast frame reception if required. */ ++ if (ndev->flags & IFF_BROADCAST) { ++ gemac_allow_broadcast(priv->EMAC_baseaddr); ++ } else { ++ netif_info(priv, drv, ndev, ++ "disabling broadcast frame reception\n"); ++ ++ gemac_no_broadcast(priv->EMAC_baseaddr); ++ } ++ ++ if (ndev->flags & IFF_ALLMULTI) { ++ /* Set the hash to rx all multicast frames */ ++ hash_addr.bottom = 0xFFFFFFFF; ++ hash_addr.top = 0xFFFFFFFF; ++ gemac_set_hash(priv->EMAC_baseaddr, &hash_addr); ++ netdev_for_each_uc_addr(ha, ndev) { ++ if (uc_count >= MAX_UC_SPEC_ADDR_REG) ++ break; ++ pfe_eth_enet_addr_byte_mac(ha->addr, &spec_addr); ++ gemac_set_laddrN(priv->EMAC_baseaddr, &spec_addr, ++ uc_count + 2); ++ uc_count++; ++ } ++ } else if ((netdev_mc_count(ndev) > 0) || (netdev_uc_count(ndev))) { ++ u8 *addr; ++ ++ hash_addr.bottom = 0; ++ hash_addr.top = 0; ++ ++ netdev_for_each_mc_addr(ha, ndev) { ++ addr = ha->addr; ++ ++ netif_info(priv, drv, ndev, ++ "adding multicast address %X:%X:%X:%X:%X:%X to gem filter\n", ++ addr[0], addr[1], addr[2], ++ addr[3], addr[4], addr[5]); ++ ++ result = pfe_eth_get_hash(addr); ++ ++ if (result < EMAC_HASH_REG_BITS) { ++ if (result < 32) ++ hash_addr.bottom |= (1 << result); ++ else ++ hash_addr.top |= (1 << (result - 32)); ++ } else { ++ break; ++ } ++ } ++ ++ uc_count = -1; ++ netdev_for_each_uc_addr(ha, ndev) { ++ addr = ha->addr; ++ ++ if (++uc_count < MAX_UC_SPEC_ADDR_REG) { ++ netdev_info(ndev, ++ "adding unicast address %02x:%02x:%02x:%02x:%02x:%02x to gem filter\n", ++ addr[0], addr[1], addr[2], ++ addr[3], addr[4], addr[5]); ++ pfe_eth_enet_addr_byte_mac(addr, &spec_addr); ++ gemac_set_laddrN(priv->EMAC_baseaddr, ++ &spec_addr, uc_count + 2); ++ } else { ++ netif_info(priv, drv, ndev, ++ "adding unicast address %02x:%02x:%02x:%02x:%02x:%02x to gem hash\n", ++ addr[0], addr[1], addr[2], ++ addr[3], addr[4], addr[5]); ++ ++ result = pfe_eth_get_hash(addr); ++ if (result >= EMAC_HASH_REG_BITS) { ++ break; ++ ++ } else { ++ if (result < 32) ++ hash_addr.bottom |= (1 << ++ result); ++ else ++ hash_addr.top |= (1 << ++ (result - 32)); ++ } ++ } ++ } ++ ++ gemac_set_hash(priv->EMAC_baseaddr, &hash_addr); ++ } ++ ++ if (!(netdev_uc_count(ndev) >= MAX_UC_SPEC_ADDR_REG)) { ++ /* ++ * Check if there are any specific address HW registers that ++ * need to be flushed ++ */ ++ for (uc_count = netdev_uc_count(ndev); uc_count < ++ MAX_UC_SPEC_ADDR_REG; uc_count++) ++ gemac_clear_laddrN(priv->EMAC_baseaddr, uc_count + 2); ++ } ++ ++ if (ndev->flags & IFF_LOOPBACK) ++ gemac_set_loop(priv->EMAC_baseaddr, LB_LOCAL); ++} ++ ++/* pfe_eth_set_features ++ */ ++static int pfe_eth_set_features(struct net_device *ndev, netdev_features_t ++ features) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int rc = 0; ++ ++ if (features & NETIF_F_RXCSUM) ++ gemac_enable_rx_checksum_offload(priv->EMAC_baseaddr); ++ else ++ gemac_disable_rx_checksum_offload(priv->EMAC_baseaddr); ++ return rc; ++} ++ ++/* pfe_eth_fast_tx_timeout ++ */ ++static enum hrtimer_restart pfe_eth_fast_tx_timeout(struct hrtimer *timer) ++{ ++ struct pfe_eth_fast_timer *fast_tx_timeout = container_of(timer, struct ++ pfe_eth_fast_timer, ++ timer); ++ struct pfe_eth_priv_s *priv = container_of(fast_tx_timeout->base, ++ struct pfe_eth_priv_s, ++ fast_tx_timeout); ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ fast_tx_timeout->queuenum); ++ ++ if (netif_tx_queue_stopped(tx_queue)) { ++#ifdef PFE_ETH_TX_STATS ++ priv->was_stopped[fast_tx_timeout->queuenum] = 1; ++#endif ++ netif_tx_wake_queue(tx_queue); ++ } ++ ++ return HRTIMER_NORESTART; ++} ++ ++/* pfe_eth_fast_tx_timeout_init ++ */ ++static void pfe_eth_fast_tx_timeout_init(struct pfe_eth_priv_s *priv) ++{ ++ int i; ++ ++ for (i = 0; i < emac_txq_cnt; i++) { ++ priv->fast_tx_timeout[i].queuenum = i; ++ hrtimer_init(&priv->fast_tx_timeout[i].timer, CLOCK_MONOTONIC, ++ HRTIMER_MODE_REL); ++ priv->fast_tx_timeout[i].timer.function = ++ pfe_eth_fast_tx_timeout; ++ priv->fast_tx_timeout[i].base = priv->fast_tx_timeout; ++ } ++} ++ ++static struct sk_buff *pfe_eth_rx_skb(struct net_device *ndev, ++ struct pfe_eth_priv_s *priv, ++ unsigned int qno) ++{ ++ void *buf_addr; ++ unsigned int rx_ctrl; ++ unsigned int desc_ctrl = 0; ++ struct hif_ipsec_hdr *ipsec_hdr = NULL; ++ struct sk_buff *skb; ++ struct sk_buff *skb_frag, *skb_frag_last = NULL; ++ int length = 0, offset; ++ ++ skb = priv->skb_inflight[qno]; ++ ++ if (skb) { ++ skb_frag_last = skb_shinfo(skb)->frag_list; ++ if (skb_frag_last) { ++ while (skb_frag_last->next) ++ skb_frag_last = skb_frag_last->next; ++ } ++ } ++ ++ while (!(desc_ctrl & CL_DESC_LAST)) { ++ buf_addr = hif_lib_receive_pkt(&priv->client, qno, &length, ++ &offset, &rx_ctrl, &desc_ctrl, ++ (void **)&ipsec_hdr); ++ if (!buf_addr) ++ goto incomplete; ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_DESC_COUNT]++; ++#endif ++ ++ /* First frag */ ++ if (desc_ctrl & CL_DESC_FIRST) { ++ skb = build_skb(buf_addr, 0); ++ if (unlikely(!skb)) ++ goto pkt_drop; ++ ++ skb_reserve(skb, offset); ++ skb_put(skb, length); ++ skb->dev = ndev; ++ ++ if ((ndev->features & NETIF_F_RXCSUM) && (rx_ctrl & ++ HIF_CTRL_RX_CHECKSUMMED)) ++ skb->ip_summed = CHECKSUM_UNNECESSARY; ++ else ++ skb_checksum_none_assert(skb); ++ ++ } else { ++ /* Next frags */ ++ if (unlikely(!skb)) { ++ pr_err("%s: NULL skb_inflight\n", ++ __func__); ++ goto pkt_drop; ++ } ++ ++ skb_frag = build_skb(buf_addr, 0); ++ ++ if (unlikely(!skb_frag)) { ++ kfree(buf_addr); ++ goto pkt_drop; ++ } ++ ++ skb_reserve(skb_frag, offset); ++ skb_put(skb_frag, length); ++ ++ skb_frag->dev = ndev; ++ ++ if (skb_shinfo(skb)->frag_list) ++ skb_frag_last->next = skb_frag; ++ else ++ skb_shinfo(skb)->frag_list = skb_frag; ++ ++ skb->truesize += skb_frag->truesize; ++ skb->data_len += length; ++ skb->len += length; ++ skb_frag_last = skb_frag; ++ } ++ } ++ ++ priv->skb_inflight[qno] = NULL; ++ return skb; ++ ++incomplete: ++ priv->skb_inflight[qno] = skb; ++ return NULL; ++ ++pkt_drop: ++ priv->skb_inflight[qno] = NULL; ++ ++ if (skb) ++ kfree_skb(skb); ++ else ++ kfree(buf_addr); ++ ++ priv->stats.rx_errors++; ++ ++ return NULL; ++} ++ ++/* pfe_eth_poll ++ */ ++static int pfe_eth_poll(struct pfe_eth_priv_s *priv, struct napi_struct *napi, ++ unsigned int qno, int budget) ++{ ++ struct net_device *ndev = priv->ndev; ++ struct sk_buff *skb; ++ int work_done = 0; ++ unsigned int len; ++ ++ netif_info(priv, intr, priv->ndev, "%s\n", __func__); ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_POLL_COUNT]++; ++#endif ++ ++ do { ++ skb = pfe_eth_rx_skb(ndev, priv, qno); ++ ++ if (!skb) ++ break; ++ ++ len = skb->len; ++ ++ /* Packet will be processed */ ++ skb->protocol = eth_type_trans(skb, ndev); ++ ++ netif_receive_skb(skb); ++ ++ priv->stats.rx_packets++; ++ priv->stats.rx_bytes += len; ++ ++ work_done++; ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_PACKET_COUNT]++; ++#endif ++ ++ } while (work_done < budget); ++ ++ /* ++ * If no Rx receive nor cleanup work was done, exit polling mode. ++ * No more netif_running(dev) check is required here , as this is ++ * checked in net/core/dev.c (2.6.33.5 kernel specific). ++ */ ++ if (work_done < budget) { ++ napi_complete(napi); ++ ++ hif_lib_event_handler_start(&priv->client, EVENT_RX_PKT_IND, ++ qno); ++ } ++#ifdef PFE_ETH_NAPI_STATS ++ else ++ priv->napi_counters[NAPI_FULL_BUDGET_COUNT]++; ++#endif ++ ++ return work_done; ++} ++ ++/* ++ * pfe_eth_lro_poll ++ */ ++static int pfe_eth_lro_poll(struct napi_struct *napi, int budget) ++{ ++ struct pfe_eth_priv_s *priv = container_of(napi, struct pfe_eth_priv_s, ++ lro_napi); ++ ++ netif_info(priv, intr, priv->ndev, "%s\n", __func__); ++ ++ return pfe_eth_poll(priv, napi, 2, budget); ++} ++ ++/* pfe_eth_low_poll ++ */ ++static int pfe_eth_low_poll(struct napi_struct *napi, int budget) ++{ ++ struct pfe_eth_priv_s *priv = container_of(napi, struct pfe_eth_priv_s, ++ low_napi); ++ ++ netif_info(priv, intr, priv->ndev, "%s\n", __func__); ++ ++ return pfe_eth_poll(priv, napi, 1, budget); ++} ++ ++/* pfe_eth_high_poll ++ */ ++static int pfe_eth_high_poll(struct napi_struct *napi, int budget) ++{ ++ struct pfe_eth_priv_s *priv = container_of(napi, struct pfe_eth_priv_s, ++ high_napi); ++ ++ netif_info(priv, intr, priv->ndev, "%s\n", __func__); ++ ++ return pfe_eth_poll(priv, napi, 0, budget); ++} ++ ++static const struct net_device_ops pfe_netdev_ops = { ++ .ndo_open = pfe_eth_open, ++ .ndo_stop = pfe_eth_close, ++ .ndo_start_xmit = pfe_eth_send_packet, ++ .ndo_select_queue = pfe_eth_select_queue, ++ .ndo_set_rx_mode = pfe_eth_set_multi, ++ .ndo_set_mac_address = pfe_eth_set_mac_address, ++ .ndo_validate_addr = eth_validate_addr, ++ .ndo_change_mtu = pfe_eth_change_mtu, ++ .ndo_get_stats = pfe_eth_get_stats, ++ .ndo_set_features = pfe_eth_set_features, ++}; ++ ++/* pfe_eth_init_one ++ */ ++static int pfe_eth_init_one(struct pfe *pfe, ++ struct ls1012a_pfe_platform_data *pfe_info, ++ int id) ++{ ++ struct net_device *ndev = NULL; ++ struct pfe_eth_priv_s *priv = NULL; ++ struct ls1012a_eth_platform_data *einfo; ++ int err; ++ ++ einfo = (struct ls1012a_eth_platform_data *) ++ pfe_info->ls1012a_eth_pdata; ++ ++ /* einfo never be NULL, but no harm in having this check */ ++ if (!einfo) { ++ pr_err( ++ "%s: pfe missing additional gemacs platform data\n" ++ , __func__); ++ err = -ENODEV; ++ goto err0; ++ } ++ ++ if (us) ++ emac_txq_cnt = EMAC_TXQ_CNT; ++ /* Create an ethernet device instance */ ++ ndev = alloc_etherdev_mq(sizeof(*priv), emac_txq_cnt); ++ ++ if (!ndev) { ++ pr_err("%s: gemac %d device allocation failed\n", ++ __func__, einfo[id].gem_id); ++ err = -ENOMEM; ++ goto err0; ++ } ++ ++ priv = netdev_priv(ndev); ++ priv->ndev = ndev; ++ priv->id = einfo[id].gem_id; ++ priv->pfe = pfe; ++ priv->phy_node = einfo[id].phy_node; ++ ++ SET_NETDEV_DEV(priv->ndev, priv->pfe->dev); ++ ++ pfe->eth.eth_priv[id] = priv; ++ ++ /* Set the info in the priv to the current info */ ++ priv->einfo = &einfo[id]; ++ priv->EMAC_baseaddr = cbus_emac_base[id]; ++ priv->GPI_baseaddr = cbus_gpi_base[id]; ++ ++ spin_lock_init(&priv->lock); ++ ++ pfe_eth_fast_tx_timeout_init(priv); ++ ++ /* Copy the station address into the dev structure, */ ++ dev_addr_set(ndev, einfo[id].mac_addr); ++ ++ if (us) ++ goto phy_init; ++ ++ ndev->mtu = 1500; ++ ++ /* Set MTU limits */ ++ ndev->min_mtu = ETH_MIN_MTU; ++ ++/* ++ * Jumbo frames are not supported on LS1012A rev-1.0. ++ * So max mtu should be restricted to supported frame length. ++ */ ++ if (pfe_errata_a010897) ++ ndev->max_mtu = JUMBO_FRAME_SIZE_V1 - ETH_HLEN - ETH_FCS_LEN; ++ else ++ ndev->max_mtu = JUMBO_FRAME_SIZE_V2 - ETH_HLEN - ETH_FCS_LEN; ++ ++ /*Enable after checksum offload is validated */ ++ ndev->hw_features = NETIF_F_RXCSUM | NETIF_F_IP_CSUM | ++ NETIF_F_IPV6_CSUM | NETIF_F_SG; ++ ++ /* enabled by default */ ++ ndev->features = ndev->hw_features; ++ ++ priv->usr_features = ndev->features; ++ ++ ndev->netdev_ops = &pfe_netdev_ops; ++ ++ ndev->ethtool_ops = &pfe_ethtool_ops; ++ ++ /* Enable basic messages by default */ ++ priv->msg_enable = NETIF_MSG_IFUP | NETIF_MSG_IFDOWN | NETIF_MSG_LINK | ++ NETIF_MSG_PROBE; ++ ++ netif_napi_add(ndev, &priv->low_napi, pfe_eth_low_poll); ++ netif_napi_add(ndev, &priv->high_napi, pfe_eth_high_poll); ++ netif_napi_add(ndev, &priv->lro_napi, pfe_eth_lro_poll); ++ ++ err = register_netdev(ndev); ++ if (err) { ++ netdev_err(ndev, "register_netdev() failed\n"); ++ goto err1; ++ } ++ ++ if ((!(pfe_use_old_dts_phy) && !(priv->phy_node)) || ++ ((pfe_use_old_dts_phy) && ++ (priv->einfo->phy_flags & GEMAC_NO_PHY))) { ++ pr_info("%s: No PHY or fixed-link\n", __func__); ++ goto skip_phy_init; ++ } ++ ++phy_init: ++ device_init_wakeup(&ndev->dev, true); ++ ++ err = pfe_phy_init(ndev); ++ if (err) { ++ netdev_err(ndev, "%s: pfe_phy_init() failed\n", ++ __func__); ++ goto err2; ++ } ++ ++ if (us) { ++ if (priv->phydev) ++ phy_start(priv->phydev); ++ return 0; ++ } ++ ++ netif_carrier_on(ndev); ++ ++skip_phy_init: ++ /* Create all the sysfs files */ ++ if (pfe_eth_sysfs_init(ndev)) ++ goto err3; ++ ++ netif_info(priv, probe, ndev, "%s: created interface, baseaddr: %p\n", ++ __func__, priv->EMAC_baseaddr); ++ ++ return 0; ++ ++err3: ++ pfe_phy_exit(priv->ndev); ++err2: ++ if (us) ++ goto err1; ++ unregister_netdev(ndev); ++err1: ++ free_netdev(priv->ndev); ++err0: ++ return err; ++} ++ ++/* pfe_eth_init ++ */ ++int pfe_eth_init(struct pfe *pfe) ++{ ++ int ii = 0; ++ int err; ++ struct ls1012a_pfe_platform_data *pfe_info; ++ ++ pr_info("%s\n", __func__); ++ ++ cbus_emac_base[0] = EMAC1_BASE_ADDR; ++ cbus_emac_base[1] = EMAC2_BASE_ADDR; ++ ++ cbus_gpi_base[0] = EGPI1_BASE_ADDR; ++ cbus_gpi_base[1] = EGPI2_BASE_ADDR; ++ ++ pfe_info = (struct ls1012a_pfe_platform_data *) ++ pfe->dev->platform_data; ++ if (!pfe_info) { ++ pr_err("%s: pfe missing additional platform data\n", __func__); ++ err = -ENODEV; ++ goto err_pdata; ++ } ++ ++ for (ii = 0; ii < NUM_GEMAC_SUPPORT; ii++) { ++ err = pfe_eth_mdio_init(pfe, pfe_info, ii); ++ if (err) { ++ pr_err("%s: pfe_eth_mdio_init() failed\n", __func__); ++ goto err_mdio_init; ++ } ++ } ++ ++ if (soc_device_match(ls1012a_rev1_soc_attr)) ++ pfe_errata_a010897 = true; ++ else ++ pfe_errata_a010897 = false; ++ ++ for (ii = 0; ii < NUM_GEMAC_SUPPORT; ii++) { ++ err = pfe_eth_init_one(pfe, pfe_info, ii); ++ if (err) ++ goto err_eth_init; ++ } ++ ++ return 0; ++ ++err_eth_init: ++ while (ii--) { ++ pfe_eth_exit_one(pfe->eth.eth_priv[ii]); ++ pfe_eth_mdio_exit(pfe, ii); ++ } ++ ++err_mdio_init: ++err_pdata: ++ return err; ++} ++ ++/* pfe_eth_exit_one ++ */ ++static void pfe_eth_exit_one(struct pfe_eth_priv_s *priv) ++{ ++ netif_info(priv, probe, priv->ndev, "%s\n", __func__); ++ ++ if (!us) ++ pfe_eth_sysfs_exit(priv->ndev); ++ ++ if ((!(pfe_use_old_dts_phy) && !(priv->phy_node)) || ++ ((pfe_use_old_dts_phy) && ++ (priv->einfo->phy_flags & GEMAC_NO_PHY))) { ++ pr_info("%s: No PHY or fixed-link\n", __func__); ++ goto skip_phy_exit; ++ } ++ ++ pfe_phy_exit(priv->ndev); ++ ++skip_phy_exit: ++ if (!us) ++ unregister_netdev(priv->ndev); ++ ++ free_netdev(priv->ndev); ++} ++ ++/* pfe_eth_exit ++ */ ++void pfe_eth_exit(struct pfe *pfe) ++{ ++ int ii; ++ ++ pr_info("%s\n", __func__); ++ ++ for (ii = NUM_GEMAC_SUPPORT - 1; ii >= 0; ii--) ++ pfe_eth_exit_one(pfe->eth.eth_priv[ii]); ++ ++ for (ii = NUM_GEMAC_SUPPORT - 1; ii >= 0; ii--) ++ pfe_eth_mdio_exit(pfe, ii); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_eth.h +@@ -0,0 +1,175 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#ifndef _PFE_ETH_H_ ++#define _PFE_ETH_H_ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define PFE_ETH_NAPI_STATS ++#define PFE_ETH_TX_STATS ++ ++#define PFE_ETH_FRAGS_MAX (65536 / HIF_RX_PKT_MIN_SIZE) ++#define LRO_LEN_COUNT_MAX 32 ++#define LRO_NB_COUNT_MAX 32 ++ ++#define PFE_PAUSE_FLAG_ENABLE 1 ++#define PFE_PAUSE_FLAG_AUTONEG 2 ++ ++/* GEMAC configured by SW */ ++/* GEMAC configured by phy lines (not for MII/GMII) */ ++ ++#define GEMAC_SW_FULL_DUPLEX BIT(9) ++#define GEMAC_SW_SPEED_10M (0 << 12) ++#define GEMAC_SW_SPEED_100M BIT(12) ++#define GEMAC_SW_SPEED_1G (2 << 12) ++ ++#define GEMAC_NO_PHY BIT(0) ++ ++struct ls1012a_eth_platform_data { ++ /* board specific information */ ++ phy_interface_t mii_config; ++ u32 phy_flags; ++ u32 gem_id; ++ u32 phy_id; ++ u32 mdio_muxval; ++ u8 mac_addr[ETH_ALEN]; ++ struct device_node *phy_node; ++}; ++ ++struct ls1012a_mdio_platform_data { ++ int id; ++ int irq[32]; ++ u32 phy_mask; ++ int mdc_div; ++}; ++ ++struct ls1012a_pfe_platform_data { ++ struct ls1012a_eth_platform_data ls1012a_eth_pdata[3]; ++ struct ls1012a_mdio_platform_data ls1012a_mdio_pdata[3]; ++}; ++ ++#define NUM_GEMAC_SUPPORT 2 ++#define DRV_NAME "pfe-eth" ++#define DRV_VERSION "1.0" ++ ++#define LS1012A_TX_FAST_RECOVERY_TIMEOUT_MS 3 ++#define TX_POLL_TIMEOUT_MS 1000 ++ ++#define EMAC_TXQ_CNT 16 ++#define EMAC_TXQ_DEPTH (HIF_TX_DESC_NT) ++ ++#define JUMBO_FRAME_SIZE_V1 1900 ++#define JUMBO_FRAME_SIZE_V2 10258 ++/* ++ * Client Tx queue threshold, for txQ flush condition. ++ * It must be smaller than the queue size (in case we ever change it in the ++ * future). ++ */ ++#define HIF_CL_TX_FLUSH_MARK 32 ++ ++/* ++ * Max number of TX resources (HIF descriptors or skbs) that will be released ++ * in a single go during batch recycling. ++ * Should be lower than the flush mark so the SW can provide the HW with a ++ * continuous stream of packets instead of bursts. ++ */ ++#define TX_FREE_MAX_COUNT 16 ++#define EMAC_RXQ_CNT 3 ++#define EMAC_RXQ_DEPTH HIF_RX_DESC_NT ++/* make sure clients can receive a full burst of packets */ ++#define EMAC_RMON_TXBYTES_POS 0x00 ++#define EMAC_RMON_RXBYTES_POS 0x14 ++ ++#define EMAC_QUEUENUM_MASK (emac_txq_cnt - 1) ++#define EMAC_MDIO_TIMEOUT 1000 ++#define MAX_UC_SPEC_ADDR_REG 31 ++ ++struct pfe_eth_fast_timer { ++ int queuenum; ++ struct hrtimer timer; ++ void *base; ++}; ++ ++struct pfe_eth_priv_s { ++ struct pfe *pfe; ++ struct hif_client_s client; ++ struct napi_struct lro_napi; ++ struct napi_struct low_napi; ++ struct napi_struct high_napi; ++ int low_tmu_q; ++ int high_tmu_q; ++ struct net_device_stats stats; ++ struct net_device *ndev; ++ int id; ++ int promisc; ++ unsigned int msg_enable; ++ unsigned int usr_features; ++ ++ spinlock_t lock; /* protect member variables */ ++ unsigned int event_status; ++ int irq; ++ void *EMAC_baseaddr; ++ void *GPI_baseaddr; ++ /* PHY stuff */ ++ struct phy_device *phydev; ++ int oldspeed; ++ int oldduplex; ++ int oldlink; ++ struct device_node *phy_node; ++ struct clk *gemtx_clk; ++ int wol; ++ int pause_flag; ++ ++ int default_priority; ++ struct pfe_eth_fast_timer fast_tx_timeout[EMAC_TXQ_CNT]; ++ ++ struct ls1012a_eth_platform_data *einfo; ++ struct sk_buff *skb_inflight[EMAC_RXQ_CNT + 6]; ++ ++#ifdef PFE_ETH_TX_STATS ++ unsigned int stop_queue_total[EMAC_TXQ_CNT]; ++ unsigned int stop_queue_hif[EMAC_TXQ_CNT]; ++ unsigned int stop_queue_hif_client[EMAC_TXQ_CNT]; ++ unsigned int stop_queue_credit[EMAC_TXQ_CNT]; ++ unsigned int clean_fail[EMAC_TXQ_CNT]; ++ unsigned int was_stopped[EMAC_TXQ_CNT]; ++#endif ++ ++#ifdef PFE_ETH_NAPI_STATS ++ unsigned int napi_counters[NAPI_MAX_COUNT]; ++#endif ++ unsigned int frags_inflight[EMAC_RXQ_CNT + 6]; ++}; ++ ++struct pfe_eth { ++ struct pfe_eth_priv_s *eth_priv[3]; ++}; ++ ++struct pfe_mdio_priv_s { ++ void __iomem *mdio_base; ++ int mdc_div; ++ struct mii_bus *mii_bus; ++}; ++ ++struct pfe_mdio { ++ struct pfe_mdio_priv_s *mdio_priv[3]; ++}; ++ ++int pfe_eth_init(struct pfe *pfe); ++void pfe_eth_exit(struct pfe *pfe); ++int pfe_eth_suspend(struct net_device *dev); ++int pfe_eth_resume(struct net_device *dev); ++int pfe_eth_mdio_reset(struct mii_bus *bus); ++ ++#endif /* _PFE_ETH_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_firmware.c +@@ -0,0 +1,398 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++/* ++ * @file ++ * Contains all the functions to handle parsing and loading of PE firmware ++ * files. ++ */ ++#include ++ ++#include "pfe_mod.h" ++#include "pfe_firmware.h" ++#include "pfe/pfe.h" ++#include ++#include ++ ++static struct elf32_shdr *get_elf_section_header(const u8 *fw, ++ const char *section) ++{ ++ struct elf32_hdr *elf_hdr = (struct elf32_hdr *)fw; ++ struct elf32_shdr *shdr; ++ struct elf32_shdr *shdr_shstr; ++ Elf32_Off e_shoff = be32_to_cpu(elf_hdr->e_shoff); ++ Elf32_Half e_shentsize = be16_to_cpu(elf_hdr->e_shentsize); ++ Elf32_Half e_shnum = be16_to_cpu(elf_hdr->e_shnum); ++ Elf32_Half e_shstrndx = be16_to_cpu(elf_hdr->e_shstrndx); ++ Elf32_Off shstr_offset; ++ Elf32_Word sh_name; ++ const char *name; ++ int i; ++ ++ /* Section header strings */ ++ shdr_shstr = (struct elf32_shdr *)((u8 *)elf_hdr + e_shoff + e_shstrndx ++ * e_shentsize); ++ shstr_offset = be32_to_cpu(shdr_shstr->sh_offset); ++ ++ for (i = 0; i < e_shnum; i++) { ++ shdr = (struct elf32_shdr *)((u8 *)elf_hdr + e_shoff ++ + i * e_shentsize); ++ ++ sh_name = be32_to_cpu(shdr->sh_name); ++ ++ name = (const char *)((u8 *)elf_hdr + shstr_offset + sh_name); ++ ++ if (!strcmp(name, section)) ++ return shdr; ++ } ++ ++ pr_err("%s: didn't find section %s\n", __func__, section); ++ ++ return NULL; ++} ++ ++#if defined(CFG_DIAGS) ++static int pfe_get_diags_info(const u8 *fw, struct pfe_diags_info ++ *diags_info) ++{ ++ struct elf32_shdr *shdr; ++ unsigned long offset, size; ++ ++ shdr = get_elf_section_header(fw, ".pfe_diags_str"); ++ if (shdr) { ++ offset = be32_to_cpu(shdr->sh_offset); ++ size = be32_to_cpu(shdr->sh_size); ++ diags_info->diags_str_base = be32_to_cpu(shdr->sh_addr); ++ diags_info->diags_str_size = size; ++ diags_info->diags_str_array = kmalloc(size, GFP_KERNEL); ++ memcpy(diags_info->diags_str_array, fw + offset, size); ++ ++ return 0; ++ } else { ++ return -1; ++ } ++} ++#endif ++ ++static void pfe_check_version_info(const u8 *fw) ++{ ++ /*static char *version = NULL;*/ ++ const u8 *elf_data = fw; ++ static char *version; ++ ++ struct elf32_shdr *shdr = get_elf_section_header(fw, ".version"); ++ ++ if (shdr) { ++ if (!version) { ++ /* ++ * this is the first fw we load, use its version ++ * string as reference (whatever it is) ++ */ ++ version = (char *)(elf_data + ++ be32_to_cpu(shdr->sh_offset)); ++ ++ pr_info("PFE binary version: %s\n", version); ++ } else { ++ /* ++ * already have loaded at least one firmware, check ++ * sequence can start now ++ */ ++ if (strcmp(version, (char *)(elf_data + ++ be32_to_cpu(shdr->sh_offset)))) { ++ pr_info( ++ "WARNING: PFE firmware binaries from incompatible version\n"); ++ } ++ } ++ } else { ++ /* ++ * version cannot be verified, a potential issue that should ++ * be reported ++ */ ++ pr_info( ++ "WARNING: PFE firmware binaries from incompatible version\n"); ++ } ++} ++ ++/* PFE elf firmware loader. ++ * Loads an elf firmware image into a list of PE's (specified using a bitmask) ++ * ++ * @param pe_mask Mask of PE id's to load firmware to ++ * @param fw Pointer to the firmware image ++ * ++ * @return 0 on success, a negative value on error ++ * ++ */ ++int pfe_load_elf(int pe_mask, const u8 *fw, struct pfe *pfe) ++{ ++ struct elf32_hdr *elf_hdr = (struct elf32_hdr *)fw; ++ Elf32_Half sections = be16_to_cpu(elf_hdr->e_shnum); ++ struct elf32_shdr *shdr = (struct elf32_shdr *)(fw + ++ be32_to_cpu(elf_hdr->e_shoff)); ++ int id, section; ++ int rc; ++ ++ pr_info("%s\n", __func__); ++ ++ /* Some sanity checks */ ++ if (strncmp(&elf_hdr->e_ident[EI_MAG0], ELFMAG, SELFMAG)) { ++ pr_err("%s: incorrect elf magic number\n", __func__); ++ return -EINVAL; ++ } ++ ++ if (elf_hdr->e_ident[EI_CLASS] != ELFCLASS32) { ++ pr_err("%s: incorrect elf class(%x)\n", __func__, ++ elf_hdr->e_ident[EI_CLASS]); ++ return -EINVAL; ++ } ++ ++ if (elf_hdr->e_ident[EI_DATA] != ELFDATA2MSB) { ++ pr_err("%s: incorrect elf data(%x)\n", __func__, ++ elf_hdr->e_ident[EI_DATA]); ++ return -EINVAL; ++ } ++ ++ if (be16_to_cpu(elf_hdr->e_type) != ET_EXEC) { ++ pr_err("%s: incorrect elf file type(%x)\n", __func__, ++ be16_to_cpu(elf_hdr->e_type)); ++ return -EINVAL; ++ } ++ ++ for (section = 0; section < sections; section++, shdr++) { ++ if (!(be32_to_cpu(shdr->sh_flags) & (SHF_WRITE | SHF_ALLOC | ++ SHF_EXECINSTR))) ++ continue; ++ ++ for (id = 0; id < MAX_PE; id++) ++ if (pe_mask & (1 << id)) { ++ rc = pe_load_elf_section(id, elf_hdr, shdr, ++ pfe->dev); ++ if (rc < 0) ++ goto err; ++ } ++ } ++ ++ pfe_check_version_info(fw); ++ ++ return 0; ++ ++err: ++ return rc; ++} ++ ++int get_firmware_in_fdt(const u8 **pe_fw, const char *name) ++{ ++ struct device_node *np; ++ const unsigned int *len; ++ const void *data; ++ ++ if (!strcmp(name, CLASS_FIRMWARE_FILENAME)) { ++ /* The firmware should be inside the device tree. */ ++ np = of_find_compatible_node(NULL, NULL, ++ "fsl,pfe-class-firmware"); ++ if (!np) { ++ pr_info("Failed to find the node\n"); ++ return -ENOENT; ++ } ++ ++ data = of_get_property(np, "fsl,class-firmware", NULL); ++ if (data) { ++ len = of_get_property(np, "length", NULL); ++ pr_info("CLASS fw of length %d bytes loaded from FDT.\n", ++ be32_to_cpu(*len)); ++ } else { ++ pr_info("fsl,class-firmware not found!!!!\n"); ++ return -ENOENT; ++ } ++ of_node_put(np); ++ *pe_fw = data; ++ } else if (!strcmp(name, TMU_FIRMWARE_FILENAME)) { ++ np = of_find_compatible_node(NULL, NULL, ++ "fsl,pfe-tmu-firmware"); ++ if (!np) { ++ pr_info("Failed to find the node\n"); ++ return -ENOENT; ++ } ++ ++ data = of_get_property(np, "fsl,tmu-firmware", NULL); ++ if (data) { ++ len = of_get_property(np, "length", NULL); ++ pr_info("TMU fw of length %d bytes loaded from FDT.\n", ++ be32_to_cpu(*len)); ++ } else { ++ pr_info("fsl,tmu-firmware not found!!!!\n"); ++ return -ENOENT; ++ } ++ of_node_put(np); ++ *pe_fw = data; ++ } else if (!strcmp(name, UTIL_FIRMWARE_FILENAME)) { ++ np = of_find_compatible_node(NULL, NULL, ++ "fsl,pfe-util-firmware"); ++ if (!np) { ++ pr_info("Failed to find the node\n"); ++ return -ENOENT; ++ } ++ ++ data = of_get_property(np, "fsl,util-firmware", NULL); ++ if (data) { ++ len = of_get_property(np, "length", NULL); ++ pr_info("UTIL fw of length %d bytes loaded from FDT.\n", ++ be32_to_cpu(*len)); ++ } else { ++ pr_info("fsl,util-firmware not found!!!!\n"); ++ return -ENOENT; ++ } ++ of_node_put(np); ++ *pe_fw = data; ++ } else { ++ pr_err("firmware:%s not known\n", name); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++/* PFE firmware initialization. ++ * Loads different firmware files from filesystem. ++ * Initializes PE IMEM/DMEM and UTIL-PE DDR ++ * Initializes control path symbol addresses (by looking them up in the elf ++ * firmware files ++ * Takes PE's out of reset ++ * ++ * @return 0 on success, a negative value on error ++ * ++ */ ++int pfe_firmware_init(struct pfe *pfe) ++{ ++ const struct firmware *class_fw, *tmu_fw; ++ const u8 *class_elf_fw, *tmu_elf_fw; ++ int rc = 0, fs_load = 0; ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ const struct firmware *util_fw; ++ const u8 *util_elf_fw; ++ ++#endif ++ ++ pr_info("%s\n", __func__); ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ if (get_firmware_in_fdt(&class_elf_fw, CLASS_FIRMWARE_FILENAME) || ++ get_firmware_in_fdt(&tmu_elf_fw, TMU_FIRMWARE_FILENAME) || ++ get_firmware_in_fdt(&util_elf_fw, UTIL_FIRMWARE_FILENAME)) ++#else ++ if (get_firmware_in_fdt(&class_elf_fw, CLASS_FIRMWARE_FILENAME) || ++ get_firmware_in_fdt(&tmu_elf_fw, TMU_FIRMWARE_FILENAME)) ++#endif ++ { ++ pr_info("%s:PFE firmware not found in FDT.\n", __func__); ++ pr_info("%s:Trying to load firmware from filesystem...!\n", __func__); ++ ++ /* look for firmware in filesystem...!*/ ++ fs_load = 1; ++ if (request_firmware(&class_fw, CLASS_FIRMWARE_FILENAME, pfe->dev)) { ++ pr_err("%s: request firmware %s failed\n", __func__, ++ CLASS_FIRMWARE_FILENAME); ++ rc = -ETIMEDOUT; ++ goto err0; ++ } ++ class_elf_fw = class_fw->data; ++ ++ if (request_firmware(&tmu_fw, TMU_FIRMWARE_FILENAME, pfe->dev)) { ++ pr_err("%s: request firmware %s failed\n", __func__, ++ TMU_FIRMWARE_FILENAME); ++ rc = -ETIMEDOUT; ++ goto err1; ++ } ++ tmu_elf_fw = tmu_fw->data; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ if (request_firmware(&util_fw, UTIL_FIRMWARE_FILENAME, pfe->dev)) { ++ pr_err("%s: request firmware %s failed\n", __func__, ++ UTIL_FIRMWARE_FILENAME); ++ rc = -ETIMEDOUT; ++ goto err2; ++ } ++ util_elf_fw = util_fw->data; ++#endif ++ } ++ ++ rc = pfe_load_elf(CLASS_MASK, class_elf_fw, pfe); ++ if (rc < 0) { ++ pr_err("%s: class firmware load failed\n", __func__); ++ goto err3; ++ } ++ ++#if defined(CFG_DIAGS) ++ rc = pfe_get_diags_info(class_elf_fw, &pfe->diags.class_diags_info); ++ if (rc < 0) { ++ pr_warn( ++ "PFE diags won't be available for class PEs\n"); ++ rc = 0; ++ } ++#endif ++ ++ rc = pfe_load_elf(TMU_MASK, tmu_elf_fw, pfe); ++ if (rc < 0) { ++ pr_err("%s: tmu firmware load failed\n", __func__); ++ goto err3; ++ } ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ rc = pfe_load_elf(UTIL_MASK, util_elf_fw, pfe); ++ if (rc < 0) { ++ pr_err("%s: util firmware load failed\n", __func__); ++ goto err3; ++ } ++ ++#if defined(CFG_DIAGS) ++ rc = pfe_get_diags_info(util_elf_fw, &pfe->diags.util_diags_info); ++ if (rc < 0) { ++ pr_warn( ++ "PFE diags won't be available for util PE\n"); ++ rc = 0; ++ } ++#endif ++ ++ util_enable(); ++#endif ++ ++ tmu_enable(0xf); ++ class_enable(); ++ ++err3: ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ if (fs_load) ++ release_firmware(util_fw); ++err2: ++#endif ++ if (fs_load) ++ release_firmware(tmu_fw); ++ ++err1: ++ if (fs_load) ++ release_firmware(class_fw); ++ ++err0: ++ return rc; ++} ++ ++/* PFE firmware cleanup ++ * Puts PE's in reset ++ * ++ * ++ */ ++void pfe_firmware_exit(struct pfe *pfe) ++{ ++ pr_info("%s\n", __func__); ++ ++ if (pe_reset_all(&pfe->ctrl) != 0) ++ pr_err("Error: Failed to stop PEs, PFE reload may not work correctly\n"); ++ ++ class_disable(); ++ tmu_disable(0xf); ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ util_disable(); ++#endif ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_firmware.h +@@ -0,0 +1,21 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#ifndef _PFE_FIRMWARE_H_ ++#define _PFE_FIRMWARE_H_ ++ ++#define CLASS_FIRMWARE_FILENAME "ppfe_class_ls1012a.elf" ++#define TMU_FIRMWARE_FILENAME "ppfe_tmu_ls1012a.elf" ++#define UTIL_FIRMWARE_FILENAME "ppfe_util_ls1012a.elf" ++ ++#define PFE_FW_CHECK_PASS 0 ++#define PFE_FW_CHECK_FAIL 1 ++#define NUM_PFE_FW 3 ++ ++int pfe_firmware_init(struct pfe *pfe); ++void pfe_firmware_exit(struct pfe *pfe); ++ ++#endif /* _PFE_FIRMWARE_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hal.c +@@ -0,0 +1,1517 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#include "pfe_mod.h" ++#include "pfe/pfe.h" ++ ++/* A-010897: Jumbo frame is not supported */ ++extern bool pfe_errata_a010897; ++ ++#define PFE_RCR_MAX_FL_MASK 0xC000FFFF ++ ++void *cbus_base_addr; ++void *ddr_base_addr; ++unsigned long ddr_phys_base_addr; ++unsigned int ddr_size; ++ ++static struct pe_info pe[MAX_PE]; ++ ++/* Initializes the PFE library. ++ * Must be called before using any of the library functions. ++ * ++ * @param[in] cbus_base CBUS virtual base address (as mapped in ++ * the host CPU address space) ++ * @param[in] ddr_base PFE DDR range virtual base address (as ++ * mapped in the host CPU address space) ++ * @param[in] ddr_phys_base PFE DDR range physical base address (as ++ * mapped in platform) ++ * @param[in] size PFE DDR range size (as defined by the host ++ * software) ++ */ ++void pfe_lib_init(void *cbus_base, void *ddr_base, unsigned long ddr_phys_base, ++ unsigned int size) ++{ ++ cbus_base_addr = cbus_base; ++ ddr_base_addr = ddr_base; ++ ddr_phys_base_addr = ddr_phys_base; ++ ddr_size = size; ++ ++ pe[CLASS0_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(0); ++ pe[CLASS0_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(0); ++ pe[CLASS0_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS0_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS0_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS0_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[CLASS1_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(1); ++ pe[CLASS1_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(1); ++ pe[CLASS1_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS1_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS1_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS1_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[CLASS2_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(2); ++ pe[CLASS2_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(2); ++ pe[CLASS2_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS2_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS2_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS2_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[CLASS3_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(3); ++ pe[CLASS3_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(3); ++ pe[CLASS3_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS3_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS3_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS3_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[CLASS4_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(4); ++ pe[CLASS4_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(4); ++ pe[CLASS4_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS4_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS4_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS4_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[CLASS5_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(5); ++ pe[CLASS5_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(5); ++ pe[CLASS5_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS5_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS5_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS5_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[TMU0_ID].dmem_base_addr = TMU_DMEM_BASE_ADDR(0); ++ pe[TMU0_ID].pmem_base_addr = TMU_IMEM_BASE_ADDR(0); ++ pe[TMU0_ID].pmem_size = TMU_IMEM_SIZE; ++ pe[TMU0_ID].mem_access_wdata = TMU_MEM_ACCESS_WDATA; ++ pe[TMU0_ID].mem_access_addr = TMU_MEM_ACCESS_ADDR; ++ pe[TMU0_ID].mem_access_rdata = TMU_MEM_ACCESS_RDATA; ++ ++ pe[TMU1_ID].dmem_base_addr = TMU_DMEM_BASE_ADDR(1); ++ pe[TMU1_ID].pmem_base_addr = TMU_IMEM_BASE_ADDR(1); ++ pe[TMU1_ID].pmem_size = TMU_IMEM_SIZE; ++ pe[TMU1_ID].mem_access_wdata = TMU_MEM_ACCESS_WDATA; ++ pe[TMU1_ID].mem_access_addr = TMU_MEM_ACCESS_ADDR; ++ pe[TMU1_ID].mem_access_rdata = TMU_MEM_ACCESS_RDATA; ++ ++ pe[TMU3_ID].dmem_base_addr = TMU_DMEM_BASE_ADDR(3); ++ pe[TMU3_ID].pmem_base_addr = TMU_IMEM_BASE_ADDR(3); ++ pe[TMU3_ID].pmem_size = TMU_IMEM_SIZE; ++ pe[TMU3_ID].mem_access_wdata = TMU_MEM_ACCESS_WDATA; ++ pe[TMU3_ID].mem_access_addr = TMU_MEM_ACCESS_ADDR; ++ pe[TMU3_ID].mem_access_rdata = TMU_MEM_ACCESS_RDATA; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ pe[UTIL_ID].dmem_base_addr = UTIL_DMEM_BASE_ADDR; ++ pe[UTIL_ID].mem_access_wdata = UTIL_MEM_ACCESS_WDATA; ++ pe[UTIL_ID].mem_access_addr = UTIL_MEM_ACCESS_ADDR; ++ pe[UTIL_ID].mem_access_rdata = UTIL_MEM_ACCESS_RDATA; ++#endif ++} ++ ++/* Writes a buffer to PE internal memory from the host ++ * through indirect access registers. ++ * ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] src Buffer source address ++ * @param[in] mem_access_addr DMEM destination address (must be 32bit ++ * aligned) ++ * @param[in] len Number of bytes to copy ++ */ ++void pe_mem_memcpy_to32(int id, u32 mem_access_addr, const void *src, unsigned ++int len) ++{ ++ u32 offset = 0, val, addr; ++ unsigned int len32 = len >> 2; ++ int i; ++ ++ addr = mem_access_addr | PE_MEM_ACCESS_WRITE | ++ PE_MEM_ACCESS_BYTE_ENABLE(0, 4); ++ ++ for (i = 0; i < len32; i++, offset += 4, src += 4) { ++ val = *(u32 *)src; ++ writel(cpu_to_be32(val), pe[id].mem_access_wdata); ++ writel(addr + offset, pe[id].mem_access_addr); ++ } ++ ++ len = (len & 0x3); ++ if (len) { ++ val = 0; ++ ++ addr = (mem_access_addr | PE_MEM_ACCESS_WRITE | ++ PE_MEM_ACCESS_BYTE_ENABLE(0, len)) + offset; ++ ++ for (i = 0; i < len; i++, src++) ++ val |= (*(u8 *)src) << (8 * i); ++ ++ writel(cpu_to_be32(val), pe[id].mem_access_wdata); ++ writel(addr, pe[id].mem_access_addr); ++ } ++} ++ ++/* Writes a buffer to PE internal data memory (DMEM) from the host ++ * through indirect access registers. ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] src Buffer source address ++ * @param[in] dst DMEM destination address (must be 32bit ++ * aligned) ++ * @param[in] len Number of bytes to copy ++ */ ++void pe_dmem_memcpy_to32(int id, u32 dst, const void *src, unsigned int len) ++{ ++ pe_mem_memcpy_to32(id, pe[id].dmem_base_addr | dst | ++ PE_MEM_ACCESS_DMEM, src, len); ++} ++ ++/* Writes a buffer to PE internal program memory (PMEM) from the host ++ * through indirect access registers. ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., TMU3_ID) ++ * @param[in] src Buffer source address ++ * @param[in] dst PMEM destination address (must be 32bit ++ * aligned) ++ * @param[in] len Number of bytes to copy ++ */ ++void pe_pmem_memcpy_to32(int id, u32 dst, const void *src, unsigned int len) ++{ ++ pe_mem_memcpy_to32(id, pe[id].pmem_base_addr | (dst & (pe[id].pmem_size ++ - 1)) | PE_MEM_ACCESS_IMEM, src, len); ++} ++ ++/* Reads PE internal program memory (IMEM) from the host ++ * through indirect access registers. ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., TMU3_ID) ++ * @param[in] addr PMEM read address (must be aligned on size) ++ * @param[in] size Number of bytes to read (maximum 4, must not ++ * cross 32bit boundaries) ++ * @return the data read (in PE endianness, i.e BE). ++ */ ++u32 pe_pmem_read(int id, u32 addr, u8 size) ++{ ++ u32 offset = addr & 0x3; ++ u32 mask = 0xffffffff >> ((4 - size) << 3); ++ u32 val; ++ ++ addr = pe[id].pmem_base_addr | ((addr & ~0x3) & (pe[id].pmem_size - 1)) ++ | PE_MEM_ACCESS_IMEM | PE_MEM_ACCESS_BYTE_ENABLE(offset, size); ++ ++ writel(addr, pe[id].mem_access_addr); ++ val = be32_to_cpu(readl(pe[id].mem_access_rdata)); ++ ++ return (val >> (offset << 3)) & mask; ++} ++ ++/* Writes PE internal data memory (DMEM) from the host ++ * through indirect access registers. ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] addr DMEM write address (must be aligned on size) ++ * @param[in] val Value to write (in PE endianness, i.e BE) ++ * @param[in] size Number of bytes to write (maximum 4, must not ++ * cross 32bit boundaries) ++ */ ++void pe_dmem_write(int id, u32 val, u32 addr, u8 size) ++{ ++ u32 offset = addr & 0x3; ++ ++ addr = pe[id].dmem_base_addr | (addr & ~0x3) | PE_MEM_ACCESS_WRITE | ++ PE_MEM_ACCESS_DMEM | PE_MEM_ACCESS_BYTE_ENABLE(offset, size); ++ ++ /* Indirect access interface is byte swapping data being written */ ++ writel(cpu_to_be32(val << (offset << 3)), pe[id].mem_access_wdata); ++ writel(addr, pe[id].mem_access_addr); ++} ++ ++/* Reads PE internal data memory (DMEM) from the host ++ * through indirect access registers. ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] addr DMEM read address (must be aligned on size) ++ * @param[in] size Number of bytes to read (maximum 4, must not ++ * cross 32bit boundaries) ++ * @return the data read (in PE endianness, i.e BE). ++ */ ++u32 pe_dmem_read(int id, u32 addr, u8 size) ++{ ++ u32 offset = addr & 0x3; ++ u32 mask = 0xffffffff >> ((4 - size) << 3); ++ u32 val; ++ ++ addr = pe[id].dmem_base_addr | (addr & ~0x3) | PE_MEM_ACCESS_DMEM | ++ PE_MEM_ACCESS_BYTE_ENABLE(offset, size); ++ ++ writel(addr, pe[id].mem_access_addr); ++ ++ /* Indirect access interface is byte swapping data being read */ ++ val = be32_to_cpu(readl(pe[id].mem_access_rdata)); ++ ++ return (val >> (offset << 3)) & mask; ++} ++ ++/* This function is used to write to CLASS internal bus peripherals (ccu, ++ * pe-lem) from the host ++ * through indirect access registers. ++ * @param[in] val value to write ++ * @param[in] addr Address to write to (must be aligned on size) ++ * @param[in] size Number of bytes to write (1, 2 or 4) ++ * ++ */ ++void class_bus_write(u32 val, u32 addr, u8 size) ++{ ++ u32 offset = addr & 0x3; ++ ++ writel((addr & CLASS_BUS_ACCESS_BASE_MASK), CLASS_BUS_ACCESS_BASE); ++ ++ addr = (addr & ~CLASS_BUS_ACCESS_BASE_MASK) | PE_MEM_ACCESS_WRITE | ++ (size << 24); ++ ++ writel(cpu_to_be32(val << (offset << 3)), CLASS_BUS_ACCESS_WDATA); ++ writel(addr, CLASS_BUS_ACCESS_ADDR); ++} ++ ++/* Reads from CLASS internal bus peripherals (ccu, pe-lem) from the host ++ * through indirect access registers. ++ * @param[in] addr Address to read from (must be aligned on size) ++ * @param[in] size Number of bytes to read (1, 2 or 4) ++ * @return the read data ++ * ++ */ ++u32 class_bus_read(u32 addr, u8 size) ++{ ++ u32 offset = addr & 0x3; ++ u32 mask = 0xffffffff >> ((4 - size) << 3); ++ u32 val; ++ ++ writel((addr & CLASS_BUS_ACCESS_BASE_MASK), CLASS_BUS_ACCESS_BASE); ++ ++ addr = (addr & ~CLASS_BUS_ACCESS_BASE_MASK) | (size << 24); ++ ++ writel(addr, CLASS_BUS_ACCESS_ADDR); ++ val = be32_to_cpu(readl(CLASS_BUS_ACCESS_RDATA)); ++ ++ return (val >> (offset << 3)) & mask; ++} ++ ++/* Writes data to the cluster memory (PE_LMEM) ++ * @param[in] dst PE LMEM destination address (must be 32bit aligned) ++ * @param[in] src Buffer source address ++ * @param[in] len Number of bytes to copy ++ */ ++void class_pe_lmem_memcpy_to32(u32 dst, const void *src, unsigned int len) ++{ ++ u32 len32 = len >> 2; ++ int i; ++ ++ for (i = 0; i < len32; i++, src += 4, dst += 4) ++ class_bus_write(*(u32 *)src, dst, 4); ++ ++ if (len & 0x2) { ++ class_bus_write(*(u16 *)src, dst, 2); ++ src += 2; ++ dst += 2; ++ } ++ ++ if (len & 0x1) { ++ class_bus_write(*(u8 *)src, dst, 1); ++ src++; ++ dst++; ++ } ++} ++ ++/* Writes value to the cluster memory (PE_LMEM) ++ * @param[in] dst PE LMEM destination address (must be 32bit aligned) ++ * @param[in] val Value to write ++ * @param[in] len Number of bytes to write ++ */ ++void class_pe_lmem_memset(u32 dst, int val, unsigned int len) ++{ ++ u32 len32 = len >> 2; ++ int i; ++ ++ val = val | (val << 8) | (val << 16) | (val << 24); ++ ++ for (i = 0; i < len32; i++, dst += 4) ++ class_bus_write(val, dst, 4); ++ ++ if (len & 0x2) { ++ class_bus_write(val, dst, 2); ++ dst += 2; ++ } ++ ++ if (len & 0x1) { ++ class_bus_write(val, dst, 1); ++ dst++; ++ } ++} ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ ++/* Writes UTIL program memory (DDR) from the host. ++ * ++ * @param[in] addr Address to write (virtual, must be aligned on size) ++ * @param[in] val Value to write (in PE endianness, i.e BE) ++ * @param[in] size Number of bytes to write (2 or 4) ++ */ ++static void util_pmem_write(u32 val, void *addr, u8 size) ++{ ++ void *addr64 = (void *)((unsigned long)addr & ~0x7); ++ unsigned long off = 8 - ((unsigned long)addr & 0x7) - size; ++ ++ /* ++ * IMEM should be loaded as a 64bit swapped value in a 64bit aligned ++ * location ++ */ ++ if (size == 4) ++ writel(be32_to_cpu(val), addr64 + off); ++ else ++ writew(be16_to_cpu((u16)val), addr64 + off); ++} ++ ++/* Writes a buffer to UTIL program memory (DDR) from the host. ++ * ++ * @param[in] dst Address to write (virtual, must be at least 16bit ++ * aligned) ++ * @param[in] src Buffer to write (in PE endianness, i.e BE, must have ++ * same alignment as dst) ++ * @param[in] len Number of bytes to write (must be at least 16bit ++ * aligned) ++ */ ++static void util_pmem_memcpy(void *dst, const void *src, unsigned int len) ++{ ++ unsigned int len32; ++ int i; ++ ++ if ((unsigned long)src & 0x2) { ++ util_pmem_write(*(u16 *)src, dst, 2); ++ src += 2; ++ dst += 2; ++ len -= 2; ++ } ++ ++ len32 = len >> 2; ++ ++ for (i = 0; i < len32; i++, dst += 4, src += 4) ++ util_pmem_write(*(u32 *)src, dst, 4); ++ ++ if (len & 0x2) ++ util_pmem_write(*(u16 *)src, dst, len & 0x2); ++} ++#endif ++ ++/* Loads an elf section into pmem ++ * Code needs to be at least 16bit aligned and only PROGBITS sections are ++ * supported ++ * ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ..., ++ * TMU3_ID) ++ * @param[in] data pointer to the elf firmware ++ * @param[in] shdr pointer to the elf section header ++ * ++ */ ++static int pe_load_pmem_section(int id, const void *data, ++ struct elf32_shdr *shdr) ++{ ++ u32 offset = be32_to_cpu(shdr->sh_offset); ++ u32 addr = be32_to_cpu(shdr->sh_addr); ++ u32 size = be32_to_cpu(shdr->sh_size); ++ u32 type = be32_to_cpu(shdr->sh_type); ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ if (id == UTIL_ID) { ++ pr_err("%s: unsupported pmem section for UTIL\n", ++ __func__); ++ return -EINVAL; ++ } ++#endif ++ ++ if (((unsigned long)(data + offset) & 0x3) != (addr & 0x3)) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) don't have the same alignment\n" ++ , __func__, addr, (unsigned long)data + offset); ++ ++ return -EINVAL; ++ } ++ ++ if (addr & 0x1) { ++ pr_err("%s: load address(%x) is not 16bit aligned\n", ++ __func__, addr); ++ return -EINVAL; ++ } ++ ++ if (size & 0x1) { ++ pr_err("%s: load size(%x) is not 16bit aligned\n", ++ __func__, size); ++ return -EINVAL; ++ } ++ ++ switch (type) { ++ case SHT_PROGBITS: ++ pe_pmem_memcpy_to32(id, addr, data + offset, size); ++ ++ break; ++ ++ default: ++ pr_err("%s: unsupported section type(%x)\n", __func__, ++ type); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++/* Loads an elf section into dmem ++ * Data needs to be at least 32bit aligned, NOBITS sections are correctly ++ * initialized to 0 ++ * ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] data pointer to the elf firmware ++ * @param[in] shdr pointer to the elf section header ++ * ++ */ ++static int pe_load_dmem_section(int id, const void *data, ++ struct elf32_shdr *shdr) ++{ ++ u32 offset = be32_to_cpu(shdr->sh_offset); ++ u32 addr = be32_to_cpu(shdr->sh_addr); ++ u32 size = be32_to_cpu(shdr->sh_size); ++ u32 type = be32_to_cpu(shdr->sh_type); ++ u32 size32 = size >> 2; ++ int i; ++ ++ if (((unsigned long)(data + offset) & 0x3) != (addr & 0x3)) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) don't have the same alignment\n", ++ __func__, addr, (unsigned long)data + offset); ++ ++ return -EINVAL; ++ } ++ ++ if (addr & 0x3) { ++ pr_err("%s: load address(%x) is not 32bit aligned\n", ++ __func__, addr); ++ return -EINVAL; ++ } ++ ++ switch (type) { ++ case SHT_PROGBITS: ++ pe_dmem_memcpy_to32(id, addr, data + offset, size); ++ break; ++ ++ case SHT_NOBITS: ++ for (i = 0; i < size32; i++, addr += 4) ++ pe_dmem_write(id, 0, addr, 4); ++ ++ if (size & 0x3) ++ pe_dmem_write(id, 0, addr, size & 0x3); ++ ++ break; ++ ++ default: ++ pr_err("%s: unsupported section type(%x)\n", __func__, ++ type); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++/* Loads an elf section into DDR ++ * Data needs to be at least 32bit aligned, NOBITS sections are correctly ++ * initialized to 0 ++ * ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] data pointer to the elf firmware ++ * @param[in] shdr pointer to the elf section header ++ * ++ */ ++static int pe_load_ddr_section(int id, const void *data, ++ struct elf32_shdr *shdr, ++ struct device *dev) { ++ u32 offset = be32_to_cpu(shdr->sh_offset); ++ u32 addr = be32_to_cpu(shdr->sh_addr); ++ u32 size = be32_to_cpu(shdr->sh_size); ++ u32 type = be32_to_cpu(shdr->sh_type); ++ u32 flags = be32_to_cpu(shdr->sh_flags); ++ ++ switch (type) { ++ case SHT_PROGBITS: ++ if (flags & SHF_EXECINSTR) { ++ if (id <= CLASS_MAX_ID) { ++ /* DO the loading only once in DDR */ ++ if (id == CLASS0_ID) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) rcvd\n", ++ __func__, addr, ++ (unsigned long)data + offset); ++ if (((unsigned long)(data + offset) ++ & 0x3) != (addr & 0x3)) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) don't have the same alignment\n" ++ , __func__, addr, ++ (unsigned long)data + offset); ++ ++ return -EINVAL; ++ } ++ ++ if (addr & 0x1) { ++ pr_err( ++ "%s: load address(%x) is not 16bit aligned\n" ++ , __func__, addr); ++ return -EINVAL; ++ } ++ ++ if (size & 0x1) { ++ pr_err( ++ "%s: load length(%x) is not 16bit aligned\n" ++ , __func__, size); ++ return -EINVAL; ++ } ++ memcpy(DDR_PHYS_TO_VIRT( ++ DDR_PFE_TO_PHYS(addr)), ++ data + offset, size); ++ } ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ } else if (id == UTIL_ID) { ++ if (((unsigned long)(data + offset) & 0x3) ++ != (addr & 0x3)) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) don't have the same alignment\n" ++ , __func__, addr, ++ (unsigned long)data + offset); ++ ++ return -EINVAL; ++ } ++ ++ if (addr & 0x1) { ++ pr_err( ++ "%s: load address(%x) is not 16bit aligned\n" ++ , __func__, addr); ++ return -EINVAL; ++ } ++ ++ if (size & 0x1) { ++ pr_err( ++ "%s: load length(%x) is not 16bit aligned\n" ++ , __func__, size); ++ return -EINVAL; ++ } ++ ++ util_pmem_memcpy(DDR_PHYS_TO_VIRT( ++ DDR_PFE_TO_PHYS(addr)), ++ data + offset, size); ++ } ++#endif ++ } else { ++ pr_err( ++ "%s: unsupported ddr section type(%x) for PE(%d)\n" ++ , __func__, type, id); ++ return -EINVAL; ++ } ++ ++ } else { ++ memcpy(DDR_PHYS_TO_VIRT(DDR_PFE_TO_PHYS(addr)), data ++ + offset, size); ++ } ++ ++ break; ++ ++ case SHT_NOBITS: ++ memset(DDR_PHYS_TO_VIRT(DDR_PFE_TO_PHYS(addr)), 0, size); ++ ++ break; ++ ++ default: ++ pr_err("%s: unsupported section type(%x)\n", __func__, ++ type); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++/* Loads an elf section into pe lmem ++ * Data needs to be at least 32bit aligned, NOBITS sections are correctly ++ * initialized to 0 ++ * ++ * @param[in] id PE identification (CLASS0_ID,..., CLASS5_ID) ++ * @param[in] data pointer to the elf firmware ++ * @param[in] shdr pointer to the elf section header ++ * ++ */ ++static int pe_load_pe_lmem_section(int id, const void *data, ++ struct elf32_shdr *shdr) ++{ ++ u32 offset = be32_to_cpu(shdr->sh_offset); ++ u32 addr = be32_to_cpu(shdr->sh_addr); ++ u32 size = be32_to_cpu(shdr->sh_size); ++ u32 type = be32_to_cpu(shdr->sh_type); ++ ++ if (id > CLASS_MAX_ID) { ++ pr_err( ++ "%s: unsupported pe-lmem section type(%x) for PE(%d)\n", ++ __func__, type, id); ++ return -EINVAL; ++ } ++ ++ if (((unsigned long)(data + offset) & 0x3) != (addr & 0x3)) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) don't have the same alignment\n", ++ __func__, addr, (unsigned long)data + offset); ++ ++ return -EINVAL; ++ } ++ ++ if (addr & 0x3) { ++ pr_err("%s: load address(%x) is not 32bit aligned\n", ++ __func__, addr); ++ return -EINVAL; ++ } ++ ++ switch (type) { ++ case SHT_PROGBITS: ++ class_pe_lmem_memcpy_to32(addr, data + offset, size); ++ break; ++ ++ case SHT_NOBITS: ++ class_pe_lmem_memset(addr, 0, size); ++ break; ++ ++ default: ++ pr_err("%s: unsupported section type(%x)\n", __func__, ++ type); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++/* Loads an elf section into a PE ++ * For now only supports loading a section to dmem (all PE's), pmem (class and ++ * tmu PE's), ++ * DDDR (util PE code) ++ * ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] data pointer to the elf firmware ++ * @param[in] shdr pointer to the elf section header ++ * ++ */ ++int pe_load_elf_section(int id, const void *data, struct elf32_shdr *shdr, ++ struct device *dev) { ++ u32 addr = be32_to_cpu(shdr->sh_addr); ++ u32 size = be32_to_cpu(shdr->sh_size); ++ ++ if (IS_DMEM(addr, size)) ++ return pe_load_dmem_section(id, data, shdr); ++ else if (IS_PMEM(addr, size)) ++ return pe_load_pmem_section(id, data, shdr); ++ else if (IS_PFE_LMEM(addr, size)) ++ return 0; ++ else if (IS_PHYS_DDR(addr, size)) ++ return pe_load_ddr_section(id, data, shdr, dev); ++ else if (IS_PE_LMEM(addr, size)) ++ return pe_load_pe_lmem_section(id, data, shdr); ++ ++ pr_err("%s: unsupported memory range(%x)\n", __func__, ++ addr); ++ return 0; ++} ++ ++/**************************** BMU ***************************/ ++ ++/* Initializes a BMU block. ++ * @param[in] base BMU block base address ++ * @param[in] cfg BMU configuration ++ */ ++void bmu_init(void *base, struct BMU_CFG *cfg) ++{ ++ bmu_disable(base); ++ ++ bmu_set_config(base, cfg); ++ ++ bmu_reset(base); ++} ++ ++/* Resets a BMU block. ++ * @param[in] base BMU block base address ++ */ ++void bmu_reset(void *base) ++{ ++ writel(CORE_SW_RESET, base + BMU_CTRL); ++ ++ /* Wait for self clear */ ++ while (readl(base + BMU_CTRL) & CORE_SW_RESET) ++ ; ++} ++ ++/* Enabled a BMU block. ++ * @param[in] base BMU block base address ++ */ ++void bmu_enable(void *base) ++{ ++ writel(CORE_ENABLE, base + BMU_CTRL); ++} ++ ++/* Disables a BMU block. ++ * @param[in] base BMU block base address ++ */ ++void bmu_disable(void *base) ++{ ++ writel(CORE_DISABLE, base + BMU_CTRL); ++} ++ ++/* Sets the configuration of a BMU block. ++ * @param[in] base BMU block base address ++ * @param[in] cfg BMU configuration ++ */ ++void bmu_set_config(void *base, struct BMU_CFG *cfg) ++{ ++ writel(cfg->baseaddr, base + BMU_UCAST_BASE_ADDR); ++ writel(cfg->count & 0xffff, base + BMU_UCAST_CONFIG); ++ writel(cfg->size & 0xffff, base + BMU_BUF_SIZE); ++ ++ /* Interrupts are never used */ ++ writel(cfg->low_watermark, base + BMU_LOW_WATERMARK); ++ writel(cfg->high_watermark, base + BMU_HIGH_WATERMARK); ++ writel(0x0, base + BMU_INT_ENABLE); ++} ++ ++/**************************** MTIP GEMAC ***************************/ ++ ++/* Enable Rx Checksum Engine. With this enabled, Frame with bad IP, ++ * TCP or UDP checksums are discarded ++ * ++ * @param[in] base GEMAC base address. ++ */ ++void gemac_enable_rx_checksum_offload(void *base) ++{ ++ /*Do not find configuration to do this */ ++} ++ ++/* Disable Rx Checksum Engine. ++ * ++ * @param[in] base GEMAC base address. ++ */ ++void gemac_disable_rx_checksum_offload(void *base) ++{ ++ /*Do not find configuration to do this */ ++} ++ ++/* GEMAC set speed. ++ * @param[in] base GEMAC base address ++ * @param[in] speed GEMAC speed (10, 100 or 1000 Mbps) ++ */ ++void gemac_set_speed(void *base, enum mac_speed gem_speed) ++{ ++ u32 ecr = readl(base + EMAC_ECNTRL_REG) & ~EMAC_ECNTRL_SPEED; ++ u32 rcr = readl(base + EMAC_RCNTRL_REG) & ~EMAC_RCNTRL_RMII_10T; ++ ++ switch (gem_speed) { ++ case SPEED_10M: ++ rcr |= EMAC_RCNTRL_RMII_10T; ++ break; ++ ++ case SPEED_1000M: ++ ecr |= EMAC_ECNTRL_SPEED; ++ break; ++ ++ case SPEED_100M: ++ default: ++ /*It is in 100M mode */ ++ break; ++ } ++ writel(ecr, (base + EMAC_ECNTRL_REG)); ++ writel(rcr, (base + EMAC_RCNTRL_REG)); ++} ++ ++/* GEMAC set duplex. ++ * @param[in] base GEMAC base address ++ * @param[in] duplex GEMAC duplex mode (Full, Half) ++ */ ++void gemac_set_duplex(void *base, int duplex) ++{ ++ if (duplex == DUPLEX_HALF) { ++ writel(readl(base + EMAC_TCNTRL_REG) & ~EMAC_TCNTRL_FDEN, base ++ + EMAC_TCNTRL_REG); ++ writel(readl(base + EMAC_RCNTRL_REG) | EMAC_RCNTRL_DRT, (base ++ + EMAC_RCNTRL_REG)); ++ } else{ ++ writel(readl(base + EMAC_TCNTRL_REG) | EMAC_TCNTRL_FDEN, base ++ + EMAC_TCNTRL_REG); ++ writel(readl(base + EMAC_RCNTRL_REG) & ~EMAC_RCNTRL_DRT, (base ++ + EMAC_RCNTRL_REG)); ++ } ++} ++ ++/* GEMAC set mode. ++ * @param[in] base GEMAC base address ++ * @param[in] mode GEMAC operation mode (MII, RMII, RGMII, SGMII) ++ */ ++void gemac_set_mode(void *base, int mode) ++{ ++ u32 val = readl(base + EMAC_RCNTRL_REG); ++ ++ /*Remove loopbank*/ ++ val &= ~EMAC_RCNTRL_LOOP; ++ ++ /* Enable flow control and MII mode.PFE firmware always expects ++ CRC should be forwarded by MAC to validate CRC in software.*/ ++ val |= (EMAC_RCNTRL_FCE | EMAC_RCNTRL_MII_MODE); ++ ++ writel(val, base + EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC enable function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable(void *base) ++{ ++ writel(readl(base + EMAC_ECNTRL_REG) | EMAC_ECNTRL_ETHER_EN, base + ++ EMAC_ECNTRL_REG); ++} ++ ++/* GEMAC disable function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_disable(void *base) ++{ ++ writel(readl(base + EMAC_ECNTRL_REG) & ~EMAC_ECNTRL_ETHER_EN, base + ++ EMAC_ECNTRL_REG); ++} ++ ++/* GEMAC TX disable function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_tx_disable(void *base) ++{ ++ writel(readl(base + EMAC_TCNTRL_REG) | EMAC_TCNTRL_GTS, base + ++ EMAC_TCNTRL_REG); ++} ++ ++void gemac_tx_enable(void *base) ++{ ++ writel(readl(base + EMAC_TCNTRL_REG) & ~EMAC_TCNTRL_GTS, base + ++ EMAC_TCNTRL_REG); ++} ++ ++/* Sets the hash register of the MAC. ++ * This register is used for matching unicast and multicast frames. ++ * ++ * @param[in] base GEMAC base address. ++ * @param[in] hash 64-bit hash to be configured. ++ */ ++void gemac_set_hash(void *base, struct pfe_mac_addr *hash) ++{ ++ writel(hash->bottom, base + EMAC_GALR); ++ writel(hash->top, base + EMAC_GAUR); ++} ++ ++void gemac_set_laddrN(void *base, struct pfe_mac_addr *address, ++ unsigned int entry_index) ++{ ++ if ((entry_index < 1) || (entry_index > EMAC_SPEC_ADDR_MAX)) ++ return; ++ ++ entry_index = entry_index - 1; ++ if (entry_index < 1) { ++ writel(htonl(address->bottom), base + EMAC_PHY_ADDR_LOW); ++ writel((htonl(address->top) | 0x8808), base + ++ EMAC_PHY_ADDR_HIGH); ++ } else { ++ writel(htonl(address->bottom), base + ((entry_index - 1) * 8) ++ + EMAC_SMAC_0_0); ++ writel((htonl(address->top) | 0x8808), base + ((entry_index - ++ 1) * 8) + EMAC_SMAC_0_1); ++ } ++} ++ ++void gemac_clear_laddrN(void *base, unsigned int entry_index) ++{ ++ if ((entry_index < 1) || (entry_index > EMAC_SPEC_ADDR_MAX)) ++ return; ++ ++ entry_index = entry_index - 1; ++ if (entry_index < 1) { ++ writel(0, base + EMAC_PHY_ADDR_LOW); ++ writel(0, base + EMAC_PHY_ADDR_HIGH); ++ } else { ++ writel(0, base + ((entry_index - 1) * 8) + EMAC_SMAC_0_0); ++ writel(0, base + ((entry_index - 1) * 8) + EMAC_SMAC_0_1); ++ } ++} ++ ++/* Set the loopback mode of the MAC. This can be either no loopback for ++ * normal operation, local loopback through MAC internal loopback module or PHY ++ * loopback for external loopback through a PHY. This asserts the external ++ * loop pin. ++ * ++ * @param[in] base GEMAC base address. ++ * @param[in] gem_loop Loopback mode to be enabled. LB_LOCAL - MAC ++ * Loopback, ++ * LB_EXT - PHY Loopback. ++ */ ++void gemac_set_loop(void *base, enum mac_loop gem_loop) ++{ ++ pr_info("%s()\n", __func__); ++ writel(readl(base + EMAC_RCNTRL_REG) | EMAC_RCNTRL_LOOP, (base + ++ EMAC_RCNTRL_REG)); ++} ++ ++/* GEMAC allow frames ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_copy_all(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) | EMAC_RCNTRL_PROM, (base + ++ EMAC_RCNTRL_REG)); ++} ++ ++/* GEMAC do not allow frames ++ * @param[in] base GEMAC base address ++ */ ++void gemac_disable_copy_all(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) & ~EMAC_RCNTRL_PROM, (base + ++ EMAC_RCNTRL_REG)); ++} ++ ++/* GEMAC allow broadcast function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_allow_broadcast(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) & ~EMAC_RCNTRL_BC_REJ, base + ++ EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC no broadcast function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_no_broadcast(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) | EMAC_RCNTRL_BC_REJ, base + ++ EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC enable 1536 rx function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_1536_rx(void *base) ++{ ++ /* Set 1536 as Maximum frame length */ ++ writel((readl(base + EMAC_RCNTRL_REG) & PFE_RCR_MAX_FL_MASK) ++ | (1536 << 16), base + EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC set rx Max frame length. ++ * @param[in] base GEMAC base address ++ * @param[in] mtu new mtu ++ */ ++void gemac_set_rx_max_fl(void *base, int mtu) ++{ ++ /* Set mtu as Maximum frame length */ ++ writel((readl(base + EMAC_RCNTRL_REG) & PFE_RCR_MAX_FL_MASK) ++ | (mtu << 16), base + EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC enable stacked vlan function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_stacked_vlan(void *base) ++{ ++ /* MTIP doesn't support stacked vlan */ ++} ++ ++/* GEMAC enable pause rx function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_pause_rx(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) | EMAC_RCNTRL_FCE, ++ base + EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC disable pause rx function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_disable_pause_rx(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) & ~EMAC_RCNTRL_FCE, ++ base + EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC enable pause tx function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_pause_tx(void *base) ++{ ++ writel(EMAC_RX_SECTION_EMPTY_V, base + EMAC_RX_SECTION_EMPTY); ++} ++ ++/* GEMAC disable pause tx function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_disable_pause_tx(void *base) ++{ ++ writel(0x0, base + EMAC_RX_SECTION_EMPTY); ++} ++ ++/* GEMAC wol configuration ++ * @param[in] base GEMAC base address ++ * @param[in] wol_conf WoL register configuration ++ */ ++void gemac_set_wol(void *base, u32 wol_conf) ++{ ++ u32 val = readl(base + EMAC_ECNTRL_REG); ++ ++ if (wol_conf) ++ val |= (EMAC_ECNTRL_MAGIC_ENA | EMAC_ECNTRL_SLEEP); ++ else ++ val &= ~(EMAC_ECNTRL_MAGIC_ENA | EMAC_ECNTRL_SLEEP); ++ writel(val, base + EMAC_ECNTRL_REG); ++} ++ ++/* Sets Gemac bus width to 64bit ++ * @param[in] base GEMAC base address ++ * @param[in] width gemac bus width to be set possible values are 32/64/128 ++ */ ++void gemac_set_bus_width(void *base, int width) ++{ ++} ++ ++/* Sets Gemac configuration. ++ * @param[in] base GEMAC base address ++ * @param[in] cfg GEMAC configuration ++ */ ++void gemac_set_config(void *base, struct gemac_cfg *cfg) ++{ ++ /*GEMAC config taken from VLSI */ ++ writel(0x00000004, base + EMAC_TFWR_STR_FWD); ++ writel(0x00000005, base + EMAC_RX_SECTION_FULL); ++ ++ if (pfe_errata_a010897) ++ writel(0x0000076c, base + EMAC_TRUNC_FL); ++ else ++ writel(0x00003fff, base + EMAC_TRUNC_FL); ++ ++ writel(0x00000030, base + EMAC_TX_SECTION_EMPTY); ++ writel(0x00000000, base + EMAC_MIB_CTRL_STS_REG); ++ ++ gemac_set_mode(base, cfg->mode); ++ ++ gemac_set_speed(base, cfg->speed); ++ ++ gemac_set_duplex(base, cfg->duplex); ++} ++ ++/**************************** GPI ***************************/ ++ ++/* Initializes a GPI block. ++ * @param[in] base GPI base address ++ * @param[in] cfg GPI configuration ++ */ ++void gpi_init(void *base, struct gpi_cfg *cfg) ++{ ++ gpi_reset(base); ++ ++ gpi_disable(base); ++ ++ gpi_set_config(base, cfg); ++} ++ ++/* Resets a GPI block. ++ * @param[in] base GPI base address ++ */ ++void gpi_reset(void *base) ++{ ++ writel(CORE_SW_RESET, base + GPI_CTRL); ++} ++ ++/* Enables a GPI block. ++ * @param[in] base GPI base address ++ */ ++void gpi_enable(void *base) ++{ ++ writel(CORE_ENABLE, base + GPI_CTRL); ++} ++ ++/* Disables a GPI block. ++ * @param[in] base GPI base address ++ */ ++void gpi_disable(void *base) ++{ ++ writel(CORE_DISABLE, base + GPI_CTRL); ++} ++ ++/* Sets the configuration of a GPI block. ++ * @param[in] base GPI base address ++ * @param[in] cfg GPI configuration ++ */ ++void gpi_set_config(void *base, struct gpi_cfg *cfg) ++{ ++ writel(CBUS_VIRT_TO_PFE(BMU1_BASE_ADDR + BMU_ALLOC_CTRL), base ++ + GPI_LMEM_ALLOC_ADDR); ++ writel(CBUS_VIRT_TO_PFE(BMU1_BASE_ADDR + BMU_FREE_CTRL), base ++ + GPI_LMEM_FREE_ADDR); ++ writel(CBUS_VIRT_TO_PFE(BMU2_BASE_ADDR + BMU_ALLOC_CTRL), base ++ + GPI_DDR_ALLOC_ADDR); ++ writel(CBUS_VIRT_TO_PFE(BMU2_BASE_ADDR + BMU_FREE_CTRL), base ++ + GPI_DDR_FREE_ADDR); ++ writel(CBUS_VIRT_TO_PFE(CLASS_INQ_PKTPTR), base + GPI_CLASS_ADDR); ++ writel(DDR_HDR_SIZE, base + GPI_DDR_DATA_OFFSET); ++ writel(LMEM_HDR_SIZE, base + GPI_LMEM_DATA_OFFSET); ++ writel(0, base + GPI_LMEM_SEC_BUF_DATA_OFFSET); ++ writel(0, base + GPI_DDR_SEC_BUF_DATA_OFFSET); ++ writel((DDR_HDR_SIZE << 16) | LMEM_HDR_SIZE, base + GPI_HDR_SIZE); ++ writel((DDR_BUF_SIZE << 16) | LMEM_BUF_SIZE, base + GPI_BUF_SIZE); ++ ++ writel(((cfg->lmem_rtry_cnt << 16) | (GPI_DDR_BUF_EN << 1) | ++ GPI_LMEM_BUF_EN), base + GPI_RX_CONFIG); ++ writel(cfg->tmlf_txthres, base + GPI_TMLF_TX); ++ writel(cfg->aseq_len, base + GPI_DTX_ASEQ); ++ writel(1, base + GPI_TOE_CHKSUM_EN); ++ ++ if (cfg->mtip_pause_reg) { ++ writel(cfg->mtip_pause_reg, base + GPI_CSR_MTIP_PAUSE_REG); ++ writel(EGPI_PAUSE_TIME, base + GPI_TX_PAUSE_TIME); ++ } ++} ++ ++/**************************** CLASSIFIER ***************************/ ++ ++/* Initializes CLASSIFIER block. ++ * @param[in] cfg CLASSIFIER configuration ++ */ ++void class_init(struct class_cfg *cfg) ++{ ++ class_reset(); ++ ++ class_disable(); ++ ++ class_set_config(cfg); ++} ++ ++/* Resets CLASSIFIER block. ++ * ++ */ ++void class_reset(void) ++{ ++ writel(CORE_SW_RESET, CLASS_TX_CTRL); ++} ++ ++/* Enables all CLASS-PE's cores. ++ * ++ */ ++void class_enable(void) ++{ ++ writel(CORE_ENABLE, CLASS_TX_CTRL); ++} ++ ++/* Disables all CLASS-PE's cores. ++ * ++ */ ++void class_disable(void) ++{ ++ writel(CORE_DISABLE, CLASS_TX_CTRL); ++} ++ ++/* ++ * Sets the configuration of the CLASSIFIER block. ++ * @param[in] cfg CLASSIFIER configuration ++ */ ++void class_set_config(struct class_cfg *cfg) ++{ ++ u32 val; ++ ++ /* Initialize route table */ ++ if (!cfg->resume) ++ memset(DDR_PHYS_TO_VIRT(cfg->route_table_baseaddr), 0, (1 << ++ cfg->route_table_hash_bits) * CLASS_ROUTE_SIZE); ++ ++#if !defined(LS1012A_PFE_RESET_WA) ++ writel(cfg->pe_sys_clk_ratio, CLASS_PE_SYS_CLK_RATIO); ++#endif ++ ++ writel((DDR_HDR_SIZE << 16) | LMEM_HDR_SIZE, CLASS_HDR_SIZE); ++ writel(LMEM_BUF_SIZE, CLASS_LMEM_BUF_SIZE); ++ writel(CLASS_ROUTE_ENTRY_SIZE(CLASS_ROUTE_SIZE) | ++ CLASS_ROUTE_HASH_SIZE(cfg->route_table_hash_bits), ++ CLASS_ROUTE_HASH_ENTRY_SIZE); ++ writel(HIF_PKT_CLASS_EN | HIF_PKT_OFFSET(sizeof(struct hif_hdr)), ++ CLASS_HIF_PARSE); ++ ++ val = HASH_CRC_PORT_IP | QB2BUS_LE; ++ ++#if defined(CONFIG_IP_ALIGNED) ++ val |= IP_ALIGNED; ++#endif ++ ++ /* ++ * Class PE packet steering will only work if TOE mode, bridge fetch or ++ * route fetch are enabled (see class/qb_fet.v). Route fetch would ++ * trigger additional memory copies (likely from DDR because of hash ++ * table size, which cannot be reduced because PE software still ++ * relies on hash value computed in HW), so when not in TOE mode we ++ * simply enable HW bridge fetch even though we don't use it. ++ */ ++ if (cfg->toe_mode) ++ val |= CLASS_TOE; ++ else ++ val |= HW_BRIDGE_FETCH; ++ ++ writel(val, CLASS_ROUTE_MULTI); ++ ++ writel(DDR_PHYS_TO_PFE(cfg->route_table_baseaddr), ++ CLASS_ROUTE_TABLE_BASE); ++ writel(CLASS_PE0_RO_DM_ADDR0_VAL, CLASS_PE0_RO_DM_ADDR0); ++ writel(CLASS_PE0_RO_DM_ADDR1_VAL, CLASS_PE0_RO_DM_ADDR1); ++ writel(CLASS_PE0_QB_DM_ADDR0_VAL, CLASS_PE0_QB_DM_ADDR0); ++ writel(CLASS_PE0_QB_DM_ADDR1_VAL, CLASS_PE0_QB_DM_ADDR1); ++ writel(CBUS_VIRT_TO_PFE(TMU_PHY_INQ_PKTPTR), CLASS_TM_INQ_ADDR); ++ ++ writel(23, CLASS_AFULL_THRES); ++ writel(23, CLASS_TSQ_FIFO_THRES); ++ ++ writel(24, CLASS_MAX_BUF_CNT); ++ writel(24, CLASS_TSQ_MAX_CNT); ++} ++ ++/**************************** TMU ***************************/ ++ ++void tmu_reset(void) ++{ ++ writel(SW_RESET, TMU_CTRL); ++} ++ ++/* Initializes TMU block. ++ * @param[in] cfg TMU configuration ++ */ ++void tmu_init(struct tmu_cfg *cfg) ++{ ++ int q, phyno; ++ ++ tmu_disable(0xF); ++ mdelay(10); ++ ++#if !defined(LS1012A_PFE_RESET_WA) ++ /* keep in soft reset */ ++ writel(SW_RESET, TMU_CTRL); ++#endif ++ writel(0x3, TMU_SYS_GENERIC_CONTROL); ++ writel(750, TMU_INQ_WATERMARK); ++ writel(CBUS_VIRT_TO_PFE(EGPI1_BASE_ADDR + ++ GPI_INQ_PKTPTR), TMU_PHY0_INQ_ADDR); ++ writel(CBUS_VIRT_TO_PFE(EGPI2_BASE_ADDR + ++ GPI_INQ_PKTPTR), TMU_PHY1_INQ_ADDR); ++ writel(CBUS_VIRT_TO_PFE(HGPI_BASE_ADDR + ++ GPI_INQ_PKTPTR), TMU_PHY3_INQ_ADDR); ++ writel(CBUS_VIRT_TO_PFE(HIF_NOCPY_RX_INQ0_PKTPTR), TMU_PHY4_INQ_ADDR); ++ writel(CBUS_VIRT_TO_PFE(UTIL_INQ_PKTPTR), TMU_PHY5_INQ_ADDR); ++ writel(CBUS_VIRT_TO_PFE(BMU2_BASE_ADDR + BMU_FREE_CTRL), ++ TMU_BMU_INQ_ADDR); ++ ++ writel(0x3FF, TMU_TDQ0_SCH_CTRL); /* ++ * enabling all 10 ++ * schedulers [9:0] of each TDQ ++ */ ++ writel(0x3FF, TMU_TDQ1_SCH_CTRL); ++ writel(0x3FF, TMU_TDQ3_SCH_CTRL); ++ ++#if !defined(LS1012A_PFE_RESET_WA) ++ writel(cfg->pe_sys_clk_ratio, TMU_PE_SYS_CLK_RATIO); ++#endif ++ ++#if !defined(LS1012A_PFE_RESET_WA) ++ writel(DDR_PHYS_TO_PFE(cfg->llm_base_addr), TMU_LLM_BASE_ADDR); ++ /* Extra packet pointers will be stored from this address onwards */ ++ ++ writel(cfg->llm_queue_len, TMU_LLM_QUE_LEN); ++ writel(5, TMU_TDQ_IIFG_CFG); ++ writel(DDR_BUF_SIZE, TMU_BMU_BUF_SIZE); ++ ++ writel(0x0, TMU_CTRL); ++ ++ /* MEM init */ ++ pr_info("%s: mem init\n", __func__); ++ writel(MEM_INIT, TMU_CTRL); ++ ++ while (!(readl(TMU_CTRL) & MEM_INIT_DONE)) ++ ; ++ ++ /* LLM init */ ++ pr_info("%s: lmem init\n", __func__); ++ writel(LLM_INIT, TMU_CTRL); ++ ++ while (!(readl(TMU_CTRL) & LLM_INIT_DONE)) ++ ; ++#endif ++ /* set up each queue for tail drop */ ++ for (phyno = 0; phyno < 4; phyno++) { ++ if (phyno == 2) ++ continue; ++ for (q = 0; q < 16; q++) { ++ u32 qdepth; ++ ++ writel((phyno << 8) | q, TMU_TEQ_CTRL); ++ writel(1 << 22, TMU_TEQ_QCFG); /*Enable tail drop */ ++ ++ if (phyno == 3) ++ qdepth = DEFAULT_TMU3_QDEPTH; ++ else ++ qdepth = (q == 0) ? DEFAULT_Q0_QDEPTH : ++ DEFAULT_MAX_QDEPTH; ++ ++ /* LOG: 68855 */ ++ /* ++ * The following is a workaround for the reordered ++ * packet and BMU2 buffer leakage issue. ++ */ ++ if (CHIP_REVISION() == 0) ++ qdepth = 31; ++ ++ writel(qdepth << 18, TMU_TEQ_HW_PROB_CFG2); ++ writel(qdepth >> 14, TMU_TEQ_HW_PROB_CFG3); ++ } ++ } ++ ++#ifdef CFG_LRO ++ /* Set TMU-3 queue 5 (LRO) in no-drop mode */ ++ writel((3 << 8) | TMU_QUEUE_LRO, TMU_TEQ_CTRL); ++ writel(0, TMU_TEQ_QCFG); ++#endif ++ ++ writel(0x05, TMU_TEQ_DISABLE_DROPCHK); ++ ++ writel(0x0, TMU_CTRL); ++} ++ ++/* Enables TMU-PE cores. ++ * @param[in] pe_mask TMU PE mask ++ */ ++void tmu_enable(u32 pe_mask) ++{ ++ writel(readl(TMU_TX_CTRL) | (pe_mask & 0xF), TMU_TX_CTRL); ++} ++ ++/* Disables TMU cores. ++ * @param[in] pe_mask TMU PE mask ++ */ ++void tmu_disable(u32 pe_mask) ++{ ++ writel(readl(TMU_TX_CTRL) & ~(pe_mask & 0xF), TMU_TX_CTRL); ++} ++ ++/* This will return the tmu queue status ++ * @param[in] if_id gem interface id or TMU index ++ * @return returns the bit mask of busy queues, zero means all ++ * queues are empty ++ */ ++u32 tmu_qstatus(u32 if_id) ++{ ++ return cpu_to_be32(pe_dmem_read(TMU0_ID + if_id, TMU_DM_PESTATUS + ++ offsetof(struct pe_status, tmu_qstatus), 4)); ++} ++ ++u32 tmu_pkts_processed(u32 if_id) ++{ ++ return cpu_to_be32(pe_dmem_read(TMU0_ID + if_id, TMU_DM_PESTATUS + ++ offsetof(struct pe_status, rx), 4)); ++} ++ ++/**************************** UTIL ***************************/ ++ ++/* Resets UTIL block. ++ */ ++void util_reset(void) ++{ ++ writel(CORE_SW_RESET, UTIL_TX_CTRL); ++} ++ ++/* Initializes UTIL block. ++ * @param[in] cfg UTIL configuration ++ */ ++void util_init(struct util_cfg *cfg) ++{ ++ writel(cfg->pe_sys_clk_ratio, UTIL_PE_SYS_CLK_RATIO); ++} ++ ++/* Enables UTIL-PE core. ++ * ++ */ ++void util_enable(void) ++{ ++ writel(CORE_ENABLE, UTIL_TX_CTRL); ++} ++ ++/* Disables UTIL-PE core. ++ * ++ */ ++void util_disable(void) ++{ ++ writel(CORE_DISABLE, UTIL_TX_CTRL); ++} ++ ++/**************************** HIF ***************************/ ++/* Initializes HIF copy block. ++ * ++ */ ++void hif_init(void) ++{ ++ /*Initialize HIF registers*/ ++ writel((HIF_RX_POLL_CTRL_CYCLE << 16) | HIF_TX_POLL_CTRL_CYCLE, ++ HIF_POLL_CTRL); ++} ++ ++/* Enable hif tx DMA and interrupt ++ * ++ */ ++void hif_tx_enable(void) ++{ ++ writel(HIF_CTRL_DMA_EN, HIF_TX_CTRL); ++ writel((readl(HIF_INT_ENABLE) | HIF_INT_EN | HIF_TXPKT_INT_EN), ++ HIF_INT_ENABLE); ++} ++ ++/* Disable hif tx DMA and interrupt ++ * ++ */ ++void hif_tx_disable(void) ++{ ++ u32 hif_int; ++ ++ writel(0, HIF_TX_CTRL); ++ ++ hif_int = readl(HIF_INT_ENABLE); ++ hif_int &= HIF_TXPKT_INT_EN; ++ writel(hif_int, HIF_INT_ENABLE); ++} ++ ++/* Enable hif rx DMA and interrupt ++ * ++ */ ++void hif_rx_enable(void) ++{ ++ hif_rx_dma_start(); ++ writel((readl(HIF_INT_ENABLE) | HIF_INT_EN | HIF_RXPKT_INT_EN), ++ HIF_INT_ENABLE); ++} ++ ++/* Disable hif rx DMA and interrupt ++ * ++ */ ++void hif_rx_disable(void) ++{ ++ u32 hif_int; ++ ++ writel(0, HIF_RX_CTRL); ++ ++ hif_int = readl(HIF_INT_ENABLE); ++ hif_int &= HIF_RXPKT_INT_EN; ++ writel(hif_int, HIF_INT_ENABLE); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hif.c +@@ -0,0 +1,1063 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include "pfe_mod.h" ++ ++#define HIF_INT_MASK (HIF_INT | HIF_RXPKT_INT | HIF_TXPKT_INT) ++ ++unsigned char napi_first_batch; ++ ++static void pfe_tx_do_cleanup(unsigned long data); ++ ++static int pfe_hif_alloc_descr(struct pfe_hif *hif) ++{ ++ void *addr; ++ dma_addr_t dma_addr; ++ int err = 0; ++ ++ pr_info("%s\n", __func__); ++ addr = dma_alloc_coherent(pfe->dev, ++ HIF_RX_DESC_NT * sizeof(struct hif_desc) + ++ HIF_TX_DESC_NT * sizeof(struct hif_desc), ++ &dma_addr, GFP_KERNEL); ++ ++ if (!addr) { ++ pr_err("%s: Could not allocate buffer descriptors!\n" ++ , __func__); ++ err = -ENOMEM; ++ goto err0; ++ } ++ ++ hif->descr_baseaddr_p = dma_addr; ++ hif->descr_baseaddr_v = addr; ++ hif->rx_ring_size = HIF_RX_DESC_NT; ++ hif->tx_ring_size = HIF_TX_DESC_NT; ++ ++ return 0; ++ ++err0: ++ return err; ++} ++ ++#if defined(LS1012A_PFE_RESET_WA) ++static void pfe_hif_disable_rx_desc(struct pfe_hif *hif) ++{ ++ int ii; ++ struct hif_desc *desc = hif->rx_base; ++ ++ /*Mark all descriptors as LAST_BD */ ++ for (ii = 0; ii < hif->rx_ring_size; ii++) { ++ desc->ctrl |= BD_CTRL_LAST_BD; ++ desc++; ++ } ++} ++ ++struct class_rx_hdr_t { ++ u32 next_ptr; /* ptr to the start of the first DDR buffer */ ++ u16 length; /* total packet length */ ++ u16 phyno; /* input physical port number */ ++ u32 status; /* gemac status bits */ ++ u32 status2; /* reserved for software usage */ ++}; ++ ++/* STATUS_BAD_FRAME_ERR is set for all errors (including checksums if enabled) ++ * except overflow ++ */ ++#define STATUS_BAD_FRAME_ERR BIT(16) ++#define STATUS_LENGTH_ERR BIT(17) ++#define STATUS_CRC_ERR BIT(18) ++#define STATUS_TOO_SHORT_ERR BIT(19) ++#define STATUS_TOO_LONG_ERR BIT(20) ++#define STATUS_CODE_ERR BIT(21) ++#define STATUS_MC_HASH_MATCH BIT(22) ++#define STATUS_CUMULATIVE_ARC_HIT BIT(23) ++#define STATUS_UNICAST_HASH_MATCH BIT(24) ++#define STATUS_IP_CHECKSUM_CORRECT BIT(25) ++#define STATUS_TCP_CHECKSUM_CORRECT BIT(26) ++#define STATUS_UDP_CHECKSUM_CORRECT BIT(27) ++#define STATUS_OVERFLOW_ERR BIT(28) /* GPI error */ ++#define MIN_PKT_SIZE 64 ++ ++static inline void copy_to_lmem(u32 *dst, u32 *src, int len) ++{ ++ int i; ++ ++ for (i = 0; i < len; i += sizeof(u32)) { ++ *dst = htonl(*src); ++ dst++; src++; ++ } ++} ++ ++static void send_dummy_pkt_to_hif(void) ++{ ++ void *lmem_ptr, *ddr_ptr, *lmem_virt_addr; ++ u32 physaddr; ++ struct class_rx_hdr_t local_hdr; ++ static u32 dummy_pkt[] = { ++ 0x33221100, 0x2b785544, 0xd73093cb, 0x01000608, ++ 0x04060008, 0x2b780200, 0xd73093cb, 0x0a01a8c0, ++ 0x33221100, 0xa8c05544, 0x00000301, 0x00000000, ++ 0x00000000, 0x00000000, 0x00000000, 0xbe86c51f }; ++ ++ ddr_ptr = (void *)((u64)readl(BMU2_BASE_ADDR + BMU_ALLOC_CTRL)); ++ if (!ddr_ptr) ++ return; ++ ++ lmem_ptr = (void *)((u64)readl(BMU1_BASE_ADDR + BMU_ALLOC_CTRL)); ++ if (!lmem_ptr) ++ return; ++ ++ pr_info("Sending a dummy pkt to HIF %p %p\n", ddr_ptr, lmem_ptr); ++ physaddr = (u32)DDR_VIRT_TO_PFE(ddr_ptr); ++ ++ lmem_virt_addr = (void *)CBUS_PFE_TO_VIRT((unsigned long int)lmem_ptr); ++ ++ local_hdr.phyno = htons(0); /* RX_PHY_0 */ ++ local_hdr.length = htons(MIN_PKT_SIZE); ++ ++ local_hdr.next_ptr = htonl((u32)physaddr); ++ /*Mark checksum is correct */ ++ local_hdr.status = htonl((STATUS_IP_CHECKSUM_CORRECT | ++ STATUS_UDP_CHECKSUM_CORRECT | ++ STATUS_TCP_CHECKSUM_CORRECT | ++ STATUS_UNICAST_HASH_MATCH | ++ STATUS_CUMULATIVE_ARC_HIT)); ++ local_hdr.status2 = 0; ++ ++ copy_to_lmem((u32 *)lmem_virt_addr, (u32 *)&local_hdr, ++ sizeof(local_hdr)); ++ ++ copy_to_lmem((u32 *)(lmem_virt_addr + LMEM_HDR_SIZE), (u32 *)dummy_pkt, ++ 0x40); ++ ++ writel((unsigned long int)lmem_ptr, CLASS_INQ_PKTPTR); ++} ++ ++void pfe_hif_rx_idle(struct pfe_hif *hif) ++{ ++ int hif_stop_loop = 10; ++ u32 rx_status; ++ ++ pfe_hif_disable_rx_desc(hif); ++ pr_info("Bringing hif to idle state..."); ++ writel(0, HIF_INT_ENABLE); ++ /*If HIF Rx BDP is busy send a dummy packet */ ++ do { ++ rx_status = readl(HIF_RX_STATUS); ++ if (rx_status & BDP_CSR_RX_DMA_ACTV) ++ send_dummy_pkt_to_hif(); ++ ++ usleep_range(100, 150); ++ } while (--hif_stop_loop); ++ ++ if (readl(HIF_RX_STATUS) & BDP_CSR_RX_DMA_ACTV) ++ pr_info("Failed\n"); ++ else ++ pr_info("Done\n"); ++} ++#endif ++ ++static void pfe_hif_free_descr(struct pfe_hif *hif) ++{ ++ pr_info("%s\n", __func__); ++ ++ dma_free_coherent(pfe->dev, ++ hif->rx_ring_size * sizeof(struct hif_desc) + ++ hif->tx_ring_size * sizeof(struct hif_desc), ++ hif->descr_baseaddr_v, hif->descr_baseaddr_p); ++} ++ ++void pfe_hif_desc_dump(struct pfe_hif *hif) ++{ ++ struct hif_desc *desc; ++ unsigned long desc_p; ++ int ii = 0; ++ ++ pr_info("%s\n", __func__); ++ ++ desc = hif->rx_base; ++ desc_p = (u32)((u64)desc - (u64)hif->descr_baseaddr_v + ++ hif->descr_baseaddr_p); ++ ++ pr_info("HIF Rx desc base %p physical %x\n", desc, (u32)desc_p); ++ for (ii = 0; ii < hif->rx_ring_size; ii++) { ++ pr_info("status: %08x, ctrl: %08x, data: %08x, next: %x\n", ++ readl(&desc->status), readl(&desc->ctrl), ++ readl(&desc->data), readl(&desc->next)); ++ desc++; ++ } ++ ++ desc = hif->tx_base; ++ desc_p = ((u64)desc - (u64)hif->descr_baseaddr_v + ++ hif->descr_baseaddr_p); ++ ++ pr_info("HIF Tx desc base %p physical %x\n", desc, (u32)desc_p); ++ for (ii = 0; ii < hif->tx_ring_size; ii++) { ++ pr_info("status: %08x, ctrl: %08x, data: %08x, next: %x\n", ++ readl(&desc->status), readl(&desc->ctrl), ++ readl(&desc->data), readl(&desc->next)); ++ desc++; ++ } ++} ++ ++/* pfe_hif_release_buffers */ ++static void pfe_hif_release_buffers(struct pfe_hif *hif) ++{ ++ struct hif_desc *desc; ++ int i = 0; ++ ++ hif->rx_base = hif->descr_baseaddr_v; ++ ++ pr_info("%s\n", __func__); ++ ++ /*Free Rx buffers */ ++ desc = hif->rx_base; ++ for (i = 0; i < hif->rx_ring_size; i++) { ++ if (readl(&desc->data)) { ++ if ((i < hif->shm->rx_buf_pool_cnt) && ++ (!hif->shm->rx_buf_pool[i])) { ++ /* ++ * dma_unmap_single(hif->dev, desc->data, ++ * hif->rx_buf_len[i], DMA_FROM_DEVICE); ++ */ ++ dma_unmap_single(hif->dev, ++ DDR_PFE_TO_PHYS( ++ readl(&desc->data)), ++ hif->rx_buf_len[i], ++ DMA_FROM_DEVICE); ++ hif->shm->rx_buf_pool[i] = hif->rx_buf_addr[i]; ++ } else { ++ pr_err("%s: buffer pool already full\n" ++ , __func__); ++ } ++ } ++ ++ writel(0, &desc->data); ++ writel(0, &desc->status); ++ writel(0, &desc->ctrl); ++ desc++; ++ } ++} ++ ++/* ++ * pfe_hif_init_buffers ++ * This function initializes the HIF Rx/Tx ring descriptors and ++ * initialize Rx queue with buffers. ++ */ ++static int pfe_hif_init_buffers(struct pfe_hif *hif) ++{ ++ struct hif_desc *desc, *first_desc_p; ++ u32 data; ++ int i = 0; ++ ++ pr_info("%s\n", __func__); ++ ++ /* Check enough Rx buffers available in the shared memory */ ++ if (hif->shm->rx_buf_pool_cnt < hif->rx_ring_size) ++ return -ENOMEM; ++ ++ hif->rx_base = hif->descr_baseaddr_v; ++ memset(hif->rx_base, 0, hif->rx_ring_size * sizeof(struct hif_desc)); ++ ++ /*Initialize Rx descriptors */ ++ desc = hif->rx_base; ++ first_desc_p = (struct hif_desc *)hif->descr_baseaddr_p; ++ ++ for (i = 0; i < hif->rx_ring_size; i++) { ++ /* Initialize Rx buffers from the shared memory */ ++ ++ data = (u32)dma_map_single(hif->dev, hif->shm->rx_buf_pool[i], ++ pfe_pkt_size, DMA_FROM_DEVICE); ++ hif->rx_buf_addr[i] = hif->shm->rx_buf_pool[i]; ++ hif->rx_buf_len[i] = pfe_pkt_size; ++ hif->shm->rx_buf_pool[i] = NULL; ++ ++ if (likely(dma_mapping_error(hif->dev, data) == 0)) { ++ writel(DDR_PHYS_TO_PFE(data), &desc->data); ++ } else { ++ pr_err("%s : low on mem\n", __func__); ++ ++ goto err; ++ } ++ ++ writel(0, &desc->status); ++ ++ /* ++ * Ensure everything else is written to DDR before ++ * writing bd->ctrl ++ */ ++ wmb(); ++ ++ writel((BD_CTRL_PKT_INT_EN | BD_CTRL_LIFM ++ | BD_CTRL_DIR | BD_CTRL_DESC_EN ++ | BD_BUF_LEN(pfe_pkt_size)), &desc->ctrl); ++ ++ /* Chain descriptors */ ++ writel((u32)DDR_PHYS_TO_PFE(first_desc_p + i + 1), &desc->next); ++ desc++; ++ } ++ ++ /* Overwrite last descriptor to chain it to first one*/ ++ desc--; ++ writel((u32)DDR_PHYS_TO_PFE(first_desc_p), &desc->next); ++ ++ hif->rxtoclean_index = 0; ++ ++ /*Initialize Rx buffer descriptor ring base address */ ++ writel(DDR_PHYS_TO_PFE(hif->descr_baseaddr_p), HIF_RX_BDP_ADDR); ++ ++ hif->tx_base = hif->rx_base + hif->rx_ring_size; ++ first_desc_p = (struct hif_desc *)hif->descr_baseaddr_p + ++ hif->rx_ring_size; ++ memset(hif->tx_base, 0, hif->tx_ring_size * sizeof(struct hif_desc)); ++ ++ /*Initialize tx descriptors */ ++ desc = hif->tx_base; ++ ++ for (i = 0; i < hif->tx_ring_size; i++) { ++ /* Chain descriptors */ ++ writel((u32)DDR_PHYS_TO_PFE(first_desc_p + i + 1), &desc->next); ++ writel(0, &desc->ctrl); ++ desc++; ++ } ++ ++ /* Overwrite last descriptor to chain it to first one */ ++ desc--; ++ writel((u32)DDR_PHYS_TO_PFE(first_desc_p), &desc->next); ++ hif->txavail = hif->tx_ring_size; ++ hif->txtosend = 0; ++ hif->txtoclean = 0; ++ hif->txtoflush = 0; ++ ++ /*Initialize Tx buffer descriptor ring base address */ ++ writel((u32)DDR_PHYS_TO_PFE(first_desc_p), HIF_TX_BDP_ADDR); ++ ++ return 0; ++ ++err: ++ pfe_hif_release_buffers(hif); ++ return -ENOMEM; ++} ++ ++/* ++ * pfe_hif_client_register ++ * ++ * This function used to register a client driver with the HIF driver. ++ * ++ * Return value: ++ * 0 - on Successful registration ++ */ ++static int pfe_hif_client_register(struct pfe_hif *hif, u32 client_id, ++ struct hif_client_shm *client_shm) ++{ ++ struct hif_client *client = &hif->client[client_id]; ++ u32 i, cnt; ++ struct rx_queue_desc *rx_qbase; ++ struct tx_queue_desc *tx_qbase; ++ struct hif_rx_queue *rx_queue; ++ struct hif_tx_queue *tx_queue; ++ int err = 0; ++ ++ pr_info("%s\n", __func__); ++ ++ spin_lock_bh(&hif->tx_lock); ++ ++ if (test_bit(client_id, &hif->shm->g_client_status[0])) { ++ pr_err("%s: client %d already registered\n", ++ __func__, client_id); ++ err = -1; ++ goto unlock; ++ } ++ ++ memset(client, 0, sizeof(struct hif_client)); ++ ++ /* Initialize client Rx queues baseaddr, size */ ++ ++ cnt = CLIENT_CTRL_RX_Q_CNT(client_shm->ctrl); ++ /* Check if client is requesting for more queues than supported */ ++ if (cnt > HIF_CLIENT_QUEUES_MAX) ++ cnt = HIF_CLIENT_QUEUES_MAX; ++ ++ client->rx_qn = cnt; ++ rx_qbase = (struct rx_queue_desc *)client_shm->rx_qbase; ++ for (i = 0; i < cnt; i++) { ++ rx_queue = &client->rx_q[i]; ++ rx_queue->base = rx_qbase + i * client_shm->rx_qsize; ++ rx_queue->size = client_shm->rx_qsize; ++ rx_queue->write_idx = 0; ++ } ++ ++ /* Initialize client Tx queues baseaddr, size */ ++ cnt = CLIENT_CTRL_TX_Q_CNT(client_shm->ctrl); ++ ++ /* Check if client is requesting for more queues than supported */ ++ if (cnt > HIF_CLIENT_QUEUES_MAX) ++ cnt = HIF_CLIENT_QUEUES_MAX; ++ ++ client->tx_qn = cnt; ++ tx_qbase = (struct tx_queue_desc *)client_shm->tx_qbase; ++ for (i = 0; i < cnt; i++) { ++ tx_queue = &client->tx_q[i]; ++ tx_queue->base = tx_qbase + i * client_shm->tx_qsize; ++ tx_queue->size = client_shm->tx_qsize; ++ tx_queue->ack_idx = 0; ++ } ++ ++ set_bit(client_id, &hif->shm->g_client_status[0]); ++ ++unlock: ++ spin_unlock_bh(&hif->tx_lock); ++ ++ return err; ++} ++ ++/* ++ * pfe_hif_client_unregister ++ * ++ * This function used to unregister a client from the HIF driver. ++ * ++ */ ++static void pfe_hif_client_unregister(struct pfe_hif *hif, u32 client_id) ++{ ++ pr_info("%s\n", __func__); ++ ++ /* ++ * Mark client as no longer available (which prevents further packet ++ * receive for this client) ++ */ ++ spin_lock_bh(&hif->tx_lock); ++ ++ if (!test_bit(client_id, &hif->shm->g_client_status[0])) { ++ pr_err("%s: client %d not registered\n", __func__, ++ client_id); ++ ++ spin_unlock_bh(&hif->tx_lock); ++ return; ++ } ++ ++ clear_bit(client_id, &hif->shm->g_client_status[0]); ++ ++ spin_unlock_bh(&hif->tx_lock); ++} ++ ++/* ++ * client_put_rxpacket- ++ * This functions puts the Rx pkt in the given client Rx queue. ++ * It actually swap the Rx pkt in the client Rx descriptor buffer ++ * and returns the free buffer from it. ++ * ++ * If the function returns NULL means client Rx queue is full and ++ * packet couldn't send to client queue. ++ */ ++static void *client_put_rxpacket(struct hif_rx_queue *queue, void *pkt, u32 len, ++ u32 flags, u32 client_ctrl, u32 *rem_len) ++{ ++ void *free_pkt = NULL; ++ struct rx_queue_desc *desc = queue->base + queue->write_idx; ++ ++ if (readl(&desc->ctrl) & CL_DESC_OWN) { ++ if (page_mode) { ++ int rem_page_size = PAGE_SIZE - ++ PRESENT_OFST_IN_PAGE(pkt); ++ int cur_pkt_size = ROUND_MIN_RX_SIZE(len + ++ pfe_pkt_headroom); ++ *rem_len = (rem_page_size - cur_pkt_size); ++ if (*rem_len) { ++ free_pkt = pkt + cur_pkt_size; ++ get_page(virt_to_page(free_pkt)); ++ } else { ++ free_pkt = (void ++ *)__get_free_page(GFP_ATOMIC | GFP_DMA_PFE); ++ *rem_len = pfe_pkt_size; ++ } ++ } else { ++ free_pkt = kmalloc(PFE_BUF_SIZE, GFP_ATOMIC | ++ GFP_DMA_PFE); ++ *rem_len = PFE_BUF_SIZE - pfe_pkt_headroom; ++ } ++ ++ if (free_pkt) { ++ desc->data = pkt; ++ desc->client_ctrl = client_ctrl; ++ /* ++ * Ensure everything else is written to DDR before ++ * writing bd->ctrl ++ */ ++ smp_wmb(); ++ writel(CL_DESC_BUF_LEN(len) | flags, &desc->ctrl); ++ queue->write_idx = (queue->write_idx + 1) ++ & (queue->size - 1); ++ ++ free_pkt += pfe_pkt_headroom; ++ } ++ } ++ ++ return free_pkt; ++} ++ ++/* ++ * pfe_hif_rx_process- ++ * This function does pfe hif rx queue processing. ++ * Dequeue packet from Rx queue and send it to corresponding client queue ++ */ ++static int pfe_hif_rx_process(struct pfe_hif *hif, int budget) ++{ ++ struct hif_desc *desc; ++ struct hif_hdr *pkt_hdr; ++ struct __hif_hdr hif_hdr; ++ void *free_buf; ++ int rtc, len, rx_processed = 0; ++ struct __hif_desc local_desc; ++ int flags; ++ unsigned int desc_p; ++ unsigned int buf_size = 0; ++ ++ spin_lock_bh(&hif->lock); ++ ++ rtc = hif->rxtoclean_index; ++ ++ while (rx_processed < budget) { ++ desc = hif->rx_base + rtc; ++ ++ __memcpy12(&local_desc, desc); ++ ++ /* ACK pending Rx interrupt */ ++ if (local_desc.ctrl & BD_CTRL_DESC_EN) { ++ writel(HIF_INT | HIF_RXPKT_INT, HIF_INT_SRC); ++ ++ if (rx_processed == 0) { ++ if (napi_first_batch == 1) { ++ desc_p = hif->descr_baseaddr_p + ++ ((unsigned long int)(desc) - ++ (unsigned long ++ int)hif->descr_baseaddr_v); ++ napi_first_batch = 0; ++ } ++ } ++ ++ __memcpy12(&local_desc, desc); ++ ++ if (local_desc.ctrl & BD_CTRL_DESC_EN) ++ break; ++ } ++ ++ napi_first_batch = 0; ++ ++#ifdef HIF_NAPI_STATS ++ hif->napi_counters[NAPI_DESC_COUNT]++; ++#endif ++ len = BD_BUF_LEN(local_desc.ctrl); ++ /* ++ * dma_unmap_single(hif->dev, DDR_PFE_TO_PHYS(local_desc.data), ++ * hif->rx_buf_len[rtc], DMA_FROM_DEVICE); ++ */ ++ dma_unmap_single(hif->dev, DDR_PFE_TO_PHYS(local_desc.data), ++ hif->rx_buf_len[rtc], DMA_FROM_DEVICE); ++ ++ pkt_hdr = (struct hif_hdr *)hif->rx_buf_addr[rtc]; ++ ++ /* Track last HIF header received */ ++ if (!hif->started) { ++ hif->started = 1; ++ ++ __memcpy8(&hif_hdr, pkt_hdr); ++ ++ hif->qno = hif_hdr.hdr.q_num; ++ hif->client_id = hif_hdr.hdr.client_id; ++ hif->client_ctrl = (hif_hdr.hdr.client_ctrl1 << 16) | ++ hif_hdr.hdr.client_ctrl; ++ flags = CL_DESC_FIRST; ++ ++ } else { ++ flags = 0; ++ } ++ ++ if (local_desc.ctrl & BD_CTRL_LIFM) ++ flags |= CL_DESC_LAST; ++ ++ /* Check for valid client id and still registered */ ++ if ((hif->client_id >= HIF_CLIENTS_MAX) || ++ !(test_bit(hif->client_id, ++ &hif->shm->g_client_status[0]))) { ++ printk_ratelimited("%s: packet with invalid client id %d q_num %d\n", ++ __func__, ++ hif->client_id, ++ hif->qno); ++ ++ free_buf = pkt_hdr; ++ ++ goto pkt_drop; ++ } ++ ++ /* Check to valid queue number */ ++ if (hif->client[hif->client_id].rx_qn <= hif->qno) { ++ pr_info("%s: packet with invalid queue: %d\n" ++ , __func__, hif->qno); ++ hif->qno = 0; ++ } ++ ++ free_buf = ++ client_put_rxpacket(&hif->client[hif->client_id].rx_q[hif->qno], ++ (void *)pkt_hdr, len, flags, ++ hif->client_ctrl, &buf_size); ++ ++ hif_lib_indicate_client(hif->client_id, EVENT_RX_PKT_IND, ++ hif->qno); ++ ++ if (unlikely(!free_buf)) { ++#ifdef HIF_NAPI_STATS ++ hif->napi_counters[NAPI_CLIENT_FULL_COUNT]++; ++#endif ++ /* ++ * If we want to keep in polling mode to retry later, ++ * we need to tell napi that we consumed ++ * the full budget or we will hit a livelock scenario. ++ * The core code keeps this napi instance ++ * at the head of the list and none of the other ++ * instances get to run ++ */ ++ rx_processed = budget; ++ ++ if (flags & CL_DESC_FIRST) ++ hif->started = 0; ++ ++ break; ++ } ++ ++pkt_drop: ++ /*Fill free buffer in the descriptor */ ++ hif->rx_buf_addr[rtc] = free_buf; ++ hif->rx_buf_len[rtc] = min(pfe_pkt_size, buf_size); ++ writel((DDR_PHYS_TO_PFE ++ ((u32)dma_map_single(hif->dev, ++ free_buf, hif->rx_buf_len[rtc], DMA_FROM_DEVICE))), ++ &desc->data); ++ /* ++ * Ensure everything else is written to DDR before ++ * writing bd->ctrl ++ */ ++ wmb(); ++ writel((BD_CTRL_PKT_INT_EN | BD_CTRL_LIFM | BD_CTRL_DIR | ++ BD_CTRL_DESC_EN | BD_BUF_LEN(hif->rx_buf_len[rtc])), ++ &desc->ctrl); ++ ++ rtc = (rtc + 1) & (hif->rx_ring_size - 1); ++ ++ if (local_desc.ctrl & BD_CTRL_LIFM) { ++ if (!(hif->client_ctrl & HIF_CTRL_RX_CONTINUED)) { ++ rx_processed++; ++ ++#ifdef HIF_NAPI_STATS ++ hif->napi_counters[NAPI_PACKET_COUNT]++; ++#endif ++ } ++ hif->started = 0; ++ } ++ } ++ ++ hif->rxtoclean_index = rtc; ++ spin_unlock_bh(&hif->lock); ++ ++ /* we made some progress, re-start rx dma in case it stopped */ ++ hif_rx_dma_start(); ++ ++ return rx_processed; ++} ++ ++/* ++ * client_ack_txpacket- ++ * This function ack the Tx packet in the give client Tx queue by resetting ++ * ownership bit in the descriptor. ++ */ ++static int client_ack_txpacket(struct pfe_hif *hif, unsigned int client_id, ++ unsigned int q_no) ++{ ++ struct hif_tx_queue *queue = &hif->client[client_id].tx_q[q_no]; ++ struct tx_queue_desc *desc = queue->base + queue->ack_idx; ++ ++ if (readl(&desc->ctrl) & CL_DESC_OWN) { ++ writel((readl(&desc->ctrl) & ~CL_DESC_OWN), &desc->ctrl); ++ queue->ack_idx = (queue->ack_idx + 1) & (queue->size - 1); ++ ++ return 0; ++ ++ } else { ++ /*This should not happen */ ++ pr_err("%s: %d %d %d %d %d %p %d\n", __func__, ++ hif->txtosend, hif->txtoclean, hif->txavail, ++ client_id, q_no, queue, queue->ack_idx); ++ WARN(1, "%s: doesn't own this descriptor", __func__); ++ return 1; ++ } ++} ++ ++void __hif_tx_done_process(struct pfe_hif *hif, int count) ++{ ++ struct hif_desc *desc; ++ struct hif_desc_sw *desc_sw; ++ int ttc, tx_avl; ++ int pkts_done[HIF_CLIENTS_MAX] = {0, 0}; ++ ++ ttc = hif->txtoclean; ++ tx_avl = hif->txavail; ++ ++ while ((tx_avl < hif->tx_ring_size) && count--) { ++ desc = hif->tx_base + ttc; ++ ++ if (readl(&desc->ctrl) & BD_CTRL_DESC_EN) ++ break; ++ ++ desc_sw = &hif->tx_sw_queue[ttc]; ++ ++ if (desc_sw->data) { ++ /* ++ * dmap_unmap_single(hif->dev, desc_sw->data, ++ * desc_sw->len, DMA_TO_DEVICE); ++ */ ++ dma_unmap_single(hif->dev, desc_sw->data, ++ desc_sw->len, DMA_TO_DEVICE); ++ } ++ ++ if (desc_sw->client_id >= HIF_CLIENTS_MAX) { ++ pr_err("Invalid cl id %d\n", desc_sw->client_id); ++ break; ++ } ++ ++ pkts_done[desc_sw->client_id]++; ++ ++ client_ack_txpacket(hif, desc_sw->client_id, desc_sw->q_no); ++ ++ ttc = (ttc + 1) & (hif->tx_ring_size - 1); ++ tx_avl++; ++ } ++ ++ if (pkts_done[0]) ++ hif_lib_indicate_client(0, EVENT_TXDONE_IND, 0); ++ if (pkts_done[1]) ++ hif_lib_indicate_client(1, EVENT_TXDONE_IND, 0); ++ ++ hif->txtoclean = ttc; ++ hif->txavail = tx_avl; ++ ++ if (!count) { ++ tasklet_schedule(&hif->tx_cleanup_tasklet); ++ } else { ++ /*Enable Tx done interrupt */ ++ writel(readl_relaxed(HIF_INT_ENABLE) | HIF_TXPKT_INT, ++ HIF_INT_ENABLE); ++ } ++} ++ ++static void pfe_tx_do_cleanup(unsigned long data) ++{ ++ struct pfe_hif *hif = (struct pfe_hif *)data; ++ ++ writel(HIF_INT | HIF_TXPKT_INT, HIF_INT_SRC); ++ ++ hif_tx_done_process(hif, 64); ++} ++ ++/* ++ * __hif_xmit_pkt - ++ * This function puts one packet in the HIF Tx queue ++ */ ++void __hif_xmit_pkt(struct pfe_hif *hif, unsigned int client_id, unsigned int ++ q_no, void *data, u32 len, unsigned int flags) ++{ ++ struct hif_desc *desc; ++ struct hif_desc_sw *desc_sw; ++ ++ desc = hif->tx_base + hif->txtosend; ++ desc_sw = &hif->tx_sw_queue[hif->txtosend]; ++ ++ desc_sw->len = len; ++ desc_sw->client_id = client_id; ++ desc_sw->q_no = q_no; ++ desc_sw->flags = flags; ++ ++ if (flags & HIF_DONT_DMA_MAP) { ++ desc_sw->data = 0; ++ writel((u32)DDR_PHYS_TO_PFE(data), &desc->data); ++ } else { ++ desc_sw->data = dma_map_single(hif->dev, data, len, ++ DMA_TO_DEVICE); ++ writel((u32)DDR_PHYS_TO_PFE(desc_sw->data), &desc->data); ++ } ++ ++ hif->txtosend = (hif->txtosend + 1) & (hif->tx_ring_size - 1); ++ hif->txavail--; ++ ++ if ((!((flags & HIF_DATA_VALID) && (flags & ++ HIF_LAST_BUFFER)))) ++ goto skip_tx; ++ ++ /* ++ * Ensure everything else is written to DDR before ++ * writing bd->ctrl ++ */ ++ wmb(); ++ ++ do { ++ desc_sw = &hif->tx_sw_queue[hif->txtoflush]; ++ desc = hif->tx_base + hif->txtoflush; ++ ++ if (desc_sw->flags & HIF_LAST_BUFFER) { ++ writel((BD_CTRL_LIFM | ++ BD_CTRL_BRFETCH_DISABLE | BD_CTRL_RTFETCH_DISABLE ++ | BD_CTRL_PARSE_DISABLE | BD_CTRL_DESC_EN | ++ BD_CTRL_PKT_INT_EN | BD_BUF_LEN(desc_sw->len)), ++ &desc->ctrl); ++ } else { ++ writel((BD_CTRL_DESC_EN | ++ BD_BUF_LEN(desc_sw->len)), &desc->ctrl); ++ } ++ hif->txtoflush = (hif->txtoflush + 1) & (hif->tx_ring_size - 1); ++ } ++ while (hif->txtoflush != hif->txtosend) ++ ; ++ ++skip_tx: ++ return; ++} ++ ++static irqreturn_t wol_isr(int irq, void *dev_id) ++{ ++ pr_info("WoL\n"); ++ gemac_set_wol(EMAC1_BASE_ADDR, 0); ++ gemac_set_wol(EMAC2_BASE_ADDR, 0); ++ return IRQ_HANDLED; ++} ++ ++/* ++ * hif_isr- ++ * This ISR routine processes Rx/Tx done interrupts from the HIF hardware block ++ */ ++static irqreturn_t hif_isr(int irq, void *dev_id) ++{ ++ struct pfe_hif *hif = (struct pfe_hif *)dev_id; ++ int int_status; ++ int int_enable_mask; ++ ++ /*Read hif interrupt source register */ ++ int_status = readl_relaxed(HIF_INT_SRC); ++ int_enable_mask = readl_relaxed(HIF_INT_ENABLE); ++ ++ if ((int_status & HIF_INT) == 0) ++ return IRQ_NONE; ++ ++ int_status &= ~(HIF_INT); ++ ++ if (int_status & HIF_RXPKT_INT) { ++ int_status &= ~(HIF_RXPKT_INT); ++ int_enable_mask &= ~(HIF_RXPKT_INT); ++ ++ napi_first_batch = 1; ++ ++ if (napi_schedule_prep(&hif->napi)) { ++#ifdef HIF_NAPI_STATS ++ hif->napi_counters[NAPI_SCHED_COUNT]++; ++#endif ++ __napi_schedule(&hif->napi); ++ } ++ } ++ ++ if (int_status & HIF_TXPKT_INT) { ++ int_status &= ~(HIF_TXPKT_INT); ++ int_enable_mask &= ~(HIF_TXPKT_INT); ++ /*Schedule tx cleanup tassklet */ ++ tasklet_schedule(&hif->tx_cleanup_tasklet); ++ } ++ ++ /*Disable interrupts, they will be enabled after they are serviced */ ++ writel_relaxed(int_enable_mask, HIF_INT_ENABLE); ++ ++ if (int_status) { ++ pr_info("%s : Invalid interrupt : %d\n", __func__, ++ int_status); ++ writel(int_status, HIF_INT_SRC); ++ } ++ ++ return IRQ_HANDLED; ++} ++ ++void hif_process_client_req(struct pfe_hif *hif, int req, int data1, int data2) ++{ ++ unsigned int client_id = data1; ++ ++ if (client_id >= HIF_CLIENTS_MAX) { ++ pr_err("%s: client id %d out of bounds\n", __func__, ++ client_id); ++ return; ++ } ++ ++ switch (req) { ++ case REQUEST_CL_REGISTER: ++ /* Request for register a client */ ++ pr_info("%s: register client_id %d\n", ++ __func__, client_id); ++ pfe_hif_client_register(hif, client_id, (struct ++ hif_client_shm *)&hif->shm->client[client_id]); ++ break; ++ ++ case REQUEST_CL_UNREGISTER: ++ pr_info("%s: unregister client_id %d\n", ++ __func__, client_id); ++ ++ /* Request for unregister a client */ ++ pfe_hif_client_unregister(hif, client_id); ++ ++ break; ++ ++ default: ++ pr_err("%s: unsupported request %d\n", ++ __func__, req); ++ break; ++ } ++ ++ /* ++ * Process client Tx queues ++ * Currently we don't have checking for tx pending ++ */ ++} ++ ++/* ++ * pfe_hif_rx_poll ++ * This function is NAPI poll function to process HIF Rx queue. ++ */ ++static int pfe_hif_rx_poll(struct napi_struct *napi, int budget) ++{ ++ struct pfe_hif *hif = container_of(napi, struct pfe_hif, napi); ++ int work_done; ++ ++#ifdef HIF_NAPI_STATS ++ hif->napi_counters[NAPI_POLL_COUNT]++; ++#endif ++ ++ work_done = pfe_hif_rx_process(hif, budget); ++ ++ if (work_done < budget) { ++ napi_complete(napi); ++ writel(readl_relaxed(HIF_INT_ENABLE) | HIF_RXPKT_INT, ++ HIF_INT_ENABLE); ++ } ++#ifdef HIF_NAPI_STATS ++ else ++ hif->napi_counters[NAPI_FULL_BUDGET_COUNT]++; ++#endif ++ ++ return work_done; ++} ++ ++/* ++ * pfe_hif_init ++ * This function initializes the baseaddresses and irq, etc. ++ */ ++int pfe_hif_init(struct pfe *pfe) ++{ ++ struct pfe_hif *hif = &pfe->hif; ++ int err; ++ ++ pr_info("%s\n", __func__); ++ ++ hif->dev = pfe->dev; ++ hif->irq = pfe->hif_irq; ++ ++ err = pfe_hif_alloc_descr(hif); ++ if (err) ++ goto err0; ++ ++ if (pfe_hif_init_buffers(hif)) { ++ pr_err("%s: Could not initialize buffer descriptors\n" ++ , __func__); ++ err = -ENOMEM; ++ goto err1; ++ } ++ ++ /* Initialize NAPI for Rx processing */ ++ init_dummy_netdev(&hif->dummy_dev); ++ netif_napi_add(&hif->dummy_dev, &hif->napi, pfe_hif_rx_poll); ++ napi_enable(&hif->napi); ++ ++ spin_lock_init(&hif->tx_lock); ++ spin_lock_init(&hif->lock); ++ ++ hif_init(); ++ hif_rx_enable(); ++ hif_tx_enable(); ++ ++ /* Disable tx done interrupt */ ++ writel(HIF_INT_MASK, HIF_INT_ENABLE); ++ ++ gpi_enable(HGPI_BASE_ADDR); ++ ++ err = request_irq(hif->irq, hif_isr, 0, "pfe_hif", hif); ++ if (err) { ++ pr_err("%s: failed to get the hif IRQ = %d\n", ++ __func__, hif->irq); ++ goto err1; ++ } ++ ++ err = request_irq(pfe->wol_irq, wol_isr, 0, "pfe_wol", pfe); ++ if (err) { ++ pr_err("%s: failed to get the wol IRQ = %d\n", ++ __func__, pfe->wol_irq); ++ goto err1; ++ } ++ ++ tasklet_init(&hif->tx_cleanup_tasklet, ++ (void(*)(unsigned long))pfe_tx_do_cleanup, ++ (unsigned long)hif); ++ ++ return 0; ++err1: ++ pfe_hif_free_descr(hif); ++err0: ++ return err; ++} ++ ++/* pfe_hif_exit- */ ++void pfe_hif_exit(struct pfe *pfe) ++{ ++ struct pfe_hif *hif = &pfe->hif; ++ ++ pr_info("%s\n", __func__); ++ ++ tasklet_kill(&hif->tx_cleanup_tasklet); ++ ++ spin_lock_bh(&hif->lock); ++ hif->shm->g_client_status[0] = 0; ++ /* Make sure all clients are disabled*/ ++ hif->shm->g_client_status[1] = 0; ++ ++ spin_unlock_bh(&hif->lock); ++ ++ /*Disable Rx/Tx */ ++ gpi_disable(HGPI_BASE_ADDR); ++ hif_rx_disable(); ++ hif_tx_disable(); ++ ++ napi_disable(&hif->napi); ++ netif_napi_del(&hif->napi); ++ ++ free_irq(pfe->wol_irq, pfe); ++ free_irq(hif->irq, hif); ++ ++ pfe_hif_release_buffers(hif); ++ pfe_hif_free_descr(hif); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hif.h +@@ -0,0 +1,199 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#ifndef _PFE_HIF_H_ ++#define _PFE_HIF_H_ ++ ++#include ++ ++#define HIF_NAPI_STATS ++ ++#define HIF_CLIENT_QUEUES_MAX 16 ++#define HIF_RX_POLL_WEIGHT 64 ++ ++#define HIF_RX_PKT_MIN_SIZE 0x800 /* 2KB */ ++#define HIF_RX_PKT_MIN_SIZE_MASK ~(HIF_RX_PKT_MIN_SIZE - 1) ++#define ROUND_MIN_RX_SIZE(_sz) (((_sz) + (HIF_RX_PKT_MIN_SIZE - 1)) \ ++ & HIF_RX_PKT_MIN_SIZE_MASK) ++#define PRESENT_OFST_IN_PAGE(_buf) (((unsigned long int)(_buf) & (PAGE_SIZE \ ++ - 1)) & HIF_RX_PKT_MIN_SIZE_MASK) ++ ++enum { ++ NAPI_SCHED_COUNT = 0, ++ NAPI_POLL_COUNT, ++ NAPI_PACKET_COUNT, ++ NAPI_DESC_COUNT, ++ NAPI_FULL_BUDGET_COUNT, ++ NAPI_CLIENT_FULL_COUNT, ++ NAPI_MAX_COUNT ++}; ++ ++/* ++ * HIF_TX_DESC_NT value should be always greter than 4, ++ * Otherwise HIF_TX_POLL_MARK will become zero. ++ */ ++#define HIF_RX_DESC_NT 256 ++#define HIF_TX_DESC_NT 2048 ++ ++#define HIF_FIRST_BUFFER BIT(0) ++#define HIF_LAST_BUFFER BIT(1) ++#define HIF_DONT_DMA_MAP BIT(2) ++#define HIF_DATA_VALID BIT(3) ++#define HIF_TSO BIT(4) ++ ++enum { ++ PFE_CL_GEM0 = 0, ++ PFE_CL_GEM1, ++ HIF_CLIENTS_MAX ++}; ++ ++/*structure to store client queue info */ ++struct hif_rx_queue { ++ struct rx_queue_desc *base; ++ u32 size; ++ u32 write_idx; ++}; ++ ++struct hif_tx_queue { ++ struct tx_queue_desc *base; ++ u32 size; ++ u32 ack_idx; ++}; ++ ++/*Structure to store the client info */ ++struct hif_client { ++ int rx_qn; ++ struct hif_rx_queue rx_q[HIF_CLIENT_QUEUES_MAX]; ++ int tx_qn; ++ struct hif_tx_queue tx_q[HIF_CLIENT_QUEUES_MAX]; ++}; ++ ++/*HIF hardware buffer descriptor */ ++struct hif_desc { ++ u32 ctrl; ++ u32 status; ++ u32 data; ++ u32 next; ++}; ++ ++struct __hif_desc { ++ u32 ctrl; ++ u32 status; ++ u32 data; ++}; ++ ++struct hif_desc_sw { ++ dma_addr_t data; ++ u16 len; ++ u8 client_id; ++ u8 q_no; ++ u16 flags; ++}; ++ ++struct hif_hdr { ++ u8 client_id; ++ u8 q_num; ++ u16 client_ctrl; ++ u16 client_ctrl1; ++}; ++ ++struct __hif_hdr { ++ union { ++ struct hif_hdr hdr; ++ u32 word[2]; ++ }; ++}; ++ ++struct hif_ipsec_hdr { ++ u16 sa_handle[2]; ++} __packed; ++ ++/* HIF_CTRL_TX... defines */ ++#define HIF_CTRL_TX_CHECKSUM BIT(2) ++ ++/* HIF_CTRL_RX... defines */ ++#define HIF_CTRL_RX_OFFSET_OFST (24) ++#define HIF_CTRL_RX_CHECKSUMMED BIT(2) ++#define HIF_CTRL_RX_CONTINUED BIT(1) ++ ++struct pfe_hif { ++ /* To store registered clients in hif layer */ ++ struct hif_client client[HIF_CLIENTS_MAX]; ++ struct hif_shm *shm; ++ int irq; ++ ++ void *descr_baseaddr_v; ++ unsigned long descr_baseaddr_p; ++ ++ struct hif_desc *rx_base; ++ u32 rx_ring_size; ++ u32 rxtoclean_index; ++ void *rx_buf_addr[HIF_RX_DESC_NT]; ++ int rx_buf_len[HIF_RX_DESC_NT]; ++ unsigned int qno; ++ unsigned int client_id; ++ unsigned int client_ctrl; ++ unsigned int started; ++ ++ struct hif_desc *tx_base; ++ u32 tx_ring_size; ++ u32 txtosend; ++ u32 txtoclean; ++ u32 txavail; ++ u32 txtoflush; ++ struct hif_desc_sw tx_sw_queue[HIF_TX_DESC_NT]; ++ ++/* tx_lock synchronizes hif packet tx as well as pfe_hif structure access */ ++ spinlock_t tx_lock; ++/* lock synchronizes hif rx queue processing */ ++ spinlock_t lock; ++ struct net_device dummy_dev; ++ struct napi_struct napi; ++ struct device *dev; ++ ++#ifdef HIF_NAPI_STATS ++ unsigned int napi_counters[NAPI_MAX_COUNT]; ++#endif ++ struct tasklet_struct tx_cleanup_tasklet; ++}; ++ ++void __hif_xmit_pkt(struct pfe_hif *hif, unsigned int client_id, unsigned int ++ q_no, void *data, u32 len, unsigned int flags); ++int hif_xmit_pkt(struct pfe_hif *hif, unsigned int client_id, unsigned int q_no, ++ void *data, unsigned int len); ++void __hif_tx_done_process(struct pfe_hif *hif, int count); ++void hif_process_client_req(struct pfe_hif *hif, int req, int data1, int ++ data2); ++int pfe_hif_init(struct pfe *pfe); ++void pfe_hif_exit(struct pfe *pfe); ++void pfe_hif_rx_idle(struct pfe_hif *hif); ++static inline void hif_tx_done_process(struct pfe_hif *hif, int count) ++{ ++ spin_lock_bh(&hif->tx_lock); ++ __hif_tx_done_process(hif, count); ++ spin_unlock_bh(&hif->tx_lock); ++} ++ ++static inline void hif_tx_lock(struct pfe_hif *hif) ++{ ++ spin_lock_bh(&hif->tx_lock); ++} ++ ++static inline void hif_tx_unlock(struct pfe_hif *hif) ++{ ++ spin_unlock_bh(&hif->tx_lock); ++} ++ ++static inline int __hif_tx_avail(struct pfe_hif *hif) ++{ ++ return hif->txavail; ++} ++ ++#define __memcpy8(dst, src) memcpy(dst, src, 8) ++#define __memcpy12(dst, src) memcpy(dst, src, 12) ++#define __memcpy(dst, src, len) memcpy(dst, src, len) ++ ++#endif /* _PFE_HIF_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hif_lib.c +@@ -0,0 +1,628 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "pfe_mod.h" ++#include "pfe_hif.h" ++#include "pfe_hif_lib.h" ++ ++unsigned int lro_mode; ++unsigned int page_mode; ++unsigned int tx_qos = 1; ++module_param(tx_qos, uint, 0444); ++MODULE_PARM_DESC(tx_qos, "0: disable ,\n" ++ "1: enable (default), guarantee no packet drop at TMU level\n"); ++unsigned int pfe_pkt_size; ++unsigned int pfe_pkt_headroom; ++unsigned int emac_txq_cnt; ++ ++/* ++ * @pfe_hal_lib.c. ++ * Common functions used by HIF client drivers ++ */ ++ ++/*HIF shared memory Global variable */ ++struct hif_shm ghif_shm; ++ ++/* Cleanup the HIF shared memory, release HIF rx_buffer_pool. ++ * This function should be called after pfe_hif_exit ++ * ++ * @param[in] hif_shm Shared memory address location in DDR ++ */ ++static void pfe_hif_shm_clean(struct hif_shm *hif_shm) ++{ ++ int i; ++ void *pkt; ++ ++ for (i = 0; i < hif_shm->rx_buf_pool_cnt; i++) { ++ pkt = hif_shm->rx_buf_pool[i]; ++ if (pkt) { ++ hif_shm->rx_buf_pool[i] = NULL; ++ pkt -= pfe_pkt_headroom; ++ ++ if (page_mode) ++ put_page(virt_to_page(pkt)); ++ else ++ kfree(pkt); ++ } ++ } ++} ++ ++/* Initialize shared memory used between HIF driver and clients, ++ * allocate rx_buffer_pool required for HIF Rx descriptors. ++ * This function should be called before initializing HIF driver. ++ * ++ * @param[in] hif_shm Shared memory address location in DDR ++ * @rerurn 0 - on succes, <0 on fail to initialize ++ */ ++static int pfe_hif_shm_init(struct hif_shm *hif_shm) ++{ ++ int i; ++ void *pkt; ++ ++ memset(hif_shm, 0, sizeof(struct hif_shm)); ++ hif_shm->rx_buf_pool_cnt = HIF_RX_DESC_NT; ++ ++ for (i = 0; i < hif_shm->rx_buf_pool_cnt; i++) { ++ if (page_mode) { ++ pkt = (void *)__get_free_page(GFP_KERNEL | ++ GFP_DMA_PFE); ++ } else { ++ pkt = kmalloc(PFE_BUF_SIZE, GFP_KERNEL | GFP_DMA_PFE); ++ } ++ ++ if (pkt) ++ hif_shm->rx_buf_pool[i] = pkt + pfe_pkt_headroom; ++ else ++ goto err0; ++ } ++ ++ return 0; ++ ++err0: ++ pr_err("%s Low memory\n", __func__); ++ pfe_hif_shm_clean(hif_shm); ++ return -ENOMEM; ++} ++ ++/*This function sends indication to HIF driver ++ * ++ * @param[in] hif hif context ++ */ ++static void hif_lib_indicate_hif(struct pfe_hif *hif, int req, int data1, int ++ data2) ++{ ++ hif_process_client_req(hif, req, data1, data2); ++} ++ ++void hif_lib_indicate_client(int client_id, int event_type, int qno) ++{ ++ struct hif_client_s *client = pfe->hif_client[client_id]; ++ ++ if (!client || (event_type >= HIF_EVENT_MAX) || (qno >= ++ HIF_CLIENT_QUEUES_MAX)) ++ return; ++ ++ if (!test_and_set_bit(qno, &client->queue_mask[event_type])) ++ client->event_handler(client->priv, event_type, qno); ++} ++ ++/*This function releases Rx queue descriptors memory and pre-filled buffers ++ * ++ * @param[in] client hif_client context ++ */ ++static void hif_lib_client_release_rx_buffers(struct hif_client_s *client) ++{ ++ struct rx_queue_desc *desc; ++ int qno, ii; ++ void *buf; ++ ++ for (qno = 0; qno < client->rx_qn; qno++) { ++ desc = client->rx_q[qno].base; ++ ++ for (ii = 0; ii < client->rx_q[qno].size; ii++) { ++ buf = (void *)desc->data; ++ if (buf) { ++ buf -= pfe_pkt_headroom; ++ ++ if (page_mode) ++ free_page((unsigned long)buf); ++ else ++ kfree(buf); ++ ++ desc->ctrl = 0; ++ } ++ ++ desc++; ++ } ++ } ++ ++ kfree(client->rx_qbase); ++} ++ ++/*This function allocates memory for the rxq descriptors and pre-fill rx queues ++ * with buffers. ++ * @param[in] client client context ++ * @param[in] q_size size of the rxQ, all queues are of same size ++ */ ++static int hif_lib_client_init_rx_buffers(struct hif_client_s *client, int ++ q_size) ++{ ++ struct rx_queue_desc *desc; ++ struct hif_client_rx_queue *queue; ++ int ii, qno; ++ ++ /*Allocate memory for the client queues */ ++ client->rx_qbase = kzalloc(client->rx_qn * q_size * sizeof(struct ++ rx_queue_desc), GFP_KERNEL); ++ if (!client->rx_qbase) ++ goto err; ++ ++ for (qno = 0; qno < client->rx_qn; qno++) { ++ queue = &client->rx_q[qno]; ++ ++ queue->base = client->rx_qbase + qno * q_size * sizeof(struct ++ rx_queue_desc); ++ queue->size = q_size; ++ queue->read_idx = 0; ++ queue->write_idx = 0; ++ ++ pr_debug("rx queue: %d, base: %p, size: %d\n", qno, ++ queue->base, queue->size); ++ } ++ ++ for (qno = 0; qno < client->rx_qn; qno++) { ++ queue = &client->rx_q[qno]; ++ desc = queue->base; ++ ++ for (ii = 0; ii < queue->size; ii++) { ++ desc->ctrl = CL_DESC_BUF_LEN(pfe_pkt_size) | ++ CL_DESC_OWN; ++ desc++; ++ } ++ } ++ ++ return 0; ++ ++err: ++ return 1; ++} ++ ++ ++static void hif_lib_client_cleanup_tx_queue(struct hif_client_tx_queue *queue) ++{ ++ pr_debug("%s\n", __func__); ++ ++ /* ++ * Check if there are any pending packets. Client must flush the tx ++ * queues before unregistering, by calling by calling ++ * hif_lib_tx_get_next_complete() ++ * ++ * Hif no longer calls since we are no longer registered ++ */ ++ if (queue->tx_pending) ++ pr_err("%s: pending transmit packets\n", __func__); ++} ++ ++static void hif_lib_client_release_tx_buffers(struct hif_client_s *client) ++{ ++ int qno; ++ ++ pr_debug("%s\n", __func__); ++ ++ for (qno = 0; qno < client->tx_qn; qno++) ++ hif_lib_client_cleanup_tx_queue(&client->tx_q[qno]); ++ ++ kfree(client->tx_qbase); ++} ++ ++static int hif_lib_client_init_tx_buffers(struct hif_client_s *client, int ++ q_size) ++{ ++ struct hif_client_tx_queue *queue; ++ int qno; ++ ++ client->tx_qbase = kzalloc(client->tx_qn * q_size * sizeof(struct ++ tx_queue_desc), GFP_KERNEL); ++ if (!client->tx_qbase) ++ return 1; ++ ++ for (qno = 0; qno < client->tx_qn; qno++) { ++ queue = &client->tx_q[qno]; ++ ++ queue->base = client->tx_qbase + qno * q_size * sizeof(struct ++ tx_queue_desc); ++ queue->size = q_size; ++ queue->read_idx = 0; ++ queue->write_idx = 0; ++ queue->tx_pending = 0; ++ queue->nocpy_flag = 0; ++ queue->prev_tmu_tx_pkts = 0; ++ queue->done_tmu_tx_pkts = 0; ++ ++ pr_debug("tx queue: %d, base: %p, size: %d\n", qno, ++ queue->base, queue->size); ++ } ++ ++ return 0; ++} ++ ++static int hif_lib_event_dummy(void *priv, int event_type, int qno) ++{ ++ return 0; ++} ++ ++int hif_lib_client_register(struct hif_client_s *client) ++{ ++ struct hif_shm *hif_shm; ++ struct hif_client_shm *client_shm; ++ int err, i; ++ /* int loop_cnt = 0; */ ++ ++ pr_debug("%s\n", __func__); ++ ++ /*Allocate memory before spin_lock*/ ++ if (hif_lib_client_init_rx_buffers(client, client->rx_qsize)) { ++ err = -ENOMEM; ++ goto err_rx; ++ } ++ ++ if (hif_lib_client_init_tx_buffers(client, client->tx_qsize)) { ++ err = -ENOMEM; ++ goto err_tx; ++ } ++ ++ spin_lock_bh(&pfe->hif.lock); ++ if (!(client->pfe) || (client->id >= HIF_CLIENTS_MAX) || ++ (pfe->hif_client[client->id])) { ++ err = -EINVAL; ++ goto err; ++ } ++ ++ hif_shm = client->pfe->hif.shm; ++ ++ if (!client->event_handler) ++ client->event_handler = hif_lib_event_dummy; ++ ++ /*Initialize client specific shared memory */ ++ client_shm = (struct hif_client_shm *)&hif_shm->client[client->id]; ++ client_shm->rx_qbase = (unsigned long int)client->rx_qbase; ++ client_shm->rx_qsize = client->rx_qsize; ++ client_shm->tx_qbase = (unsigned long int)client->tx_qbase; ++ client_shm->tx_qsize = client->tx_qsize; ++ client_shm->ctrl = (client->tx_qn << CLIENT_CTRL_TX_Q_CNT_OFST) | ++ (client->rx_qn << CLIENT_CTRL_RX_Q_CNT_OFST); ++ /* spin_lock_init(&client->rx_lock); */ ++ ++ for (i = 0; i < HIF_EVENT_MAX; i++) { ++ client->queue_mask[i] = 0; /* ++ * By default all events are ++ * unmasked ++ */ ++ } ++ ++ /*Indicate to HIF driver*/ ++ hif_lib_indicate_hif(&pfe->hif, REQUEST_CL_REGISTER, client->id, 0); ++ ++ pr_debug("%s: client: %p, client_id: %d, tx_qsize: %d, rx_qsize: %d\n", ++ __func__, client, client->id, client->tx_qsize, ++ client->rx_qsize); ++ ++ client->cpu_id = -1; ++ ++ pfe->hif_client[client->id] = client; ++ spin_unlock_bh(&pfe->hif.lock); ++ ++ return 0; ++ ++err: ++ spin_unlock_bh(&pfe->hif.lock); ++ hif_lib_client_release_tx_buffers(client); ++ ++err_tx: ++ hif_lib_client_release_rx_buffers(client); ++ ++err_rx: ++ return err; ++} ++ ++int hif_lib_client_unregister(struct hif_client_s *client) ++{ ++ struct pfe *pfe = client->pfe; ++ u32 client_id = client->id; ++ ++ pr_info( ++ "%s : client: %p, client_id: %d, txQ_depth: %d, rxQ_depth: %d\n" ++ , __func__, client, client->id, client->tx_qsize, ++ client->rx_qsize); ++ ++ spin_lock_bh(&pfe->hif.lock); ++ hif_lib_indicate_hif(&pfe->hif, REQUEST_CL_UNREGISTER, client->id, 0); ++ ++ hif_lib_client_release_tx_buffers(client); ++ hif_lib_client_release_rx_buffers(client); ++ pfe->hif_client[client_id] = NULL; ++ spin_unlock_bh(&pfe->hif.lock); ++ ++ return 0; ++} ++ ++int hif_lib_event_handler_start(struct hif_client_s *client, int event, ++ int qno) ++{ ++ struct hif_client_rx_queue *queue = &client->rx_q[qno]; ++ struct rx_queue_desc *desc = queue->base + queue->read_idx; ++ ++ if ((event >= HIF_EVENT_MAX) || (qno >= HIF_CLIENT_QUEUES_MAX)) { ++ pr_debug("%s: Unsupported event : %d queue number : %d\n", ++ __func__, event, qno); ++ return -1; ++ } ++ ++ test_and_clear_bit(qno, &client->queue_mask[event]); ++ ++ switch (event) { ++ case EVENT_RX_PKT_IND: ++ if (!(desc->ctrl & CL_DESC_OWN)) ++ hif_lib_indicate_client(client->id, ++ EVENT_RX_PKT_IND, qno); ++ break; ++ ++ case EVENT_HIGH_RX_WM: ++ case EVENT_TXDONE_IND: ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ ++/* ++ * This function gets one packet from the specified client queue ++ * It also refill the rx buffer ++ */ ++void *hif_lib_receive_pkt(struct hif_client_s *client, int qno, int *len, int ++ *ofst, unsigned int *rx_ctrl, ++ unsigned int *desc_ctrl, void **priv_data) ++{ ++ struct hif_client_rx_queue *queue = &client->rx_q[qno]; ++ struct rx_queue_desc *desc; ++ void *pkt = NULL; ++ ++ /* ++ * Following lock is to protect rx queue access from, ++ * hif_lib_event_handler_start. ++ * In general below lock is not required, because hif_lib_xmit_pkt and ++ * hif_lib_event_handler_start are called from napi poll and which is ++ * not re-entrant. But if some client use in different way this lock is ++ * required. ++ */ ++ /*spin_lock_irqsave(&client->rx_lock, flags); */ ++ desc = queue->base + queue->read_idx; ++ if (!(desc->ctrl & CL_DESC_OWN)) { ++ pkt = desc->data - pfe_pkt_headroom; ++ ++ *rx_ctrl = desc->client_ctrl; ++ *desc_ctrl = desc->ctrl; ++ ++ if (desc->ctrl & CL_DESC_FIRST) { ++ u16 size = *rx_ctrl >> HIF_CTRL_RX_OFFSET_OFST; ++ ++ if (size) { ++ size += PFE_PARSE_INFO_SIZE; ++ *len = CL_DESC_BUF_LEN(desc->ctrl) - ++ PFE_PKT_HEADER_SZ - size; ++ *ofst = pfe_pkt_headroom + PFE_PKT_HEADER_SZ ++ + size; ++ *priv_data = desc->data + PFE_PKT_HEADER_SZ; ++ } else { ++ *len = CL_DESC_BUF_LEN(desc->ctrl) - ++ PFE_PKT_HEADER_SZ - PFE_PARSE_INFO_SIZE; ++ *ofst = pfe_pkt_headroom ++ + PFE_PKT_HEADER_SZ ++ + PFE_PARSE_INFO_SIZE; ++ *priv_data = NULL; ++ } ++ ++ } else { ++ *len = CL_DESC_BUF_LEN(desc->ctrl); ++ *ofst = pfe_pkt_headroom; ++ } ++ ++ /* ++ * Needed so we don't free a buffer/page ++ * twice on module_exit ++ */ ++ desc->data = NULL; ++ ++ /* ++ * Ensure everything else is written to DDR before ++ * writing bd->ctrl ++ */ ++ smp_wmb(); ++ ++ desc->ctrl = CL_DESC_BUF_LEN(pfe_pkt_size) | CL_DESC_OWN; ++ queue->read_idx = (queue->read_idx + 1) & (queue->size - 1); ++ } ++ ++ /*spin_unlock_irqrestore(&client->rx_lock, flags); */ ++ return pkt; ++} ++ ++static inline void hif_hdr_write(struct hif_hdr *pkt_hdr, unsigned int ++ client_id, unsigned int qno, ++ u32 client_ctrl) ++{ ++ /* Optimize the write since the destinaton may be non-cacheable */ ++ if (!((unsigned long)pkt_hdr & 0x3)) { ++ ((u32 *)pkt_hdr)[0] = (client_ctrl << 16) | (qno << 8) | ++ client_id; ++ } else { ++ ((u16 *)pkt_hdr)[0] = (qno << 8) | (client_id & 0xFF); ++ ((u16 *)pkt_hdr)[1] = (client_ctrl & 0xFFFF); ++ } ++} ++ ++/*This function puts the given packet in the specific client queue */ ++void __hif_lib_xmit_pkt(struct hif_client_s *client, unsigned int qno, void ++ *data, unsigned int len, u32 client_ctrl, ++ unsigned int flags, void *client_data) ++{ ++ struct hif_client_tx_queue *queue = &client->tx_q[qno]; ++ struct tx_queue_desc *desc = queue->base + queue->write_idx; ++ ++ /* First buffer */ ++ if (flags & HIF_FIRST_BUFFER) { ++ data -= sizeof(struct hif_hdr); ++ len += sizeof(struct hif_hdr); ++ ++ hif_hdr_write(data, client->id, qno, client_ctrl); ++ } ++ ++ desc->data = client_data; ++ desc->ctrl = CL_DESC_OWN | CL_DESC_FLAGS(flags); ++ ++ __hif_xmit_pkt(&pfe->hif, client->id, qno, data, len, flags); ++ ++ queue->write_idx = (queue->write_idx + 1) & (queue->size - 1); ++ queue->tx_pending++; ++ queue->jiffies_last_packet = jiffies; ++} ++ ++void *hif_lib_tx_get_next_complete(struct hif_client_s *client, int qno, ++ unsigned int *flags, int count) ++{ ++ struct hif_client_tx_queue *queue = &client->tx_q[qno]; ++ struct tx_queue_desc *desc = queue->base + queue->read_idx; ++ ++ pr_debug("%s: qno : %d rd_indx: %d pending:%d\n", __func__, qno, ++ queue->read_idx, queue->tx_pending); ++ ++ if (!queue->tx_pending) ++ return NULL; ++ ++ if (queue->nocpy_flag && !queue->done_tmu_tx_pkts) { ++ u32 tmu_tx_pkts = be32_to_cpu(pe_dmem_read(TMU0_ID + ++ client->id, TMU_DM_TX_TRANS, 4)); ++ ++ if (queue->prev_tmu_tx_pkts > tmu_tx_pkts) ++ queue->done_tmu_tx_pkts = UINT_MAX - ++ queue->prev_tmu_tx_pkts + tmu_tx_pkts; ++ else ++ queue->done_tmu_tx_pkts = tmu_tx_pkts - ++ queue->prev_tmu_tx_pkts; ++ ++ queue->prev_tmu_tx_pkts = tmu_tx_pkts; ++ ++ if (!queue->done_tmu_tx_pkts) ++ return NULL; ++ } ++ ++ if (desc->ctrl & CL_DESC_OWN) ++ return NULL; ++ ++ queue->read_idx = (queue->read_idx + 1) & (queue->size - 1); ++ queue->tx_pending--; ++ ++ *flags = CL_DESC_GET_FLAGS(desc->ctrl); ++ ++ if (queue->done_tmu_tx_pkts && (*flags & HIF_LAST_BUFFER)) ++ queue->done_tmu_tx_pkts--; ++ ++ return desc->data; ++} ++ ++static void hif_lib_tmu_credit_init(struct pfe *pfe) ++{ ++ int i, q; ++ ++ for (i = 0; i < NUM_GEMAC_SUPPORT; i++) ++ for (q = 0; q < emac_txq_cnt; q++) { ++ pfe->tmu_credit.tx_credit_max[i][q] = (q == 0) ? ++ DEFAULT_Q0_QDEPTH : DEFAULT_MAX_QDEPTH; ++ pfe->tmu_credit.tx_credit[i][q] = ++ pfe->tmu_credit.tx_credit_max[i][q]; ++ } ++} ++ ++/* __hif_lib_update_credit ++ * ++ * @param[in] client hif client context ++ * @param[in] queue queue number in match with TMU ++ */ ++void __hif_lib_update_credit(struct hif_client_s *client, unsigned int queue) ++{ ++ unsigned int tmu_tx_packets, tmp; ++ ++ if (tx_qos) { ++ tmu_tx_packets = be32_to_cpu(pe_dmem_read(TMU0_ID + ++ client->id, (TMU_DM_TX_TRANS + (queue * 4)), 4)); ++ ++ /* tx_packets counter overflowed */ ++ if (tmu_tx_packets > ++ pfe->tmu_credit.tx_packets[client->id][queue]) { ++ tmp = UINT_MAX - tmu_tx_packets + ++ pfe->tmu_credit.tx_packets[client->id][queue]; ++ ++ pfe->tmu_credit.tx_credit[client->id][queue] = ++ pfe->tmu_credit.tx_credit_max[client->id][queue] - tmp; ++ } else { ++ /* TMU tx <= pfe_eth tx, normal case or both OF since ++ * last time ++ */ ++ pfe->tmu_credit.tx_credit[client->id][queue] = ++ pfe->tmu_credit.tx_credit_max[client->id][queue] - ++ (pfe->tmu_credit.tx_packets[client->id][queue] - ++ tmu_tx_packets); ++ } ++ } ++} ++ ++int pfe_hif_lib_init(struct pfe *pfe) ++{ ++ int rc; ++ ++ pr_info("%s\n", __func__); ++ ++ if (lro_mode) { ++ page_mode = 1; ++ pfe_pkt_size = min(PAGE_SIZE, MAX_PFE_PKT_SIZE); ++ pfe_pkt_headroom = 0; ++ } else { ++ page_mode = 0; ++ pfe_pkt_size = PFE_PKT_SIZE; ++ pfe_pkt_headroom = PFE_PKT_HEADROOM; ++ } ++ ++ if (tx_qos) ++ emac_txq_cnt = EMAC_TXQ_CNT / 2; ++ else ++ emac_txq_cnt = EMAC_TXQ_CNT; ++ ++ hif_lib_tmu_credit_init(pfe); ++ pfe->hif.shm = &ghif_shm; ++ rc = pfe_hif_shm_init(pfe->hif.shm); ++ ++ return rc; ++} ++ ++void pfe_hif_lib_exit(struct pfe *pfe) ++{ ++ pr_info("%s\n", __func__); ++ ++ pfe_hif_shm_clean(pfe->hif.shm); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hif_lib.h +@@ -0,0 +1,229 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#ifndef _PFE_HIF_LIB_H_ ++#define _PFE_HIF_LIB_H_ ++ ++#include "pfe_hif.h" ++ ++#define HIF_CL_REQ_TIMEOUT 10 ++#define GFP_DMA_PFE 0 ++#define PFE_PARSE_INFO_SIZE 16 ++ ++enum { ++ REQUEST_CL_REGISTER = 0, ++ REQUEST_CL_UNREGISTER, ++ HIF_REQUEST_MAX ++}; ++ ++enum { ++ /* Event to indicate that client rx queue is reached water mark level */ ++ EVENT_HIGH_RX_WM = 0, ++ /* Event to indicate that, packet received for client */ ++ EVENT_RX_PKT_IND, ++ /* Event to indicate that, packet tx done for client */ ++ EVENT_TXDONE_IND, ++ HIF_EVENT_MAX ++}; ++ ++/*structure to store client queue info */ ++ ++/*structure to store client queue info */ ++struct hif_client_rx_queue { ++ struct rx_queue_desc *base; ++ u32 size; ++ u32 read_idx; ++ u32 write_idx; ++}; ++ ++struct hif_client_tx_queue { ++ struct tx_queue_desc *base; ++ u32 size; ++ u32 read_idx; ++ u32 write_idx; ++ u32 tx_pending; ++ unsigned long jiffies_last_packet; ++ u32 nocpy_flag; ++ u32 prev_tmu_tx_pkts; ++ u32 done_tmu_tx_pkts; ++}; ++ ++struct hif_client_s { ++ int id; ++ int tx_qn; ++ int rx_qn; ++ void *rx_qbase; ++ void *tx_qbase; ++ int tx_qsize; ++ int rx_qsize; ++ int cpu_id; ++ struct hif_client_tx_queue tx_q[HIF_CLIENT_QUEUES_MAX]; ++ struct hif_client_rx_queue rx_q[HIF_CLIENT_QUEUES_MAX]; ++ int (*event_handler)(void *priv, int event, int data); ++ unsigned long queue_mask[HIF_EVENT_MAX]; ++ struct pfe *pfe; ++ void *priv; ++}; ++ ++/* ++ * Client specific shared memory ++ * It contains number of Rx/Tx queues, base addresses and queue sizes ++ */ ++struct hif_client_shm { ++ u32 ctrl; /*0-7: number of Rx queues, 8-15: number of tx queues */ ++ unsigned long rx_qbase; /*Rx queue base address */ ++ u32 rx_qsize; /*each Rx queue size, all Rx queues are of same size */ ++ unsigned long tx_qbase; /* Tx queue base address */ ++ u32 tx_qsize; /*each Tx queue size, all Tx queues are of same size */ ++}; ++ ++/*Client shared memory ctrl bit description */ ++#define CLIENT_CTRL_RX_Q_CNT_OFST 0 ++#define CLIENT_CTRL_TX_Q_CNT_OFST 8 ++#define CLIENT_CTRL_RX_Q_CNT(ctrl) (((ctrl) >> CLIENT_CTRL_RX_Q_CNT_OFST) \ ++ & 0xFF) ++#define CLIENT_CTRL_TX_Q_CNT(ctrl) (((ctrl) >> CLIENT_CTRL_TX_Q_CNT_OFST) \ ++ & 0xFF) ++ ++/* ++ * Shared memory used to communicate between HIF driver and host/client drivers ++ * Before starting the hif driver rx_buf_pool ans rx_buf_pool_cnt should be ++ * initialized with host buffers and buffers count in the pool. ++ * rx_buf_pool_cnt should be >= HIF_RX_DESC_NT. ++ * ++ */ ++struct hif_shm { ++ u32 rx_buf_pool_cnt; /*Number of rx buffers available*/ ++ /*Rx buffers required to initialize HIF rx descriptors */ ++ void *rx_buf_pool[HIF_RX_DESC_NT]; ++ unsigned long g_client_status[2]; /*Global client status bit mask */ ++ /* Client specific shared memory */ ++ struct hif_client_shm client[HIF_CLIENTS_MAX]; ++}; ++ ++#define CL_DESC_OWN BIT(31) ++/* This sets owner ship to HIF driver */ ++#define CL_DESC_LAST BIT(30) ++/* This indicates last packet for multi buffers handling */ ++#define CL_DESC_FIRST BIT(29) ++/* This indicates first packet for multi buffers handling */ ++ ++#define CL_DESC_BUF_LEN(x) ((x) & 0xFFFF) ++#define CL_DESC_FLAGS(x) (((x) & 0xF) << 16) ++#define CL_DESC_GET_FLAGS(x) (((x) >> 16) & 0xF) ++ ++struct rx_queue_desc { ++ void *data; ++ u32 ctrl; /*0-15bit len, 16-20bit flags, 31bit owner*/ ++ u32 client_ctrl; ++}; ++ ++struct tx_queue_desc { ++ void *data; ++ u32 ctrl; /*0-15bit len, 16-20bit flags, 31bit owner*/ ++}; ++ ++/* HIF Rx is not working properly for 2-byte aligned buffers and ++ * ip_header should be 4byte aligned for better iperformance. ++ * "ip_header = 64 + 6(hif_header) + 14 (MAC Header)" will be 4byte aligned. ++ */ ++#define PFE_PKT_HEADER_SZ sizeof(struct hif_hdr) ++/* must be big enough for headroom, pkt size and skb shared info */ ++#define PFE_BUF_SIZE 2048 ++#define PFE_PKT_HEADROOM 128 ++ ++#define SKB_SHARED_INFO_SIZE SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) ++#define PFE_PKT_SIZE (PFE_BUF_SIZE - PFE_PKT_HEADROOM \ ++ - SKB_SHARED_INFO_SIZE) ++#define MAX_L2_HDR_SIZE 14 /* Not correct for VLAN/PPPoE */ ++#define MAX_L3_HDR_SIZE 20 /* Not correct for IPv6 */ ++#define MAX_L4_HDR_SIZE 60 /* TCP with maximum options */ ++#define MAX_HDR_SIZE (MAX_L2_HDR_SIZE + MAX_L3_HDR_SIZE \ ++ + MAX_L4_HDR_SIZE) ++/* Used in page mode to clamp packet size to the maximum supported by the hif ++ *hw interface (<16KiB) ++ */ ++#define MAX_PFE_PKT_SIZE 16380UL ++ ++extern unsigned int pfe_pkt_size; ++extern unsigned int pfe_pkt_headroom; ++extern unsigned int page_mode; ++extern unsigned int lro_mode; ++extern unsigned int tx_qos; ++extern unsigned int emac_txq_cnt; ++ ++int pfe_hif_lib_init(struct pfe *pfe); ++void pfe_hif_lib_exit(struct pfe *pfe); ++int hif_lib_client_register(struct hif_client_s *client); ++int hif_lib_client_unregister(struct hif_client_s *client); ++void __hif_lib_xmit_pkt(struct hif_client_s *client, unsigned int qno, void ++ *data, unsigned int len, u32 client_ctrl, ++ unsigned int flags, void *client_data); ++int hif_lib_xmit_pkt(struct hif_client_s *client, unsigned int qno, void *data, ++ unsigned int len, u32 client_ctrl, void *client_data); ++void hif_lib_indicate_client(int cl_id, int event, int data); ++int hif_lib_event_handler_start(struct hif_client_s *client, int event, int ++ data); ++int hif_lib_tmu_queue_start(struct hif_client_s *client, int qno); ++int hif_lib_tmu_queue_stop(struct hif_client_s *client, int qno); ++void *hif_lib_tx_get_next_complete(struct hif_client_s *client, int qno, ++ unsigned int *flags, int count); ++void *hif_lib_receive_pkt(struct hif_client_s *client, int qno, int *len, int ++ *ofst, unsigned int *rx_ctrl, ++ unsigned int *desc_ctrl, void **priv_data); ++void __hif_lib_update_credit(struct hif_client_s *client, unsigned int queue); ++void hif_lib_set_rx_cpu_affinity(struct hif_client_s *client, int cpu_id); ++void hif_lib_set_tx_queue_nocpy(struct hif_client_s *client, int qno, int ++ enable); ++static inline int hif_lib_tx_avail(struct hif_client_s *client, unsigned int ++ qno) ++{ ++ struct hif_client_tx_queue *queue = &client->tx_q[qno]; ++ ++ return (queue->size - queue->tx_pending); ++} ++ ++static inline int hif_lib_get_tx_wr_index(struct hif_client_s *client, unsigned ++ int qno) ++{ ++ struct hif_client_tx_queue *queue = &client->tx_q[qno]; ++ ++ return queue->write_idx; ++} ++ ++static inline int hif_lib_tx_pending(struct hif_client_s *client, unsigned int ++ qno) ++{ ++ struct hif_client_tx_queue *queue = &client->tx_q[qno]; ++ ++ return queue->tx_pending; ++} ++ ++#define hif_lib_tx_credit_avail(pfe, id, qno) \ ++ ((pfe)->tmu_credit.tx_credit[id][qno]) ++ ++#define hif_lib_tx_credit_max(pfe, id, qno) \ ++ ((pfe)->tmu_credit.tx_credit_max[id][qno]) ++ ++/* ++ * Test comment ++ */ ++#define hif_lib_tx_credit_use(pfe, id, qno, credit) \ ++ ({ typeof(pfe) pfe_ = pfe; \ ++ typeof(id) id_ = id; \ ++ typeof(qno) qno_ = qno; \ ++ typeof(credit) credit_ = credit; \ ++ do { \ ++ if (tx_qos) { \ ++ (pfe_)->tmu_credit.tx_credit[id_][qno_]\ ++ -= credit_; \ ++ (pfe_)->tmu_credit.tx_packets[id_][qno_]\ ++ += credit_; \ ++ } \ ++ } while (0); \ ++ }) ++ ++#endif /* _PFE_HIF_LIB_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hw.c +@@ -0,0 +1,164 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#include "pfe_mod.h" ++#include "pfe_hw.h" ++ ++/* Functions to handle most of pfe hw register initialization */ ++int pfe_hw_init(struct pfe *pfe, int resume) ++{ ++ struct class_cfg class_cfg = { ++ .pe_sys_clk_ratio = PE_SYS_CLK_RATIO, ++ .route_table_baseaddr = pfe->ddr_phys_baseaddr + ++ ROUTE_TABLE_BASEADDR, ++ .route_table_hash_bits = ROUTE_TABLE_HASH_BITS, ++ }; ++ ++ struct tmu_cfg tmu_cfg = { ++ .pe_sys_clk_ratio = PE_SYS_CLK_RATIO, ++ .llm_base_addr = pfe->ddr_phys_baseaddr + TMU_LLM_BASEADDR, ++ .llm_queue_len = TMU_LLM_QUEUE_LEN, ++ }; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ struct util_cfg util_cfg = { ++ .pe_sys_clk_ratio = PE_SYS_CLK_RATIO, ++ }; ++#endif ++ ++ struct BMU_CFG bmu1_cfg = { ++ .baseaddr = CBUS_VIRT_TO_PFE(LMEM_BASE_ADDR + ++ BMU1_LMEM_BASEADDR), ++ .count = BMU1_BUF_COUNT, ++ .size = BMU1_BUF_SIZE, ++ .low_watermark = 10, ++ .high_watermark = 15, ++ }; ++ ++ struct BMU_CFG bmu2_cfg = { ++ .baseaddr = DDR_PHYS_TO_PFE(pfe->ddr_phys_baseaddr + ++ BMU2_DDR_BASEADDR), ++ .count = BMU2_BUF_COUNT, ++ .size = BMU2_BUF_SIZE, ++ .low_watermark = 250, ++ .high_watermark = 253, ++ }; ++ ++ struct gpi_cfg egpi1_cfg = { ++ .lmem_rtry_cnt = EGPI1_LMEM_RTRY_CNT, ++ .tmlf_txthres = EGPI1_TMLF_TXTHRES, ++ .aseq_len = EGPI1_ASEQ_LEN, ++ .mtip_pause_reg = CBUS_VIRT_TO_PFE(EMAC1_BASE_ADDR + ++ EMAC_TCNTRL_REG), ++ }; ++ ++ struct gpi_cfg egpi2_cfg = { ++ .lmem_rtry_cnt = EGPI2_LMEM_RTRY_CNT, ++ .tmlf_txthres = EGPI2_TMLF_TXTHRES, ++ .aseq_len = EGPI2_ASEQ_LEN, ++ .mtip_pause_reg = CBUS_VIRT_TO_PFE(EMAC2_BASE_ADDR + ++ EMAC_TCNTRL_REG), ++ }; ++ ++ struct gpi_cfg hgpi_cfg = { ++ .lmem_rtry_cnt = HGPI_LMEM_RTRY_CNT, ++ .tmlf_txthres = HGPI_TMLF_TXTHRES, ++ .aseq_len = HGPI_ASEQ_LEN, ++ .mtip_pause_reg = 0, ++ }; ++ ++ pr_info("%s\n", __func__); ++ ++#if !defined(LS1012A_PFE_RESET_WA) ++ /* LS1012A needs this to make PE work correctly */ ++ writel(0x3, CLASS_PE_SYS_CLK_RATIO); ++ writel(0x3, TMU_PE_SYS_CLK_RATIO); ++ writel(0x3, UTIL_PE_SYS_CLK_RATIO); ++ usleep_range(10, 20); ++#endif ++ ++ pr_info("CLASS version: %x\n", readl(CLASS_VERSION)); ++ pr_info("TMU version: %x\n", readl(TMU_VERSION)); ++ ++ pr_info("BMU1 version: %x\n", readl(BMU1_BASE_ADDR + ++ BMU_VERSION)); ++ pr_info("BMU2 version: %x\n", readl(BMU2_BASE_ADDR + ++ BMU_VERSION)); ++ ++ pr_info("EGPI1 version: %x\n", readl(EGPI1_BASE_ADDR + ++ GPI_VERSION)); ++ pr_info("EGPI2 version: %x\n", readl(EGPI2_BASE_ADDR + ++ GPI_VERSION)); ++ pr_info("HGPI version: %x\n", readl(HGPI_BASE_ADDR + ++ GPI_VERSION)); ++ ++ pr_info("HIF version: %x\n", readl(HIF_VERSION)); ++ pr_info("HIF NOPCY version: %x\n", readl(HIF_NOCPY_VERSION)); ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ pr_info("UTIL version: %x\n", readl(UTIL_VERSION)); ++#endif ++ while (!(readl(TMU_CTRL) & ECC_MEM_INIT_DONE)) ++ ; ++ ++ hif_rx_disable(); ++ hif_tx_disable(); ++ ++ bmu_init(BMU1_BASE_ADDR, &bmu1_cfg); ++ ++ pr_info("bmu_init(1) done\n"); ++ ++ bmu_init(BMU2_BASE_ADDR, &bmu2_cfg); ++ ++ pr_info("bmu_init(2) done\n"); ++ ++ class_cfg.resume = resume ? 1 : 0; ++ ++ class_init(&class_cfg); ++ ++ pr_info("class_init() done\n"); ++ ++ tmu_init(&tmu_cfg); ++ ++ pr_info("tmu_init() done\n"); ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ util_init(&util_cfg); ++ ++ pr_info("util_init() done\n"); ++#endif ++ gpi_init(EGPI1_BASE_ADDR, &egpi1_cfg); ++ ++ pr_info("gpi_init(1) done\n"); ++ ++ gpi_init(EGPI2_BASE_ADDR, &egpi2_cfg); ++ ++ pr_info("gpi_init(2) done\n"); ++ ++ gpi_init(HGPI_BASE_ADDR, &hgpi_cfg); ++ ++ pr_info("gpi_init(hif) done\n"); ++ ++ bmu_enable(BMU1_BASE_ADDR); ++ ++ pr_info("bmu_enable(1) done\n"); ++ ++ bmu_enable(BMU2_BASE_ADDR); ++ ++ pr_info("bmu_enable(2) done\n"); ++ ++ return 0; ++} ++ ++void pfe_hw_exit(struct pfe *pfe) ++{ ++ pr_info("%s\n", __func__); ++ ++ bmu_disable(BMU1_BASE_ADDR); ++ bmu_reset(BMU1_BASE_ADDR); ++ ++ bmu_disable(BMU2_BASE_ADDR); ++ bmu_reset(BMU2_BASE_ADDR); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hw.h +@@ -0,0 +1,15 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#ifndef _PFE_HW_H_ ++#define _PFE_HW_H_ ++ ++#define PE_SYS_CLK_RATIO 1 /* SYS/AXI = 250MHz, HFE = 500MHz */ ++ ++int pfe_hw_init(struct pfe *pfe, int resume); ++void pfe_hw_exit(struct pfe *pfe); ++ ++#endif /* _PFE_HW_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c +@@ -0,0 +1,383 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "pfe_mod.h" ++ ++extern bool pfe_use_old_dts_phy; ++struct ls1012a_pfe_platform_data pfe_platform_data; ++ ++static int pfe_get_gemac_if_properties(struct device_node *gem, ++ int port, ++ struct ls1012a_pfe_platform_data *pdata) ++{ ++ struct device_node *phy_node = NULL; ++ int size; ++ int phy_id = 0; ++ const u32 *addr; ++ int err; ++ ++ addr = of_get_property(gem, "reg", &size); ++ if (addr) ++ port = be32_to_cpup(addr); ++ else ++ goto err; ++ ++ pdata->ls1012a_eth_pdata[port].gem_id = port; ++ ++ err = of_get_mac_address(gem, pdata->ls1012a_eth_pdata[port].mac_addr); ++ ++ phy_node = of_parse_phandle(gem, "phy-handle", 0); ++ pdata->ls1012a_eth_pdata[port].phy_node = phy_node; ++ if (phy_node) { ++ pfe_use_old_dts_phy = false; ++ goto process_phynode; ++ } else if (of_phy_is_fixed_link(gem)) { ++ pfe_use_old_dts_phy = false; ++ if (of_phy_register_fixed_link(gem) < 0) { ++ pr_err("broken fixed-link specification\n"); ++ goto err; ++ } ++ phy_node = of_node_get(gem); ++ pdata->ls1012a_eth_pdata[port].phy_node = phy_node; ++ } else if (of_get_property(gem, "fsl,pfe-phy-if-flags", &size)) { ++ pfe_use_old_dts_phy = true; ++ /* Use old dts properties for phy handling */ ++ addr = of_get_property(gem, "fsl,pfe-phy-if-flags", &size); ++ pdata->ls1012a_eth_pdata[port].phy_flags = be32_to_cpup(addr); ++ ++ addr = of_get_property(gem, "fsl,gemac-phy-id", &size); ++ if (!addr) { ++ pr_err("%s:%d Invalid gemac-phy-id....\n", __func__, ++ __LINE__); ++ } else { ++ phy_id = be32_to_cpup(addr); ++ pdata->ls1012a_eth_pdata[port].phy_id = phy_id; ++ pdata->ls1012a_mdio_pdata[0].phy_mask &= ~(1 << phy_id); ++ } ++ ++ /* If PHY is enabled, read mdio properties */ ++ if (pdata->ls1012a_eth_pdata[port].phy_flags & GEMAC_NO_PHY) ++ goto done; ++ ++ } else { ++ pr_info("%s: No PHY or fixed-link\n", __func__); ++ return 0; ++ } ++ ++process_phynode: ++ err = of_get_phy_mode(gem, &pdata->ls1012a_eth_pdata[port].mii_config); ++ if (err) ++ pr_err("%s:%d Incorrect Phy mode....\n", __func__, ++ __LINE__); ++ ++ addr = of_get_property(gem, "fsl,mdio-mux-val", &size); ++ if (!addr) { ++ pr_err("%s: Invalid mdio-mux-val....\n", __func__); ++ } else { ++ phy_id = be32_to_cpup(addr); ++ pdata->ls1012a_eth_pdata[port].mdio_muxval = phy_id; ++ } ++ ++ if (pdata->ls1012a_eth_pdata[port].phy_id < 32) ++ pfe->mdio_muxval[pdata->ls1012a_eth_pdata[port].phy_id] = ++ pdata->ls1012a_eth_pdata[port].mdio_muxval; ++ ++ ++ pdata->ls1012a_mdio_pdata[port].irq[0] = PHY_POLL; ++ ++done: ++ return 0; ++ ++err: ++ return -1; ++} ++ ++/* ++ * ++ * pfe_platform_probe - ++ * ++ * ++ */ ++static int pfe_platform_probe(struct platform_device *pdev) ++{ ++ struct resource res; ++ int ii = 0, rc, interface_count = 0, size = 0; ++ const u32 *prop; ++ struct device_node *np, *gem = NULL; ++ struct clk *pfe_clk; ++ ++ np = pdev->dev.of_node; ++ ++ if (!np) { ++ pr_err("Invalid device node\n"); ++ return -EINVAL; ++ } ++ ++ pfe = kzalloc(sizeof(*pfe), GFP_KERNEL); ++ if (!pfe) { ++ rc = -ENOMEM; ++ goto err_alloc; ++ } ++ ++ platform_set_drvdata(pdev, pfe); ++ ++ if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) { ++ rc = -ENOMEM; ++ pr_err("unable to configure DMA mask.\n"); ++ goto err_ddr; ++ } ++ ++ if (of_address_to_resource(np, 1, &res)) { ++ rc = -ENOMEM; ++ pr_err("failed to get ddr resource\n"); ++ goto err_ddr; ++ } ++ ++ pfe->ddr_phys_baseaddr = res.start; ++ pfe->ddr_size = resource_size(&res); ++ ++ pfe->ddr_baseaddr = memremap(res.start, resource_size(&res), ++ MEMREMAP_WB); ++ if (!pfe->ddr_baseaddr) { ++ pr_err("memremap() ddr failed\n"); ++ rc = -ENOMEM; ++ goto err_ddr; ++ } ++ ++ pfe->scfg = ++ syscon_regmap_lookup_by_phandle(pdev->dev.of_node, ++ "fsl,pfe-scfg"); ++ if (IS_ERR(pfe->scfg)) { ++ dev_err(&pdev->dev, "No syscfg phandle specified\n"); ++ return PTR_ERR(pfe->scfg); ++ } ++ ++ pfe->cbus_baseaddr = of_iomap(np, 0); ++ if (!pfe->cbus_baseaddr) { ++ rc = -ENOMEM; ++ pr_err("failed to get axi resource\n"); ++ goto err_axi; ++ } ++ ++ pfe->hif_irq = platform_get_irq(pdev, 0); ++ if (pfe->hif_irq < 0) { ++ pr_err("platform_get_irq for hif failed\n"); ++ rc = pfe->hif_irq; ++ goto err_hif_irq; ++ } ++ ++ pfe->wol_irq = platform_get_irq(pdev, 2); ++ if (pfe->wol_irq < 0) { ++ pr_err("platform_get_irq for WoL failed\n"); ++ rc = pfe->wol_irq; ++ goto err_hif_irq; ++ } ++ ++ /* Read interface count */ ++ prop = of_get_property(np, "fsl,pfe-num-interfaces", &size); ++ if (!prop) { ++ pr_err("Failed to read number of interfaces\n"); ++ rc = -ENXIO; ++ goto err_prop; ++ } ++ ++ interface_count = be32_to_cpup(prop); ++ if (interface_count <= 0) { ++ pr_err("No ethernet interface count : %d\n", ++ interface_count); ++ rc = -ENXIO; ++ goto err_prop; ++ } ++ ++ pfe_platform_data.ls1012a_mdio_pdata[0].phy_mask = 0xffffffff; ++ ++ while ((gem = of_get_next_child(np, gem))) { ++ if (of_find_property(gem, "reg", &size)) { ++ pfe_get_gemac_if_properties(gem, ii, ++ &pfe_platform_data); ++ ii++; ++ } ++ } ++ ++ if (interface_count != ii) ++ pr_info("missing some of gemac interface properties.\n"); ++ ++ pfe->dev = &pdev->dev; ++ ++ pfe->dev->platform_data = &pfe_platform_data; ++ ++ /* declare WoL capabilities */ ++ device_init_wakeup(&pdev->dev, true); ++ ++ /* find the clocks */ ++ pfe_clk = devm_clk_get(pfe->dev, "pfe"); ++ if (IS_ERR(pfe_clk)) ++ return PTR_ERR(pfe_clk); ++ ++ /* PFE clock is (platform clock / 2) */ ++ /* save sys_clk value as KHz */ ++ pfe->ctrl.sys_clk = clk_get_rate(pfe_clk) / (2 * 1000); ++ ++ rc = pfe_probe(pfe); ++ if (rc < 0) ++ goto err_probe; ++ ++ return 0; ++ ++err_probe: ++err_prop: ++err_hif_irq: ++ iounmap(pfe->cbus_baseaddr); ++ ++err_axi: ++ memunmap(pfe->ddr_baseaddr); ++ ++err_ddr: ++ platform_set_drvdata(pdev, NULL); ++ ++ kfree(pfe); ++ ++err_alloc: ++ return rc; ++} ++ ++/* ++ * pfe_platform_remove - ++ */ ++static int pfe_platform_remove(struct platform_device *pdev) ++{ ++ struct pfe *pfe = platform_get_drvdata(pdev); ++ int rc; ++ ++ pr_info("%s\n", __func__); ++ ++ rc = pfe_remove(pfe); ++ ++ iounmap(pfe->cbus_baseaddr); ++ ++ memunmap(pfe->ddr_baseaddr); ++ ++ platform_set_drvdata(pdev, NULL); ++ ++ kfree(pfe); ++ ++ return rc; ++} ++ ++#ifdef CONFIG_PM ++#ifdef CONFIG_PM_SLEEP ++int pfe_platform_suspend(struct device *dev) ++{ ++ struct pfe *pfe = platform_get_drvdata(to_platform_device(dev)); ++ struct net_device *netdev; ++ int i; ++ ++ pfe->wake = 0; ++ ++ for (i = 0; i < (NUM_GEMAC_SUPPORT); i++) { ++ netdev = pfe->eth.eth_priv[i]->ndev; ++ ++ netif_device_detach(netdev); ++ ++ if (netif_running(netdev)) ++ if (pfe_eth_suspend(netdev)) ++ pfe->wake = 1; ++ } ++ ++ /* Shutdown PFE only if we're not waking up the system */ ++ if (!pfe->wake) { ++#if defined(LS1012A_PFE_RESET_WA) ++ pfe_hif_rx_idle(&pfe->hif); ++#endif ++ pfe_ctrl_suspend(&pfe->ctrl); ++ pfe_firmware_exit(pfe); ++ ++ pfe_hif_exit(pfe); ++ pfe_hif_lib_exit(pfe); ++ ++ pfe_hw_exit(pfe); ++ } ++ ++ return 0; ++} ++ ++static int pfe_platform_resume(struct device *dev) ++{ ++ struct pfe *pfe = platform_get_drvdata(to_platform_device(dev)); ++ struct net_device *netdev; ++ int i; ++ ++ if (!pfe->wake) { ++ pfe_hw_init(pfe, 1); ++ pfe_hif_lib_init(pfe); ++ pfe_hif_init(pfe); ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ util_enable(); ++#endif ++ tmu_enable(0xf); ++ class_enable(); ++ pfe_ctrl_resume(&pfe->ctrl); ++ } ++ ++ for (i = 0; i < (NUM_GEMAC_SUPPORT); i++) { ++ netdev = pfe->eth.eth_priv[i]->ndev; ++ ++ if (pfe->mdio.mdio_priv[i]->mii_bus) ++ pfe_eth_mdio_reset(pfe->mdio.mdio_priv[i]->mii_bus); ++ ++ if (netif_running(netdev)) ++ pfe_eth_resume(netdev); ++ ++ netif_device_attach(netdev); ++ } ++ return 0; ++} ++#else ++#define pfe_platform_suspend NULL ++#define pfe_platform_resume NULL ++#endif ++ ++static const struct dev_pm_ops pfe_platform_pm_ops = { ++ SET_SYSTEM_SLEEP_PM_OPS(pfe_platform_suspend, pfe_platform_resume) ++}; ++#endif ++ ++static const struct of_device_id pfe_match[] = { ++ { ++ .compatible = "fsl,pfe", ++ }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, pfe_match); ++ ++static struct platform_driver pfe_platform_driver = { ++ .probe = pfe_platform_probe, ++ .remove = pfe_platform_remove, ++ .driver = { ++ .name = "pfe", ++ .of_match_table = pfe_match, ++#ifdef CONFIG_PM ++ .pm = &pfe_platform_pm_ops, ++#endif ++ }, ++}; ++ ++module_platform_driver(pfe_platform_driver); ++MODULE_LICENSE("GPL"); ++MODULE_DESCRIPTION("PFE Ethernet driver"); ++MODULE_AUTHOR("NXP DNCPE"); +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_mod.c +@@ -0,0 +1,158 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#include ++#include "pfe_mod.h" ++#include "pfe_cdev.h" ++ ++unsigned int us; ++module_param(us, uint, 0444); ++MODULE_PARM_DESC(us, "0: module enabled for kernel networking (DEFAULT)\n" ++ "1: module enabled for userspace networking\n"); ++struct pfe *pfe; ++ ++/* ++ * pfe_probe - ++ */ ++int pfe_probe(struct pfe *pfe) ++{ ++ int rc; ++ ++ if (pfe->ddr_size < DDR_MAX_SIZE) { ++ pr_err("%s: required DDR memory (%x) above platform ddr memory (%x)\n", ++ __func__, (unsigned int)DDR_MAX_SIZE, pfe->ddr_size); ++ rc = -ENOMEM; ++ goto err_hw; ++ } ++ ++ if (((int)(pfe->ddr_phys_baseaddr + BMU2_DDR_BASEADDR) & ++ (8 * SZ_1M - 1)) != 0) { ++ pr_err("%s: BMU2 base address (0x%x) must be aligned on 8MB boundary\n", ++ __func__, (int)pfe->ddr_phys_baseaddr + ++ BMU2_DDR_BASEADDR); ++ rc = -ENOMEM; ++ goto err_hw; ++ } ++ ++ pr_info("cbus_baseaddr: %lx, ddr_baseaddr: %lx, ddr_phys_baseaddr: %lx, ddr_size: %x\n", ++ (unsigned long)pfe->cbus_baseaddr, ++ (unsigned long)pfe->ddr_baseaddr, ++ pfe->ddr_phys_baseaddr, pfe->ddr_size); ++ ++ pfe_lib_init(pfe->cbus_baseaddr, pfe->ddr_baseaddr, ++ pfe->ddr_phys_baseaddr, pfe->ddr_size); ++ ++ rc = pfe_hw_init(pfe, 0); ++ if (rc < 0) ++ goto err_hw; ++ ++ if (us) ++ goto firmware_init; ++ ++ rc = pfe_hif_lib_init(pfe); ++ if (rc < 0) ++ goto err_hif_lib; ++ ++ rc = pfe_hif_init(pfe); ++ if (rc < 0) ++ goto err_hif; ++ ++firmware_init: ++ rc = pfe_firmware_init(pfe); ++ if (rc < 0) ++ goto err_firmware; ++ ++ rc = pfe_ctrl_init(pfe); ++ if (rc < 0) ++ goto err_ctrl; ++ ++ rc = pfe_eth_init(pfe); ++ if (rc < 0) ++ goto err_eth; ++ ++ rc = pfe_sysfs_init(pfe); ++ if (rc < 0) ++ goto err_sysfs; ++ ++ rc = pfe_debugfs_init(pfe); ++ if (rc < 0) ++ goto err_debugfs; ++ ++ if (us) { ++ /* Creating a character device */ ++ rc = pfe_cdev_init(); ++ if (rc < 0) ++ goto err_cdev; ++ } ++ ++ return 0; ++ ++err_cdev: ++ pfe_debugfs_exit(pfe); ++ ++err_debugfs: ++ pfe_sysfs_exit(pfe); ++ ++err_sysfs: ++ pfe_eth_exit(pfe); ++ ++err_eth: ++ pfe_ctrl_exit(pfe); ++ ++err_ctrl: ++ pfe_firmware_exit(pfe); ++ ++err_firmware: ++ if (us) ++ goto err_hif_lib; ++ ++ pfe_hif_exit(pfe); ++ ++err_hif: ++ pfe_hif_lib_exit(pfe); ++ ++err_hif_lib: ++ pfe_hw_exit(pfe); ++ ++err_hw: ++ return rc; ++} ++ ++/* ++ * pfe_remove - ++ */ ++int pfe_remove(struct pfe *pfe) ++{ ++ pr_info("%s\n", __func__); ++ ++ if (us) ++ pfe_cdev_exit(); ++ ++ pfe_debugfs_exit(pfe); ++ ++ pfe_sysfs_exit(pfe); ++ ++ pfe_eth_exit(pfe); ++ ++ pfe_ctrl_exit(pfe); ++ ++#if defined(LS1012A_PFE_RESET_WA) ++ pfe_hif_rx_idle(&pfe->hif); ++#endif ++ pfe_firmware_exit(pfe); ++ ++ if (us) ++ goto hw_exit; ++ ++ pfe_hif_exit(pfe); ++ ++ pfe_hif_lib_exit(pfe); ++ ++hw_exit: ++ pfe_hw_exit(pfe); ++ ++ return 0; ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_mod.h +@@ -0,0 +1,103 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#ifndef _PFE_MOD_H_ ++#define _PFE_MOD_H_ ++ ++#include ++#include ++ ++extern unsigned int us; ++ ++struct pfe; ++ ++#include "pfe_hw.h" ++#include "pfe_firmware.h" ++#include "pfe_ctrl.h" ++#include "pfe_hif.h" ++#include "pfe_hif_lib.h" ++#include "pfe_eth.h" ++#include "pfe_sysfs.h" ++#include "pfe_perfmon.h" ++#include "pfe_debugfs.h" ++ ++#define PHYID_MAX_VAL 32 ++ ++struct pfe_tmu_credit { ++ /* Number of allowed TX packet in-flight, matches TMU queue size */ ++ unsigned int tx_credit[NUM_GEMAC_SUPPORT][EMAC_TXQ_CNT]; ++ unsigned int tx_credit_max[NUM_GEMAC_SUPPORT][EMAC_TXQ_CNT]; ++ unsigned int tx_packets[NUM_GEMAC_SUPPORT][EMAC_TXQ_CNT]; ++}; ++ ++struct pfe { ++ struct regmap *scfg; ++ unsigned long ddr_phys_baseaddr; ++ void *ddr_baseaddr; ++ unsigned int ddr_size; ++ void *cbus_baseaddr; ++ void *apb_baseaddr; ++ unsigned long iram_phys_baseaddr; ++ void *iram_baseaddr; ++ unsigned long ipsec_phys_baseaddr; ++ void *ipsec_baseaddr; ++ int hif_irq; ++ int wol_irq; ++ int hif_client_irq; ++ struct device *dev; ++ struct dentry *dentry; ++ struct pfe_ctrl ctrl; ++ struct pfe_hif hif; ++ struct pfe_eth eth; ++ struct pfe_mdio mdio; ++ struct hif_client_s *hif_client[HIF_CLIENTS_MAX]; ++#if defined(CFG_DIAGS) ++ struct pfe_diags diags; ++#endif ++ struct pfe_tmu_credit tmu_credit; ++ struct pfe_cpumon cpumon; ++ struct pfe_memmon memmon; ++ int wake; ++ int mdio_muxval[PHYID_MAX_VAL]; ++ struct clk *hfe_clock; ++}; ++ ++extern struct pfe *pfe; ++ ++int pfe_probe(struct pfe *pfe); ++int pfe_remove(struct pfe *pfe); ++ ++/* DDR Mapping in reserved memory*/ ++#define ROUTE_TABLE_BASEADDR 0 ++#define ROUTE_TABLE_HASH_BITS 15 /* 32K entries */ ++#define ROUTE_TABLE_SIZE ((1 << ROUTE_TABLE_HASH_BITS) \ ++ * CLASS_ROUTE_SIZE) ++#define BMU2_DDR_BASEADDR (ROUTE_TABLE_BASEADDR + ROUTE_TABLE_SIZE) ++#define BMU2_BUF_COUNT (4096 - 256) ++/* This is to get a total DDR size of 12MiB */ ++#define BMU2_DDR_SIZE (DDR_BUF_SIZE * BMU2_BUF_COUNT) ++#define UTIL_CODE_BASEADDR (BMU2_DDR_BASEADDR + BMU2_DDR_SIZE) ++#define UTIL_CODE_SIZE (128 * SZ_1K) ++#define UTIL_DDR_DATA_BASEADDR (UTIL_CODE_BASEADDR + UTIL_CODE_SIZE) ++#define UTIL_DDR_DATA_SIZE (64 * SZ_1K) ++#define CLASS_DDR_DATA_BASEADDR (UTIL_DDR_DATA_BASEADDR + UTIL_DDR_DATA_SIZE) ++#define CLASS_DDR_DATA_SIZE (32 * SZ_1K) ++#define TMU_DDR_DATA_BASEADDR (CLASS_DDR_DATA_BASEADDR + CLASS_DDR_DATA_SIZE) ++#define TMU_DDR_DATA_SIZE (32 * SZ_1K) ++#define TMU_LLM_BASEADDR (TMU_DDR_DATA_BASEADDR + TMU_DDR_DATA_SIZE) ++#define TMU_LLM_QUEUE_LEN (8 * 512) ++/* Must be power of two and at least 16 * 8 = 128 bytes */ ++#define TMU_LLM_SIZE (4 * 16 * TMU_LLM_QUEUE_LEN) ++/* (4 TMU's x 16 queues x queue_len) */ ++ ++#define DDR_MAX_SIZE (TMU_LLM_BASEADDR + TMU_LLM_SIZE) ++ ++/* LMEM Mapping */ ++#define BMU1_LMEM_BASEADDR 0 ++#define BMU1_BUF_COUNT 256 ++#define BMU1_LMEM_SIZE (LMEM_BUF_SIZE * BMU1_BUF_COUNT) ++ ++#endif /* _PFE_MOD_H */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_perfmon.h +@@ -0,0 +1,26 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#ifndef _PFE_PERFMON_H_ ++#define _PFE_PERFMON_H_ ++ ++#include "pfe/pfe.h" ++ ++#define CT_CPUMON_INTERVAL (1 * TIMER_TICKS_PER_SEC) ++ ++struct pfe_cpumon { ++ u32 cpu_usage_pct[MAX_PE]; ++ u32 class_usage_pct; ++}; ++ ++struct pfe_memmon { ++ u32 kernel_memory_allocated; ++}; ++ ++int pfe_perfmon_init(struct pfe *pfe); ++void pfe_perfmon_exit(struct pfe *pfe); ++ ++#endif /* _PFE_PERFMON_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_sysfs.c +@@ -0,0 +1,840 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#include ++#include ++ ++#include "pfe_mod.h" ++ ++#define PE_EXCEPTION_DUMP_ADDRESS 0x1fa8 ++#define NUM_QUEUES 16 ++ ++static char register_name[20][5] = { ++ "EPC", "ECAS", "EID", "ED", ++ "r0", "r1", "r2", "r3", ++ "r4", "r5", "r6", "r7", ++ "r8", "r9", "r10", "r11", ++ "r12", "r13", "r14", "r15", ++}; ++ ++static char exception_name[14][20] = { ++ "Reset", ++ "HardwareFailure", ++ "NMI", ++ "InstBreakpoint", ++ "DataBreakpoint", ++ "Unsupported", ++ "PrivilegeViolation", ++ "InstBusError", ++ "DataBusError", ++ "AlignmentError", ++ "ArithmeticError", ++ "SystemCall", ++ "MemoryManagement", ++ "Interrupt", ++}; ++ ++static unsigned long class_do_clear; ++static unsigned long tmu_do_clear; ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++static unsigned long util_do_clear; ++#endif ++ ++static ssize_t display_pe_status(char *buf, int id, u32 dmem_addr, unsigned long ++ do_clear) ++{ ++ ssize_t len = 0; ++ u32 val; ++ char statebuf[5]; ++ struct pfe_cpumon *cpumon = &pfe->cpumon; ++ u32 debug_indicator; ++ u32 debug[20]; ++ ++ if (id < CLASS0_ID || id >= MAX_PE) ++ return len; ++ ++ *(u32 *)statebuf = pe_dmem_read(id, dmem_addr, 4); ++ dmem_addr += 4; ++ ++ statebuf[4] = '\0'; ++ len += sprintf(buf + len, "state=%4s ", statebuf); ++ ++ val = pe_dmem_read(id, dmem_addr, 4); ++ dmem_addr += 4; ++ len += sprintf(buf + len, "ctr=%08x ", cpu_to_be32(val)); ++ ++ val = pe_dmem_read(id, dmem_addr, 4); ++ if (do_clear && val) ++ pe_dmem_write(id, 0, dmem_addr, 4); ++ dmem_addr += 4; ++ len += sprintf(buf + len, "rx=%u ", cpu_to_be32(val)); ++ ++ val = pe_dmem_read(id, dmem_addr, 4); ++ if (do_clear && val) ++ pe_dmem_write(id, 0, dmem_addr, 4); ++ dmem_addr += 4; ++ if (id >= TMU0_ID && id <= TMU_MAX_ID) ++ len += sprintf(buf + len, "qstatus=%x", cpu_to_be32(val)); ++ else ++ len += sprintf(buf + len, "tx=%u", cpu_to_be32(val)); ++ ++ val = pe_dmem_read(id, dmem_addr, 4); ++ if (do_clear && val) ++ pe_dmem_write(id, 0, dmem_addr, 4); ++ dmem_addr += 4; ++ if (val) ++ len += sprintf(buf + len, " drop=%u", cpu_to_be32(val)); ++ ++ len += sprintf(buf + len, " load=%d%%", cpumon->cpu_usage_pct[id]); ++ ++ len += sprintf(buf + len, "\n"); ++ ++ debug_indicator = pe_dmem_read(id, dmem_addr, 4); ++ dmem_addr += 4; ++ if (!strncmp((char *)&debug_indicator, "DBUG", 4)) { ++ int j, last = 0; ++ ++ for (j = 0; j < 16; j++) { ++ debug[j] = pe_dmem_read(id, dmem_addr, 4); ++ if (debug[j]) { ++ if (do_clear) ++ pe_dmem_write(id, 0, dmem_addr, 4); ++ last = j + 1; ++ } ++ dmem_addr += 4; ++ } ++ for (j = 0; j < last; j++) { ++ len += sprintf(buf + len, "%08x%s", ++ cpu_to_be32(debug[j]), ++ (j & 0x7) == 0x7 || j == last - 1 ? "\n" : " "); ++ } ++ } ++ ++ if (!strncmp(statebuf, "DEAD", 4)) { ++ u32 i, dump = PE_EXCEPTION_DUMP_ADDRESS; ++ ++ len += sprintf(buf + len, "Exception details:\n"); ++ for (i = 0; i < 20; i++) { ++ debug[i] = pe_dmem_read(id, dump, 4); ++ dump += 4; ++ if (i == 2) ++ len += sprintf(buf + len, "%4s = %08x (=%s) ", ++ register_name[i], cpu_to_be32(debug[i]), ++ exception_name[min((u32) ++ cpu_to_be32(debug[i]), (u32)13)]); ++ else ++ len += sprintf(buf + len, "%4s = %08x%s", ++ register_name[i], cpu_to_be32(debug[i]), ++ (i & 0x3) == 0x3 || i == 19 ? "\n" : " "); ++ } ++ } ++ ++ return len; ++} ++ ++static ssize_t class_phy_stats(char *buf, int phy) ++{ ++ ssize_t len = 0; ++ int off1 = phy * 0x28; ++ int off2 = phy * 0x10; ++ ++ if (phy == 3) ++ off1 = CLASS_PHY4_RX_PKTS - CLASS_PHY1_RX_PKTS; ++ ++ len += sprintf(buf + len, "phy: %d\n", phy); ++ len += sprintf(buf + len, ++ " rx: %10u, tx: %10u, intf: %10u, ipv4: %10u, ipv6: %10u\n", ++ readl(CLASS_PHY1_RX_PKTS + off1), ++ readl(CLASS_PHY1_TX_PKTS + off1), ++ readl(CLASS_PHY1_INTF_MATCH_PKTS + off1), ++ readl(CLASS_PHY1_V4_PKTS + off1), ++ readl(CLASS_PHY1_V6_PKTS + off1)); ++ ++ len += sprintf(buf + len, ++ " icmp: %10u, igmp: %10u, tcp: %10u, udp: %10u\n", ++ readl(CLASS_PHY1_ICMP_PKTS + off2), ++ readl(CLASS_PHY1_IGMP_PKTS + off2), ++ readl(CLASS_PHY1_TCP_PKTS + off2), ++ readl(CLASS_PHY1_UDP_PKTS + off2)); ++ ++ len += sprintf(buf + len, " err\n"); ++ len += sprintf(buf + len, ++ " lp: %10u, intf: %10u, l3: %10u, chcksum: %10u, ttl: %10u\n", ++ readl(CLASS_PHY1_LP_FAIL_PKTS + off1), ++ readl(CLASS_PHY1_INTF_FAIL_PKTS + off1), ++ readl(CLASS_PHY1_L3_FAIL_PKTS + off1), ++ readl(CLASS_PHY1_CHKSUM_ERR_PKTS + off1), ++ readl(CLASS_PHY1_TTL_ERR_PKTS + off1)); ++ ++ return len; ++} ++ ++/* qm_read_drop_stat ++ * This function is used to read the drop statistics from the TMU ++ * hw drop counter. Since the hw counter is always cleared afer ++ * reading, this function maintains the previous drop count, and ++ * adds the new value to it. That value can be retrieved by ++ * passing a pointer to it with the total_drops arg. ++ * ++ * @param tmu TMU number (0 - 3) ++ * @param queue queue number (0 - 15) ++ * @param total_drops pointer to location to store total drops (or NULL) ++ * @param do_reset if TRUE, clear total drops after updating ++ */ ++u32 qm_read_drop_stat(u32 tmu, u32 queue, u32 *total_drops, int do_reset) ++{ ++ static u32 qtotal[TMU_MAX_ID + 1][NUM_QUEUES]; ++ u32 val; ++ ++ writel((tmu << 8) | queue, TMU_TEQ_CTRL); ++ writel((tmu << 8) | queue, TMU_LLM_CTRL); ++ val = readl(TMU_TEQ_DROP_STAT); ++ qtotal[tmu][queue] += val; ++ if (total_drops) ++ *total_drops = qtotal[tmu][queue]; ++ if (do_reset) ++ qtotal[tmu][queue] = 0; ++ return val; ++} ++ ++static ssize_t tmu_queue_stats(char *buf, int tmu, int queue) ++{ ++ ssize_t len = 0; ++ u32 drops; ++ ++ len += sprintf(buf + len, "%d-%02d, ", tmu, queue); ++ ++ drops = qm_read_drop_stat(tmu, queue, NULL, 0); ++ ++ /* Select queue */ ++ writel((tmu << 8) | queue, TMU_TEQ_CTRL); ++ writel((tmu << 8) | queue, TMU_LLM_CTRL); ++ ++ len += sprintf(buf + len, ++ "(teq) drop: %10u, tx: %10u (llm) head: %08x, tail: %08x, drop: %10u\n", ++ drops, readl(TMU_TEQ_TRANS_STAT), ++ readl(TMU_LLM_QUE_HEADPTR), readl(TMU_LLM_QUE_TAILPTR), ++ readl(TMU_LLM_QUE_DROPCNT)); ++ ++ return len; ++} ++ ++static ssize_t tmu_queues(char *buf, int tmu) ++{ ++ ssize_t len = 0; ++ int queue; ++ ++ for (queue = 0; queue < 16; queue++) ++ len += tmu_queue_stats(buf + len, tmu, queue); ++ ++ return len; ++} ++ ++static ssize_t block_version(char *buf, void *addr) ++{ ++ ssize_t len = 0; ++ u32 val; ++ ++ val = readl(addr); ++ len += sprintf(buf + len, "revision: %x, version: %x, id: %x\n", ++ (val >> 24) & 0xff, (val >> 16) & 0xff, val & 0xffff); ++ ++ return len; ++} ++ ++static ssize_t bmu(char *buf, int id, void *base) ++{ ++ ssize_t len = 0; ++ ++ len += sprintf(buf + len, "%s: %d\n ", __func__, id); ++ ++ len += block_version(buf + len, base + BMU_VERSION); ++ ++ len += sprintf(buf + len, " buf size: %x\n", (1 << readl(base + ++ BMU_BUF_SIZE))); ++ len += sprintf(buf + len, " buf count: %x\n", readl(base + ++ BMU_BUF_CNT)); ++ len += sprintf(buf + len, " buf rem: %x\n", readl(base + ++ BMU_REM_BUF_CNT)); ++ len += sprintf(buf + len, " buf curr: %x\n", readl(base + ++ BMU_CURR_BUF_CNT)); ++ len += sprintf(buf + len, " free err: %x\n", readl(base + ++ BMU_FREE_ERR_ADDR)); ++ ++ return len; ++} ++ ++static ssize_t gpi(char *buf, int id, void *base) ++{ ++ ssize_t len = 0; ++ u32 val; ++ ++ len += sprintf(buf + len, "%s%d:\n ", __func__, id); ++ len += block_version(buf + len, base + GPI_VERSION); ++ ++ len += sprintf(buf + len, " tx under stick: %x\n", readl(base + ++ GPI_FIFO_STATUS)); ++ val = readl(base + GPI_FIFO_DEBUG); ++ len += sprintf(buf + len, " tx pkts: %x\n", (val >> 23) & ++ 0x3f); ++ len += sprintf(buf + len, " rx pkts: %x\n", (val >> 18) & ++ 0x3f); ++ len += sprintf(buf + len, " tx bytes: %x\n", (val >> 9) & ++ 0x1ff); ++ len += sprintf(buf + len, " rx bytes: %x\n", (val >> 0) & ++ 0x1ff); ++ len += sprintf(buf + len, " overrun: %x\n", readl(base + ++ GPI_OVERRUN_DROPCNT)); ++ ++ return len; ++} ++ ++static ssize_t pfe_set_class(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ class_do_clear = kstrtoul(buf, 0, 0); ++ return count; ++} ++ ++static ssize_t pfe_show_class(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ int id; ++ u32 val; ++ struct pfe_cpumon *cpumon = &pfe->cpumon; ++ ++ len += block_version(buf + len, CLASS_VERSION); ++ ++ for (id = CLASS0_ID; id <= CLASS_MAX_ID; id++) { ++ len += sprintf(buf + len, "%d: ", id - CLASS0_ID); ++ ++ val = readl(CLASS_PE0_DEBUG + id * 4); ++ len += sprintf(buf + len, "pc=1%04x ", val & 0xffff); ++ ++ len += display_pe_status(buf + len, id, CLASS_DM_PESTATUS, ++ class_do_clear); ++ } ++ len += sprintf(buf + len, "aggregate load=%d%%\n\n", ++ cpumon->class_usage_pct); ++ ++ len += sprintf(buf + len, "pe status: 0x%x\n", ++ readl(CLASS_PE_STATUS)); ++ len += sprintf(buf + len, "max buf cnt: 0x%x afull thres: 0x%x\n", ++ readl(CLASS_MAX_BUF_CNT), readl(CLASS_AFULL_THRES)); ++ len += sprintf(buf + len, "tsq max cnt: 0x%x tsq fifo thres: 0x%x\n", ++ readl(CLASS_TSQ_MAX_CNT), readl(CLASS_TSQ_FIFO_THRES)); ++ len += sprintf(buf + len, "state: 0x%x\n", readl(CLASS_STATE)); ++ ++ len += class_phy_stats(buf + len, 0); ++ len += class_phy_stats(buf + len, 1); ++ len += class_phy_stats(buf + len, 2); ++ len += class_phy_stats(buf + len, 3); ++ ++ return len; ++} ++ ++static ssize_t pfe_set_tmu(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ tmu_do_clear = kstrtoul(buf, 0, 0); ++ return count; ++} ++ ++static ssize_t pfe_show_tmu(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ int id; ++ u32 val; ++ ++ len += block_version(buf + len, TMU_VERSION); ++ ++ for (id = TMU0_ID; id <= TMU_MAX_ID; id++) { ++ if (id == TMU2_ID) ++ continue; ++ len += sprintf(buf + len, "%d: ", id - TMU0_ID); ++ ++ len += display_pe_status(buf + len, id, TMU_DM_PESTATUS, ++ tmu_do_clear); ++ } ++ ++ len += sprintf(buf + len, "pe status: %x\n", readl(TMU_PE_STATUS)); ++ len += sprintf(buf + len, "inq fifo cnt: %x\n", ++ readl(TMU_PHY_INQ_FIFO_CNT)); ++ val = readl(TMU_INQ_STAT); ++ len += sprintf(buf + len, "inq wr ptr: %x\n", val & 0x3ff); ++ len += sprintf(buf + len, "inq rd ptr: %x\n", val >> 10); ++ ++ return len; ++} ++ ++static unsigned long drops_do_clear; ++static u32 class_drop_counter[CLASS_NUM_DROP_COUNTERS]; ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++static u32 util_drop_counter[UTIL_NUM_DROP_COUNTERS]; ++#endif ++ ++char *class_drop_description[CLASS_NUM_DROP_COUNTERS] = { ++ "ICC", ++ "Host Pkt Error", ++ "Rx Error", ++ "IPsec Outbound", ++ "IPsec Inbound", ++ "EXPT IPsec Error", ++ "Reassembly", ++ "Fragmenter", ++ "NAT-T", ++ "Socket", ++ "Multicast", ++ "NAT-PT", ++ "Tx Disabled", ++}; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++char *util_drop_description[UTIL_NUM_DROP_COUNTERS] = { ++ "IPsec Outbound", ++ "IPsec Inbound", ++ "IPsec Rate Limiter", ++ "Fragmenter", ++ "Socket", ++ "Tx Disabled", ++ "Rx Error", ++}; ++#endif ++ ++static ssize_t pfe_set_drops(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ drops_do_clear = kstrtoul(buf, 0, 0); ++ return count; ++} ++ ++static u32 tmu_drops[4][16]; ++static ssize_t pfe_show_drops(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ int id, dropnum; ++ int tmu, queue; ++ u32 val; ++ u32 dmem_addr; ++ int num_class_drops = 0, num_tmu_drops = 0, num_util_drops = 0; ++ struct pfe_ctrl *ctrl = &pfe->ctrl; ++ ++ memset(class_drop_counter, 0, sizeof(class_drop_counter)); ++ for (id = CLASS0_ID; id <= CLASS_MAX_ID; id++) { ++ if (drops_do_clear) ++ pe_sync_stop(ctrl, (1 << id)); ++ for (dropnum = 0; dropnum < CLASS_NUM_DROP_COUNTERS; ++ dropnum++) { ++ dmem_addr = CLASS_DM_DROP_CNTR; ++ val = be32_to_cpu(pe_dmem_read(id, dmem_addr, 4)); ++ class_drop_counter[dropnum] += val; ++ num_class_drops += val; ++ if (drops_do_clear) ++ pe_dmem_write(id, 0, dmem_addr, 4); ++ } ++ if (drops_do_clear) ++ pe_start(ctrl, (1 << id)); ++ } ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ if (drops_do_clear) ++ pe_sync_stop(ctrl, (1 << UTIL_ID)); ++ for (dropnum = 0; dropnum < UTIL_NUM_DROP_COUNTERS; dropnum++) { ++ dmem_addr = UTIL_DM_DROP_CNTR; ++ val = be32_to_cpu(pe_dmem_read(UTIL_ID, dmem_addr, 4)); ++ util_drop_counter[dropnum] = val; ++ num_util_drops += val; ++ if (drops_do_clear) ++ pe_dmem_write(UTIL_ID, 0, dmem_addr, 4); ++ } ++ if (drops_do_clear) ++ pe_start(ctrl, (1 << UTIL_ID)); ++#endif ++ for (tmu = 0; tmu < 4; tmu++) { ++ for (queue = 0; queue < 16; queue++) { ++ qm_read_drop_stat(tmu, queue, &tmu_drops[tmu][queue], ++ drops_do_clear); ++ num_tmu_drops += tmu_drops[tmu][queue]; ++ } ++ } ++ ++ if (num_class_drops == 0 && num_util_drops == 0 && num_tmu_drops == 0) ++ len += sprintf(buf + len, "No PE drops\n\n"); ++ ++ if (num_class_drops > 0) { ++ len += sprintf(buf + len, "Class PE drops --\n"); ++ for (dropnum = 0; dropnum < CLASS_NUM_DROP_COUNTERS; ++ dropnum++) { ++ if (class_drop_counter[dropnum] > 0) ++ len += sprintf(buf + len, " %s: %d\n", ++ class_drop_description[dropnum], ++ class_drop_counter[dropnum]); ++ } ++ len += sprintf(buf + len, "\n"); ++ } ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ if (num_util_drops > 0) { ++ len += sprintf(buf + len, "Util PE drops --\n"); ++ for (dropnum = 0; dropnum < UTIL_NUM_DROP_COUNTERS; dropnum++) { ++ if (util_drop_counter[dropnum] > 0) ++ len += sprintf(buf + len, " %s: %d\n", ++ util_drop_description[dropnum], ++ util_drop_counter[dropnum]); ++ } ++ len += sprintf(buf + len, "\n"); ++ } ++#endif ++ if (num_tmu_drops > 0) { ++ len += sprintf(buf + len, "TMU drops --\n"); ++ for (tmu = 0; tmu < 4; tmu++) { ++ for (queue = 0; queue < 16; queue++) { ++ if (tmu_drops[tmu][queue] > 0) ++ len += sprintf(buf + len, ++ " TMU%d-Q%d: %d\n" ++ , tmu, queue, tmu_drops[tmu][queue]); ++ } ++ } ++ len += sprintf(buf + len, "\n"); ++ } ++ ++ return len; ++} ++ ++static ssize_t pfe_show_tmu0_queues(struct device *dev, struct device_attribute ++ *attr, char *buf) ++{ ++ return tmu_queues(buf, 0); ++} ++ ++static ssize_t pfe_show_tmu1_queues(struct device *dev, struct device_attribute ++ *attr, char *buf) ++{ ++ return tmu_queues(buf, 1); ++} ++ ++static ssize_t pfe_show_tmu2_queues(struct device *dev, struct device_attribute ++ *attr, char *buf) ++{ ++ return tmu_queues(buf, 2); ++} ++ ++static ssize_t pfe_show_tmu3_queues(struct device *dev, struct device_attribute ++ *attr, char *buf) ++{ ++ return tmu_queues(buf, 3); ++} ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++static ssize_t pfe_set_util(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ util_do_clear = kstrtoul(buf, NULL, 0); ++ return count; ++} ++ ++static ssize_t pfe_show_util(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ struct pfe_ctrl *ctrl = &pfe->ctrl; ++ ++ len += block_version(buf + len, UTIL_VERSION); ++ ++ pe_sync_stop(ctrl, (1 << UTIL_ID)); ++ len += display_pe_status(buf + len, UTIL_ID, UTIL_DM_PESTATUS, ++ util_do_clear); ++ pe_start(ctrl, (1 << UTIL_ID)); ++ ++ len += sprintf(buf + len, "pe status: %x\n", readl(UTIL_PE_STATUS)); ++ len += sprintf(buf + len, "max buf cnt: %x\n", ++ readl(UTIL_MAX_BUF_CNT)); ++ len += sprintf(buf + len, "tsq max cnt: %x\n", ++ readl(UTIL_TSQ_MAX_CNT)); ++ ++ return len; ++} ++#endif ++ ++static ssize_t pfe_show_bmu(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ ++ len += bmu(buf + len, 1, BMU1_BASE_ADDR); ++ len += bmu(buf + len, 2, BMU2_BASE_ADDR); ++ ++ return len; ++} ++ ++static ssize_t pfe_show_hif(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ ++ len += sprintf(buf + len, "hif:\n "); ++ len += block_version(buf + len, HIF_VERSION); ++ ++ len += sprintf(buf + len, " tx curr bd: %x\n", ++ readl(HIF_TX_CURR_BD_ADDR)); ++ len += sprintf(buf + len, " tx status: %x\n", ++ readl(HIF_TX_STATUS)); ++ len += sprintf(buf + len, " tx dma status: %x\n", ++ readl(HIF_TX_DMA_STATUS)); ++ ++ len += sprintf(buf + len, " rx curr bd: %x\n", ++ readl(HIF_RX_CURR_BD_ADDR)); ++ len += sprintf(buf + len, " rx status: %x\n", ++ readl(HIF_RX_STATUS)); ++ len += sprintf(buf + len, " rx dma status: %x\n", ++ readl(HIF_RX_DMA_STATUS)); ++ ++ len += sprintf(buf + len, "hif nocopy:\n "); ++ len += block_version(buf + len, HIF_NOCPY_VERSION); ++ ++ len += sprintf(buf + len, " tx curr bd: %x\n", ++ readl(HIF_NOCPY_TX_CURR_BD_ADDR)); ++ len += sprintf(buf + len, " tx status: %x\n", ++ readl(HIF_NOCPY_TX_STATUS)); ++ len += sprintf(buf + len, " tx dma status: %x\n", ++ readl(HIF_NOCPY_TX_DMA_STATUS)); ++ ++ len += sprintf(buf + len, " rx curr bd: %x\n", ++ readl(HIF_NOCPY_RX_CURR_BD_ADDR)); ++ len += sprintf(buf + len, " rx status: %x\n", ++ readl(HIF_NOCPY_RX_STATUS)); ++ len += sprintf(buf + len, " rx dma status: %x\n", ++ readl(HIF_NOCPY_RX_DMA_STATUS)); ++ ++ return len; ++} ++ ++static ssize_t pfe_show_gpi(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ ++ len += gpi(buf + len, 0, EGPI1_BASE_ADDR); ++ len += gpi(buf + len, 1, EGPI2_BASE_ADDR); ++ len += gpi(buf + len, 3, HGPI_BASE_ADDR); ++ ++ return len; ++} ++ ++static ssize_t pfe_show_pfemem(struct device *dev, struct device_attribute ++ *attr, char *buf) ++{ ++ ssize_t len = 0; ++ struct pfe_memmon *memmon = &pfe->memmon; ++ ++ len += sprintf(buf + len, "Kernel Memory: %d Bytes (%d KB)\n", ++ memmon->kernel_memory_allocated, ++ (memmon->kernel_memory_allocated + 1023) / 1024); ++ ++ return len; ++} ++ ++static ssize_t pfe_show_crc_revalidated(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ u64 crc_validated = 0; ++ ssize_t len = 0; ++ int id, phyid; ++ ++ len += sprintf(buf + len, "FCS re-validated by PFE:\n"); ++ ++ for (phyid = 0; phyid < 2; phyid++) { ++ crc_validated = 0; ++ for (id = CLASS0_ID; id <= CLASS_MAX_ID; id++) { ++ crc_validated += be32_to_cpu(pe_dmem_read(id, ++ CLASS_DM_CRC_VALIDATED + (phyid * 4), 4)); ++ } ++ len += sprintf(buf + len, "MAC %d:\n count:%10llu\n", ++ phyid, crc_validated); ++ } ++ ++ return len; ++} ++ ++#ifdef HIF_NAPI_STATS ++static ssize_t pfe_show_hif_napi_stats(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct platform_device *pdev = to_platform_device(dev); ++ struct pfe *pfe = platform_get_drvdata(pdev); ++ ssize_t len = 0; ++ ++ len += sprintf(buf + len, "sched: %u\n", ++ pfe->hif.napi_counters[NAPI_SCHED_COUNT]); ++ len += sprintf(buf + len, "poll: %u\n", ++ pfe->hif.napi_counters[NAPI_POLL_COUNT]); ++ len += sprintf(buf + len, "packet: %u\n", ++ pfe->hif.napi_counters[NAPI_PACKET_COUNT]); ++ len += sprintf(buf + len, "budget: %u\n", ++ pfe->hif.napi_counters[NAPI_FULL_BUDGET_COUNT]); ++ len += sprintf(buf + len, "desc: %u\n", ++ pfe->hif.napi_counters[NAPI_DESC_COUNT]); ++ len += sprintf(buf + len, "full: %u\n", ++ pfe->hif.napi_counters[NAPI_CLIENT_FULL_COUNT]); ++ ++ return len; ++} ++ ++static ssize_t pfe_set_hif_napi_stats(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct platform_device *pdev = to_platform_device(dev); ++ struct pfe *pfe = platform_get_drvdata(pdev); ++ ++ memset(pfe->hif.napi_counters, 0, sizeof(pfe->hif.napi_counters)); ++ ++ return count; ++} ++ ++static DEVICE_ATTR(hif_napi_stats, 0644, pfe_show_hif_napi_stats, ++ pfe_set_hif_napi_stats); ++#endif ++ ++static DEVICE_ATTR(class, 0644, pfe_show_class, pfe_set_class); ++static DEVICE_ATTR(tmu, 0644, pfe_show_tmu, pfe_set_tmu); ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++static DEVICE_ATTR(util, 0644, pfe_show_util, pfe_set_util); ++#endif ++static DEVICE_ATTR(bmu, 0444, pfe_show_bmu, NULL); ++static DEVICE_ATTR(hif, 0444, pfe_show_hif, NULL); ++static DEVICE_ATTR(gpi, 0444, pfe_show_gpi, NULL); ++static DEVICE_ATTR(drops, 0644, pfe_show_drops, pfe_set_drops); ++static DEVICE_ATTR(tmu0_queues, 0444, pfe_show_tmu0_queues, NULL); ++static DEVICE_ATTR(tmu1_queues, 0444, pfe_show_tmu1_queues, NULL); ++static DEVICE_ATTR(tmu2_queues, 0444, pfe_show_tmu2_queues, NULL); ++static DEVICE_ATTR(tmu3_queues, 0444, pfe_show_tmu3_queues, NULL); ++static DEVICE_ATTR(pfemem, 0444, pfe_show_pfemem, NULL); ++static DEVICE_ATTR(fcs_revalidated, 0444, pfe_show_crc_revalidated, NULL); ++ ++int pfe_sysfs_init(struct pfe *pfe) ++{ ++ if (device_create_file(pfe->dev, &dev_attr_class)) ++ goto err_class; ++ ++ if (device_create_file(pfe->dev, &dev_attr_tmu)) ++ goto err_tmu; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ if (device_create_file(pfe->dev, &dev_attr_util)) ++ goto err_util; ++#endif ++ ++ if (device_create_file(pfe->dev, &dev_attr_bmu)) ++ goto err_bmu; ++ ++ if (device_create_file(pfe->dev, &dev_attr_hif)) ++ goto err_hif; ++ ++ if (device_create_file(pfe->dev, &dev_attr_gpi)) ++ goto err_gpi; ++ ++ if (device_create_file(pfe->dev, &dev_attr_drops)) ++ goto err_drops; ++ ++ if (device_create_file(pfe->dev, &dev_attr_tmu0_queues)) ++ goto err_tmu0_queues; ++ ++ if (device_create_file(pfe->dev, &dev_attr_tmu1_queues)) ++ goto err_tmu1_queues; ++ ++ if (device_create_file(pfe->dev, &dev_attr_tmu2_queues)) ++ goto err_tmu2_queues; ++ ++ if (device_create_file(pfe->dev, &dev_attr_tmu3_queues)) ++ goto err_tmu3_queues; ++ ++ if (device_create_file(pfe->dev, &dev_attr_pfemem)) ++ goto err_pfemem; ++ ++ if (device_create_file(pfe->dev, &dev_attr_fcs_revalidated)) ++ goto err_crc_revalidated; ++ ++#ifdef HIF_NAPI_STATS ++ if (device_create_file(pfe->dev, &dev_attr_hif_napi_stats)) ++ goto err_hif_napi_stats; ++#endif ++ ++ return 0; ++ ++#ifdef HIF_NAPI_STATS ++err_hif_napi_stats: ++ device_remove_file(pfe->dev, &dev_attr_fcs_revalidated); ++#endif ++ ++err_crc_revalidated: ++ device_remove_file(pfe->dev, &dev_attr_pfemem); ++ ++err_pfemem: ++ device_remove_file(pfe->dev, &dev_attr_tmu3_queues); ++ ++err_tmu3_queues: ++ device_remove_file(pfe->dev, &dev_attr_tmu2_queues); ++ ++err_tmu2_queues: ++ device_remove_file(pfe->dev, &dev_attr_tmu1_queues); ++ ++err_tmu1_queues: ++ device_remove_file(pfe->dev, &dev_attr_tmu0_queues); ++ ++err_tmu0_queues: ++ device_remove_file(pfe->dev, &dev_attr_drops); ++ ++err_drops: ++ device_remove_file(pfe->dev, &dev_attr_gpi); ++ ++err_gpi: ++ device_remove_file(pfe->dev, &dev_attr_hif); ++ ++err_hif: ++ device_remove_file(pfe->dev, &dev_attr_bmu); ++ ++err_bmu: ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ device_remove_file(pfe->dev, &dev_attr_util); ++ ++err_util: ++#endif ++ device_remove_file(pfe->dev, &dev_attr_tmu); ++ ++err_tmu: ++ device_remove_file(pfe->dev, &dev_attr_class); ++ ++err_class: ++ return -1; ++} ++ ++void pfe_sysfs_exit(struct pfe *pfe) ++{ ++#ifdef HIF_NAPI_STATS ++ device_remove_file(pfe->dev, &dev_attr_hif_napi_stats); ++#endif ++ device_remove_file(pfe->dev, &dev_attr_fcs_revalidated); ++ device_remove_file(pfe->dev, &dev_attr_pfemem); ++ device_remove_file(pfe->dev, &dev_attr_tmu3_queues); ++ device_remove_file(pfe->dev, &dev_attr_tmu2_queues); ++ device_remove_file(pfe->dev, &dev_attr_tmu1_queues); ++ device_remove_file(pfe->dev, &dev_attr_tmu0_queues); ++ device_remove_file(pfe->dev, &dev_attr_drops); ++ device_remove_file(pfe->dev, &dev_attr_gpi); ++ device_remove_file(pfe->dev, &dev_attr_hif); ++ device_remove_file(pfe->dev, &dev_attr_bmu); ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ device_remove_file(pfe->dev, &dev_attr_util); ++#endif ++ device_remove_file(pfe->dev, &dev_attr_tmu); ++ device_remove_file(pfe->dev, &dev_attr_class); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_sysfs.h +@@ -0,0 +1,17 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ */ ++ ++#ifndef _PFE_SYSFS_H_ ++#define _PFE_SYSFS_H_ ++ ++#include ++ ++u32 qm_read_drop_stat(u32 tmu, u32 queue, u32 *total_drops, int do_reset); ++ ++int pfe_sysfs_init(struct pfe *pfe); ++void pfe_sysfs_exit(struct pfe *pfe); ++ ++#endif /* _PFE_SYSFS_H_ */ diff --git a/target/linux/layerscape/patches-6.1/702-phy-Add-2.5G-SGMII-interface-mode.patch b/target/linux/layerscape/patches-6.1/702-phy-Add-2.5G-SGMII-interface-mode.patch new file mode 100644 index 00000000000000..77c976407875f4 --- /dev/null +++ b/target/linux/layerscape/patches-6.1/702-phy-Add-2.5G-SGMII-interface-mode.patch @@ -0,0 +1,54 @@ +From fd32b1bc9a49919d3d59a50d775d03fe7ca5e654 Mon Sep 17 00:00:00 2001 +From: Bhaskar Upadhaya +Date: Wed, 29 Nov 2017 15:27:57 +0530 +Subject: [PATCH] phy: Add 2.5G SGMII interface mode + +Add 2.5G SGMII interface mode(PHY_INTERFACE_MODE_2500SGMII) +in existing phy_interface list + +Signed-off-by: Bhaskar Upadhaya +--- + drivers/net/phy/phy-core.c | 1 + + drivers/net/phy/phylink.c | 1 + + include/linux/phy.h | 3 +++ + 3 files changed, 5 insertions(+) + +--- a/drivers/net/phy/phy-core.c ++++ b/drivers/net/phy/phy-core.c +@@ -136,6 +136,7 @@ int phy_interface_num_ports(phy_interfac + case PHY_INTERFACE_MODE_RXAUI: + case PHY_INTERFACE_MODE_XAUI: + case PHY_INTERFACE_MODE_1000BASEKX: ++ case PHY_INTERFACE_MODE_2500SGMII: + return 1; + case PHY_INTERFACE_MODE_QSGMII: + case PHY_INTERFACE_MODE_QUSGMII: +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -199,6 +199,7 @@ static int phylink_interface_max_speed(p + return SPEED_1000; + + case PHY_INTERFACE_MODE_2500BASEX: ++ case PHY_INTERFACE_MODE_2500SGMII: + return SPEED_2500; + + case PHY_INTERFACE_MODE_5GBASER: +--- a/include/linux/phy.h ++++ b/include/linux/phy.h +@@ -157,6 +157,7 @@ typedef enum { + PHY_INTERFACE_MODE_10GKR, + PHY_INTERFACE_MODE_QUSGMII, + PHY_INTERFACE_MODE_1000BASEKX, ++ PHY_INTERFACE_MODE_2500SGMII, + PHY_INTERFACE_MODE_MAX, + } phy_interface_t; + +@@ -276,6 +277,8 @@ static inline const char *phy_modes(phy_ + return "100base-x"; + case PHY_INTERFACE_MODE_QUSGMII: + return "qusgmii"; ++ case PHY_INTERFACE_MODE_2500SGMII: ++ return "sgmii-2500"; + default: + return "unknown"; + } diff --git a/target/linux/layerscape/patches-6.1/703-layerscape-6.1-fix-compilation-warning-for-fsl-ppfe-.patch b/target/linux/layerscape/patches-6.1/703-layerscape-6.1-fix-compilation-warning-for-fsl-ppfe-.patch new file mode 100644 index 00000000000000..d49488ab4c3e4c --- /dev/null +++ b/target/linux/layerscape/patches-6.1/703-layerscape-6.1-fix-compilation-warning-for-fsl-ppfe-.patch @@ -0,0 +1,239 @@ +From 1dc3a2e216d99adc2df022ab37eab32f61d80e0e Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Mon, 8 May 2023 19:26:48 +0200 +Subject: [PATCH] layerscape: 6.1: fix compilation warning for fsl ppfe driver + +Rework some desc dump and dummy pkt function to fix compilation warning. +Fix compilation warning: +drivers/staging/fsl_ppfe/pfe_hif.c: In function 'send_dummy_pkt_to_hif': +drivers/staging/fsl_ppfe/pfe_hif.c:118:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] + 118 | ddr_ptr = (void *)((u64)readl(BMU2_BASE_ADDR + BMU_ALLOC_CTRL)); + | ^ +drivers/staging/fsl_ppfe/pfe_hif.c:122:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] + 122 | lmem_ptr = (void *)((u64)readl(BMU1_BASE_ADDR + BMU_ALLOC_CTRL)); + | ^ +drivers/staging/fsl_ppfe/pfe_hif.c: In function 'pfe_hif_desc_dump': +drivers/staging/fsl_ppfe/pfe_hif.c:195:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] + 195 | desc_p = (u32)((u64)desc - (u64)hif->descr_baseaddr_v + + | ^ +drivers/staging/fsl_ppfe/pfe_hif.c:195:36: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] + 195 | desc_p = (u32)((u64)desc - (u64)hif->descr_baseaddr_v + + | ^ +drivers/staging/fsl_ppfe/pfe_hif.c:207:19: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] + 207 | desc_p = ((u64)desc - (u64)hif->descr_baseaddr_v + + | ^ +drivers/staging/fsl_ppfe/pfe_hif.c:207:31: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] + 207 | desc_p = ((u64)desc - (u64)hif->descr_baseaddr_v + + | ^ +cc1: all warnings being treated as errors + +In file included from ./include/linux/kernel.h:19, + from ./include/linux/list.h:9, + from ./include/linux/wait.h:7, + from ./include/linux/eventfd.h:13, + from drivers/staging/fsl_ppfe/pfe_cdev.c:11: +drivers/staging/fsl_ppfe/pfe_cdev.c: In function 'pfe_cdev_read': +./include/linux/kern_levels.h:5:25: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'int' [-Werror=format=] + 5 | #define KERN_SOH "\001" /* ASCII Start Of Header */ + | ^~~~~~ +./include/linux/printk.h:422:25: note: in definition of macro 'printk_index_wrap' + 422 | _p_func(_fmt, ##__VA_ARGS__); \ + | ^~~~ +./include/linux/printk.h:132:17: note: in expansion of macro 'printk' + 132 | printk(fmt, ##__VA_ARGS__); \ + | ^~~~~~ +./include/linux/printk.h:580:9: note: in expansion of macro 'no_printk' + 580 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) + | ^~~~~~~~~ +./include/linux/kern_levels.h:15:25: note: in expansion of macro 'KERN_SOH' + 15 | #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */ + | ^~~~~~~~ +./include/linux/printk.h:580:19: note: in expansion of macro 'KERN_DEBUG' + 580 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) + | ^~~~~~~~~~ +drivers/staging/fsl_ppfe/pfe_cdev.c:42:17: note: in expansion of macro 'pr_debug' + 42 | pr_debug("%u %lu", link_states[ret].phy_id, + | ^~~~~~~~ +./include/linux/kern_levels.h:5:25: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=] + 5 | #define KERN_SOH "\001" /* ASCII Start Of Header */ + | ^~~~~~ +./include/linux/printk.h:422:25: note: in definition of macro 'printk_index_wrap' + 422 | _p_func(_fmt, ##__VA_ARGS__); \ + | ^~~~ +./include/linux/printk.h:493:9: note: in expansion of macro 'printk' + 493 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) + | ^~~~~~ +./include/linux/kern_levels.h:11:25: note: in expansion of macro 'KERN_SOH' + 11 | #define KERN_ERR KERN_SOH "3" /* error conditions */ + | ^~~~~~~~ +./include/linux/printk.h:493:16: note: in expansion of macro 'KERN_ERR' + 493 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) + | ^~~~~~~~ +drivers/staging/fsl_ppfe/pfe_cdev.c:50:17: note: in expansion of macro 'pr_err' + 50 | pr_err("Failed to send (%d)bytes of (%lu) requested.\n", + | ^~~~~~ +./include/linux/kern_levels.h:5:25: error: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'unsigned int' [-Werror=format=] + 5 | #define KERN_SOH "\001" /* ASCII Start Of Header */ + | ^~~~~~ +./include/linux/printk.h:422:25: note: in definition of macro 'printk_index_wrap' + 422 | _p_func(_fmt, ##__VA_ARGS__); \ + | ^~~~ +./include/linux/printk.h:132:17: note: in expansion of macro 'printk' + 132 | printk(fmt, ##__VA_ARGS__); \ + | ^~~~~~ +./include/linux/printk.h:580:9: note: in expansion of macro 'no_printk' + 580 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) + | ^~~~~~~~~ +./include/linux/kern_levels.h:15:25: note: in expansion of macro 'KERN_SOH' + 15 | #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */ + | ^~~~~~~~ +./include/linux/printk.h:580:19: note: in expansion of macro 'KERN_DEBUG' + 580 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) + | ^~~~~~~~~~ +drivers/staging/fsl_ppfe/pfe_cdev.c:57:9: note: in expansion of macro 'pr_debug' + 57 | pr_debug("Read of (%lu) bytes performed.\n", sizeof(link_states)); + | ^~~~~~~~ +cc1: all warnings being treated as errors + +In file included from ./include/uapi/linux/posix_types.h:5, + from ./include/uapi/linux/types.h:14, + from ./include/linux/types.h:6, + from ./include/linux/list.h:5, + from ./include/linux/module.h:12, + from drivers/staging/fsl_ppfe/pfe_sysfs.c:7: +drivers/staging/fsl_ppfe/pfe_sysfs.c: In function 'pfe_set_util': +./include/linux/stddef.h:8:14: error: passing argument 2 of 'kstrtoul' makes integer from pointer without a cast [-Werror=int-conversion] + 8 | #define NULL ((void *)0) + | ^~~~~~~~~~~ + | | + | void * +drivers/staging/fsl_ppfe/pfe_sysfs.c:538:39: note: in expansion of macro 'NULL' + 538 | util_do_clear = kstrtoul(buf, NULL, 0); + | ^~~~ +In file included from ./include/linux/kernel.h:13, + from ./include/linux/list.h:9: +./include/linux/kstrtox.h:30:69: note: expected 'unsigned int' but argument is of type 'void *' + 30 | static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res) + | ~~~~~~~~~~~~~^~~~ +cc1: all warnings being treated as errors + +With UTIL compiled on, fix compilation warning: +drivers/staging/fsl_ppfe/pfe_hal.c: In function 'pe_load_ddr_section': +drivers/staging/fsl_ppfe/pfe_hal.c:617:19: error: 'else' without a previous 'if' + 617 | } else { + | ^~~~ +drivers/staging/fsl_ppfe/pfe_hal.c:622:17: error: break statement not within loop or switch + 622 | break; + | ^~~~~ +drivers/staging/fsl_ppfe/pfe_hal.c:624:9: error: case label not within a switch statement + 624 | case SHT_NOBITS: + | ^~~~ +drivers/staging/fsl_ppfe/pfe_hal.c:627:17: error: break statement not within loop or switch + 627 | break; + | ^~~~~ +drivers/staging/fsl_ppfe/pfe_hal.c:629:9: error: 'default' label not within a switch statement + 629 | default: + | ^~~~~~~ +drivers/staging/fsl_ppfe/pfe_hal.c: At top level: +drivers/staging/fsl_ppfe/pfe_hal.c:635:9: error: expected identifier or '(' before 'return' + 635 | return 0; + | ^~~~~~ +drivers/staging/fsl_ppfe/pfe_hal.c:636:1: error: expected identifier or '(' before '}' token + 636 | } + +Signed-off-by: Christian Marangi +Signed-off-by: Pawel Dembicki +--- + drivers/staging/fsl_ppfe/pfe_cdev.c | 6 +++--- + drivers/staging/fsl_ppfe/pfe_hif.c | 14 +++++++------- + drivers/staging/fsl_ppfe/pfe_sysfs.c | 2 +- + 3 files changed, 11 insertions(+), 11 deletions(-) + +--- a/drivers/staging/fsl_ppfe/pfe_cdev.c ++++ b/drivers/staging/fsl_ppfe/pfe_cdev.c +@@ -34,7 +34,7 @@ static ssize_t pfe_cdev_read(struct file + { + int ret = 0; + +- pr_info("PFE CDEV attempt copying (%lu) size of user.\n", ++ pr_info("PFE CDEV attempt copying (%zu) size of user.\n", + sizeof(link_states)); + + pr_debug("Dump link_state on screen before copy_to_user\n"); +@@ -47,14 +47,14 @@ static ssize_t pfe_cdev_read(struct file + /* Copy to user the value in buffer sized len */ + ret = copy_to_user(buf, &link_states, sizeof(link_states)); + if (ret != 0) { +- pr_err("Failed to send (%d)bytes of (%lu) requested.\n", ++ pr_err("Failed to send (%d)bytes of (%zu) requested.\n", + ret, len); + return -EFAULT; + } + + /* offset set back to 0 as there is contextual reading offset */ + *off = 0; +- pr_debug("Read of (%lu) bytes performed.\n", sizeof(link_states)); ++ pr_debug("Read of (%zu) bytes performed.\n", sizeof(link_states)); + + return sizeof(link_states); + } +--- a/drivers/staging/fsl_ppfe/pfe_hif.c ++++ b/drivers/staging/fsl_ppfe/pfe_hif.c +@@ -115,11 +115,11 @@ static void send_dummy_pkt_to_hif(void) + 0x33221100, 0xa8c05544, 0x00000301, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xbe86c51f }; + +- ddr_ptr = (void *)((u64)readl(BMU2_BASE_ADDR + BMU_ALLOC_CTRL)); ++ ddr_ptr = (void *)((uintptr_t)readl(BMU2_BASE_ADDR + BMU_ALLOC_CTRL)); + if (!ddr_ptr) + return; + +- lmem_ptr = (void *)((u64)readl(BMU1_BASE_ADDR + BMU_ALLOC_CTRL)); ++ lmem_ptr = (void *)((uintptr_t)readl(BMU1_BASE_ADDR + BMU_ALLOC_CTRL)); + if (!lmem_ptr) + return; + +@@ -186,16 +186,16 @@ static void pfe_hif_free_descr(struct pf + void pfe_hif_desc_dump(struct pfe_hif *hif) + { + struct hif_desc *desc; +- unsigned long desc_p; ++ u64 desc_p; + int ii = 0; + + pr_info("%s\n", __func__); + + desc = hif->rx_base; +- desc_p = (u32)((u64)desc - (u64)hif->descr_baseaddr_v + ++ desc_p = ((void *)desc - hif->descr_baseaddr_v + + hif->descr_baseaddr_p); + +- pr_info("HIF Rx desc base %p physical %x\n", desc, (u32)desc_p); ++ pr_info("HIF Rx desc base %p physical %llx\n", desc, desc_p); + for (ii = 0; ii < hif->rx_ring_size; ii++) { + pr_info("status: %08x, ctrl: %08x, data: %08x, next: %x\n", + readl(&desc->status), readl(&desc->ctrl), +@@ -204,10 +204,10 @@ void pfe_hif_desc_dump(struct pfe_hif *h + } + + desc = hif->tx_base; +- desc_p = ((u64)desc - (u64)hif->descr_baseaddr_v + ++ desc_p = ((void *)desc - hif->descr_baseaddr_v + + hif->descr_baseaddr_p); + +- pr_info("HIF Tx desc base %p physical %x\n", desc, (u32)desc_p); ++ pr_info("HIF Tx desc base %p physical %llx\n", desc, desc_p); + for (ii = 0; ii < hif->tx_ring_size; ii++) { + pr_info("status: %08x, ctrl: %08x, data: %08x, next: %x\n", + readl(&desc->status), readl(&desc->ctrl), +--- a/drivers/staging/fsl_ppfe/pfe_sysfs.c ++++ b/drivers/staging/fsl_ppfe/pfe_sysfs.c +@@ -535,7 +535,7 @@ static ssize_t pfe_show_tmu3_queues(stru + static ssize_t pfe_set_util(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) + { +- util_do_clear = kstrtoul(buf, NULL, 0); ++ util_do_clear = kstrtoul(buf, 0, 0); + return count; + } + diff --git a/target/linux/layerscape/patches-6.1/704-net-phylink-treat-PHY_INTERFACE_MODE_2500SGMII-in-ph.patch b/target/linux/layerscape/patches-6.1/704-net-phylink-treat-PHY_INTERFACE_MODE_2500SGMII-in-ph.patch new file mode 100644 index 00000000000000..f0d71009456c5d --- /dev/null +++ b/target/linux/layerscape/patches-6.1/704-net-phylink-treat-PHY_INTERFACE_MODE_2500SGMII-in-ph.patch @@ -0,0 +1,42 @@ +From eb57941154e2ad142c07d47e874a221328467349 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Thu, 2 Jun 2022 12:11:11 +0300 +Subject: [PATCH] net: phylink: treat PHY_INTERFACE_MODE_2500SGMII in + phylink_get_linkmodes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +There is a downstream patch which adds a new interface type - +PHY_INTERFACE_MODE_2500SGMII (which is really the same one as +PHY_INTERFACE_MODE_2500BASEX). + +We backported from upstream the following phylink patch which, of +course, does not treat the PHY_INTERFACE_MODE_2500SGMII interface mode +in a switch case statement. + 34ae2c09d46a ("net: phylink: add generic validate implementation") + +Because of this, we get the following build warning. + +drivers/net/phy/phylink.c: In function ‘phylink_get_linkmodes’: +drivers/net/phy/phylink.c:322:2: warning: enumeration value ‘PHY_INTERFACE_MODE_2500SGMII’ not handled in switch [-Wswitch] + 322 | switch (interface) { + | ^~~~~~ + +Fix it by treating the new interface mode in the switch-case statement. + +Signed-off-by: Ioana Ciornei +--- + drivers/net/phy/phylink.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -485,6 +485,7 @@ unsigned long phylink_get_capabilities(p + break; + + case PHY_INTERFACE_MODE_2500BASEX: ++ case PHY_INTERFACE_MODE_2500SGMII: + caps |= MAC_2500FD; + break; + diff --git a/target/linux/mediatek/dts/mt7622-buffalo-wsr-2533dhp2.dts b/target/linux/mediatek/dts/mt7622-buffalo-wsr-2533dhp2.dts index a9f29591912c54..b8fac373a0a843 100644 --- a/target/linux/mediatek/dts/mt7622-buffalo-wsr-2533dhp2.dts +++ b/target/linux/mediatek/dts/mt7622-buffalo-wsr-2533dhp2.dts @@ -87,7 +87,6 @@ }; factory: partition@1c0000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x1c0000 0x40000>; read-only; diff --git a/target/linux/mediatek/dts/mt7622-dlink-eagle-pro-ai-m32-a1.dts b/target/linux/mediatek/dts/mt7622-dlink-eagle-pro-ai-m32-a1.dts new file mode 100644 index 00000000000000..9c90cee516a6a8 --- /dev/null +++ b/target/linux/mediatek/dts/mt7622-dlink-eagle-pro-ai-m32-a1.dts @@ -0,0 +1,401 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include "mt7622.dtsi" +#include "mt6380.dtsi" +#include +#include + +/ { + model = "D-Link EAGLE PRO AI M32 A1"; + compatible = "dlink,eagle-pro-ai-m32-a1", "mediatek,mt7622"; + + aliases { + led-boot = &status_orange; + led-failsafe = &status_red; + led-running = &status_white; + led-upgrade = &status_red; + serial0 = &uart0; + label-mac-device = &gmac0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8 swiotlb=512"; + }; + + cpus { + cpu@0 { + proc-supply = <&mt6380_vcpu_reg>; + sram-supply = <&mt6380_vm_reg>; + }; + + cpu@1 { + proc-supply = <&mt6380_vcpu_reg>; + sram-supply = <&mt6380_vm_reg>; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + gpios = <&pio 0 GPIO_ACTIVE_LOW>; + label = "reset"; + linux,code = ; + }; + + wps { + gpios = <&pio 102 GPIO_ACTIVE_LOW>; + label = "wps"; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + status_white: status_white { + label = "white:status"; + gpios = <&pio 85 GPIO_ACTIVE_LOW>; + }; + + status_orange: status_orange { + label = "orange:status"; + gpios = <&pio 20 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + status_red: status_red { + label = "red:status"; + gpios = <&pio 17 GPIO_ACTIVE_LOW>; + }; + }; + + memory { + reg = <0 0x40000000 0 0x40000000>; + }; +}; + +&bch { + status = "okay"; +}; + +&btif { + status = "okay"; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <ð_pins>; + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + nvmem-cells = <&macaddr_odm_83>; + nvmem-cell-names = "mac-address"; + phy-mode = "2500base-x"; + reg = <0>; + + fixed-link { + full-duplex; + pause; + speed = <2500>; + }; + }; + + mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + + switch@0 { + compatible = "mediatek,mt7531"; + reg = <0>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <53 IRQ_TYPE_LEVEL_HIGH>; + reset-gpios = <&pio 54 0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@2 { + reg = <2>; + label = "lan2"; + }; + + port@3 { + reg = <3>; + label = "lan1"; + }; + + wan: port@4 { + reg = <4>; + label = "wan"; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; + }; + }; +}; + +&pcie0 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie0_pins>; + status = "okay"; +}; + +&pcie1 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie1_pins>; + status = "okay"; +}; + +&pio { + epa_elna_pins: epa-elna-pins { + mux { + function = "antsel"; + groups = "antsel0", "antsel1", "antsel2", "antsel3", + "antsel4", "antsel5", "antsel6", "antsel7", + "antsel8", "antsel9", "antsel12", "antsel13", + "antsel14", "antsel15", "antsel16", "antsel17"; + }; + }; + + eth_pins: eth-pins { + mux { + function = "eth"; + groups = "mdc_mdio", "rgmii_via_gmac2"; + }; + }; + + pcie0_pins: pcie0-pins { + mux { + function = "pcie"; + groups = "pcie0_pad_perst", + "pcie0_1_waken", + "pcie0_1_clkreq"; + }; + }; + + pcie1_pins: pcie1-pins { + mux { + function = "pcie"; + groups = "pcie1_pad_perst", + "pcie1_0_waken", + "pcie1_0_clkreq"; + }; + }; + + pmic_bus_pins: pmic-bus-pins { + mux { + function = "pmic"; + groups = "pmic_bus"; + }; + }; + + /* Serial NAND is shared pin with SPI-NOR */ + serial_nand_pins: serial-nand-pins { + mux { + function = "flash"; + groups = "snfi"; + }; + }; + + uart0_pins: uart0-pins { + mux { + function = "uart"; + groups = "uart0_0_tx_rx"; + }; + }; + + watchdog_pins: watchdog-pins { + mux { + function = "watchdog"; + groups = "watchdog"; + }; + }; +}; + +&pwrap { + pinctrl-names = "default"; + pinctrl-0 = <&pmic_bus_pins>; + status = "okay"; +}; + +&rtc { + status = "disabled"; +}; + +&sata { + status = "disabled"; +}; + +&sata_phy { + status = "disabled"; +}; + +&slot0 { + wmac1: mt7915@0,0 { + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <5000000 6000000>; + mediatek,mtd-eeprom = <&factory 0x05000>; + }; +}; + +&snfi { + pinctrl-names = "default"; + pinctrl-0 = <&serial_nand_pins>; + status = "okay"; + + snand: flash@0 { + compatible = "spi-nand"; + mediatek,bmt-table-size = <0x1000>; + mediatek,bmt-v2; + nand-ecc-engine = <&snfi>; + reg = <0>; + spi-rx-bus-width = <4>; + spi-tx-bus-width = <4>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Preloader"; + reg = <0x00000000 0x00080000>; + read-only; + }; + + partition@80000 { + label = "ATF"; + reg = <0x00080000 0x00040000>; + read-only; + }; + + partition@C0000 { + label = "Bootloader"; + reg = <0x000C0000 0x00080000>; + read-only; + }; + + partition@140000 { + label = "BootConfig"; + reg = <0x00140000 0x00040000>; + read-only; + }; + + odm: partition@180000 { + label = "Odm"; + reg = <0x00180000 0x00040000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_odm_83: macaddr@83 { + reg = <0x83 0x6>; + }; + }; + }; + + config1: partition@1C0000 { + label = "Config1"; + reg = <0x001C0000 0x00080000>; + read-only; + }; + + partition@240000 { + label = "Config2"; + reg = <0x00240000 0x00080000>; + read-only; + }; + + partition@2C0000 { + label = "Kernel1"; + reg = <0x002C0000 0x02D00000>; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + partition@0 { + label = "kernel"; + reg = <0x00000000 0x00800000>; + }; + + partition@800000 { + label = "ubi"; + reg = <0x00800000 0x02500000>; + }; + }; + + partition@2FC0000 { + label = "Kernel2"; + reg = <0x02FC0000 0x02D00000>; + read-only; + }; + + factory: partition@5CC0000 { + label = "Factory"; + reg = <0x05CC0000 0x00100000>; + read-only; + }; + + partition@5DC0000 { + label = "Mydlink"; + reg = <0x05DC0000 0x00200000>; + read-only; + }; + + partition@5FC0000 { + label = "Storage"; + reg = <0x05FC0000 0x00300000>; + read-only; + }; + }; + }; +}; + +&ssusb { + status = "disabled"; +}; + +&u3phy { + status = "disabled"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + status = "okay"; +}; + +&watchdog { + pinctrl-names = "default"; + pinctrl-0 = <&watchdog_pins>; + status = "okay"; +}; + +&wmac { + pinctrl-names = "default"; + pinctrl-0 = <&epa_elna_pins>; + mediatek,mtd-eeprom = <&factory 0x0000>; + status = "okay"; +}; + diff --git a/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts b/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts index c7e11c80b05990..c775d998181e28 100644 --- a/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts +++ b/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts @@ -326,20 +326,24 @@ reg = <0x1c0000 0x100000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_factory_7fff4: macaddr@7fff4 { - reg = <0x7fff4 0x6>; - }; + macaddr_factory_7fff4: macaddr@7fff4 { + reg = <0x7fff4 0x6>; + }; - macaddr_factory_7fffa: macaddr@7fffa { - reg = <0x7fffa 0x6>; + macaddr_factory_7fffa: macaddr@7fffa { + reg = <0x7fffa 0x6>; + }; }; }; @@ -394,9 +398,8 @@ reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x5000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; diff --git a/target/linux/mediatek/dts/mt7622-linksys-e8450-ubi.dts b/target/linux/mediatek/dts/mt7622-linksys-e8450-ubi.dts index 9df736eb01e9a9..e78db1de6cf41e 100644 --- a/target/linux/mediatek/dts/mt7622-linksys-e8450-ubi.dts +++ b/target/linux/mediatek/dts/mt7622-linksys-e8450-ubi.dts @@ -34,6 +34,20 @@ label = "factory"; reg = <0x1c0000 0x100000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_7fff4: macaddr@7fff4 { + reg = <0x7fff4 0x6>; + }; + + macaddr_factory_7fffa: macaddr@7fffa { + reg = <0x7fffa 0x6>; + }; + }; }; partition@300000 { @@ -61,17 +75,3 @@ nvmem-cells = <&macaddr_factory_7fffa>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_7fff4: macaddr@7fff4 { - reg = <0x7fff4 0x6>; - }; - - macaddr_factory_7fffa: macaddr@7fffa { - reg = <0x7fffa 0x6>; - }; -}; diff --git a/target/linux/mediatek/dts/mt7622-linksys-e8450.dts b/target/linux/mediatek/dts/mt7622-linksys-e8450.dts index 8552dbf1a92b11..dedcc057f49de5 100644 --- a/target/linux/mediatek/dts/mt7622-linksys-e8450.dts +++ b/target/linux/mediatek/dts/mt7622-linksys-e8450.dts @@ -45,6 +45,20 @@ factory: partition@1c0000 { label = "factory"; reg = <0x1c0000 0x0100000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_7fff4: macaddr@7fff4 { + reg = <0x7fff4 0x6>; + }; + + macaddr_factory_7fffa: macaddr@7fffa { + reg = <0x7fffa 0x6>; + }; + }; }; partition@300000 { @@ -106,17 +120,3 @@ nvmem-cells = <&macaddr_factory_7fffa>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_7fff4: macaddr@7fff4 { - reg = <0x7fff4 0x6>; - }; - - macaddr_factory_7fffa: macaddr@7fffa { - reg = <0x7fffa 0x6>; - }; -}; diff --git a/target/linux/mediatek/dts/mt7622-netgear-wax206.dts b/target/linux/mediatek/dts/mt7622-netgear-wax206.dts index 9e877b85f16d44..737ac35f3d548c 100644 --- a/target/linux/mediatek/dts/mt7622-netgear-wax206.dts +++ b/target/linux/mediatek/dts/mt7622-netgear-wax206.dts @@ -405,19 +405,22 @@ }; factory: partition@1c0000 { - compatible = "nvmem-cells"; label = "Factory"; reg = <0x1c0000 0x0100000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - macaddr_factory_7fff4: macaddr@7fff4 { - reg = <0x7fff4 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_7fffa: macaddr@7fffa { - reg = <0x7fffa 0x6>; + macaddr_factory_7fff4: macaddr@7fff4 { + reg = <0x7fff4 0x6>; + }; + + macaddr_factory_7fffa: macaddr@7fffa { + reg = <0x7fffa 0x6>; + }; }; }; diff --git a/target/linux/mediatek/dts/mt7622-totolink-a8000ru.dts b/target/linux/mediatek/dts/mt7622-totolink-a8000ru.dts index b634e28783a0b2..776d38d1e31dcb 100644 --- a/target/linux/mediatek/dts/mt7622-totolink-a8000ru.dts +++ b/target/linux/mediatek/dts/mt7622-totolink-a8000ru.dts @@ -284,6 +284,20 @@ label = "factory"; reg = <0x1c0000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_24: macaddr@24 { + reg = <0x24 0x6>; + }; + + macaddr_factory_2a: macaddr@2a { + reg = <0x2a 0x6>; + }; + }; }; partition@200000 { @@ -305,20 +319,6 @@ }; }; -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_24: macaddr@24 { - reg = <0x24 0x6>; - }; - - macaddr_factory_2a: macaddr@2a { - reg = <0x2a 0x6>; - }; -}; - &ssusb { vusb33-supply = <®_3p3v>; vbus-supply = <®_5v>; diff --git a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1-ubootmod.dts b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1-ubootmod.dts index 5b1fd1d9ba82da..7a7a8a815911ea 100644 --- a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1-ubootmod.dts @@ -33,6 +33,20 @@ label = "eeprom"; reg = <0x110000 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@120000 { @@ -68,17 +82,3 @@ nvmem-cells = <&macaddr_eeprom_0>; nvmem-cell-names = "mac-address"; }; - -&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/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1.dts b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1.dts index 95f19af4cd9b69..7e07e1ba6b5982 100644 --- a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1.dts +++ b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v1.dts @@ -38,6 +38,20 @@ label = "eeprom"; reg = <0x110000 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@120000 { @@ -84,17 +98,3 @@ nvmem-cells = <&macaddr_eeprom_0>; nvmem-cell-names = "mac-address"; }; - -&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/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2-ubootmod.dts b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2-ubootmod.dts index 6a7b6868ce3787..3a37d1d5004f0f 100644 --- a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2-ubootmod.dts @@ -33,6 +33,20 @@ label = "eeprom"; reg = <0x110000 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@120000 { @@ -68,17 +82,3 @@ nvmem-cells = <&macaddr_eeprom_0>; nvmem-cell-names = "mac-address"; }; - -&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/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2.dts b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2.dts index f40e8e632b05d3..9fef3d67210b28 100644 --- a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2.dts +++ b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v2.dts @@ -38,6 +38,20 @@ label = "eeprom"; reg = <0x110000 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@120000 { @@ -84,17 +98,3 @@ nvmem-cells = <&macaddr_eeprom_0>; nvmem-cell-names = "mac-address"; }; - -&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/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3-ubootmod.dts b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3-ubootmod.dts index 46faf8da307442..e91aaa63f58bdf 100644 --- a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3-ubootmod.dts @@ -33,6 +33,20 @@ label = "eeprom"; reg = <0x110000 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@120000 { @@ -68,17 +82,3 @@ nvmem-cells = <&macaddr_eeprom_0>; nvmem-cell-names = "mac-address"; }; - -&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/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3.dts b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3.dts index 34bdaa6254af55..71ee9f0ceca007 100644 --- a/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3.dts +++ b/target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-v3.dts @@ -38,6 +38,20 @@ label = "eeprom"; reg = <0x110000 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@120000 { @@ -84,17 +98,3 @@ nvmem-cells = <&macaddr_eeprom_0>; nvmem-cell-names = "mac-address"; }; - -&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/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts b/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts index ecc25fd328ca04..dcf851b2740a38 100644 --- a/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts +++ b/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts @@ -146,9 +146,8 @@ phy-connection-type = "2500base-x"; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; fixed-link { speed = <2500>; @@ -268,12 +267,16 @@ reg = <0x1c0000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/mediatek/dts/mt7629-iptime-a6004mx.dts b/target/linux/mediatek/dts/mt7629-iptime-a6004mx.dts index dc1868a0669e0d..5b1b3083a06658 100644 --- a/target/linux/mediatek/dts/mt7629-iptime-a6004mx.dts +++ b/target/linux/mediatek/dts/mt7629-iptime-a6004mx.dts @@ -97,9 +97,8 @@ compatible = "mediatek,eth-mac"; reg = <0>; phy-mode = "2500base-x"; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; fixed-link { speed = <2500>; @@ -113,9 +112,8 @@ reg = <1>; phy-mode = "gmii"; phy-handle = <&phy0>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; mdio: mdio-bus { @@ -212,12 +210,16 @@ reg = <0x140000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/mediatek/dts/mt7629-tplink_eap225-v5.dts b/target/linux/mediatek/dts/mt7629-tplink_eap225-v5.dts new file mode 100644 index 00000000000000..5eab714fdac3c1 --- /dev/null +++ b/target/linux/mediatek/dts/mt7629-tplink_eap225-v5.dts @@ -0,0 +1,193 @@ +// SPDX-License-Identifier: GPL-2.0 + +/dts-v1/; +#include +#include "mt7629.dtsi" + +/ { + model = "TP-Link EAP225 v5"; + compatible = "tplink,eap225-v5", "mediatek,mt7629"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_amber; + led-running = &led_status_green; + led-upgrade = &led_status_amber; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-override = "console=ttyS0,115200n8"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&pio 21 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: status_green { + label = "green:status"; + gpios = <&pio 55 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + led_status_amber: status_amber { + label = "amber:status"; + gpios = <&pio 56 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <ð_pins>; + pinctrl-1 = <&ephy_leds_pins>; + status = "okay"; + + mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&phy0>; + nvmem-cells = <&macaddr_factory_8>; + nvmem-cell-names = "mac-address"; + }; + + mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + + phy0: ethernet-phy@0 { + reg = <0>; + }; + }; +}; + +&qspi { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&qspi_pins>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Bootloader"; + reg = <0x0 0x00080000>; + read-only; + }; + + partition@80000 { + label = "Partition"; + reg = <0x00080000 0x00010000>; + read-only; + }; + + partition@90000 { + label = "Factory"; + reg = <0x00090000 0x00010000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; + }; + + partition@A0000 { + label = "Radio"; + reg = <0x000A0000 0x00010000>; + read-only; + }; + + partition@B0000 { + label = "Extra"; + reg = <0x000B0000 0x00010000>; + read-only; + }; + + /* Vendor layout: kernel (0x000C0000 0x001A0000) - rootfs (0x00260000 0x00BE0000) */ + /* OpenWrt flash layout: combine kernel and rootfs from OEM layout */ + partition@C0000 { + label = "firmware"; + reg = <0x000C0000 0x00D80000>; + }; + + partition@E40000 { + label = "Config"; + reg = <0x00E40000 0x0001B0000>; + read-only; + }; + }; + }; +}; + +&pio { + eth_pins: eth-pins { + mux { + function = "eth"; + groups = "mdc_mdio"; + }; + }; + + ephy_leds_pins: ephy-leds-pins { + mux { + function = "led"; + groups = "ephy_leds"; + }; + }; + + qspi_pins: qspi-pins { + mux { + function = "flash"; + groups = "spi_nor"; + }; + }; + + uart0_pins: uart0-pins { + mux { + function = "uart"; + groups = "uart0_txd_rxd" ; + }; + }; + + watchdog_pins: watchdog-pins { + mux { + function = "watchdog"; + groups = "watchdog"; + }; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + status = "okay"; +}; + +&watchdog { + pinctrl-names = "default"; + pinctrl-0 = <&watchdog_pins>; + status = "okay"; +}; diff --git a/target/linux/mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts b/target/linux/mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts index ece78ee50ebc56..48fe2f2fc0e537 100644 --- a/target/linux/mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts +++ b/target/linux/mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts @@ -115,16 +115,18 @@ reg = <0x00000 0x10000>; read-only; - 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>; + 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>; + }; }; }; diff --git a/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dts b/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dts index d39083ffb0d614..4949cdb3d77da7 100644 --- a/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dts +++ b/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dts @@ -77,7 +77,7 @@ }; &mdio_bus { - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; @@ -100,18 +100,18 @@ reg = <0>; spi-max-frequency = <52000000>; - spi-tx-buswidth = <4>; - spi-rx-buswidth = <4>; + 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>; - mediatek,nmbm; - mediatek,bmt-max-ratio = <1>; - mediatek,bmt-max-reserved-blocks = <64>; - partition@0 { label = "BL2"; reg = <0x0000000 0x0100000>; @@ -128,12 +128,14 @@ reg = <0x0180000 0x0100000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; }; }; diff --git a/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc.dtso b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc.dtso new file mode 100644 index 00000000000000..c1c9c75c271ae3 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc.dtso @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +/plugin/; + +/ { + compatible = "cmcc,rax3000m", "mediatek,mt7981"; + + fragment@0 { + target = <&mmc0>; + __overlay__ { + bus-width = <8>; + max-frequency = <26000000>; + no-sd; + no-sdio; + non-removable; + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc0_pins_default>; + pinctrl-1 = <&mmc0_pins_uhs>; + vmmc-supply = <®_3p3v>; + status = "okay"; + }; + }; + + fragment@1 { + target = <&pio>; + __overlay__ { + mmc0_pins_default: mmc0-pins { + mux { + function = "flash"; + groups = "emmc_45"; + }; + }; + + mmc0_pins_uhs: mmc0-uhs-pins { + mux { + function = "flash"; + groups = "emmc_45"; + }; + }; + }; + }; +}; diff --git a/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand.dtso b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand.dtso new file mode 100644 index 00000000000000..4d2b01cb63e90e --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand.dtso @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +/plugin/; + +/ { + compatible = "cmcc,rax3000m", "mediatek,mt7981"; + + fragment@0 { + target = <&gmac0>; + __overlay__ { + nvmem-cells = <&macaddr_factory_2a 0>; + nvmem-cell-names = "mac-address"; + }; + }; + + fragment@1 { + target = <&gmac1>; + __overlay__ { + nvmem-cells = <&macaddr_factory_24 0>; + nvmem-cell-names = "mac-address"; + }; + }; + + fragment@2 { + target = <&pio>; + __overlay__ { + 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 */ + }; + }; + }; + }; + + fragment@3 { + target = <&spi0>; + __overlay__ { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand@0 { + compatible = "spi-nand"; + #address-cells = <1>; + #size-cells = <1>; + 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 0x0100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x100000 0x80000>; + }; + + factory: partition@180000 { + label = "factory"; + reg = <0x180000 0x200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_24: macaddr@24 { + compatible = "mac-base"; + reg = <0x24 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_2a: macaddr@2a { + compatible = "mac-base"; + reg = <0x2a 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@380000 { + label = "fip"; + reg = <0x380000 0x200000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x7200000>; + }; + }; + }; + }; + }; + + fragment@4 { + target = <&wifi>; + __overlay__ { + mediatek,mtd-eeprom = <&factory 0x0>; + }; + }; +}; diff --git a/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m.dts b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m.dts new file mode 100644 index 00000000000000..3f330f40fae43e --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m.dts @@ -0,0 +1,156 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* + * Copyright (C) 2023 Tianling Shen + */ + +/dts-v1/; +#include +#include + +#include "mt7981.dtsi" + +/ { + model = "CMCC RAX3000M"; + compatible = "cmcc,rax3000m", "mediatek,mt7981"; + + aliases { + led-boot = &red_led; + led-failsafe = &red_led; + led-running = &green_led; + led-upgrade = &green_led; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory { + reg = <0 0x40000000 0 0x20000000>; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + + button-mesh { + label = "mesh"; + linux,code = ; + linux,input-type = ; + gpios = <&pio 0 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + green_led: led-0 { + label = "green:status"; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + }; + + led-1 { + label = "blue:status"; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + }; + + red_led: led-2 { + label = "red:status"; + gpios = <&pio 35 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + }; +}; + +&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>; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan3"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan1"; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + status = "okay"; +}; + +&xhci { + status = "okay"; +}; diff --git a/target/linux/mediatek/dts/mt7981b-confiabits-mt7981.dts b/target/linux/mediatek/dts/mt7981b-confiabits-mt7981.dts new file mode 100644 index 00000000000000..2824bbfc842156 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-confiabits-mt7981.dts @@ -0,0 +1,296 @@ +/dts-v1/; + +#include "mt7981.dtsi" +#include +#include +#include + +/ { + model = "Confiabits MT7981"; + compatible = "confiabits,mt7981", "mediatek,mt7981"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-mesh { + label = "mesh"; + linux,input-type = ; + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + + button-reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-wlan5g { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <5>; + gpios = <&pio 5 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + led-wan-red { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&pio 6 GPIO_ACTIVE_LOW>; + }; + + led_power: led-power { + label = "blue:power"; // can be removed once #13837 is merged + color = ; + function = LED_FUNCTION_POWER; + gpios = <&pio 7 GPIO_ACTIVE_LOW>; + }; + + led-lan1 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + }; + + led-lan2 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + + led-lan3 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + + led-wan-blue { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + }; + + led-wlan2g { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <2>; + gpios = <&pio 34 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led-mesh { + color = ; + function = "mesh"; // no LED_FUNCTION_MESH yet + gpios = <&pio 35 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_4 0>; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; +}; + + +&mdio_bus { + #address-cells = <1>; + #size-cells = <0>; + + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@2 { + reg = <2>; + label = "lan2"; + }; + + port@3 { + reg = <3>; + label = "lan3"; + }; + + port@4 { + reg = <4>; + label = "wan"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_4 1>; + }; + + port@6 { + reg = <6>; + label = "cpu"; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&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-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-buswidth = <4>; + spi-rx-buswidth = <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 0x0100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x0100000 0x0080000>; + read-only; + }; + + factory: partition@180000 { + label = "Factory"; + reg = <0x180000 0x0200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@380000 { + label = "FIP"; + reg = <0x380000 0x0200000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x4000000>; + compatible = "linux,ubi"; + }; + }; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + }; + +}; + +&usb_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; + mediatek,u3p-dis-msk = <0x1>; +}; + +&wifi { + status = "okay"; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; +}; diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts b/target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts index 7975d247b15f2e..e2fa8bf5d3fbf9 100644 --- a/target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts +++ b/target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts @@ -95,7 +95,7 @@ phy-mode = "2500base-x"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; fixed-link { speed = <2500>; @@ -112,7 +112,7 @@ }; &mdio_bus { - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; @@ -168,6 +168,18 @@ label = "bdinfo"; reg = <0x60000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@70000 { @@ -223,8 +235,7 @@ label = "wan"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_bdinfo_de00>; - mac-address-increment = <1>; + nvmem-cells = <&macaddr_bdinfo_de00 1>; }; lan1: port@1 { @@ -232,7 +243,7 @@ label = "lan1"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; }; port@2 { @@ -240,7 +251,7 @@ label = "lan2"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; }; port@3 { @@ -248,7 +259,7 @@ label = "lan3"; nvmem-cell-names = "mac-address"; - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; }; port@6 { @@ -270,13 +281,3 @@ status = "okay"; mediatek,mtd-eeprom = <&factory 0x0>; }; - -&bdinfo { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdinfo_de00: macaddr@de00 { - reg = <0xde00 0x6>; - }; -}; diff --git a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts new file mode 100644 index 00000000000000..068dd0f236e28a --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts @@ -0,0 +1,151 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; +#include "mt7981.dtsi" + +/ { + model = "GL.iNet GL-MT2500"; + compatible = "glinet,gl-mt2500", "mediatek,mt7981"; + + aliases { + label-mac-device = &gmac0; + led-boot = &led_sys_white; + led-failsafe = &led_sys_blue; + led-running = &led_sys_white; + led-upgrade = &led_sys_blue; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " root=PARTLABEL=rootfs rootwait"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-vpn { + label = "white:vpn"; + gpios = <&pio 31 GPIO_ACTIVE_LOW>; + }; + + led_sys_white: led-system-white { + label = "white:system"; + gpios = <&pio 30 GPIO_ACTIVE_LOW>; + }; + + led_sys_blue: led-system-blue { + label = "blue:system"; + gpios = <&pio 29 GPIO_ACTIVE_LOW>; + }; + }; + + usb_vbus: regulstor-usb { + compatible = "regulator-fixed"; + + regulator-name = "usb-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + + gpio = <&pio 12 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-boot-on; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; +}; + +&pio { + mmc0_pins_default: mmc0-pins-default { + mux { + function = "flash"; + groups = "emmc_45"; + }; + }; + mmc0_pins_uhs: mmc0-pins-uhs { + mux { + function = "flash"; + groups = "emmc_45"; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +ð { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + + phy-mode = "2500base-x"; + phy-handle = <&phy5>; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + }; +}; + +&mdio_bus { + reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>; + reset-delay-us = <600>; + reset-post-delay-us = <20000>; + + phy5: ethernet-phy@5 { + reg = <5>; + compatible = "ethernet-phy-ieee802.3-c45"; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; + vbus-supply = <&usb_vbus>; +}; + +&mmc0 { + status = "okay"; + + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc0_pins_default>; + pinctrl-1 = <&mmc0_pins_uhs>; + bus-width = <8>; + max-frequency = <52000000>; + vmmc-supply = <®_3p3v>; + cap-mmc-highspeed; + non-removable; +}; diff --git a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt3000.dts b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt3000.dts index 028b0e83b72ba0..b1ebaf4312cb81 100644 --- a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt3000.dts +++ b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt3000.dts @@ -7,6 +7,7 @@ compatible = "glinet,gl-mt3000", "mediatek,mt7981"; aliases { + label-mac-device = &gmac0; led-boot = &led_lightblue; led-failsafe = &led_lightblue; led-running = &led_white; @@ -90,7 +91,7 @@ reg = <0>; phy-mode = "2500base-x"; phy-handle = <&phy0>; - nvmem-cells = <&macaddr>; + nvmem-cells = <&macaddr 0>; nvmem-cell-names = "mac-address"; }; @@ -99,9 +100,8 @@ reg = <1>; phy-mode = "gmii"; phy-handle = <&int_gbe_phy>; - nvmem-cells = <&macaddr>; + nvmem-cells = <&macaddr 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; @@ -178,12 +178,16 @@ reg = <0x180000 0x0200000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr: macaddr@a { - reg = <0xa 0x6>; + macaddr: macaddr@a { + compatible = "mac-base"; + reg = <0xa 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; 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 671e1f1839ab49..de702d4a534c6f 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-jcg-q30-pro.dts b/target/linux/mediatek/dts/mt7981b-jcg-q30-pro.dts new file mode 100644 index 00000000000000..bb6b474080ac12 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-jcg-q30-pro.dts @@ -0,0 +1,225 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include +#include + +#include "mt7981.dtsi" + +/ { + model = "JCG Q30 PRO"; + compatible = "jcg,q30-pro", "mediatek,mt7981"; + + aliases { + serial0 = &uart0; + label-mac-device = &gmac0; + led-boot = &led_status_red; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_blue; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory { + reg = <0 0x40000000 0 0x10000000>; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_red: red { + label = "red:status"; + gpios = <&pio 8 GPIO_ACTIVE_HIGH>; + }; + + led_status_blue: blue { + label = "blue:status"; + gpios = <&pio 13 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cells = <&macaddr_lan>; + nvmem-cell-names = "mac-address"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; +}; + +&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@0 { + compatible = "spi-nand"; + #address-cells = <1>; + #size-cells = <1>; + 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 = <0x0000000 0x0100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x0100000 0x0080000>; + }; + + factory: partition@180000 { + label = "Factory"; + reg = <0x0180000 0x0200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_wan: macaddr@a0024 { + reg = <0xa0024 0x6>; + }; + + macaddr_lan: macaddr@a002a { + reg = <0xa002a 0x6>; + }; + }; + }; + + partition@380000 { + label = "fip"; + reg = <0x0380000 0x0200000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + reg = <0x0580000 0x7000000>; + }; + }; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "wan"; + nvmem-cells = <&macaddr_wan>; + 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-qihoo-360t7.dts b/target/linux/mediatek/dts/mt7981b-qihoo-360t7.dts index d897697ef2331e..cd6f6b30c3efed 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 7ab94f36230c2a..1e738a4474dc67 100644 --- a/target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u.dtsi +++ b/target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u.dtsi @@ -73,9 +73,8 @@ reg = <0>; phy-mode = "2500base-x"; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; fixed-link { speed = <2500>; @@ -86,7 +85,7 @@ }; &mdio_bus { - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; @@ -177,12 +176,16 @@ reg = <0x180000 0x200000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/mediatek/dts/mt7981b-zbtlink-zbt-z8102ax.dts b/target/linux/mediatek/dts/mt7981b-zbtlink-zbt-z8102ax.dts new file mode 100644 index 00000000000000..112fd777f05b51 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-zbtlink-zbt-z8102ax.dts @@ -0,0 +1,331 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "mt7981.dtsi" + +/ { + model = "Zbtlink ZBT-Z8102AX"; + compatible = "zbtlink,zbt-z8102ax", "mediatek,mt7981"; + + aliases { + serial0 = &uart0; + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_green; + label-mac-device = &gmac0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8 loglevel=8"; + }; + + memory { + reg = <0 0x40000000 0 0x40000000>; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + + button-mesh { + label = "mesh"; + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_HIGH>; + }; + + button-hub { + label = "hub"; + linux,code = ; + gpios = <&pio 12 GPIO_ACTIVE_HIGH>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_red: red { + label = "red:status"; + gpios = <&pio 9 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_STATUS; + }; + + led_status_green: green { + label = "green:status"; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + }; + + blue { + label = "blue:status"; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + }; + + 4g { + label = "blue:4g"; + gpios = <&pio 8 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_USB; + function-enumerator = <0>; + }; + + 4g2 { + label = "blue:4g2"; + gpios = <&pio 14 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_USB; + function-enumerator = <1>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&pio 2 GPIO_ACTIVE_HIGH>; + hw_algo = "toggle"; + hw_margin_ms = <1000>; + }; + + gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + pcie { + gpio-export,name = "pcie_power"; + gpio-export,output = <1>; + gpios = <&pio 3 GPIO_ACTIVE_HIGH>; + }; + + 5g1 { + gpio-export,name = "5g1"; + gpio-export,output = <1>; + gpios = <&pio 4 GPIO_ACTIVE_HIGH>; + }; + + 5g2 { + gpio-export,name = "5g2"; + gpio-export,output = <1>; + gpios = <&pio 5 GPIO_ACTIVE_HIGH>; + }; + + sim1 { + gpio-export,name = "sim1"; + gpio-export,output = <1>; + gpios = <&pio 6 GPIO_ACTIVE_HIGH>; + }; + + sim2 { + gpio-export,name = "sim2"; + gpio-export,output = <1>; + gpios = <&pio 7 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + /* LAN */ + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_4 2>; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + /* WAN */ + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_4 3>; + }; +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <0x1f>; + 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@0 { + compatible = "spi-nand"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + + spi-max-frequency = <52000000>; + 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 = <0x0000000 0x0100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x100000 0x80000>; + }; + + partition@180000 { + label = "Factory"; + reg = <0x180000 0x200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory: eeprom@0 { + reg = <0x0 0x1000>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@380000 { + label = "FIP"; + reg = <0x380000 0x200000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x4000000>; + }; + }; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + }; + + port@3 { + reg = <3>; + label = "lan4"; + }; + + port@6 { + reg = <6>; + label = "cpu"; + 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>; + bias-pull-up = <103>; + }; + + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = <8>; + bias-pull-down = <103>; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; +}; + +&wifi { + status = "okay"; + + nvmem-cells = <&eeprom_factory>; + nvmem-cell-names = "eeprom"; +}; diff --git a/target/linux/mediatek/dts/mt7981b-zyxel-nwa50ax-pro.dts b/target/linux/mediatek/dts/mt7981b-zyxel-nwa50ax-pro.dts index d222cebb4fe83c..54df8c054ace3a 100644 --- a/target/linux/mediatek/dts/mt7981b-zyxel-nwa50ax-pro.dts +++ b/target/linux/mediatek/dts/mt7981b-zyxel-nwa50ax-pro.dts @@ -136,12 +136,14 @@ reg = <0x180000 0x0200000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr: macaddr@a { - reg = <0xa 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr: macaddr@a { + reg = <0xa 0x6>; + }; }; }; @@ -190,12 +192,14 @@ reg = <0xef80000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_mrd_1fff8: macaddr@1fff8 { - reg = <0x1fff8 0x6>; + macaddr_mrd_1fff8: macaddr@1fff8 { + reg = <0x1fff8 0x6>; + }; }; }; }; diff --git a/target/linux/mediatek/dts/mt7986a-acelink-ew-7886cax.dts b/target/linux/mediatek/dts/mt7986a-acelink-ew-7886cax.dts new file mode 100644 index 00000000000000..1bf5d7317e8471 --- /dev/null +++ b/target/linux/mediatek/dts/mt7986a-acelink-ew-7886cax.dts @@ -0,0 +1,238 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT + +/dts-v1/; +#include +#include +#include + +#include "mt7986a.dtsi" + +/ { + compatible = "acelink,ew-7886cax", "mediatek,mt7986a"; + model = "Acelink EW-7886CAX"; + + aliases { + serial0 = &uart0; + led-boot = &led_status_blue; + led-running = &led_status_green; + led-upgrade = &led_status_red; + led-failsafe = &led_status_red; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory@40000000 { + reg = <0 0x40000000 0 0x20000000>; + device_type = "memory"; + }; + + keys { + compatible = "gpio-keys"; + + key-restart { + label = "Reset"; + gpios = <&pio 7 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_red: led-0 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 18 GPIO_ACTIVE_HIGH>; + }; + + led_status_green: led-1 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 19 GPIO_ACTIVE_HIGH>; + }; + + led_status_blue: led-2 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 20 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&crypto { + status = "okay"; +}; + +ð { + status = "okay"; + + mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "2500base-x"; + phy-handle = <&phy6>; + nvmem-cells = <&macaddr>; + nvmem-cell-names = "mac-address"; + }; + + mdio-bus { + reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>; + reset-delay-us = <50000>; + reset-post-delay-us = <20000>; + #address-cells = <1>; + #size-cells = <0>; + + /* Maxlinear GPY211C */ + phy6: phy@6 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <6>; + }; + }; +}; + +&pcie_phy { + status = "okay"; +}; + +&pio { + spi_flash_pins: spi-flash-pins-33-to-38 { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + conf-pu { + pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP"; + drive-strength = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + conf-pd { + pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; + drive-strength = <8>; + mediatek,pull-down-adv = <0>; /* bias-disable */ + }; + }; + + wf_2g_5g_pins: wf_2g_5g-pins { + mux { + function = "wifi"; + groups = "wf_2g", "wf_5g"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; + + wf_dbdc_pins: wf-dbdc-pins { + mux { + function = "wifi"; + groups = "wf_dbdc"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi_flash_pins>; + status = "okay"; + + flash@0 { + compatible = "spi-nand"; + reg = <0>; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <52000000>; + spi-rx-bus-width = <4>; + spi-tx-bus-width = <4>; + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x100000>; + label = "bootloader"; + read-only; + }; + + partition@100000 { + reg = <0x100000 0x80000>; + label = "u-boot-env"; + }; + + partition@180000 { + compatible = "nvmem-cells"; + reg = <0x180000 0x200000>; + label = "factory"; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom: eeprom@0 { + reg = <0x0 0x1000>; + }; + + macaddr: macaddr@4 { + reg = <0x4 0x6>; + }; + }; + }; + + partition@380000 { + reg = <0x380000 0x200000>; + label = "fip"; + }; + + partition@580000 { + reg = <0x580000 0x4000000>; + label = "ubi"; + }; + }; + }; +}; + +&trng { + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + pinctrl-names = "default", "dbdc"; + pinctrl-0 = <&wf_2g_5g_pins>; + pinctrl-1 = <&wf_dbdc_pins>; + nvmem-cells = <&eeprom>; + nvmem-cell-names = "eeprom"; + status = "okay"; +}; diff --git a/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts b/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts index 35a2c30bb45476..6bff786558be9e 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 ac854f10d13ae5..2af18958bc517f 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 new file mode 100644 index 00000000000000..41e6d2471d09f6 --- /dev/null +++ b/target/linux/mediatek/dts/mt7986a-asus-tuf-ax6000.dts @@ -0,0 +1,382 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; +#include +#include +#include + +#include "mt7986a.dtsi" + +/ { + model = "ASUS TUF-AX6000"; + compatible = "asus,tuf-ax6000", "mediatek,mt7986a"; + + aliases { + serial0 = &uart0; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-override = "ubi.mtd=UBI_DEV"; + }; + + memory { + reg = <0 0x40000000 0 0x20000000>; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + mesh { + label = "wps"; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + wlan { + label = "white:wlan"; + gpios = <&pio 2 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1tpt"; + }; + + led_system: system { + label = "white:system"; + gpios = <&pio 11 GPIO_ACTIVE_HIGH>; + }; + + wan-red { + label = "red:wan"; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + }; + + cover-blue { + label = "blue:cover"; + gpios = <&pio 20 GPIO_ACTIVE_HIGH>; + }; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_5v: regulator-5v { + compatible = "regulator-fixed"; + regulator-name = "fixed-5V"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + regulator-always-on; + }; +}; + +&crypto { + status = "okay"; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + /* LAN */ + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + /* WAN */ + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "2500base-x"; + phy-handle = <&phy6>; + }; + + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + }; +}; + +&mdio { + reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>; + reset-delay-us = <50000>; + reset-post-delay-us = <20000>; + + phy5: phy@5 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <5>; + + mxl,led-config = <0x03f0 0x0 0x0 0x0>; + }; + + phy6: phy@6 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <6>; + + /* LED0: CONN (WAN white) */ + mxl,led-config = <0x03f0 0x0 0x0 0x0>; + }; + + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + + reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; + reset-assert-us = <10000>; + reset-deassert-us = <10000>; + }; +}; + +&pio { + spi_flash_pins: spi-flash-pins-33-to-38 { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + conf-pu { + pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP"; + drive-strength = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + conf-pd { + pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; + drive-strength = <8>; + mediatek,pull-down-adv = <0>; /* bias-disable */ + }; + }; + + wf_2g_5g_pins: wf_2g_5g-pins { + mux { + function = "wifi"; + groups = "wf_2g", "wf_5g"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; + + wf_dbdc_pins: wf-dbdc-pins { + mux { + function = "wifi"; + groups = "wf_dbdc"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; +}; + +&pcie_phy { + status = "okay"; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi_flash_pins>; + status = "okay"; + + spi_nand_flash: flash@0 { + compatible = "spi-nand"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + + spi-max-frequency = <20000000>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + + partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x0 0x400000>; + read-only; + }; + + partition@400000 { + label = "UBI_DEV"; + reg = <0x400000 0xfc00000>; + }; + }; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <4>; + label = "lan1"; + }; + + port@2 { + reg = <3>; + label = "lan2"; + }; + + port@3 { + reg = <2>; + label = "lan3"; + }; + + port@4 { + reg = <1>; + label = "lan4"; + }; + + port@5 { + reg = <5>; + label = "lan5"; + phy-mode = "2500base-x"; + phy-handle = <&phy5>; + + }; + + port@6 { + reg = <6>; + label = "cpu"; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + phy@1 { + reg = <1>; + + mediatek,led-config = < + 0x21 0x8009 /* BASIC_CTRL */ + 0x22 0x0c00 /* ON_DURATION */ + 0x23 0x1400 /* BLINK_DURATION */ + 0x24 0x8000 /* LED0_ON_CTRL */ + 0x25 0x0000 /* LED0_BLINK_CTRL */ + 0x26 0xc007 /* LED1_ON_CTRL */ + 0x27 0x003f /* LED1_BLINK_CTRL */ + >; + }; + + phy@2 { + reg = <2>; + + mediatek,led-config = < + 0x21 0x8009 /* BASIC_CTRL */ + 0x22 0x0c00 /* ON_DURATION */ + 0x23 0x1400 /* BLINK_DURATION */ + 0x24 0x8000 /* LED0_ON_CTRL */ + 0x25 0x0000 /* LED0_BLINK_CTRL */ + 0x26 0xc007 /* LED1_ON_CTRL */ + 0x27 0x003f /* LED1_BLINK_CTRL */ + >; + }; + + phy@3 { + reg = <3>; + + mediatek,led-config = < + 0x21 0x8009 /* BASIC_CTRL */ + 0x22 0x0c00 /* ON_DURATION */ + 0x23 0x1400 /* BLINK_DURATION */ + 0x24 0x8000 /* LED0_ON_CTRL */ + 0x25 0x0000 /* LED0_BLINK_CTRL */ + 0x26 0xc007 /* LED1_ON_CTRL */ + 0x27 0x003f /* LED1_BLINK_CTRL */ + >; + }; + + phy@4 { + reg = <4>; + + mediatek,led-config = < + 0x21 0x8009 /* BASIC_CTRL */ + 0x22 0x0c00 /* ON_DURATION */ + 0x23 0x1400 /* BLINK_DURATION */ + 0x24 0x8000 /* LED0_ON_CTRL */ + 0x25 0x0000 /* LED0_BLINK_CTRL */ + 0x26 0xc007 /* LED1_ON_CTRL */ + 0x27 0x003f /* LED1_BLINK_CTRL */ + >; + }; + }; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + status = "okay"; + pinctrl-names = "default", "dbdc"; + pinctrl-0 = <&wf_2g_5g_pins>; + pinctrl-1 = <&wf_dbdc_pins>; +}; + +&trng { + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +&ssusb { + vusb33-supply = <®_3p3v>; + vbus-supply = <®_5v>; + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; diff --git a/target/linux/mediatek/dts/mt7986a-glinet-gl-mt6000.dts b/target/linux/mediatek/dts/mt7986a-glinet-gl-mt6000.dts index 2be1907f632f12..fded507039b269 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 a1910e36d24b6c..da08bdc723b1b2 100644 --- a/target/linux/mediatek/dts/mt7986a-tplink-tl-xdr-common.dtsi +++ b/target/linux/mediatek/dts/mt7986a-tplink-tl-xdr-common.dtsi @@ -95,7 +95,7 @@ reg = <0>; phy-mode = "2500base-x"; - nvmem-cells = <&macaddr_config_1c>; + nvmem-cells = <&macaddr_config_1c 0>; nvmem-cell-names = "mac-address"; fixed-link { @@ -111,9 +111,8 @@ phy-handle = <&phy7>; phy-mode = "2500base-x"; - nvmem-cells = <&macaddr_config_1c>; + nvmem-cells = <&macaddr_config_1c 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; mdio: mdio-bus { @@ -141,7 +140,7 @@ realtek,aldps-enable; }; - switch: switch@31 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; @@ -182,6 +181,18 @@ label = "config"; reg = <0x100000 0x0060000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_1c: macaddr@1c { + compatible = "mac-base"; + reg = <0x1c 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; factory: partition@160000 { @@ -253,18 +264,7 @@ &wifi { mediatek,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_config_1c>; + nvmem-cells = <&macaddr_config_1c 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; status = "okay"; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_1c: macaddr@1c { - reg = <0x1c 0x6>; - }; -}; 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 a9b44f8df99f4c..ffa5acb5d3694e 100644 --- a/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dtsi +++ b/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dtsi @@ -54,9 +54,8 @@ reg = <0>; phy-mode = "2500base-x"; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; fixed-link { speed = <2500>; @@ -72,7 +71,7 @@ }; &mdio { - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; @@ -167,12 +166,16 @@ reg = <0x180000 0x200000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-common.dtsi b/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-common.dtsi new file mode 100644 index 00000000000000..04e86a737d1d01 --- /dev/null +++ b/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-common.dtsi @@ -0,0 +1,433 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2021 MediaTek Inc. + * Author: Sam.Shih + */ + +#include "mt7986a.dtsi" +#include +#include + +/ { + aliases { + serial0 = &uart0; + label-mac-device = &gmac0; + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_red; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory { + reg = <0 0x40000000 0 0x40000000>; + }; + + reg_1p8v: regulator-1p8v { + compatible = "regulator-fixed"; + regulator-name = "fixed-1.8V"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "fixed-3.3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + + reg_5v: regulator-5v { + compatible = "regulator-fixed"; + regulator-name = "fixed-5V"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + regulator-always-on; + }; + + gpio-keys { + compatible = "gpio-keys"; + poll-interval = <20>; + + reset-button { + label = "reset"; + gpios = <&pio 21 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wlan-button { + label = "wlan"; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + wps-button { + label = "wps"; + gpios = <&pio 56 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_green_wifi24g { + label = "green:wifi24g"; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led_green_wifi5g { + label = "green:wifi5g"; + gpios = <&pio 2 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led_green_inet { + label = "green:inet"; + gpios = <&pio 14 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led_red_inet { + label = "red:inet"; + gpios = <&pio 15 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led_status_green: led_green_pwr { + label = "green:pwr"; + gpios = <&pio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "timer"; /* Default blinking */ + led-pattern = <125 125>; /* Fast blink is 4 HZ */ + }; + + led_status_red: led_red_pwr { + label = "red:pwr"; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led_green_fxs { + label = "green:fxs"; + gpios = <&pio 16 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + led_amber_fxs { + label = "amber:fxs"; + gpios = <&pio 17 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + led_amber_wps24g { + label = "amber:wps24g"; + gpios = <&pio 18 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + led_amber_wps5g { + label = "amber:wps5g"; + gpios = <&pio 19 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + led_green_lan { + label = "green:lan"; + gpios = <&pio 20 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + led_green_sfp { + label = "green:sfp"; + gpios = <&pio 24 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi_flash_pins>; + cs-gpios = <0>, <0>; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + spi_nand: spi_nand@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <10000000>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + + nand_partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + }; + }; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <ð_pins>; + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "2500base-x"; + phy = <&phy6>; + }; + + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>; + reset-delay-us = <1500000>; + reset-post-delay-us = <1000000>; + + phy5: phy@5 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <5>; + mxl,led-config = <0x03f0 0x0 0x0 0x0>; + }; + + phy6: phy@6 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <6>; + mxl,led-config = <0x00f0 0x0 0x0 0x0>; + }; + + switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + }; + + port@3 { + reg = <3>; + label = "lan4"; + }; + + port@5 { + reg = <5>; + label = "lan1"; + phy-mode = "2500base-x"; + phy = <&phy5>; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; + }; + }; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + status = "okay"; + pinctrl-names = "default", "dbdc"; + pinctrl-0 = <&wf_2g_5g_pins>; + pinctrl-1 = <&wf_dbdc_pins>; +}; + +&crypto { + status = "okay"; +}; + +&pio { + eth_pins: eth-pins { + mux { + function = "eth"; + groups = "switch_int", "mdc_mdio"; + }; + }; + + spic_pins_g2: spic-pins-29-to-32 { + mux { + function = "spi"; + groups = "spi1_2"; + }; + }; + + spi_flash_pins: spi-flash-pins-33-to-38 { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + conf-pu { + pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP"; + drive-strength = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + conf-pd { + pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; + drive-strength = <8>; + mediatek,pull-down-adv = <0>; /* bias-disable */ + }; + }; + + uart0_pins: uart0-pins { + mux { + function = "uart"; + groups = "uart0"; + }; + }; + + uart1_pins: uart1-pins { + mux { + function = "uart"; + groups = "uart1"; + }; + }; + + uart2_pins: uart2-pins { + mux { + function = "uart"; + groups = "uart2"; + }; + }; + + wf_2g_5g_pins: wf_2g_5g-pins { + mux { + function = "wifi"; + groups = "wf_2g", "wf_5g"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; + + wf_dbdc_pins: wf_dbdc-pins { + mux { + function = "wifi"; + groups = "wf_dbdc"; + }; + conf { + pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", + "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", + "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", + "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", + "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", + "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", + "WF1_TOP_CLK", "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; + + usb-oc-hog { + gpio-hog; + gpios = <7 GPIO_ACTIVE_LOW>; + input; + line-name = "usb-oc"; + }; +}; + +&spi1 { + pinctrl-names = "default"; + pinctrl-0 = <&spic_pins_g2>; + status = "okay"; + + proslic_spi: proslic_spi@0 { + compatible = "silabs,proslic_spi"; + reg = <0>; + spi-max-frequency = <10000000>; + spi-cpha = <1>; + spi-cpol = <1>; + channel_count = <1>; + debug_level = <4>; /* 1 = TRC, 2 = DBG, 4 = ERR */ + reset_gpio = <&pio 25 GPIO_ACTIVE_HIGH>; + ig,enable-spi = <1>; /* 1: Enable, 0: Disable */ + }; +}; + +&ssusb { + vusb33-supply = <®_3p3v>; + vbus-supply = <®_5v>; + status = "okay"; +}; + +&trng { + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; + status = "disabled"; + + /* EFR32MG21 Zigbee (BOOT)*/ +}; + +&uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&uart2_pins>; + status = "disabled"; + + /* EFR32MG21 Zigbee */ +}; + +&usb_phy { + status = "okay"; +}; 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 2469d3d77d1f12..4dbbd1367794e0 100644 --- a/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-stock.dts +++ b/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-stock.dts @@ -6,6 +6,7 @@ /dts-v1/; #include "mt7986a.dtsi" +#include "mt7986a-zyxel-ex5601-t0-common.dtsi" #include #include @@ -13,556 +14,106 @@ model = "Zyxel EX5601-T0"; compatible = "zyxel,ex5601-t0", "mediatek,mt7986a-rfb-snand"; - aliases { - serial0 = &uart0; + memory@40000000 { + device_type = "memory"; + reg = <0x40000000 0x20000000>; }; - - chosen { - stdout-path = "serial0:115200n8"; - }; - - memory { - reg = <0 0x40000000 0 0x40000000>; - }; - - reg_1p8v: regulator-1p8v { - compatible = "regulator-fixed"; - regulator-name = "fixed-1.8V"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-boot-on; - regulator-always-on; - }; - - reg_3p3v: regulator-3p3v { - compatible = "regulator-fixed"; - regulator-name = "fixed-3.3V"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-boot-on; - regulator-always-on; - }; - - reg_5v: regulator-5v { - compatible = "regulator-fixed"; - regulator-name = "fixed-5V"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - regulator-boot-on; - regulator-always-on; - }; - - gpio-keys { - compatible = "gpio-keys"; - poll-interval = <20>; - - reset-button { - label = "reset"; - gpios = <&pio 21 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wlan-button { - label = "wlan"; - gpios = <&pio 11 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - wps-button { - label = "wps"; - gpios = <&pio 56 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - - zyleds { - compatible = "gpio-leds"; - - led_green_wifi24g { - label = "zyled-green-wifi24g"; - gpios = <&pio 1 GPIO_ACTIVE_LOW>; - default-state = "off"; - }; - - led_green_wifi5g { - label = "zyled-green-wifi5g"; - gpios = <&pio 2 GPIO_ACTIVE_LOW>; - default-state = "off"; - }; - - led_green_inet { - label = "zyled-green-inet"; - gpios = <&pio 14 GPIO_ACTIVE_LOW>; - default-state = "off"; - }; - - led_red_inet { - label = "zyled-red-inet"; - gpios = <&pio 15 GPIO_ACTIVE_LOW>; - default-state = "off"; - }; - - led_green_pwr { - label = "zyled-green-pwr"; - gpios = <&pio 13 GPIO_ACTIVE_LOW>; - linux,default-trigger = "timer"; /* Default blinking */ - led-pattern = <125 125>; /* Fast blink is 4 HZ */ - }; - - led_red_pwr { - label = "zyled-red-pwr"; - gpios = <&pio 12 GPIO_ACTIVE_LOW>; - default-state = "off"; - }; - - led_green_fxs { - label = "zyled-green-fxs"; - gpios = <&pio 16 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_amber_fxs { - label = "zyled-amber-fxs"; - gpios = <&pio 17 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_amber_wps24g { - label = "zyled-amber-wps24g"; - gpios = <&pio 18 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_amber_wps5g { - label = "zyled-amber-wps5g"; - gpios = <&pio 19 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_green_lan { - label = "zyled-green-lan"; - gpios = <&pio 20 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - led_green_sfp { - label = "zyled-green-sfp"; - gpios = <&pio 24 GPIO_ACTIVE_HIGH>; - default-state = "off"; - }; - - }; - -}; - -ð { - status = "okay"; - - gmac0: mac@0 { - compatible = "mediatek,eth-mac"; - reg = <0>; - phy-mode = "2500base-x"; - - nvmem-cells = <&macaddr_factory_002a>; - nvmem-cell-names = "mac-address"; - - fixed-link { - speed = <2500>; - full-duplex; - pause; - }; - }; - - gmac1: mac@1 { - compatible = "mediatek,eth-mac"; - reg = <1>; - phy-mode = "2500base-x"; - phy = <&phy6>; - - nvmem-cells = <&macaddr_factory_0024>; - nvmem-cell-names = "mac-address"; - }; - - mdio: mdio-bus { - #address-cells = <1>; - #size-cells = <0>; - reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>; - reset-delay-us = <1500000>; - reset-post-delay-us = <1000000>; - - phy5: phy@5 { - compatible = "ethernet-phy-ieee802.3-c45"; - reg = <5>; - }; - - phy6: phy@6 { - compatible = "ethernet-phy-ieee802.3-c45"; - reg = <6>; - }; - - switch@0 { - compatible = "mediatek,mt7531"; - reg = <31>; - reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@1 { - reg = <1>; - label = "lan1"; - }; - - port@2 { - reg = <2>; - label = "lan2"; - }; - - port@3 { - reg = <3>; - label = "lan3"; - }; - - port@5 { - reg = <5>; - label = "lan4"; - phy-mode = "2500base-x"; - phy = <&phy5>; - }; - - port@6 { - reg = <6>; - ethernet = <&gmac0>; - phy-mode = "2500base-x"; - - fixed-link { - speed = <2500>; - full-duplex; - pause; - }; - }; - }; - }; - }; -}; - -&watchdog { - status = "okay"; }; -&wifi { - status = "okay"; - pinctrl-names = "default", "dbdc"; - pinctrl-0 = <&wf_2g_5g_pins>; - pinctrl-1 = <&wf_dbdc_pins>; - mediatek,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_factory_0004>; - nvmem-cell-names = "mac-address"; -}; - -&crypto { - status = "okay"; -}; - -&mmc0 { - pinctrl-names = "default", "state_uhs"; - pinctrl-0 = <&mmc0_pins_default>; - pinctrl-1 = <&mmc0_pins_uhs>; - bus-width = <8>; - max-frequency = <200000000>; - cap-mmc-highspeed; - mmc-hs200-1_8v; - mmc-hs400-1_8v; - hs400-ds-delay = <0x14014>; - vmmc-supply = <®_3p3v>; - vqmmc-supply = <®_1p8v>; - non-removable; - no-sd; - no-sdio; - status = "disabled"; +&spi_nand { + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; }; -&pcie { - pinctrl-names = "default"; - pinctrl-0 = <&pcie_pins>; - status = "okay"; -}; +&nand_partitions { -&pcie_phy { - status = "okay"; -}; - -&pio { - mmc0_pins_default: mmc0-pins { - mux { - function = "emmc"; - groups = "emmc_51"; - }; - conf-cmd-dat { - pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", - "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", - "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; - input-enable; - drive-strength = <4>; - mediatek,pull-up-adv = <1>; /* pull-up 10K */ - }; - conf-clk { - pins = "EMMC_CK"; - drive-strength = <6>; - mediatek,pull-down-adv = <2>; /* pull-down 50K */ - }; - conf-ds { - pins = "EMMC_DSL"; - mediatek,pull-down-adv = <2>; /* pull-down 50K */ - }; - conf-rst { - pins = "EMMC_RSTB"; - drive-strength = <4>; - mediatek,pull-up-adv = <1>; /* pull-up 10K */ - }; + partition@0 { + label = "BL2"; + reg = <0x00000 0x0100000>; + read-only; }; - mmc0_pins_uhs: mmc0-uhs-pins { - mux { - function = "emmc"; - groups = "emmc_51"; - }; - conf-cmd-dat { - pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2", - "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5", - "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD"; - input-enable; - drive-strength = <4>; - mediatek,pull-up-adv = <1>; /* pull-up 10K */ - }; - conf-clk { - pins = "EMMC_CK"; - drive-strength = <6>; - mediatek,pull-down-adv = <2>; /* pull-down 50K */ - }; - conf-ds { - pins = "EMMC_DSL"; - mediatek,pull-down-adv = <2>; /* pull-down 50K */ - }; - conf-rst { - pins = "EMMC_RSTB"; - drive-strength = <4>; - mediatek,pull-up-adv = <1>; /* pull-up 10K */ - }; + partition@100000 { + label = "u-boot-env"; + reg = <0x0100000 0x0080000>; }; - pcie_pins: pcie-pins { - mux { - function = "pcie"; - groups = "pcie_clk", "pcie_wake", "pcie_pereset"; - }; - }; - - spic_pins_g2: spic-pins-29-to-32 { - mux { - function = "spi"; - groups = "spi1_2"; - }; - }; - - spi_flash_pins: spi-flash-pins-33-to-38 { - mux { - function = "spi"; - groups = "spi0", "spi0_wp_hold"; - }; - conf-pu { - pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP"; - drive-strength = <8>; - mediatek,pull-up-adv = <0>; /* bias-disable */ - }; - conf-pd { - pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; - drive-strength = <8>; - mediatek,pull-down-adv = <0>; /* bias-disable */ - }; - }; + factory: partition@180000 { + label = "Factory"; + reg = <0x180000 0x0200000>; + read-only; - uart1_pins: uart1-pins { - mux { - function = "uart"; - groups = "uart1"; - }; - }; - - uart2_pins: uart2-pins { - mux { - function = "uart"; - groups = "uart2"; - }; - }; - - wf_2g_5g_pins: wf_2g_5g-pins { - mux { - function = "wifi"; - groups = "wf_2g", "wf_5g"; - }; - conf { - pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", - "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", - "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", - "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", - "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", - "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", - "WF1_TOP_CLK", "WF1_TOP_DATA"; - drive-strength = <4>; - }; - }; - - wf_dbdc_pins: wf_dbdc-pins { - mux { - function = "wifi"; - groups = "wf_dbdc"; - }; - conf { - pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4", - "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6", - "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10", - "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1", - "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0", - "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8", - "WF1_TOP_CLK", "WF1_TOP_DATA"; - drive-strength = <4>; - }; - }; -}; - -&spi0 { - pinctrl-names = "default"; - pinctrl-0 = <&spi_flash_pins>; - cs-gpios = <0>, <0>; - #address-cells = <1>; - #size-cells = <0>; - status = "okay"; - - spi_nand: spi_nand@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "spi-nand"; - reg = <1>; - spi-max-frequency = <10000000>; - spi-tx-bus-width = <4>; - spi-rx-bus-width = <4>; - - partitions { - compatible = "fixed-partitions"; + nvmem-layout { + compatible = "fixed-layout"; #address-cells = <1>; #size-cells = <1>; - partition@0 { - label = "BL2"; - reg = <0x00000 0x0100000>; - read-only; + eeprom_factory: eeprom@0 { + #size-cells = <1>; + reg = <0x0 0x1000>; }; - partition@100000 { - label = "u-boot-env"; - reg = <0x0100000 0x0080000>; + macaddr_factory_0004: macaddr@0004 { + compatible = "mac-base"; + reg = <0x0004 0x6>; + #nvmem-cell-cells = <1>; }; - factory: partition@180000 { - label = "Factory"; - reg = <0x180000 0x0200000>; - read-only; + macaddr_factory_0024: macaddr@0024 { + compatible = "mac-base"; + reg = <0x0024 0x6>; + #nvmem-cell-cells = <1>; }; - partition@380000 { - label = "FIP"; - reg = <0x380000 0x01C0000>; - read-only; - }; - - partition@540000 { - label = "zloader"; - reg = <0x540000 0x0040000>; - read-only; - }; - - partition@580000 { - label = "ubi"; - reg = <0x580000 0x4000000>; - }; - - partition@4580000 { - label = "ubi2"; - reg = <0x4580000 0x4000000>; - read-only; - }; - - partition@8580000 { - label = "zyubi"; - reg = <0x8580000 0x15A80000>; + macaddr_factory_002a: macaddr@002a { + compatible = "mac-base"; + reg = <0x002a 0x6>; + #nvmem-cell-cells = <1>; }; }; }; -}; -&spi1 { - pinctrl-names = "default"; - pinctrl-0 = <&spic_pins_g2>; - status = "okay"; - - proslic_spi: proslic_spi@0 { - compatible = "silabs,proslic_spi"; - reg = <0>; - spi-max-frequency = <10000000>; - spi-cpha = <1>; - spi-cpol = <1>; - channel_count = <1>; - debug_level = <4>; /* 1 = TRC, 2 = DBG, 4 = ERR */ - reset_gpio = <&pio 7 GPIO_ACTIVE_HIGH>; - ig,enable-spi = <1>; /* 1: Enable, 0: Disable */ + partition@380000 { + label = "FIP"; + reg = <0x380000 0x01C0000>; + read-only; }; -}; -&ssusb { - vusb33-supply = <®_3p3v>; - vbus-supply = <®_5v>; - status = "okay"; -}; + partition@540000 { + label = "zloader"; + reg = <0x540000 0x0040000>; + read-only; + }; -&trng { - status = "okay"; -}; + partition@580000 { + label = "ubi"; + reg = <0x580000 0x4000000>; + }; -&uart0 { - status = "okay"; -}; + partition@4580000 { + label = "ubi2"; + reg = <0x4580000 0x4000000>; + read-only; + }; -&uart1 { - pinctrl-names = "default"; - pinctrl-0 = <&uart1_pins>; - status = "okay"; + partition@8580000 { + label = "zyubi"; + reg = <0x8580000 0x15A80000>; + }; }; -&uart2 { - pinctrl-names = "default"; - pinctrl-0 = <&uart2_pins>; - status = "okay"; +&gmac0 { + nvmem-cells = <&macaddr_factory_002a 0>; + nvmem-cell-names = "mac-address"; }; -&usb_phy { - status = "okay"; +&gmac1 { + nvmem-cells = <&macaddr_factory_0024 0>; + nvmem-cell-names = "mac-address"; }; -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_0004: macaddr@0004 { - reg = <0x0004 0x6>; - }; - - macaddr_factory_0024: macaddr@0024 { - reg = <0x0024 0x6>; - }; - - macaddr_factory_002a: macaddr@002a { - reg = <0x002a 0x6>; - }; +&wifi { + nvmem-cells = <&eeprom_factory>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-ubootmod.dts b/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-ubootmod.dts new file mode 100644 index 00000000000000..62ce50ed232f15 --- /dev/null +++ b/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-ubootmod.dts @@ -0,0 +1,101 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright (C) 2021 MediaTek Inc. + * Author: Sam.Shih + */ + +/dts-v1/; +#include "mt7986a.dtsi" +#include "mt7986a-zyxel-ex5601-t0-common.dtsi" +#include +#include + +/ { + model = "Zyxel EX5601-T0 ubootmod"; + compatible = "zyxel,ex5601-t0-ubootmod", "mediatek,mt7986a"; + memory@40000000 { + device_type = "memory"; + reg = <0x40000000 0x20000000>; + }; +}; + +&nand_partitions { + partition@0 { + label = "bl2"; + reg = <0x0 0x100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x0100000 0x0080000>; + read-only; + }; + + factory: partition@180000 { + label = "Factory"; + reg = <0x180000 0x0200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory: eeprom@0 { + #size-cells = <1>; + reg = <0x0 0x1000>; + }; + + macaddr_factory_0004: macaddr@0004 { + compatible = "mac-base"; + reg = <0x0004 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_0024: macaddr@0024 { + compatible = "mac-base"; + reg = <0x0024 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_002a: macaddr@002a { + compatible = "mac-base"; + reg = <0x002a 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@380000 { + label = "fip"; + reg = <0x380000 0x0200000>; + read-only; + }; + + partition@540000 { + label = "zloader"; + reg = <0x540000 0x0040000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x1da80000>; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_002a 0>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + nvmem-cells = <&macaddr_factory_0024 0>; + nvmem-cell-names = "mac-address"; +}; + +&wifi { + nvmem-cells = <&eeprom_factory>; + nvmem-cell-names = "eeprom"; +}; diff --git a/target/linux/mediatek/dts/mt7986a-zyxel-ex5700-telenor.dts b/target/linux/mediatek/dts/mt7986a-zyxel-ex5700-telenor.dts index a486f29fec8fe3..f5bb73c97d7ee7 100644 --- a/target/linux/mediatek/dts/mt7986a-zyxel-ex5700-telenor.dts +++ b/target/linux/mediatek/dts/mt7986a-zyxel-ex5700-telenor.dts @@ -337,10 +337,6 @@ label = "Factory"; reg = <0x180000 0x200000>; read-only; - - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; }; partition@380000 { label = "FIP"; diff --git a/target/linux/mediatek/dts/mt7986b-mercusys-mr90x-v1.dts b/target/linux/mediatek/dts/mt7986b-mercusys-mr90x-v1.dts index d4620b385662b7..42250be19ac845 100644 --- a/target/linux/mediatek/dts/mt7986b-mercusys-mr90x-v1.dts +++ b/target/linux/mediatek/dts/mt7986b-mercusys-mr90x-v1.dts @@ -8,7 +8,7 @@ / { compatible = "mercusys,mr90x-v1", "mediatek,mt7986b"; - model = "Mercusys MR90X v1"; + model = "MERCUSYS MR90X v1"; aliases { serial0 = &uart0; @@ -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/mt7981.dtsi b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981.dtsi index 05d4b7d91da112..cb161df81e9d57 100644 --- a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981.dtsi +++ b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7981.dtsi @@ -55,8 +55,8 @@ fan: pwm-fan { compatible = "pwm-fan"; - /* cooling level (0, 1, 2, 3) : (0% duty, 50% duty, 75% duty, 100% duty) */ - cooling-levels = <0 128 192 255>; + /* cooling level (0, 1, 2, 3, 4, 5, 6, 7) : (0%/25%/37.5%/50%/62.5%/75%/87.5%/100% duty) */ + cooling-levels = <0 63 95 127 159 191 223 255>; #cooling-cells = <2>; status = "disabled"; }; @@ -67,55 +67,67 @@ polling-delay = <1000>; thermal-sensors = <&thermal 0>; trips { - cpu_trip_crit: crit { - temperature = <125000>; + cpu_trip_active_highest: active-highest { + temperature = <70000>; hysteresis = <2000>; - type = "critical"; - }; - - cpu_trip_hot: hot { - temperature = <120000>; - hysteresis = <2000>; - type = "hot"; + type = "active"; }; cpu_trip_active_high: active-high { - temperature = <115000>; + temperature = <60000>; hysteresis = <2000>; type = "active"; }; cpu_trip_active_med: active-med { - temperature = <85000>; + temperature = <50000>; hysteresis = <2000>; type = "active"; }; cpu_trip_active_low: active-low { - temperature = <60000>; + temperature = <45000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_active_lowest: active-lowest { + temperature = <40000>; hysteresis = <2000>; type = "active"; }; }; cooling-maps { + cpu-active-highest { + /* active: set fan to cooling level 7 */ + cooling-device = <&fan 7 7>; + trip = <&cpu_trip_active_highest>; + }; + cpu-active-high { - /* active: set fan to cooling level 3 */ - cooling-device = <&fan 3 3>; + /* active: set fan to cooling level 5 */ + cooling-device = <&fan 5 5>; trip = <&cpu_trip_active_high>; }; cpu-active-med { - /* active: set fan to cooling level 2 */ - cooling-device = <&fan 2 2>; + /* active: set fan to cooling level 3 */ + cooling-device = <&fan 3 3>; trip = <&cpu_trip_active_med>; }; cpu-active-low { - /* passive: set fan to cooling level 1 */ - cooling-device = <&fan 1 1>; + /* active: set fan to cooling level 2 */ + cooling-device = <&fan 2 2>; trip = <&cpu_trip_active_low>; }; + + cpu-active-lowest { + /* active: set fan to cooling level 1 */ + cooling-device = <&fan 1 1>; + trip = <&cpu_trip_active_lowest>; + }; }; }; }; 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 1d3c575b7d4c42..d326c416a9d3ae 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 1ab56e37f741cd..26d560bd4bcb11 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 83d51916717fb9..8cd094f7c3eeb1 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/mt7981.dtsi b/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7981.dtsi index 05d4b7d91da112..cb161df81e9d57 100644 --- a/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7981.dtsi +++ b/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7981.dtsi @@ -55,8 +55,8 @@ fan: pwm-fan { compatible = "pwm-fan"; - /* cooling level (0, 1, 2, 3) : (0% duty, 50% duty, 75% duty, 100% duty) */ - cooling-levels = <0 128 192 255>; + /* cooling level (0, 1, 2, 3, 4, 5, 6, 7) : (0%/25%/37.5%/50%/62.5%/75%/87.5%/100% duty) */ + cooling-levels = <0 63 95 127 159 191 223 255>; #cooling-cells = <2>; status = "disabled"; }; @@ -67,55 +67,67 @@ polling-delay = <1000>; thermal-sensors = <&thermal 0>; trips { - cpu_trip_crit: crit { - temperature = <125000>; + cpu_trip_active_highest: active-highest { + temperature = <70000>; hysteresis = <2000>; - type = "critical"; - }; - - cpu_trip_hot: hot { - temperature = <120000>; - hysteresis = <2000>; - type = "hot"; + type = "active"; }; cpu_trip_active_high: active-high { - temperature = <115000>; + temperature = <60000>; hysteresis = <2000>; type = "active"; }; cpu_trip_active_med: active-med { - temperature = <85000>; + temperature = <50000>; hysteresis = <2000>; type = "active"; }; cpu_trip_active_low: active-low { - temperature = <60000>; + temperature = <45000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_active_lowest: active-lowest { + temperature = <40000>; hysteresis = <2000>; type = "active"; }; }; cooling-maps { + cpu-active-highest { + /* active: set fan to cooling level 7 */ + cooling-device = <&fan 7 7>; + trip = <&cpu_trip_active_highest>; + }; + cpu-active-high { - /* active: set fan to cooling level 3 */ - cooling-device = <&fan 3 3>; + /* active: set fan to cooling level 5 */ + cooling-device = <&fan 5 5>; trip = <&cpu_trip_active_high>; }; cpu-active-med { - /* active: set fan to cooling level 2 */ - cooling-device = <&fan 2 2>; + /* active: set fan to cooling level 3 */ + cooling-device = <&fan 3 3>; trip = <&cpu_trip_active_med>; }; cpu-active-low { - /* passive: set fan to cooling level 1 */ - cooling-device = <&fan 1 1>; + /* active: set fan to cooling level 2 */ + cooling-device = <&fan 2 2>; trip = <&cpu_trip_active_low>; }; + + cpu-active-lowest { + /* active: set fan to cooling level 1 */ + cooling-device = <&fan 1 1>; + trip = <&cpu_trip_active_lowest>; + }; }; }; }; 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 1ab56e37f741cd..26d560bd4bcb11 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/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index ea126bc46f9e40..b1411d56d39353 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -6,6 +6,12 @@ board=$(board_name) board_config_update case $board in +confiabits,mt7981) + ucidef_set_led_netdev "lan1" "lan1" "blue:lan-1" "lan1" "link tx rx" + ucidef_set_led_netdev "lan2" "lan2" "blue:lan-2" "lan2" "link tx rx" + ucidef_set_led_netdev "lan3" "lan3" "blue:lan-3" "lan3" "link tx rx" + ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" "link tx rx" + ;; cudy,wr3000-v1) ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" ;; @@ -29,6 +35,13 @@ xiaomi,redmi-router-ax6000-stock|\ xiaomi,redmi-router-ax6000-ubootmod) ucidef_set_led_netdev "wan" "wan" "rgb:network" "wan" ;; +zyxel_ex5601-t0-stock|\ +zyxel,ex5601-t0-ubootmod) + ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0" "link tx rx" + ucidef_set_led_netdev "wan" "WAN" "green:inet" "eth1" "link tx rx" + ucidef_set_led_netdev "wifi-24g" "WIFI-2.4G" "green:wifi24g" "phy0-ap0" "link tx rx" + ucidef_set_led_netdev "wifi-5g" "WIFI-5G" "green:wifi5g" "phy1-ap0" "link tx rx" + ;; esac board_config_flush 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 590c1fb2a66482..962cdfb83a2e3f 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 @@ -8,29 +8,42 @@ mediatek_setup_interfaces() local board="$1" case $board in + acelink,ew-7886cax) + ucidef_set_interface_lan "eth0" "dhcp" + ;; acer,predator-w6) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 game" eth1 ;; asus,tuf-ax4200|\ - mediatek,mt7981-rfb) + mediatek,mt7981-rfb|\ + zbtlink,zbt-z8102ax) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" eth1 ;; - netgear,wax220|\ - ubnt,unifi-6-plus|\ - zyxel,nwa50ax-pro) - ucidef_set_interface_lan "eth0" + asus,tuf-ax6000) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" eth1 ;; bananapi,bpi-r3) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan" ;; - cudy,wr3000-v1) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" + cetron,ct3003|\ + confiabits,mt7981|\ + cudy,wr3000-v1|\ + jcg,q30-pro|\ + qihoo,360t7) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan + ;; + cmcc,rax3000m|\ + h3c,magic-nx30-pro) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" eth1 ;; + glinet,gl-mt2500|\ glinet,gl-mt3000) ucidef_set_interfaces_lan_wan eth1 eth0 ;; - h3c,magic-nx30-pro) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" eth1 + glinet,gl-mt6000|\ + tplink,tl-xdr4288|\ + tplink,tl-xdr6088) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" eth1 ;; mediatek,mt7986a-rfb) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan6" "eth1 wan" @@ -44,14 +57,10 @@ mediatek_setup_interfaces() mercusys,mr90x-v1) ucidef_set_interfaces_lan_wan "lan0 lan1 lan2" eth1 ;; - cetron,ct3003|\ - qihoo,360t7) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan - ;; - glinet,gl-mt6000|\ - tplink,tl-xdr4288|\ - tplink,tl-xdr6088) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" eth1 + netgear,wax220|\ + ubnt,unifi-6-plus|\ + zyxel,nwa50ax-pro) + ucidef_set_interface_lan "eth0" ;; tplink,tl-xdr6086) ucidef_set_interfaces_lan_wan "lan1 lan2" eth1 @@ -63,6 +72,10 @@ mediatek_setup_interfaces() xiaomi,redmi-router-ax6000-ubootmod) ucidef_set_interfaces_lan_wan "lan2 lan3 lan4" wan ;; + zyxel,ex5601-t0-stock|\ + zyxel,ex5601-t0-ubootmod) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" eth1 + ;; *) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan ;; @@ -77,7 +90,8 @@ mediatek_setup_macs() local label_mac="" case $board in - asus,tuf-ax4200) + asus,tuf-ax4200|\ + asus,tuf-ax6000) CI_UBIPART="UBI_DEV" addr=$(mtd_get_mac_binary_ubi "Factory" 0x4) wan_mac="${addr}" @@ -91,6 +105,20 @@ mediatek_setup_macs() wan_mac=$(macaddr_add "$lan_mac" 3) label_mac=$lan_mac ;; + cmcc,rax3000m) + case "$(cmdline_get_var root)" in + /dev/mmc*) + wan_mac=$(mmc_get_mac_binary factory 0x2a) + lan_mac=$(mmc_get_mac_binary factory 0x24) + label_mac=$wan_mac + ;; + esac + ;; + glinet,gl-mt2500) + label_mac="$(get_mac_binary "/dev/mmcblk0boot1" 0xA)" + wan_mac="$label_mac" + lan_mac="$(macaddr_add $label_mac 1)" + ;; glinet,gl-mt6000) label_mac=$(mmc_get_mac_binary factory 0x0a) wan_mac=$label_mac diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/03_gpio_switches b/target/linux/mediatek/filogic/base-files/etc/board.d/03_gpio_switches new file mode 100644 index 00000000000000..4cbec1ef078db3 --- /dev/null +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/03_gpio_switches @@ -0,0 +1,19 @@ +. /lib/functions/uci-defaults.sh + +board_config_update + +board=$(board_name) + +case "$board" in +zbtlink,zbt-z8102ax) + ucidef_add_gpio_switch "5g1" "Power 1st modem" "5g1" "1" + ucidef_add_gpio_switch "5g2" "Power 2nd modem" "5g2" "1" + ucidef_add_gpio_switch "pcie" "Power PCIe port" "pcie" "1" + ucidef_add_gpio_switch "sim1" "SIM 1" "sim1" "1" + ucidef_add_gpio_switch "sim2" "SIM 2" "sim2" "1" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata index bc1dcb0008c25e..4d9833f66cfb0a 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata @@ -16,6 +16,13 @@ case "$FIRMWARE" in ;; "mediatek/mt7981_eeprom_mt7976_dbdc.bin") case "$board" in + cmcc,rax3000m) + case "$(cmdline_get_var root)" in + /dev/mmc*) + caldata_extract_mmc "factory" 0x0 0x1000 + ;; + esac + ;; ubnt,unifi-6-plus) caldata_extract_mmc "factory" 0x0 0x1000 ;; @@ -46,6 +53,10 @@ case "$FIRMWARE" in ;; "mediatek/mt7986_eeprom_mt7976_dual.bin") case "$board" in + asus,tuf-ax6000) + CI_UBIPART="UBI_DEV" + caldata_extract_ubi "Factory" 0x0 0x1000 + ;; glinet,gl-mt6000) caldata_extract_mmc "factory" 0x0 0x1000 ;; 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 115ff2201ece67..f4d99eb148f7ed 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 @@ -16,7 +16,8 @@ case "$board" in [ "$PHYNBR" = "1" ] && cat $key_path/6gMAC > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "2" ] && cat $key_path/5gMAC > /sys${DEVPATH}/macaddress ;; - asus,tuf-ax4200) + asus,tuf-ax4200|\ + asus,tuf-ax6000) CI_UBIPART="UBI_DEV" addr=$(mtd_get_mac_binary_ubi "Factory" 0x4) # Originally, phy0 is phy1 mac with LA bit set. However, this would conflict @@ -35,6 +36,17 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 2) > /sys${DEVPATH}/macaddress ;; + cmcc,rax3000m) + case "$(cmdline_get_var root)" in + /dev/mmc*) + addr=$(mmc_get_mac_binary factory 0xa) + ;; + *) + addr=$(mtd_get_mac_binary factory 0xa) + ;; + esac + [ "$PHYNBR" = "1" ] && echo "$addr" > /sys${DEVPATH}/macaddress + ;; cudy,wr3000-v1) addr=$(mtd_get_mac_binary bdinfo 0xde00) # Originally, phy0 is phy1 mac with LA bit set. However, this would conflict @@ -53,6 +65,11 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress ;; + jcg,q30-pro) + # 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 + ;; mercusys,mr90x-v1) addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0) [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress @@ -63,11 +80,6 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 3 > /sys${DEVPATH}/macaddress ;; - ubnt,unifi-6-plus) - addr=$(mtd_get_mac_binary EEPROM 0x6) - [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress - [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress - ;; qihoo,360t7) addr=$(mtd_get_mac_ascii factory lanMac) [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress @@ -78,7 +90,14 @@ case "$board" in tplink,tl-xdr6088) [ "$PHYNBR" = "0" ] && get_mac_label > /sys${DEVPATH}/macaddress ;; - zyxel,ex5601-t0) + ubnt,unifi-6-plus) + addr=$(mtd_get_mac_binary EEPROM 0x6) + [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress + ;; + zbtlink,zbt-z8102ax|\ + zyxel,ex5601-t0|\ + zyxel,ex5601-t0-ubootmod) addr=$(mtd_get_mac_binary "Factory" 0x4) [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress ;; diff --git a/target/linux/mediatek/filogic/base-files/etc/init.d/bootcount b/target/linux/mediatek/filogic/base-files/etc/init.d/bootcount old mode 100644 new mode 100755 diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh index 69d0ab6c60c54f..d770b1364322af 100644 --- a/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh @@ -10,7 +10,8 @@ preinit_set_mac_address() { ip link set dev game address "$(cat $key_path/LANMAC)" ip link set dev eth1 address "$(cat $key_path/WANMAC)" ;; - asus,tuf-ax4200) + asus,tuf-ax4200|\ + asus,tuf-ax6000) CI_UBIPART="UBI_DEV" addr=$(mtd_get_mac_binary_ubi "Factory" 0x4) ip link set dev eth0 address "$addr" 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 42156aefb4d663..c9599cdc9bede6 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -56,7 +56,8 @@ platform_do_upgrade() { CI_ROOTPART="rootfs" emmc_do_upgrade "$1" ;; - asus,tuf-ax4200) + asus,tuf-ax4200|\ + asus,tuf-ax6000) CI_UBIPART="UBI_DEV" CI_KERNPART="linux" nand_do_upgrade "$1" @@ -81,24 +82,29 @@ platform_do_upgrade() { ;; esac ;; + cmcc,rax3000m) + case "$(cmdline_get_var root)" in + /dev/mmc*) + CI_KERNPART="production" + emmc_do_upgrade "$1" + ;; + *) + CI_KERNPART="fit" + nand_do_upgrade "$1" + ;; + esac + ;; cudy,wr3000-v1) default_do_upgrade "$1" ;; + glinet,gl-mt2500|\ glinet,gl-mt6000) CI_KERNPART="kernel" CI_ROOTPART="rootfs" emmc_do_upgrade "$1" ;; - mercusys,mr90x-v1) - CI_UBIPART="ubi0" - nand_do_upgrade "$1" - ;; - ubnt,unifi-6-plus) - CI_KERNPART="kernel0" - EMMC_ROOT_DEV="$(cmdline_get_var root)" - emmc_do_upgrade "$1" - ;; h3c,magic-nx30-pro|\ + jcg,q30-pro|\ mediatek,mt7981-rfb|\ qihoo,360t7|\ tplink,tl-xdr4288|\ @@ -109,12 +115,26 @@ platform_do_upgrade() { CI_KERNPART="fit" nand_do_upgrade "$1" ;; + mercusys,mr90x-v1) + CI_UBIPART="ubi0" + nand_do_upgrade "$1" + ;; + ubnt,unifi-6-plus) + CI_KERNPART="kernel0" + EMMC_ROOT_DEV="$(cmdline_get_var root)" + emmc_do_upgrade "$1" + ;; xiaomi,mi-router-wr30u-stock|\ xiaomi,redmi-router-ax6000-stock) CI_KERN_UBIPART=ubi_kernel CI_ROOT_UBIPART=ubi nand_do_upgrade "$1" ;; + zyxel,ex5601-t0-ubootmod) + CI_KERNPART="fit" + CI_ROOTPART="ubi_rootfs" + nand_do_upgrade "$1" + ;; *) nand_do_upgrade "$1" ;; @@ -130,7 +150,8 @@ platform_check_image() { [ "$#" -gt 1 ] && return 1 case "$board" in - bananapi,bpi-r3) + bananapi,bpi-r3|\ + cmcc,rax3000m) [ "$magic" != "d00dfeed" ] && { echo "Invalid image type." return 1 @@ -148,13 +169,16 @@ platform_check_image() { platform_copy_config() { case "$(board_name)" in - bananapi,bpi-r3) + bananapi,bpi-r3|\ + cmcc,rax3000m) case "$(cmdline_get_var root)" in /dev/mmc*) emmc_copy_config ;; esac ;; + acer,predator-w6|\ + glinet,gl-mt2500|\ glinet,gl-mt6000|\ ubnt,unifi-6-plus) emmc_copy_config diff --git a/target/linux/mediatek/filogic/config-5.15 b/target/linux/mediatek/filogic/config-5.15 index 2ffc466b7c3344..8c46b9ad2c5c60 100644 --- a/target/linux/mediatek/filogic/config-5.15 +++ b/target/linux/mediatek/filogic/config-5.15 @@ -169,6 +169,8 @@ CONFIG_GENERIC_STRNLEN_USER=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GLOB=y CONFIG_GPIO_CDEV=y +CONFIG_GPIO_WATCHDOG=y +CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y CONFIG_GRO_CELLS=y CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDIRQS_SW_RESEND=y diff --git a/target/linux/mediatek/filogic/config-6.1 b/target/linux/mediatek/filogic/config-6.1 index 36cb9c1e4e6be8..0bd5e9cb708f09 100644 --- a/target/linux/mediatek/filogic/config-6.1 +++ b/target/linux/mediatek/filogic/config-6.1 @@ -187,6 +187,8 @@ CONFIG_GENERIC_STRNLEN_USER=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GLOB=y CONFIG_GPIO_CDEV=y +CONFIG_GPIO_WATCHDOG=y +CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y CONFIG_GRO_CELLS=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 6082cf5f47ebd4..58dc2ce97faa72 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -105,6 +105,38 @@ define Build/cetron-header rm $@.tmp endef +define Device/acelink_ew-7886cax + DEVICE_VENDOR := Acelink + DEVICE_MODEL := EW-7886CAX + DEVICE_DTS := mt7986a-acelink-ew-7886cax + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 65536k + KERNEL_IN_UBI := 1 + IMAGES += factory.bin + IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE) + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += acelink_ew-7886cax + +define Device/acer_predator-w6 + DEVICE_VENDOR := Acer + DEVICE_MODEL := Predator W6 + DEVICE_DTS := mt7986a-acer-predator-w6 + DEVICE_DTS_DIR := ../dts + DEVICE_DTS_LOADADDR := 0x47000000 + DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware kmod-mt7916-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs + IMAGES := sysupgrade.bin + KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += acer_predator-w6 + define Device/asus_tuf-ax4200 DEVICE_VENDOR := ASUS DEVICE_MODEL := TUF-AX4200 @@ -121,20 +153,21 @@ define Device/asus_tuf-ax4200 endef TARGET_DEVICES += asus_tuf-ax4200 -define Device/acer_predator-w6 - DEVICE_VENDOR := Acer - DEVICE_MODEL := Predator W6 - DEVICE_DTS := mt7986a-acer-predator-w6 +define Device/asus_tuf-ax6000 + DEVICE_VENDOR := ASUS + DEVICE_MODEL := TUF-AX6000 + DEVICE_DTS := mt7986a-asus-tuf-ax6000 DEVICE_DTS_DIR := ../dts DEVICE_DTS_LOADADDR := 0x47000000 - DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware kmod-mt7916-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs + DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware IMAGES := sysupgrade.bin - KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb + KERNEL := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb KERNEL_INITRAMFS := kernel-bin | lzma | \ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef -TARGET_DEVICES += acer_predator-w6 +TARGET_DEVICES += asus_tuf-ax6000 define Device/bananapi_bpi-r3 DEVICE_VENDOR := Bananapi @@ -176,7 +209,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 @@ -204,6 +239,55 @@ define Device/cetron_ct3003 endef TARGET_DEVICES += cetron_ct3003 +define Device/cmcc_rax3000m + DEVICE_VENDOR := CMCC + DEVICE_MODEL := RAX3000M + DEVICE_DTS := mt7981b-cmcc-rax3000m + DEVICE_DTS_OVERLAY := mt7981b-cmcc-rax3000m-emmc mt7981b-cmcc-rax3000m-nand + DEVICE_DTS_DIR := ../dts + DEVICE_DTC_FLAGS := --pad 4096 + DEVICE_DTS_LOADADDR := 0x43f00000 + DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 \ + e2fsprogs f2fsck mkf2fs + KERNEL_LOADADDR := 0x44000000 + KERNEL := kernel-bin | gzip + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + KERNEL_IN_UBI := 1 + UBOOTENV_IN_UBI := 1 + IMAGES := sysupgrade.itb + IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m + IMAGE/sysupgrade.itb := append-kernel | \ + fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | \ + pad-rootfs | append-metadata + ARTIFACTS := \ + emmc-gpt.bin emmc-preloader.bin emmc-bl31-uboot.fip \ + nand-preloader.bin nand-bl31-uboot.fip + ARTIFACT/emmc-gpt.bin := mt798x-gpt emmc + ARTIFACT/emmc-preloader.bin := mt7981-bl2 emmc-ddr4 + ARTIFACT/emmc-bl31-uboot.fip := mt7981-bl31-uboot cmcc_rax3000m-emmc + ARTIFACT/nand-preloader.bin := mt7981-bl2 spim-nand-ddr4 + ARTIFACT/nand-bl31-uboot.fip := mt7981-bl31-uboot cmcc_rax3000m-nand +endef +TARGET_DEVICES += cmcc_rax3000m + +define Device/confiabits_mt7981 + DEVICE_VENDOR := Confiabits + DEVICE_MODEL := MT7981 + DEVICE_DTS := mt7981b-confiabits-mt7981 + DEVICE_DTS_DIR := ../dts + SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-2500wan-gmac2-rfb + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 65536k + KERNEL_IN_UBI := 1 + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + DEVICE_PACKAGES := kmod-usb3 kmod-mt7981-firmware +endef +TARGET_DEVICES += confiabits_mt7981 + define Device/cudy_wr3000-v1 DEVICE_VENDOR := Cudy DEVICE_MODEL := WR3000 @@ -223,6 +307,19 @@ define Device/cudy_wr3000-v1 endef TARGET_DEVICES += cudy_wr3000-v1 +define Device/glinet_gl-mt2500 + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-MT2500 + DEVICE_DTS := mt7981b-glinet-gl-mt2500 + DEVICE_DTS_DIR := ../dts + DEVICE_DTS_LOADADDR := 0x47000000 + DEVICE_PACKAGES := -kmod-mt7915e -wpad-basic-mbedtls e2fsprogs f2fsck mkf2fs kmod-usb3 + SUPPORTED_DEVICES += glinet,mt2500-emmc + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata +endef +TARGET_DEVICES += glinet_gl-mt2500 + define Device/glinet_gl-mt3000 DEVICE_VENDOR := GL.iNet DEVICE_MODEL := GL-MT3000 @@ -244,7 +341,7 @@ define Device/glinet_gl-mt6000 DEVICE_MODEL := GL-MT6000 DEVICE_DTS := mt7986a-glinet-gl-mt6000 DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-usb2 kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware e2fsprogs f2fsck mkf2fs + DEVICE_PACKAGES := e2fsprogs f2fsck mkf2fs kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware IMAGES += factory.bin IMAGE/factory.bin := append-kernel | pad-to 32M | append-rootfs IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata @@ -279,23 +376,29 @@ define Device/h3c_magic-nx30-pro endef TARGET_DEVICES += h3c_magic-nx30-pro -define Device/netgear_wax220 - DEVICE_VENDOR := NETGEAR - DEVICE_MODEL := WAX220 - DEVICE_DTS := mt7986b-netgear-wax220 +define Device/jcg_q30-pro + DEVICE_VENDOR := JCG + DEVICE_MODEL := Q30 PRO + DEVICE_DTS := mt7981b-jcg-q30-pro DEVICE_DTS_DIR := ../dts - NETGEAR_ENC_MODEL := WAX220 - NETGEAR_ENC_REGION := US - DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_IN_UBI := 1 + UBOOTENV_IN_UBI := 1 + IMAGES := sysupgrade.itb KERNEL_INITRAMFS_SUFFIX := -recovery.itb - IMAGE_SIZE := 32768k - IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - IMAGES += factory.img - # Padding to 10M seems to be required by OEM web interface - IMAGE/factory.img := sysupgrade-tar | \ - pad-to 10M | check-size | netgear-encrypted-factory + 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-pro endef -TARGET_DEVICES += netgear_wax220 +TARGET_DEVICES += jcg_q30-pro define Device/mediatek_mt7981-rfb DEVICE_VENDOR := MediaTek @@ -455,7 +558,7 @@ endef TARGET_DEVICES += mediatek_mt7988a-rfb define Device/mercusys_mr90x-v1 - DEVICE_VENDOR := Mercusys + DEVICE_VENDOR := MERCUSYS DEVICE_MODEL := MR90X v1 DEVICE_DTS := mt7986b-mercusys-mr90x-v1 DEVICE_DTS_DIR := ../dts @@ -468,6 +571,24 @@ define Device/mercusys_mr90x-v1 endef TARGET_DEVICES += mercusys_mr90x-v1 +define Device/netgear_wax220 + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := WAX220 + DEVICE_DTS := mt7986b-netgear-wax220 + DEVICE_DTS_DIR := ../dts + NETGEAR_ENC_MODEL := WAX220 + NETGEAR_ENC_REGION := US + DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + IMAGE_SIZE := 32768k + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGES += factory.img + # Padding to 10M seems to be required by OEM web interface + IMAGE/factory.img := sysupgrade-tar | \ + pad-to 10M | check-size | netgear-encrypted-factory +endef +TARGET_DEVICES += netgear_wax220 + define Device/qihoo_360t7 DEVICE_VENDOR := Qihoo DEVICE_MODEL := 360T7 @@ -653,12 +774,30 @@ endif endef TARGET_DEVICES += xiaomi_redmi-router-ax6000-ubootmod +define Device/zbtlink_zbt-z8102ax + DEVICE_VENDOR := Zbtlink + DEVICE_MODEL := ZBT-Z8102AX + DEVICE_DTS := mt7981b-zbtlink-zbt-z8102ax + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 kmod-usb-net-qmi-wwan kmod-usb-serial-option + KERNEL_IN_UBI := 1 + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 65536k + IMAGES += factory.bin + IMAGE/factory.bin := append-ubi | check-size $$(IMAGE_SIZE) + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += zbtlink_zbt-z8102ax + define Device/zyxel_ex5601-t0-stock DEVICE_VENDOR := Zyxel - DEVICE_MODEL := EX5601-T0 (stock layout) + DEVICE_MODEL := EX5601-T0 + DEVICE_VARIANT := (stock layout) DEVICE_DTS := mt7986a-zyxel-ex5601-t0-stock DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware + DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware kmod-usb3 SUPPORTED_DEVICES := mediatek,mt7986a-rfb-snand UBINIZE_OPTS := -E 5 BLOCKSIZE := 256k @@ -675,6 +814,35 @@ define Device/zyxel_ex5601-t0-stock endef TARGET_DEVICES += zyxel_ex5601-t0-stock +define Device/zyxel_ex5601-t0-ubootmod + DEVICE_VENDOR := Zyxel + DEVICE_MODEL := EX5601-T0 + DEVICE_VARIANT := (OpenWrt U-Boot layout) + DEVICE_DTS := mt7986a-zyxel-ex5601-t0-ubootmod + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware kmod-usb3 + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + IMAGES := sysupgrade.itb + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 256k + PAGESIZE := 4096 + KERNEL_IN_UBI := 1 + UBOOTENV_IN_UBI := 1 + KERNEL := kernel-bin | lzma + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd + IMAGE/sysupgrade.itb := append-kernel | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata + ARTIFACTS := preloader.bin bl31-uboot.fip + ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-4k-ddr4 + ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot zyxel_ex5601-t0 +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + ARTIFACTS += initramfs-factory.ubi + ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-recovery.itb | ubinize-kernel +endif +endef +TARGET_DEVICES += zyxel_ex5601-t0-ubootmod + define Device/zyxel_ex5700-telenor DEVICE_VENDOR := ZyXEL DEVICE_MODEL := EX5700 (Telenor) diff --git a/target/linux/mediatek/image/mt7622.mk b/target/linux/mediatek/image/mt7622.mk index 65db1ebe2e36fc..d0f5280dcf74ef 100644 --- a/target/linux/mediatek/image/mt7622.mk +++ b/target/linux/mediatek/image/mt7622.mk @@ -21,7 +21,7 @@ define Build/buffalo-trx -f $(kern_bin) \ $(if $(rtfs_bin),\ -a 0x20000 \ - -b $$(( $(subst k, * 1024,$(kern_size)) )) \ + -b $$(( $(call exp_units,$(kern_size)) )) \ -f $(rtfs_bin),) \ $(if $(apnd_bin),\ -A $(apnd_bin) \ @@ -37,6 +37,25 @@ define Build/bl31-uboot cat $(STAGING_DIR_IMAGE)/mt7622_$1-u-boot.fip >> $@ endef +# Append header to a D-Link M32 Kernel 1 partition +define Build/m32-recovery-header-kernel1 + echo -en "DLK6E6010001\x00\x00\xCF\x33" > "$@.header" + echo -en "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x8D\x57\x30\x0B" >> "$@.header" +# Byte 0-3: Erase Start 0x002C0000 +# Byte 4-7: Erase Length 0x02D00000 +# Byte 8-11: Data offset: 0x002C0000 +# Byte 12-15: Data Length: 0x02D00000 + echo -en "\x00\x00\x2C\x00\x00\x00\xD0\x02\x00\x00\x2C\x00\x00\x00\xD0\x02" >> "$@.header" +# Only zeros + echo -en "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" >> "$@.header" +# Note: The last 2 bytes of the following line are the checksum of the header +# If any data in the header will be changed, the checksum must be re-calculated + echo -en "\x42\x48\x02\x00\x00\x00\x08\x00\x00\x00\x00\x00\x60\x6E\x68\x61" >> "$@.header" + cat "$@.header" "$@" > "$@.new" + mv "$@.new" "$@" + rm "$@.header" +endef + define Build/mt7622-gpt cp $@ $@.tmp 2>/dev/null || true ptgen -g -o $@.tmp -a 1 -l 1024 \ @@ -88,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 @@ -147,6 +168,25 @@ define Device/buffalo_wsr-3200ax4s endef TARGET_DEVICES += buffalo_wsr-3200ax4s +define Device/dlink_eagle-pro-ai-m32-a1 + IMAGE_SIZE := 46080k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := EAGLE PRO AI M32 + DEVICE_VARIANT := A1 + DEVICE_DTS := mt7622-dlink-eagle-pro-ai-m32-a1 + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7915-firmware + KERNEL_SIZE := 8192k + BLOCKSIZE := 128k + PAGESIZE := 2048 + UBINIZE_OPTS := -E 5 + IMAGES += tftp.bin recovery.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGE/tftp.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size + IMAGE/recovery.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | pad-to $$(IMAGE_SIZE) | m32-recovery-header-kernel1 +endef +TARGET_DEVICES += dlink_eagle-pro-ai-m32-a1 + define Device/elecom_wrc-2533gent DEVICE_VENDOR := Elecom DEVICE_MODEL := WRC-2533GENT diff --git a/target/linux/mediatek/image/mt7623.mk b/target/linux/mediatek/image/mt7623.mk index 5828c4d763d937..2c4402da661949 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/image/mt7629.mk b/target/linux/mediatek/image/mt7629.mk index 33c557190f64d3..9374228808c8f8 100644 --- a/target/linux/mediatek/image/mt7629.mk +++ b/target/linux/mediatek/image/mt7629.mk @@ -48,3 +48,12 @@ define Device/netgear_ex6250-v2 pad-rootfs | check-size | netgear-encrypted-factory endef TARGET_DEVICES += netgear_ex6250-v2 + +define Device/tplink_eap225-v5 + DEVICE_VENDOR := TP-Link + DEVICE_MODEL := EAP225 + DEVICE_VARIANT := v5 + DEVICE_DTS := mt7629-tplink_eap225-v5 + DEVICE_DTS_DIR := ../dts +endef +TARGET_DEVICES += tplink_eap225-v5 diff --git a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network index d1341099bc8d41..75c5e37be14c54 100644 --- a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network @@ -24,6 +24,9 @@ mediatek_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" ;; + dlink,eagle-pro-ai-m32-a1) + ucidef_set_interfaces_lan_wan "lan1 lan2" wan + ;; ubnt,unifi-6-lr*) ucidef_set_interface_lan "eth0" ;; @@ -61,6 +64,10 @@ mediatek_setup_macs() wan_mac=$lan_mac label_mac=$lan_mac ;; + dlink,eagle-pro-ai-m32-a1) + wan_mac=$(get_mac_label) + lan_mac=$(macaddr_add $(get_mac_label) 1) + ;; reyee,ax3200-e5|\ ruijie,rg-ew3200gx-pro) lan_mac=$(macaddr_add $(get_mac_label) 1) diff --git a/target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index 7ee9f24071c598..e9cc5922375ba7 100644 --- a/target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -18,6 +18,10 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $basemac 1 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $basemac 8 > /sys${DEVPATH}/macaddress ;; + dlink,eagle-pro-ai-m32-a1) + [ "$PHYNBR" = "0" ] && macaddr_add $(cat /sys/class/net/eth0/address) 2 > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_add $(cat /sys/class/net/eth0/address) 3 > /sys${DEVPATH}/macaddress + ;; reyee,ax3200-e5|\ ruijie,rg-ew3200gx-pro) [ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh index ea3176d2d1e79f..e256d2b53325e3 100755 --- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh @@ -34,6 +34,7 @@ platform_do_upgrade() { nand_do_upgrade "$1" fi ;; + dlink,eagle-pro-ai-m32-a1|\ elecom,wrc-x3200gst3|\ mediatek,mt7622-rfb1-ubi|\ netgear,wax206|\ @@ -72,6 +73,7 @@ platform_check_image() { buffalo,wsr-3200ax4s) buffalo_check_image "$board" "$magic" "$1" || return 1 ;; + dlink,eagle-pro-ai-m32-a1|\ elecom,wrc-x3200gst3|\ mediatek,mt7622-rfb1-ubi|\ netgear,wax206|\ diff --git a/target/linux/mediatek/mt7629/base-files/etc/board.d/02_network b/target/linux/mediatek/mt7629/base-files/etc/board.d/02_network index db931c8334e962..df042f8ad27d4f 100644 --- a/target/linux/mediatek/mt7629/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/mt7629/base-files/etc/board.d/02_network @@ -16,7 +16,8 @@ mediatek_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "6@eth0" ;; - netgear,ex6250-v2) + netgear,ex6250-v2|\ + tplink,eap225-v5) ucidef_set_interface_lan "eth0" ;; esac diff --git a/target/linux/mediatek/patches-5.15/410-bt-mtk-serial-fix.patch b/target/linux/mediatek/patches-5.15/410-bt-mtk-serial-fix.patch index bfa90f3849c6c3..3f4597c65d68f8 100644 --- a/target/linux/mediatek/patches-5.15/410-bt-mtk-serial-fix.patch +++ b/target/linux/mediatek/patches-5.15/410-bt-mtk-serial-fix.patch @@ -19,7 +19,7 @@ }, [PORT_NPCM] = { .name = "Nuvoton 16550", -@@ -2763,6 +2763,11 @@ serial8250_do_set_termios(struct uart_po +@@ -2766,6 +2766,11 @@ serial8250_do_set_termios(struct uart_po unsigned long flags; unsigned int baud, quot, frac = 0; diff --git a/target/linux/mediatek/patches-5.15/611-pcie-mediatek-gen3-PERST-for-100ms.patch b/target/linux/mediatek/patches-5.15/611-pcie-mediatek-gen3-PERST-for-100ms.patch new file mode 100644 index 00000000000000..d526aded85a7b9 --- /dev/null +++ b/target/linux/mediatek/patches-5.15/611-pcie-mediatek-gen3-PERST-for-100ms.patch @@ -0,0 +1,17 @@ +--- a/drivers/pci/controller/pcie-mediatek-gen3.c ++++ b/drivers/pci/controller/pcie-mediatek-gen3.c +@@ -319,7 +319,13 @@ static int mtk_pcie_startup_port(struct + msleep(100); + + /* De-assert reset signals */ +- val &= ~(PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB | PCIE_PE_RSTB); ++ val &= ~(PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB); ++ writel_relaxed(val, port->base + PCIE_RST_CTRL_REG); ++ ++ msleep(100); ++ ++ /* De-assert PERST# signals */ ++ val &= ~(PCIE_PE_RSTB); + writel_relaxed(val, port->base + PCIE_RST_CTRL_REG); + + /* Check if the link is up or not */ diff --git a/target/linux/mediatek/patches-5.15/850-v6.0-i2c-move-drivers-from-strlcpy-to-strscpy.patch b/target/linux/mediatek/patches-5.15/850-v6.0-i2c-move-drivers-from-strlcpy-to-strscpy.patch index 79444e071e8443..69f2d2a545dcf4 100644 --- a/target/linux/mediatek/patches-5.15/850-v6.0-i2c-move-drivers-from-strlcpy-to-strscpy.patch +++ b/target/linux/mediatek/patches-5.15/850-v6.0-i2c-move-drivers-from-strlcpy-to-strscpy.patch @@ -72,7 +72,7 @@ Signed-off-by: Wolfram Sang idev->adapter.dev.parent = &pdev->dev; --- a/drivers/i2c/busses/i2c-aspeed.c +++ b/drivers/i2c/busses/i2c-aspeed.c -@@ -1024,7 +1024,7 @@ static int aspeed_i2c_probe_bus(struct p +@@ -1028,7 +1028,7 @@ static int aspeed_i2c_probe_bus(struct p bus->adap.algo = &aspeed_i2c_algo; bus->adap.dev.parent = &pdev->dev; bus->adap.dev.of_node = pdev->dev.of_node; @@ -237,7 +237,7 @@ Signed-off-by: Wolfram Sang priv->adap.algo = &hix5hd2_i2c_algorithm; --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c -@@ -1111,7 +1111,7 @@ static void dmi_check_onboard_device(u8 +@@ -1110,7 +1110,7 @@ static void dmi_check_onboard_device(u8 memset(&info, 0, sizeof(struct i2c_board_info)); info.addr = dmi_devices[i].i2c_addr; @@ -246,7 +246,7 @@ Signed-off-by: Wolfram Sang i2c_new_client_device(adap, &info); break; } -@@ -1267,7 +1267,7 @@ static void register_dell_lis3lv02d_i2c_ +@@ -1266,7 +1266,7 @@ static void register_dell_lis3lv02d_i2c_ memset(&info, 0, sizeof(struct i2c_board_info)); info.addr = dell_lis3lv02d_devices[i].i2c_addr; @@ -403,7 +403,7 @@ Signed-off-by: Wolfram Sang /* Slow down if we can't sense SCL */ --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c -@@ -1403,7 +1403,7 @@ static int i2c_pxa_probe(struct platform +@@ -1463,7 +1463,7 @@ static int i2c_pxa_probe(struct platform spin_lock_init(&i2c->lock); init_waitqueue_head(&i2c->wait); diff --git a/target/linux/mediatek/patches-5.15/901-arm-add-cmdline-override.patch b/target/linux/mediatek/patches-5.15/901-arm-add-cmdline-override.patch index 5ded06ff63f617..54901f5549ef46 100644 --- a/target/linux/mediatek/patches-5.15/901-arm-add-cmdline-override.patch +++ b/target/linux/mediatek/patches-5.15/901-arm-add-cmdline-override.patch @@ -37,7 +37,7 @@ * managed to set the command line, unless CONFIG_CMDLINE_FORCE --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig -@@ -2057,6 +2057,14 @@ config CMDLINE_FORCE +@@ -2059,6 +2059,14 @@ config CMDLINE_FORCE endchoice diff --git a/target/linux/mediatek/patches-5.15/922-v6.1-PCI-mediatek-gen3-change-driver-name-to-mtk-pcie-gen.patch b/target/linux/mediatek/patches-5.15/922-v6.1-PCI-mediatek-gen3-change-driver-name-to-mtk-pcie-gen.patch index 44aed2207d564c..f026f5573ce177 100644 --- a/target/linux/mediatek/patches-5.15/922-v6.1-PCI-mediatek-gen3-change-driver-name-to-mtk-pcie-gen.patch +++ b/target/linux/mediatek/patches-5.15/922-v6.1-PCI-mediatek-gen3-change-driver-name-to-mtk-pcie-gen.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/pci/controller/pcie-mediatek-gen3.c +++ b/drivers/pci/controller/pcie-mediatek-gen3.c -@@ -1025,7 +1025,7 @@ static struct platform_driver mtk_pcie_d +@@ -1031,7 +1031,7 @@ static struct platform_driver mtk_pcie_d .probe = mtk_pcie_probe, .remove = mtk_pcie_remove, .driver = { 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 b459e9dfe7329e..38f159c74ee370 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/220-v6.3-clk-mediatek-clk-gate-Propagate-struct-device-with-m.patch b/target/linux/mediatek/patches-6.1/220-v6.3-clk-mediatek-clk-gate-Propagate-struct-device-with-m.patch index e3292a067ce582..af5715e1f5deb1 100644 --- a/target/linux/mediatek/patches-6.1/220-v6.3-clk-mediatek-clk-gate-Propagate-struct-device-with-m.patch +++ b/target/linux/mediatek/patches-6.1/220-v6.3-clk-mediatek-clk-gate-Propagate-struct-device-with-m.patch @@ -209,7 +209,7 @@ Signed-off-by: Stephen Boyd if (r) --- a/drivers/clk/mediatek/clk-mt2701.c +++ b/drivers/clk/mediatek/clk-mt2701.c -@@ -683,8 +683,8 @@ static int mtk_topckgen_init(struct plat +@@ -685,8 +685,8 @@ static int mtk_topckgen_init(struct plat mtk_clk_register_dividers(top_adj_divs, ARRAY_SIZE(top_adj_divs), base, &mt2701_clk_lock, clk_data); @@ -220,7 +220,7 @@ Signed-off-by: Stephen Boyd return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data); } -@@ -783,8 +783,8 @@ static int mtk_infrasys_init(struct plat +@@ -789,8 +789,8 @@ static int mtk_infrasys_init(struct plat } } @@ -231,9 +231,9 @@ Signed-off-by: Stephen Boyd mtk_clk_register_factors(infra_fixed_divs, ARRAY_SIZE(infra_fixed_divs), infra_clk_data); -@@ -894,8 +894,8 @@ static int mtk_pericfg_init(struct platf - - clk_data = mtk_alloc_clk_data(CLK_PERI_NR); +@@ -902,8 +902,8 @@ static int mtk_pericfg_init(struct platf + if (!clk_data) + return -ENOMEM; - mtk_clk_register_gates(node, peri_clks, ARRAY_SIZE(peri_clks), - clk_data); @@ -397,9 +397,9 @@ Signed-off-by: Stephen Boyd &mt7622_clk_lock, clk_data); --- a/drivers/clk/mediatek/clk-mt7629-eth.c +++ b/drivers/clk/mediatek/clk-mt7629-eth.c -@@ -80,7 +80,8 @@ static int clk_mt7629_ethsys_init(struct - - clk_data = mtk_alloc_clk_data(CLK_ETH_NR_CLK); +@@ -82,7 +82,8 @@ static int clk_mt7629_ethsys_init(struct + if (!clk_data) + return -ENOMEM; - mtk_clk_register_gates(node, eth_clks, CLK_ETH_NR_CLK, clk_data); + mtk_clk_register_gates(&pdev->dev, node, eth_clks, @@ -407,9 +407,9 @@ Signed-off-by: Stephen Boyd r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data); if (r) -@@ -102,8 +103,8 @@ static int clk_mt7629_sgmiisys_init(stru - - clk_data = mtk_alloc_clk_data(CLK_SGMII_NR_CLK); +@@ -106,8 +107,8 @@ static int clk_mt7629_sgmiisys_init(stru + if (!clk_data) + return -ENOMEM; - mtk_clk_register_gates(node, sgmii_clks[id++], CLK_SGMII_NR_CLK, - clk_data); @@ -444,9 +444,9 @@ Signed-off-by: Stephen Boyd if (r) --- a/drivers/clk/mediatek/clk-mt7629.c +++ b/drivers/clk/mediatek/clk-mt7629.c -@@ -581,8 +581,8 @@ static int mtk_infrasys_init(struct plat - - clk_data = mtk_alloc_clk_data(CLK_INFRA_NR_CLK); +@@ -585,8 +585,8 @@ static int mtk_infrasys_init(struct plat + if (!clk_data) + return -ENOMEM; - mtk_clk_register_gates(node, infra_clks, ARRAY_SIZE(infra_clks), - clk_data); @@ -455,9 +455,9 @@ Signed-off-by: Stephen Boyd mtk_clk_register_cpumuxes(node, infra_muxes, ARRAY_SIZE(infra_muxes), clk_data); -@@ -604,8 +604,8 @@ static int mtk_pericfg_init(struct platf - - clk_data = mtk_alloc_clk_data(CLK_PERI_NR_CLK); +@@ -610,8 +610,8 @@ static int mtk_pericfg_init(struct platf + if (!clk_data) + return -ENOMEM; - mtk_clk_register_gates(node, peri_clks, ARRAY_SIZE(peri_clks), - clk_data); @@ -466,7 +466,7 @@ Signed-off-by: Stephen Boyd mtk_clk_register_composites(peri_muxes, ARRAY_SIZE(peri_muxes), base, &mt7629_clk_lock, clk_data); -@@ -631,7 +631,7 @@ static int mtk_apmixedsys_init(struct pl +@@ -637,7 +637,7 @@ static int mtk_apmixedsys_init(struct pl mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data); diff --git a/target/linux/mediatek/patches-6.1/221-v6.3-clk-mediatek-cpumux-Propagate-struct-device-where-po.patch b/target/linux/mediatek/patches-6.1/221-v6.3-clk-mediatek-cpumux-Propagate-struct-device-where-po.patch index 2333e722e19efd..223155c59b8940 100644 --- a/target/linux/mediatek/patches-6.1/221-v6.3-clk-mediatek-cpumux-Propagate-struct-device-where-po.patch +++ b/target/linux/mediatek/patches-6.1/221-v6.3-clk-mediatek-cpumux-Propagate-struct-device-where-po.patch @@ -78,7 +78,7 @@ Signed-off-by: Stephen Boyd --- a/drivers/clk/mediatek/clk-mt2701.c +++ b/drivers/clk/mediatek/clk-mt2701.c -@@ -757,7 +757,7 @@ static void __init mtk_infrasys_init_ear +@@ -761,7 +761,7 @@ static void __init mtk_infrasys_init_ear mtk_clk_register_factors(infra_fixed_divs, ARRAY_SIZE(infra_fixed_divs), infra_clk_data); @@ -114,7 +114,7 @@ Signed-off-by: Stephen Boyd clk_data); --- a/drivers/clk/mediatek/clk-mt7629.c +++ b/drivers/clk/mediatek/clk-mt7629.c -@@ -584,8 +584,8 @@ static int mtk_infrasys_init(struct plat +@@ -588,8 +588,8 @@ static int mtk_infrasys_init(struct plat mtk_clk_register_gates(&pdev->dev, node, infra_clks, ARRAY_SIZE(infra_clks), clk_data); diff --git a/target/linux/mediatek/patches-6.1/222-v6.3-clk-mediatek-clk-mtk-Propagate-struct-device-for-com.patch b/target/linux/mediatek/patches-6.1/222-v6.3-clk-mediatek-clk-mtk-Propagate-struct-device-for-com.patch index 01eed6cc01be44..eca1b614cdfc35 100644 --- a/target/linux/mediatek/patches-6.1/222-v6.3-clk-mediatek-clk-mtk-Propagate-struct-device-for-com.patch +++ b/target/linux/mediatek/patches-6.1/222-v6.3-clk-mediatek-clk-mtk-Propagate-struct-device-for-com.patch @@ -26,7 +26,7 @@ Signed-off-by: Stephen Boyd --- a/drivers/clk/mediatek/clk-mt2701.c +++ b/drivers/clk/mediatek/clk-mt2701.c -@@ -677,8 +677,9 @@ static int mtk_topckgen_init(struct plat +@@ -679,8 +679,9 @@ static int mtk_topckgen_init(struct plat mtk_clk_register_factors(top_fixed_divs, ARRAY_SIZE(top_fixed_divs), clk_data); @@ -38,7 +38,7 @@ Signed-off-by: Stephen Boyd mtk_clk_register_dividers(top_adj_divs, ARRAY_SIZE(top_adj_divs), base, &mt2701_clk_lock, clk_data); -@@ -897,8 +898,9 @@ static int mtk_pericfg_init(struct platf +@@ -905,8 +906,9 @@ static int mtk_pericfg_init(struct platf mtk_clk_register_gates(&pdev->dev, node, peri_clks, ARRAY_SIZE(peri_clks), clk_data); @@ -104,7 +104,7 @@ Signed-off-by: Stephen Boyd r = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data); --- a/drivers/clk/mediatek/clk-mt7629.c +++ b/drivers/clk/mediatek/clk-mt7629.c -@@ -564,8 +564,9 @@ static int mtk_topckgen_init(struct plat +@@ -566,8 +566,9 @@ static int mtk_topckgen_init(struct plat mtk_clk_register_factors(top_divs, ARRAY_SIZE(top_divs), clk_data); @@ -116,7 +116,7 @@ Signed-off-by: Stephen Boyd clk_prepare_enable(clk_data->hws[CLK_TOP_AXI_SEL]->clk); clk_prepare_enable(clk_data->hws[CLK_TOP_MEM_SEL]->clk); -@@ -607,7 +608,8 @@ static int mtk_pericfg_init(struct platf +@@ -613,7 +614,8 @@ static int mtk_pericfg_init(struct platf mtk_clk_register_gates(&pdev->dev, node, peri_clks, ARRAY_SIZE(peri_clks), clk_data); diff --git a/target/linux/mediatek/patches-6.1/410-bt-mtk-serial-fix.patch b/target/linux/mediatek/patches-6.1/410-bt-mtk-serial-fix.patch index 072883e7fec5a0..5b94c9216d950a 100644 --- a/target/linux/mediatek/patches-6.1/410-bt-mtk-serial-fix.patch +++ b/target/linux/mediatek/patches-6.1/410-bt-mtk-serial-fix.patch @@ -19,7 +19,7 @@ }, [PORT_NPCM] = { .name = "Nuvoton 16550", -@@ -2770,6 +2770,11 @@ serial8250_do_set_termios(struct uart_po +@@ -2773,6 +2773,11 @@ serial8250_do_set_termios(struct uart_po unsigned long flags; unsigned int baud, quot, frac = 0; diff --git a/target/linux/mediatek/patches-6.1/500-gsw-rtl8367s-mt7622-support.patch b/target/linux/mediatek/patches-6.1/500-gsw-rtl8367s-mt7622-support.patch index e37705f388c1b3..9c575d694b1cf1 100644 --- a/target/linux/mediatek/patches-6.1/500-gsw-rtl8367s-mt7622-support.patch +++ b/target/linux/mediatek/patches-6.1/500-gsw-rtl8367s-mt7622-support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -389,6 +389,12 @@ config ROCKCHIP_PHY +@@ -386,6 +386,12 @@ config ROCKCHIP_PHY help Currently supports the integrated Ethernet PHY. @@ -15,7 +15,7 @@ help --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile -@@ -98,6 +98,7 @@ obj-$(CONFIG_QSEMI_PHY) += qsemi.o +@@ -94,6 +94,7 @@ obj-$(CONFIG_QSEMI_PHY) += qsemi.o obj-$(CONFIG_REALTEK_PHY) += realtek.o obj-$(CONFIG_RENESAS_PHY) += uPD60620.o obj-$(CONFIG_ROCKCHIP_PHY) += rockchip.o diff --git a/target/linux/mediatek/patches-6.1/611-pcie-mediatek-gen3-PERST-for-100ms.patch b/target/linux/mediatek/patches-6.1/611-pcie-mediatek-gen3-PERST-for-100ms.patch new file mode 100644 index 00000000000000..5e343d01ccef1f --- /dev/null +++ b/target/linux/mediatek/patches-6.1/611-pcie-mediatek-gen3-PERST-for-100ms.patch @@ -0,0 +1,17 @@ +--- a/drivers/pci/controller/pcie-mediatek-gen3.c ++++ b/drivers/pci/controller/pcie-mediatek-gen3.c +@@ -350,7 +350,13 @@ static int mtk_pcie_startup_port(struct + msleep(100); + + /* De-assert reset signals */ +- val &= ~(PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB | PCIE_PE_RSTB); ++ val &= ~(PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB); ++ writel_relaxed(val, pcie->base + PCIE_RST_CTRL_REG); ++ ++ msleep(100); ++ ++ /* De-assert PERST# signals */ ++ val &= ~(PCIE_PE_RSTB); + writel_relaxed(val, pcie->base + PCIE_RST_CTRL_REG); + + /* Check if the link is up or not */ diff --git a/target/linux/mediatek/patches-6.1/730-v6.5-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch b/target/linux/mediatek/patches-6.1/730-v6.5-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch index eb2a40f5c1f58e..389b2e4c99d687 100644 --- a/target/linux/mediatek/patches-6.1/730-v6.5-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch +++ b/target/linux/mediatek/patches-6.1/730-v6.5-net-phy-add-driver-for-MediaTek-SoC-built-in-GE-PHYs.patch @@ -42,7 +42,7 @@ Signed-off-by: David S. Miller L: linux-i2c@vger.kernel.org --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -314,6 +314,18 @@ config MEDIATEK_GE_PHY +@@ -311,6 +311,18 @@ config MEDIATEK_GE_PHY help Supports the MediaTek Gigabit Ethernet PHYs. @@ -63,7 +63,7 @@ Signed-off-by: David S. Miller depends on PTP_1588_CLOCK_OPTIONAL --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile -@@ -84,6 +84,7 @@ obj-$(CONFIG_MARVELL_PHY) += marvell.o +@@ -80,6 +80,7 @@ obj-$(CONFIG_MARVELL_PHY) += marvell.o obj-$(CONFIG_MARVELL_88X2222_PHY) += marvell-88x2222.o obj-$(CONFIG_MAXLINEAR_GPHY) += mxl-gpy.o obj-$(CONFIG_MEDIATEK_GE_PHY) += mediatek-ge.o diff --git a/target/linux/mediatek/patches-6.1/733-net-phy-add-driver-for-MediaTek-2.5G-PHY.patch b/target/linux/mediatek/patches-6.1/733-net-phy-add-driver-for-MediaTek-2.5G-PHY.patch index 125bd9b0b38f49..a3dcefd3f1824f 100644 --- a/target/linux/mediatek/patches-6.1/733-net-phy-add-driver-for-MediaTek-2.5G-PHY.patch +++ b/target/linux/mediatek/patches-6.1/733-net-phy-add-driver-for-MediaTek-2.5G-PHY.patch @@ -13,7 +13,7 @@ Signed-off-by: Daniel Golle --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -326,6 +326,13 @@ config MEDIATEK_GE_SOC_PHY +@@ -323,6 +323,13 @@ config MEDIATEK_GE_SOC_PHY present in the SoCs efuse and will dynamically calibrate VCM (common-mode voltage) during startup. @@ -29,7 +29,7 @@ Signed-off-by: Daniel Golle depends on PTP_1588_CLOCK_OPTIONAL --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile -@@ -83,6 +83,7 @@ obj-$(CONFIG_MARVELL_10G_PHY) += marvell +@@ -79,6 +79,7 @@ obj-$(CONFIG_MARVELL_10G_PHY) += marvell obj-$(CONFIG_MARVELL_PHY) += marvell.o obj-$(CONFIG_MARVELL_88X2222_PHY) += marvell-88x2222.o obj-$(CONFIG_MAXLINEAR_GPHY) += mxl-gpy.o diff --git a/target/linux/mediatek/patches-6.1/901-arm-add-cmdline-override.patch b/target/linux/mediatek/patches-6.1/901-arm-add-cmdline-override.patch index 3978f52db135b3..72e4d1500950f8 100644 --- a/target/linux/mediatek/patches-6.1/901-arm-add-cmdline-override.patch +++ b/target/linux/mediatek/patches-6.1/901-arm-add-cmdline-override.patch @@ -37,7 +37,7 @@ * CONFIG_CMDLINE is meant to be a default in case nothing else --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig -@@ -2221,6 +2221,14 @@ config CMDLINE_FORCE +@@ -2236,6 +2236,14 @@ config CMDLINE_FORCE endchoice 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 a4bc10ff3882da..39c3f137da699f 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 @@ -43,9 +43,7 @@ reg = <0 0xffe05000 0 0x1000>; ranges = <0x0 0x0 0x0 0xec000000 0x4000000>; - nor@0,0 { - #address-cells = <1>; - #size-cells = <1>; + nor@0 { compatible = "cfi-flash"; reg = <0x0 0x0 0x4000000>; bank-width = <2>; @@ -87,12 +85,16 @@ label = "hw-info"; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_hwinfo_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_hwinfo_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -154,8 +156,6 @@ switch@10 { compatible = "qca,qca8327"; - #address-cells = <1>; - #size-cells = <0>; reg = <0x10>; reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; @@ -167,43 +167,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 +228,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 +282,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 +321,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/firebox-t10.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts index 607706a2d434c2..89d8afe463a4a1 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/firebox-t10.dts @@ -194,7 +194,7 @@ 0x1 0x0 0x0 0xff800000 0x00010000 0x3 0x0 0x0 0xffb00000 0x00000020>; - nand@1,0 { + nand@100000000 { compatible = "fsl,ifc-nand"; reg = <0x1 0x0 0x10000>; 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 a807403a07a43f..6ad5c4ccd6d413 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 @@ -35,7 +35,7 @@ reg = <0 0xffe05000 0 0x1000>; ranges = <0x0 0x0 0x0 0xec000000 0x4000000>; - nor@0,0 { + nor@0 { #address-cells = <1>; #size-cells = <1>; compatible = "cfi-flash"; @@ -76,12 +76,16 @@ label = "hw-info"; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_hwinfo_0: macaddr@0 { - reg = <0x0 0x6>; + 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/panda.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/panda.dts index 9be822f7bb8acf..4b3b52d35b1290 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/panda.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/panda.dts @@ -31,7 +31,7 @@ 0x2 0x0 0x0 0xffa00000 0x00020000 0x3 0x0 0x0 0xffb00000 0x00020000>; - nand@1,0 { + nand@100000000 { compatible = "fsl,p1020-fcm-nand", "fsl,elbc-fcm-nand"; reg = <0x1 0x0 0x40000>; diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts index db35602b94b5b7..19bb8023ed5db9 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts @@ -122,7 +122,7 @@ 0x1 0x0 0x0 0xff800000 0x00010000 0x3 0x0 0x0 0xffb00000 0x00000020>; - nand@1,0 { + nand@100000000 { compatible = "fsl,ifc-nand"; reg = <0x1 0x0 0x10000>; @@ -165,19 +165,23 @@ read-only; }; - partition@300000 { - reg = <0x300000 0x800000>; - label = "kernel"; - }; - - partition@b00000 { - reg = <0xb00000 0x7500000>; - label = "ubi"; - }; - oem-partition@300000 { reg = <0x300000 0x1900000>; label = "sophos-os1"; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x800000>; + label = "kernel"; + }; + + partition@800000 { + reg = <0x800000 0x7500000>; + label = "ubi"; + }; }; oem-partition@1c00000 { 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 c54cb53f9452ea..5cf3c26fc93764 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>; + }; }; }; @@ -123,10 +125,8 @@ reg = <4>; }; - switch@0 { + switch@10 { compatible = "qca,qca8327"; - #address-cells = <1>; - #size-cells = <0>; reg = <0x10>; ports { diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3710i.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3710i.dts index 5d81da46864139..72b8f7a9d6e9ac 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3710i.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3710i.dts @@ -60,7 +60,7 @@ reg = <0 0xffe05000 0 0x1000>; ranges = <0x0 0x0 0x0 0xee000000 0x2000000>; - nor@0,0 { + nor@0 { #address-cells = <1>; #size-cells = <1>; compatible = "cfi-flash"; diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3715i.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3715i.dts index af8917ffe1ab4d..764c8a31c8ae18 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3715i.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3715i.dts @@ -152,7 +152,7 @@ 0x1000000 0x0 0x0 0x0 0x100000>; - wifi@0,0,0 { + wifi@0,0 { compatible = "pci168c,0033"; reg = <0x0 0 0 0 0>; ieee80211-freq-limit = <2400000 2500000>; @@ -173,7 +173,7 @@ 0x1000000 0x0 0x0 0x0 0x100000>; - wifi@0,0,0 { + wifi@0,0 { compatible = "pci168c,0033"; reg = <0x0 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; 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 a347900e5dfe3e..e72d8e9354415e 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 @@ -9,6 +9,9 @@ model = "Extreme Networks WS-AP3825i"; compatible = "extreme-networks,ws-ap3825i"; + #address-cells = <2>; + #size-cells = <2>; + aliases { ethernet0 = &enet0; ethernet1 = &enet2; @@ -20,7 +23,7 @@ chosen { bootargs-override = "console=ttyS0,115200"; - linux,stdout-path = &serial0; + stdout-path = &serial0; }; memory { @@ -301,8 +304,18 @@ }; memory { - /* Reserve upper MB for second-core-bootpage */ - reg = <0x0 0x0 0x0 0xff00000>; + reg = <0x0 0x0 0x0 0x10000000>; + }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + cpu1-bootpage@e000000 { + /* Reserve upper 1 MB for second-core-bootpage */ + reg = <0x0 0xff00000 0x0 0x100000>; + }; }; soc@ffe00000 { diff --git a/target/linux/mpc85xx/patches-5.15/150-arch-powerpc-simpleboot-prevent-overwrite-of-CPU1-sp.patch b/target/linux/mpc85xx/patches-5.15/150-arch-powerpc-simpleboot-prevent-overwrite-of-CPU1-sp.patch new file mode 100644 index 00000000000000..1ff80a5016e8f3 --- /dev/null +++ b/target/linux/mpc85xx/patches-5.15/150-arch-powerpc-simpleboot-prevent-overwrite-of-CPU1-sp.patch @@ -0,0 +1,41 @@ +From 5f856ccc34df25060d36a5a81b7b45b574d86e35 Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Sun, 3 Dec 2023 20:09:24 +0100 +Subject: [PATCH] arch: powerpc: simpleboot: prevent overwrite of CPU1 + spin-table + +Don't overwrite the spin-table of additional CPU cores with loader-heap. + +U-Boot places the spin-table for CPU1 on P1020 SoCs in the top 1MB of +system-memory. Instead of parsing reserved-memory (which would be +considerable more work), reduce the available system-memory for the +loader by 1MB. + +This prevents the loader from overwriting the spin-table of +additional CPU cores on these platforms. + +Linux itself needs to be made aware by this using reserved-memory +definitions. + +This patch is required for using CPU1 on the Extreme Networks +WS-AP3825i. + +Signed-off-by: David Bauer +--- + arch/powerpc/boot/simpleboot.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/arch/powerpc/boot/simpleboot.c ++++ b/arch/powerpc/boot/simpleboot.c +@@ -65,6 +65,11 @@ void platform_init(unsigned long r3, uns + if (sizeof(void *) == 4 && memsize64 >= 0x100000000ULL) + memsize64 = 0xffffffff; + ++ /* Reserve upper 1 MB of memory for CPU1 spin-table */ ++ if (memsize64 > 0x100000) { ++ memsize64 = memsize64 - 0x100000; ++ } ++ + /* finally, setup the timebase */ + node = fdt_node_offset_by_prop_value(_dtb_start, -1, "device_type", + "cpu", sizeof("cpu")); 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 9db29d52df5a6a..b9ac2bb1ae04d9 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,18 +12,14 @@ 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) ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3 lan4" "eth2" ;; - fortinet,fg-50e) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" "eth1 eth2" - ;; - iptime,nas1dual) - ucidef_set_interface_lan "eth0 eth1" "dhcp" - ;; + fortinet,fg-30e|\ linksys,wrt1200ac|\ linksys,wrt1900ac-v1|\ linksys,wrt1900ac-v2|\ @@ -32,6 +28,15 @@ mvebu_setup_interfaces() linksys,wrt32x) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" ;; + fortinet,fg-50e) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" "eth1 eth2" + ;; + iij,sa-w2) + ucidef_set_interfaces_lan_wan "ge1_0 ge1_1 ge1_2 ge1_3" "ge0" + ;; + iptime,nas1dual) + ucidef_set_interface_lan "eth0 eth1" "dhcp" + ;; marvell,a385-db-ap) ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2" ;; diff --git a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh index fbbb68e05eb93d..7f45aa8a9157de 100755 --- a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh +++ b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh @@ -52,9 +52,24 @@ platform_do_upgrade() { solidrun,clearfog-pro-a1) legacy_sdcard_do_upgrade "$1" ;; + fortinet,fg-30e|\ fortinet,fg-50e) fortinet_do_upgrade "$1" ;; + iij,sa-w2) + local envmtd=$(find_mtd_part "bootloader-env") + local bootdev=$(grep "BOOTDEV=" "$envmtd") + case "${bootdev#*=}" in + flash) PART_NAME="firmware" ;; + rescue) PART_NAME="rescue" ;; + *) + echo "invalid BOOTDEV is set (\"${bootdev#*=}\")" + umount -a + reboot -f + ;; + esac + default_do_upgrade "$1" + ;; linksys,wrt1200ac|\ linksys,wrt1900ac-v1|\ linksys,wrt1900ac-v2|\ diff --git a/target/linux/mvebu/cortexa9/config-5.15 b/target/linux/mvebu/cortexa9/config-5.15 index 88a2f14c0264e0..266596d6384e96 100644 --- a/target/linux/mvebu/cortexa9/config-5.15 +++ b/target/linux/mvebu/cortexa9/config-5.15 @@ -1,3 +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 b78c734fada493..7f825a806b1e02 100644 --- a/target/linux/mvebu/cortexa9/config-6.1 +++ b/target/linux/mvebu/cortexa9/config-6.1 @@ -3,6 +3,10 @@ CONFIG_CPU_LITTLE_ENDIAN=y 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 new file mode 100644 index 00000000000000..09604e20176f90 --- /dev/null +++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-380-iij-sa-w2.dts @@ -0,0 +1,389 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include +#include +#include +#include "armada-380.dtsi" + +/ { + model = "IIJ SA-W2"; + compatible = "iij,sa-w2", "marvell,armada380"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_green; + label-mac-device = &ge0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x10000000>; /* 256MB */ + }; + + soc { + ranges = ; + + pcie { + status = "okay"; + + pcie@1,0 { + status = "okay"; + }; + + pcie@3,0 { + status = "okay"; + }; + }; + }; + + keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&pmx_keys_pins>; + + button-init { + label = "init"; + linux,code = ; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&pmx_leds_pins>; + + led-0 { + label = "green:wlan5g"; + gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>; + color = ; + linux,default-trigger = "phy0tpt"; + }; + + led-1 { + label = "red:wlan5g"; + gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>; + color = ; + }; + + led-2 { + label = "green:status"; + gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_STATUS; + }; + + led-3 { + label = "red:status"; + gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_STATUS; + }; + + led-4 { + label = "green:mobile"; + gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; + color = ; + }; + + led-5 { + label = "red:mobile"; + gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; + color = ; + }; + + led-6 { + label = "green:wlan2g"; + gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>; + color = ; + linux,default-trigger = "phy1tpt"; + }; + + led-7 { + label = "red:wlan2g"; + gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; + color = ; + }; + + led_power_green: led-8 { + label = "green:power"; + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; + color = ; + }; + + led_power_red: led-9 { + label = "red:power"; + gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>; + color = ; + }; + + led-10 { + label = "green:usb1"; + gpios = <&gpio1 22 GPIO_ACTIVE_LOW>; + color = ; + linux,default-trigger = "usbport"; + trigger-sources = <&hub_port2>; + }; + + led-11 { + label = "green:usb0"; + gpios = <&gpio1 23 GPIO_ACTIVE_LOW>; + color = ; + linux,default-trigger = "usbport"; + trigger-sources = <&hub_port1>; + }; + }; + + regulator-vbus-usb0 { + compatible = "regulator-fixed"; + regulator-name = "vbus-usb0"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio1 20 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-always-on; + }; + + regulator-vbus-usb1 { + compatible = "regulator-fixed"; + regulator-name = "vbus-usb1"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio1 21 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-always-on; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + status = "okay"; +}; + +&pinctrl { + pmx_usb_pins: usb-pins { + marvell,pins = "mpp2", /* smsc usb2514b reset */ + "mpp48", "mpp49", /* port over current */ + "mpp52", "mpp53"; /* port vbus */ + marvell,function = "gpio"; + }; + + pmx_keys_pins: keys-pins { + marvell,pins = "mpp18"; + marvell,function = "gpio"; + }; + + pmx_leds_pins: leds-pins { + marvell,pins = "mpp19", "mpp20", "mpp33", "mpp34", "mpp35", + "mpp36", "mpp44", "mpp45", "mpp46", "mpp47", + "mpp54", "mpp55"; + marvell,function = "gpio"; + }; +}; + +&gpio0 { + usb-hub-reset { + gpio-hog; + gpios = <2 GPIO_ACTIVE_HIGH>; + output-high; + }; +}; + +&usb0 { + pinctrl-names = "default"; + pinctrl-0 = <&pmx_usb_pins>; + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + /* SMSC USB2514B on PCB */ + hub@1 { + compatible = "usb424,2514"; + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + hub_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + hub_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; + }; +}; + +&bm { + status = "okay"; +}; + +&bm_bppi { + status = "okay"; +}; + +ð1 { + pinctrl-names = "default"; + pinctrl-0 = <&ge1_rgmii_pins>; + status = "okay"; + + phy-connection-type = "rgmii-id"; + buffer-manager = <&bm>; + bm,pool-long = <2>; + bm,pool-short = <3>; + + nvmem-cells = <&macaddr_bdinfo_6 1>; + nvmem-cell-names = "mac-address"; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&mdio { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + status = "okay"; + + /* Marvell 88E6172 */ + switch@0 { + compatible = "marvell,mv88e6085"; + reg = <0x0>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio1>; + interrupts = <10 IRQ_TYPE_LEVEL_LOW>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "ge1_0"; + }; + + port@1 { + reg = <1>; + label = "ge1_1"; + }; + + port@2 { + reg = <2>; + label = "ge1_2"; + }; + + port@3 { + reg = <3>; + label = "ge1_3"; + }; + + ge0: port@4 { + reg = <4>; + label = "ge0"; + nvmem-cells = <&macaddr_bdinfo_6 0>; + nvmem-cell-names = "mac-address"; + }; + + /* + * eth0 is connected to port5 for WAN connection + * on port4 ("GE0") + */ + + port@6 { + reg = <6>; + label = "cpu"; + ethernet = <ð1>; + phy-connection-type = "rgmii-id"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; + }; +}; + +&rtc { + status = "disabled"; +}; + +&spi1 { + pinctrl-names = "default"; + pinctrl-0 = <&spi1_pins>; + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x100000>; + label = "bootloader"; + read-only; + }; + + partition@100000 { + reg = <0x100000 0x10000>; + label = "bootloader-env"; + read-only; + }; + + partition@110000 { + reg = <0x110000 0xf0000>; + label = "board_info"; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_6: macaddr@6 { + compatible = "mac-base"; + reg = <0x6 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@200000 { + compatible = "iij,seil-firmware"; + reg = <0x200000 0xf00000>; + label = "firmware"; + iij,bootdev-name = "flash"; + iij,seil-id = <0x5345494c 0x32303135>; + }; + + partition@1100000 { + compatible = "iij,seil-firmware"; + reg = <0x1100000 0xf00000>; + label = "rescue"; + iij,bootdev-name = "rescue"; + iij,seil-id = <0x5345494c 0x32303135>; + }; + }; + }; +}; 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 new file mode 100644 index 00000000000000..8788f022f23fea --- /dev/null +++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-fortinet-fg-30e.dts @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "armada-385-fortinet-fg-x0e.dtsi" + +/ { + model = "Fortinet FortiGate 30E"; + compatible = "fortinet,fg-30e", "marvell,armada385", "marvell,armada380"; + + memory@0 { + device_type = "memory"; + reg = <0x00000000 0x40000000>; /* 1GB */ + }; +}; + +&gpio_leds { + led-14 { + label = "amber:speed_wan"; + gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>; + color = ; + linux,default-trigger = "mv88e6xxx-1:00:100Mbps"; + }; + + led-15 { + label = "green:speed_wan"; + gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>; + color = ; + linux,default-trigger = "mv88e6xxx-1:00:1Gbps"; + }; +}; + +&pinctrl { + pmx_switch_pins: switch-pins { + marvell,pins = "mpp19"; + marvell,function = "gpio"; + }; +}; + +&mdio { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>, <&pmx_switch_pins>; + + /* Marvell 88E6176 */ + switch@2 { + compatible = "marvell,mv88e6085"; + reg = <0x2>; + reset-gpios = <&gpio0 19 GPIO_ACTIVE_LOW>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "wan"; + nvmem-cells = <&macaddr_bdinfo_d880 1>; + nvmem-cell-names = "mac-address"; + }; + + port@1 { + reg = <1>; + label = "lan4"; + nvmem-cells = <&macaddr_bdinfo_d880 5>; + nvmem-cell-names = "mac-address"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + nvmem-cells = <&macaddr_bdinfo_d880 4>; + nvmem-cell-names = "mac-address"; + }; + + port@3 { + reg = <3>; + label = "lan2"; + nvmem-cells = <&macaddr_bdinfo_d880 3>; + nvmem-cell-names = "mac-address"; + }; + + port@4 { + reg = <4>; + label = "lan1"; + nvmem-cells = <&macaddr_bdinfo_d880 2>; + nvmem-cell-names = "mac-address"; + }; + + port@6 { + reg = <6>; + ethernet = <ð0>; + phy-connection-type = "rgmii-id"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; + }; +}; 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 dba215de3efabd..4deca093c2dda9 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 @@ -1,264 +1,52 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; - -#include -#include -#include -#include "armada-385.dtsi" +#include "armada-385-fortinet-fg-x0e.dtsi" / { model = "Fortinet FortiGate 50E"; compatible = "fortinet,fg-50e", "marvell,armada385", "marvell,armada380"; - aliases { - led-boot = &led_status_green; - led-failsafe = &led_status_red; - led-running = &led_status_green; - led-upgrade = &led_status_green; - label-mac-device = ð0; - }; - - chosen { - stdout-path = "serial0:9600n8"; - }; - memory@0 { device_type = "memory"; reg = <0x00000000 0x80000000>; /* 2GB */ }; +}; - soc { - ranges = ; - }; - - gpio-keys { - compatible = "gpio-keys"; - pinctrl-names = "default"; - pinctrl-0 = <&pmx_gpio_keys_pins>; - - reset { - label = "reset"; - linux,code = ; - gpios = <&gpio1 22 GPIO_ACTIVE_LOW>; - }; - }; - - gpio-leds { - compatible = "gpio-leds"; - pinctrl-names = "default"; - pinctrl-0 = <&pmx_gpio_leds_pins>; - - led-0 { - label = "red:alarm"; - gpios = <&gpio0 30 GPIO_ACTIVE_LOW>; - color = ; - function = LED_FUNCTION_ALARM; - }; - - led-1 { - label = "red:ha"; - gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; - color = ; - }; - - led_status_green: led-2 { - label = "green:sta"; - gpios = <&gpio1 1 GPIO_ACTIVE_LOW>; - color = ; - function = LED_FUNCTION_STATUS; - }; - - led-3 { - label = "green:ha"; - gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; - color = ; - }; - - led-4 { - label = "amber:alarm"; - gpios = <&gpio1 13 GPIO_ACTIVE_LOW>; - color = ; - function = LED_FUNCTION_ALARM; - }; - - led_status_red: led-5 { - label = "red:sta"; - gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; - color = ; - function = LED_FUNCTION_STATUS; - }; - - led-6 { - label = "green:speed_wan1"; - gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>; - color = ; - linux,default-trigger = "f1072004.mdio-mii:00:1Gbps"; - }; - - led-7 { - label = "green:speed_wan2"; - gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>; - color = ; - linux,default-trigger = "f1072004.mdio-mii:01:1Gbps"; - }; - - led-8 { - label = "amber:speed_lan5"; - gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>; - color = ; - linux,default-trigger = "mv88e6xxx-1:00:100Mbps"; - }; - - led-9 { - label = "green:speed_lan5"; - gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>; - color = ; - linux,default-trigger = "mv88e6xxx-1:00:1Gbps"; - }; - - led-10 { - label = "green:speed_lan4"; - gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; - color = ; - linux,default-trigger = "mv88e6xxx-1:01:1Gbps"; - }; - - led-11 { - label = "amber:speed_lan4"; - gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; - color = ; - linux,default-trigger = "mv88e6xxx-1:01:100Mbps"; - }; - - led-12 { - label = "amber:speed_lan3"; - gpios = <&gpio2 6 GPIO_ACTIVE_LOW>; - color = ; - linux,default-trigger = "mv88e6xxx-1:02:100Mbps"; - }; - - led-13 { - label = "green:speed_lan3"; - gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; - color = ; - linux,default-trigger = "mv88e6xxx-1:02:1Gbps"; - }; - - led-14 { - label = "green:speed_lan1"; - gpios = <&gpio2 12 GPIO_ACTIVE_LOW>; - color = ; - linux,default-trigger = "mv88e6xxx-1:04:1Gbps"; - }; - - led-15 { - label = "amber:speed_lan1"; - gpios = <&gpio2 13 GPIO_ACTIVE_LOW>; - color = ; - linux,default-trigger = "mv88e6xxx-1:04:100Mbps"; - }; - - led-16 { - label = "green:speed_lan2"; - gpios = <&gpio2 14 GPIO_ACTIVE_LOW>; - color = ; - linux,default-trigger = "mv88e6xxx-1:03:1Gbps"; - }; - - led-17 { - label = "amber:speed_lan2"; - gpios = <&gpio2 15 GPIO_ACTIVE_LOW>; - color = ; - linux,default-trigger = "mv88e6xxx-1:03:100Mbps"; - }; +&gpio_leds { + led-14 { + label = "green:speed_wan1"; + gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>; + color = ; + linux,default-trigger = "f1072004.mdio-mii:00:1Gbps"; }; - reg_usb_vbus: regulator-usb-vbus { - compatible = "fixed-regulator"; - regulator-name = "usb-vbus"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - gpio = <&gpio1 21 GPIO_ACTIVE_LOW>; - regulator-always-on; + led-15 { + label = "green:speed_wan2"; + gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>; + color = ; + linux,default-trigger = "f1072004.mdio-mii:01:1Gbps"; }; -}; - -&i2c0 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c0_pins>; - status = "okay"; - gpio2: gpio@24 { - compatible = "nxp,pca9555"; - reg = <0x24>; - gpio-controller; - #gpio-cells = <0x2>; + led-16 { + label = "amber:speed_lan5"; + gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>; + color = ; + linux,default-trigger = "mv88e6xxx-1:00:100Mbps"; }; - hwmon@28 { - compatible = "nuvoton,nct7802"; - reg = <0x28>; + led-17 { + label = "green:speed_lan5"; + gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>; + color = ; + linux,default-trigger = "mv88e6xxx-1:00:1Gbps"; }; }; -&uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins>; - status = "okay"; -}; - &pinctrl { pmx_phy_switch_pins: phy-switch-pins { marvell,pins = "mpp19", "mpp20", "mpp23", "mpp34", "mpp41"; marvell,function = "gpio"; }; - - pmx_gpio_leds_pins: gpio-leds-pins { - marvell,pins = "mpp30", "mpp32", "mpp33", "mpp35", - "mpp45", "mpp47"; - marvell,function = "gpio"; - }; - - pmx_usb_pins: usb-pins { - marvell,pins = "mpp53"; - marvell,function = "gpio"; - }; - - pmx_gpio_keys_pins: gpio-keys-pins { - marvell,pins = "mpp54"; - marvell,function = "gpio"; - }; -}; - -&bm { - status = "okay"; -}; - -&bm_bppi { - status = "okay"; -}; - -ð0 { - pinctrl-names = "default"; - pinctrl-0 = <&ge0_rgmii_pins>; - status = "okay"; - - phy-connection-type = "rgmii-id"; - buffer-manager = <&bm>; - bm,pool-long = <0>; - bm,pool-short = <1>; - nvmem-cells = <&macaddr_bdinfo_d880>; - nvmem-cell-names = "mac-address"; - - fixed-link { - speed = <1000>; - full-duplex; - }; }; ð1 { @@ -268,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 { @@ -280,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 { @@ -338,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 { @@ -388,120 +169,3 @@ }; }; }; - -&usb3_0 { - pinctrl-names = "default"; - pinctrl-0 = <&pmx_usb_pins>; - status = "okay"; - - vbus-supply = <®_usb_vbus>; -}; - -&spi1 { - pinctrl-names = "default"; - pinctrl-0 = <&spi1_pins>; - 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 { - reg = <0x0 0x1c0000>; - label = "u-boot"; - read-only; - }; - - partition@1c0000 { - reg = <0x1c0000 0x10000>; - label = "firmware-info"; - - /* - * 0x10 - 0x2f : image name (image1) - * 0x30 - 0x4f : image name (image2) - * 0x170 (1byte): active image (0x0/0x1) - * 0x184 - 0x185: kernel block count (image1) - * 0x18c - 0x18d: rootfs block count (image1) - * 0x194 - 0x195: kernel block count (image2) - * 0x19c - 0x19d: rootfs block count (image2) - * 0x1be (1byte): bit7 -> active flag (image1)? - * 0x1ce (1byte): bit7 -> active flag (image2)? - * - * Note: block size --> 0x200 (512 bytes) - */ - }; - - partition@1d0000 { - reg = <0x1d0000 0x10000>; - label = "dtb"; - read-only; - }; - - partition@1e0000 { - reg = <0x1e0000 0x10000>; - label = "u-boot-env"; - read-only; - }; - - partition@1f0000 { - reg = <0x1f0000 0x10000>; - label = "board-info"; - read-only; - - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdinfo_d880: macaddr@d880 { - reg = <0xd880 0x6>; - }; - }; - - partition@200000 { - reg = <0x200000 0x600000>; - label = "kernel"; - }; - - partition@800000 { - reg = <0x800000 0x1800000>; - label = "rootfs"; - }; - - partition@2000000 { - reg = <0x2000000 0x600000>; - label = "kn2"; - read-only; - }; - - partition@2600000 { - reg = <0x2600000 0x1800000>; - label = "rfs2"; - read-only; - }; - - partition@3e00000 { - reg = <0x3e00000 0x1200000>; - label = "part1"; - read-only; - }; - - partition@5000000 { - reg = <0x5000000 0x1200000>; - label = "part2"; - read-only; - }; - - partition@6200000 { - reg = <0x6200000 0x1e00000>; - label = "config"; - read-only; - }; - }; - }; -}; 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 new file mode 100644 index 00000000000000..91458299a209ec --- /dev/null +++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-fortinet-fg-x0e.dtsi @@ -0,0 +1,342 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include +#include +#include +#include "armada-385.dtsi" + +/ { + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_green; + label-mac-device = ð0; + }; + + chosen { + stdout-path = "serial0:9600n8"; + }; + + soc { + ranges = ; + }; + + gpio-keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&pmx_gpio_keys_pins>; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio1 22 GPIO_ACTIVE_LOW>; + }; + }; + + gpio_leds: gpio-leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&pmx_gpio_leds_pins>; + + led-0 { + label = "red:alarm"; + gpios = <&gpio0 30 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_ALARM; + }; + + led-1 { + label = "red:ha"; + gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; + color = ; + }; + + led_status_green: led-2 { + label = "green:sta"; + gpios = <&gpio1 1 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + }; + + led-3 { + label = "green:ha"; + gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; + color = ; + }; + + led-4 { + label = "amber:alarm"; + gpios = <&gpio1 13 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_ALARM; + }; + + led_status_red: led-5 { + label = "red:sta"; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + }; + + led-6 { + label = "green:speed_lan4"; + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + color = ; + linux,default-trigger = "mv88e6xxx-1:01:1Gbps"; + }; + + led-7 { + label = "amber:speed_lan4"; + gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; + color = ; + linux,default-trigger = "mv88e6xxx-1:01:100Mbps"; + }; + + led-8 { + label = "amber:speed_lan3"; + gpios = <&gpio2 6 GPIO_ACTIVE_LOW>; + color = ; + linux,default-trigger = "mv88e6xxx-1:02:100Mbps"; + }; + + led-9 { + label = "green:speed_lan3"; + gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; + color = ; + linux,default-trigger = "mv88e6xxx-1:02:1Gbps"; + }; + + led-10 { + label = "green:speed_lan1"; + gpios = <&gpio2 12 GPIO_ACTIVE_LOW>; + color = ; + linux,default-trigger = "mv88e6xxx-1:04:1Gbps"; + }; + + led-11 { + label = "amber:speed_lan1"; + gpios = <&gpio2 13 GPIO_ACTIVE_LOW>; + color = ; + linux,default-trigger = "mv88e6xxx-1:04:100Mbps"; + }; + + led-12 { + label = "green:speed_lan2"; + gpios = <&gpio2 14 GPIO_ACTIVE_LOW>; + color = ; + linux,default-trigger = "mv88e6xxx-1:03:1Gbps"; + }; + + led-13 { + label = "amber:speed_lan2"; + gpios = <&gpio2 15 GPIO_ACTIVE_LOW>; + color = ; + linux,default-trigger = "mv88e6xxx-1:03:100Mbps"; + }; + }; + + reg_usb_vbus: regulator-usb-vbus { + compatible = "fixed-regulator"; + regulator-name = "usb-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio1 21 GPIO_ACTIVE_LOW>; + regulator-always-on; + }; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + status = "okay"; + + gpio2: gpio@24 { + compatible = "nxp,pca9555"; + reg = <0x24>; + gpio-controller; + #gpio-cells = <0x2>; + }; + + hwmon@28 { + compatible = "nuvoton,nct7802"; + reg = <0x28>; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + status = "okay"; +}; + +&pinctrl { + pmx_gpio_leds_pins: gpio-leds-pins { + marvell,pins = "mpp30", "mpp32", "mpp33", "mpp35", + "mpp45", "mpp47"; + marvell,function = "gpio"; + }; + + pmx_usb_pins: usb-pins { + marvell,pins = "mpp53"; + marvell,function = "gpio"; + }; + + pmx_gpio_keys_pins: gpio-keys-pins { + marvell,pins = "mpp54"; + marvell,function = "gpio"; + }; +}; + +&bm { + status = "okay"; +}; + +&bm_bppi { + status = "okay"; +}; + +ð0 { + pinctrl-names = "default"; + pinctrl-0 = <&ge0_rgmii_pins>; + status = "okay"; + + phy-connection-type = "rgmii-id"; + buffer-manager = <&bm>; + bm,pool-long = <0>; + bm,pool-short = <1>; + nvmem-cells = <&macaddr_bdinfo_d880 0>; + nvmem-cell-names = "mac-address"; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&usb3_0 { + pinctrl-names = "default"; + pinctrl-0 = <&pmx_usb_pins>; + status = "okay"; + + vbus-supply = <®_usb_vbus>; +}; + +&spi1 { + pinctrl-names = "default"; + pinctrl-0 = <&spi1_pins>; + 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 { + reg = <0x0 0x1c0000>; + label = "u-boot"; + read-only; + }; + + partition@1c0000 { + reg = <0x1c0000 0x10000>; + label = "firmware-info"; + + /* + * 0x10 - 0x2f : image name (image1) + * 0x30 - 0x4f : image name (image2) + * 0x170 (1byte): active image (0x0/0x1) + * 0x184 - 0x185: kernel block count (image1) + * 0x18c - 0x18d: rootfs block count (image1) + * 0x194 - 0x195: kernel block count (image2) + * 0x19c - 0x19d: rootfs block count (image2) + * 0x1be (1byte): bit7 -> active flag (image1)? + * 0x1ce (1byte): bit7 -> active flag (image2)? + * + * Note: block size --> 0x200 (512 bytes) + */ + }; + + partition@1d0000 { + reg = <0x1d0000 0x10000>; + label = "dtb"; + read-only; + }; + + partition@1e0000 { + reg = <0x1e0000 0x10000>; + label = "u-boot-env"; + read-only; + }; + + partition@1f0000 { + reg = <0x1f0000 0x10000>; + label = "board-info"; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_d880: macaddr@d880 { + compatible = "mac-base"; + reg = <0xd880 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@200000 { + reg = <0x200000 0x600000>; + label = "kernel"; + }; + + partition@800000 { + reg = <0x800000 0x1800000>; + label = "rootfs"; + }; + + partition@2000000 { + reg = <0x2000000 0x600000>; + label = "kn2"; + read-only; + }; + + partition@2600000 { + reg = <0x2600000 0x1800000>; + label = "rfs2"; + read-only; + }; + + partition@3e00000 { + reg = <0x3e00000 0x1200000>; + label = "part1"; + read-only; + }; + + partition@5000000 { + reg = <0x5000000 0x1200000>; + label = "part2"; + read-only; + }; + + partition@6200000 { + reg = <0x6200000 0x1e00000>; + label = "config"; + read-only; + }; + }; + }; +}; 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 d14ea8b94e391a..494487a8b410b2 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 8d163059a007e1..22dcbfac35fe04 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 ba6213a89ef7f5..a49401d904c64e 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -16,6 +16,23 @@ define Build/fortigate-header mv $@.new $@ endef +define Build/seil-header + ( \ + data_size_crc="$$(gzip -c $@ | tail -c8 | \ + od -An -tx8 --endian little | tr -d ' \n')"; \ + printf "SEIL2015"; \ + printf "$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION)" | \ + dd bs=80 count=1 conv=sync 2>/dev/null; \ + printf "$$(echo $${data_size_crc:8:8} | sed 's/../\\x&/g')"; \ + printf "\x00\x00\x00\x01\x00\x00\x00\x09\x00\x00\x00\x63"; \ + printf "$(REVISION)" | dd bs=32 count=1 conv=sync 2>/dev/null; \ + printf "\x00\x00\x00\x00"; \ + printf "$$(echo $${data_size_crc:0:8} | sed 's/../\\x&/g')"; \ + cat $@; \ + ) > $@.new + mv $@.new $@ +endef + define Device/dsa-migration DEVICE_COMPAT_VERSION := 1.1 DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA @@ -95,6 +112,21 @@ define Device/cznic_turris-omnia endef TARGET_DEVICES += cznic_turris-omnia +define Device/fortinet_fg-30e + DEVICE_VENDOR := Fortinet + DEVICE_MODEL := FortiGate 30E + SOC := armada-385 + KERNEL := kernel-bin | append-dtb + KERNEL_INITRAMFS := kernel-bin | append-dtb | fortigate-header | \ + gzip-filename FGT30E + KERNEL_SIZE := 6144k + DEVICE_DTS := armada-385-fortinet-fg-30e + IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | \ + sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := kmod-hwmon-nct7802 +endef +TARGET_DEVICES += fortinet_fg-30e + define Device/fortinet_fg-50e DEVICE_VENDOR := Fortinet DEVICE_MODEL := FortiGate 50E @@ -119,6 +151,20 @@ define Device/globalscale_mirabox endef TARGET_DEVICES += globalscale_mirabox +define Device/iij_sa-w2 + DEVICE_VENDOR := IIJ + DEVICE_MODEL := SA-W2 + SOC := armada-380 + KERNEL := kernel-bin | append-dtb | seil-header + DEVICE_DTS := armada-380-iij-sa-w2 + IMAGE_SIZE := 15360k + IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | \ + append-rootfs | pad-rootfs | check-size | append-metadata + DEVICE_PACKAGES := kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \ + wpad-basic-mbedtls +endef +TARGET_DEVICES += iij_sa-w2 + define Device/iptime_nas1dual DEVICE_VENDOR := ipTIME DEVICE_MODEL := NAS1dual @@ -342,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/102-leds-turris-omnia-support-HW-controlled-mode-via-pri.patch b/target/linux/mvebu/patches-5.15/102-leds-turris-omnia-support-HW-controlled-mode-via-pri.patch deleted file mode 100644 index c14469460a76cf..00000000000000 --- a/target/linux/mvebu/patches-5.15/102-leds-turris-omnia-support-HW-controlled-mode-via-pri.patch +++ /dev/null @@ -1,118 +0,0 @@ -From 80e643510cb14f116f687e992210c0008a09d869 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marek=20Beh=C3=BAn?= -Date: Mon, 4 Jul 2022 12:59:53 +0200 -Subject: [PATCH] leds: turris-omnia: support HW controlled mode via - private trigger -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add support for enabling MCU controlled mode of the Turris Omnia LEDs -via a LED private trigger called "omnia-mcu". - -When in MCU controlled mode, the user can still set LED color, but the -blinking is done by MCU, which does different things for various LEDs: -- WAN LED is blinked according to the LED[0] pin of the WAN PHY -- LAN LEDs are blinked according to the LED[0] output of corresponding - port of the LAN switch -- PCIe LEDs are blinked according to the logical OR of the MiniPCIe port - LED pins - -For a long time I wanted to actually do this differently: I wanted to -make the netdev trigger to transparently offload the blinking to the HW -if user set compatible settings for the netdev trigger. -There was some work on this, and hopefully we will be able to complete -it sometime, but since there are various complications, it will probably -not be soon. - -In the meantime let's support HW controlled mode via this private LED -trigger. If, in the future, we manage to complete the netdev trigger -offloading, we can still keep this private trigger for backwards -compatiblity, if needed. - -We also set "omnia-mcu" to cdev->default_trigger, so that the MCU keeps -control until the user first wants to take over it. If a different -default trigger is specified in device-tree via the -`linux,default-trigger` property, LED class will overwrite -cdev->default_trigger, and so the DT property will be respected. - -Signed-off-by: Marek Behún ---- - drivers/leds/Kconfig | 1 + - drivers/leds/leds-turris-omnia.c | 41 ++++++++++++++++++++++++++++++++ - 2 files changed, 42 insertions(+) - ---- a/drivers/leds/Kconfig -+++ b/drivers/leds/Kconfig -@@ -163,6 +163,7 @@ config LEDS_TURRIS_OMNIA - depends on I2C - depends on MACH_ARMADA_38X || COMPILE_TEST - depends on OF -+ select LEDS_TRIGGERS - help - This option enables basic support for the LEDs found on the front - side of CZ.NIC's Turris Omnia router. There are 12 RGB LEDs on the ---- a/drivers/leds/leds-turris-omnia.c -+++ b/drivers/leds/leds-turris-omnia.c -@@ -41,6 +41,39 @@ struct omnia_leds { - struct omnia_led leds[]; - }; - -+static struct led_hw_trigger_type omnia_hw_trigger_type; -+ -+static int omnia_hwtrig_activate(struct led_classdev *cdev) -+{ -+ struct omnia_leds *leds = dev_get_drvdata(cdev->dev->parent); -+ struct omnia_led *led = to_omnia_led(lcdev_to_mccdev(cdev)); -+ -+ /* put the LED into MCU controlled mode */ -+ return i2c_smbus_write_byte_data(leds->client, CMD_LED_MODE, -+ CMD_LED_MODE_LED(led->reg)); -+} -+ -+static void omnia_hwtrig_deactivate(struct led_classdev *cdev) -+{ -+ struct omnia_leds *leds = dev_get_drvdata(cdev->dev->parent); -+ struct omnia_led *led = to_omnia_led(lcdev_to_mccdev(cdev)); -+ int ret; -+ -+ /* put the LED into software mode */ -+ ret = i2c_smbus_write_byte_data(leds->client, CMD_LED_MODE, -+ CMD_LED_MODE_LED(led->reg) | -+ CMD_LED_MODE_USER); -+ if (ret < 0) -+ dev_err(cdev->dev, "Cannot put to software mode: %i\n", ret); -+} -+ -+static struct led_trigger omnia_hw_trigger = { -+ .name = "omnia-mcu", -+ .activate = omnia_hwtrig_activate, -+ .deactivate = omnia_hwtrig_deactivate, -+ .trigger_type = &omnia_hw_trigger_type, -+}; -+ - static int omnia_led_brightness_set_blocking(struct led_classdev *cdev, - enum led_brightness brightness) - { -@@ -112,6 +145,8 @@ static int omnia_led_register(struct i2c - cdev = &led->mc_cdev.led_cdev; - cdev->max_brightness = 255; - cdev->brightness_set_blocking = omnia_led_brightness_set_blocking; -+ cdev->trigger_type = &omnia_hw_trigger_type; -+ cdev->default_trigger = omnia_hw_trigger.name; - - /* put the LED into software mode */ - ret = i2c_smbus_write_byte_data(client, CMD_LED_MODE, -@@ -228,6 +263,12 @@ static int omnia_leds_probe(struct i2c_c - - mutex_init(&leds->lock); - -+ ret = devm_led_trigger_register(dev, &omnia_hw_trigger); -+ if (ret < 0) { -+ dev_err(dev, "Cannot register private LED trigger: %d\n", ret); -+ return ret; -+ } -+ - led = &leds->leds[0]; - for_each_available_child_of_node(np, child) { - ret = omnia_led_register(client, led, child); diff --git a/target/linux/mvebu/patches-5.15/103-leds-turris-omnia-initialize-multi-intensity-to-full.patch b/target/linux/mvebu/patches-5.15/103-leds-turris-omnia-initialize-multi-intensity-to-full.patch deleted file mode 100644 index 1fe76b8f2cfcf4..00000000000000 --- a/target/linux/mvebu/patches-5.15/103-leds-turris-omnia-initialize-multi-intensity-to-full.patch +++ /dev/null @@ -1,33 +0,0 @@ -From bda176cceb735b9b46c1900658b6486c34e13ae6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marek=20Beh=C3=BAn?= -Date: Mon, 4 Jul 2022 12:59:54 +0200 -Subject: [PATCH] leds: turris-omnia: initialize multi-intensity to full -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The default color of each LED before driver probe (255, 255, 255). -Initialize multi_intensity to this value, so that it corresponds to the -reality. - -Signed-off-by: Marek Behún ---- - drivers/leds/leds-turris-omnia.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/drivers/leds/leds-turris-omnia.c -+++ b/drivers/leds/leds-turris-omnia.c -@@ -131,10 +131,13 @@ static int omnia_led_register(struct i2c - } - - led->subled_info[0].color_index = LED_COLOR_ID_RED; -+ led->subled_info[0].intensity = 255; - led->subled_info[0].channel = 0; - led->subled_info[1].color_index = LED_COLOR_ID_GREEN; -+ led->subled_info[1].intensity = 255; - led->subled_info[1].channel = 1; - led->subled_info[2].color_index = LED_COLOR_ID_BLUE; -+ led->subled_info[2].intensity = 255; - led->subled_info[2].channel = 2; - - led->mc_cdev.subled_info = led->subled_info; diff --git a/target/linux/mvebu/patches-5.15/104-leds-turris-omnia-change-max-brightness-from-255-to-.patch b/target/linux/mvebu/patches-5.15/104-leds-turris-omnia-change-max-brightness-from-255-to-.patch deleted file mode 100644 index fb8864dfd1d39f..00000000000000 --- a/target/linux/mvebu/patches-5.15/104-leds-turris-omnia-change-max-brightness-from-255-to-.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 349cbe949b9622cc05b148ecfa6268cbbae35b45 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marek=20Beh=C3=BAn?= -Date: Mon, 4 Jul 2022 12:59:55 +0200 -Subject: [PATCH] leds: turris-omnia: change max brightness from 255 to 1 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Using binary brightness makes more sense for this controller, because -internally in the MCU it works that way: the LED has a color, and a -state whether it is ON or OFF. - -The resulting brightness computation with led_mc_calc_color_components() -will now always result in either (0, 0, 0) or the multi_intensity value. - -Signed-off-by: Marek Behún ---- - drivers/leds/leds-turris-omnia.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/leds/leds-turris-omnia.c -+++ b/drivers/leds/leds-turris-omnia.c -@@ -146,7 +146,7 @@ static int omnia_led_register(struct i2c - init_data.fwnode = &np->fwnode; - - cdev = &led->mc_cdev.led_cdev; -- cdev->max_brightness = 255; -+ cdev->max_brightness = 1; - cdev->brightness_set_blocking = omnia_led_brightness_set_blocking; - cdev->trigger_type = &omnia_hw_trigger_type; - cdev->default_trigger = omnia_hw_trigger.name; diff --git a/target/linux/mvebu/patches-5.15/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/mvebu/patches-5.15/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch index d064b801ecfa7c..bedeea4784c4fe 100644 --- a/target/linux/mvebu/patches-5.15/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/mvebu/patches-5.15/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch @@ -258,7 +258,7 @@ Signed-off-by: Michael Gray static int kernel_init(void *); extern void init_IRQ(void); -@@ -988,6 +992,18 @@ asmlinkage __visible void __init __no_sa +@@ -992,6 +996,18 @@ asmlinkage __visible void __init __no_sa page_alloc_init(); pr_notice("Kernel command line: %s\n", saved_command_line); 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 00000000000000..280fc5957e49ce --- /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/102-leds-turris-omnia-support-HW-controlled-mode-via-pri.patch b/target/linux/mvebu/patches-6.1/102-leds-turris-omnia-support-HW-controlled-mode-via-pri.patch deleted file mode 100644 index c14469460a76cf..00000000000000 --- a/target/linux/mvebu/patches-6.1/102-leds-turris-omnia-support-HW-controlled-mode-via-pri.patch +++ /dev/null @@ -1,118 +0,0 @@ -From 80e643510cb14f116f687e992210c0008a09d869 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marek=20Beh=C3=BAn?= -Date: Mon, 4 Jul 2022 12:59:53 +0200 -Subject: [PATCH] leds: turris-omnia: support HW controlled mode via - private trigger -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Add support for enabling MCU controlled mode of the Turris Omnia LEDs -via a LED private trigger called "omnia-mcu". - -When in MCU controlled mode, the user can still set LED color, but the -blinking is done by MCU, which does different things for various LEDs: -- WAN LED is blinked according to the LED[0] pin of the WAN PHY -- LAN LEDs are blinked according to the LED[0] output of corresponding - port of the LAN switch -- PCIe LEDs are blinked according to the logical OR of the MiniPCIe port - LED pins - -For a long time I wanted to actually do this differently: I wanted to -make the netdev trigger to transparently offload the blinking to the HW -if user set compatible settings for the netdev trigger. -There was some work on this, and hopefully we will be able to complete -it sometime, but since there are various complications, it will probably -not be soon. - -In the meantime let's support HW controlled mode via this private LED -trigger. If, in the future, we manage to complete the netdev trigger -offloading, we can still keep this private trigger for backwards -compatiblity, if needed. - -We also set "omnia-mcu" to cdev->default_trigger, so that the MCU keeps -control until the user first wants to take over it. If a different -default trigger is specified in device-tree via the -`linux,default-trigger` property, LED class will overwrite -cdev->default_trigger, and so the DT property will be respected. - -Signed-off-by: Marek Behún ---- - drivers/leds/Kconfig | 1 + - drivers/leds/leds-turris-omnia.c | 41 ++++++++++++++++++++++++++++++++ - 2 files changed, 42 insertions(+) - ---- a/drivers/leds/Kconfig -+++ b/drivers/leds/Kconfig -@@ -163,6 +163,7 @@ config LEDS_TURRIS_OMNIA - depends on I2C - depends on MACH_ARMADA_38X || COMPILE_TEST - depends on OF -+ select LEDS_TRIGGERS - help - This option enables basic support for the LEDs found on the front - side of CZ.NIC's Turris Omnia router. There are 12 RGB LEDs on the ---- a/drivers/leds/leds-turris-omnia.c -+++ b/drivers/leds/leds-turris-omnia.c -@@ -41,6 +41,39 @@ struct omnia_leds { - struct omnia_led leds[]; - }; - -+static struct led_hw_trigger_type omnia_hw_trigger_type; -+ -+static int omnia_hwtrig_activate(struct led_classdev *cdev) -+{ -+ struct omnia_leds *leds = dev_get_drvdata(cdev->dev->parent); -+ struct omnia_led *led = to_omnia_led(lcdev_to_mccdev(cdev)); -+ -+ /* put the LED into MCU controlled mode */ -+ return i2c_smbus_write_byte_data(leds->client, CMD_LED_MODE, -+ CMD_LED_MODE_LED(led->reg)); -+} -+ -+static void omnia_hwtrig_deactivate(struct led_classdev *cdev) -+{ -+ struct omnia_leds *leds = dev_get_drvdata(cdev->dev->parent); -+ struct omnia_led *led = to_omnia_led(lcdev_to_mccdev(cdev)); -+ int ret; -+ -+ /* put the LED into software mode */ -+ ret = i2c_smbus_write_byte_data(leds->client, CMD_LED_MODE, -+ CMD_LED_MODE_LED(led->reg) | -+ CMD_LED_MODE_USER); -+ if (ret < 0) -+ dev_err(cdev->dev, "Cannot put to software mode: %i\n", ret); -+} -+ -+static struct led_trigger omnia_hw_trigger = { -+ .name = "omnia-mcu", -+ .activate = omnia_hwtrig_activate, -+ .deactivate = omnia_hwtrig_deactivate, -+ .trigger_type = &omnia_hw_trigger_type, -+}; -+ - static int omnia_led_brightness_set_blocking(struct led_classdev *cdev, - enum led_brightness brightness) - { -@@ -112,6 +145,8 @@ static int omnia_led_register(struct i2c - cdev = &led->mc_cdev.led_cdev; - cdev->max_brightness = 255; - cdev->brightness_set_blocking = omnia_led_brightness_set_blocking; -+ cdev->trigger_type = &omnia_hw_trigger_type; -+ cdev->default_trigger = omnia_hw_trigger.name; - - /* put the LED into software mode */ - ret = i2c_smbus_write_byte_data(client, CMD_LED_MODE, -@@ -228,6 +263,12 @@ static int omnia_leds_probe(struct i2c_c - - mutex_init(&leds->lock); - -+ ret = devm_led_trigger_register(dev, &omnia_hw_trigger); -+ if (ret < 0) { -+ dev_err(dev, "Cannot register private LED trigger: %d\n", ret); -+ return ret; -+ } -+ - led = &leds->leds[0]; - for_each_available_child_of_node(np, child) { - ret = omnia_led_register(client, led, child); diff --git a/target/linux/mvebu/patches-6.1/103-leds-turris-omnia-initialize-multi-intensity-to-full.patch b/target/linux/mvebu/patches-6.1/103-leds-turris-omnia-initialize-multi-intensity-to-full.patch deleted file mode 100644 index 1fe76b8f2cfcf4..00000000000000 --- a/target/linux/mvebu/patches-6.1/103-leds-turris-omnia-initialize-multi-intensity-to-full.patch +++ /dev/null @@ -1,33 +0,0 @@ -From bda176cceb735b9b46c1900658b6486c34e13ae6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marek=20Beh=C3=BAn?= -Date: Mon, 4 Jul 2022 12:59:54 +0200 -Subject: [PATCH] leds: turris-omnia: initialize multi-intensity to full -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The default color of each LED before driver probe (255, 255, 255). -Initialize multi_intensity to this value, so that it corresponds to the -reality. - -Signed-off-by: Marek Behún ---- - drivers/leds/leds-turris-omnia.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/drivers/leds/leds-turris-omnia.c -+++ b/drivers/leds/leds-turris-omnia.c -@@ -131,10 +131,13 @@ static int omnia_led_register(struct i2c - } - - led->subled_info[0].color_index = LED_COLOR_ID_RED; -+ led->subled_info[0].intensity = 255; - led->subled_info[0].channel = 0; - led->subled_info[1].color_index = LED_COLOR_ID_GREEN; -+ led->subled_info[1].intensity = 255; - led->subled_info[1].channel = 1; - led->subled_info[2].color_index = LED_COLOR_ID_BLUE; -+ led->subled_info[2].intensity = 255; - led->subled_info[2].channel = 2; - - led->mc_cdev.subled_info = led->subled_info; diff --git a/target/linux/mvebu/patches-6.1/104-leds-turris-omnia-change-max-brightness-from-255-to-.patch b/target/linux/mvebu/patches-6.1/104-leds-turris-omnia-change-max-brightness-from-255-to-.patch deleted file mode 100644 index fb8864dfd1d39f..00000000000000 --- a/target/linux/mvebu/patches-6.1/104-leds-turris-omnia-change-max-brightness-from-255-to-.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 349cbe949b9622cc05b148ecfa6268cbbae35b45 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marek=20Beh=C3=BAn?= -Date: Mon, 4 Jul 2022 12:59:55 +0200 -Subject: [PATCH] leds: turris-omnia: change max brightness from 255 to 1 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Using binary brightness makes more sense for this controller, because -internally in the MCU it works that way: the LED has a color, and a -state whether it is ON or OFF. - -The resulting brightness computation with led_mc_calc_color_components() -will now always result in either (0, 0, 0) or the multi_intensity value. - -Signed-off-by: Marek Behún ---- - drivers/leds/leds-turris-omnia.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/leds/leds-turris-omnia.c -+++ b/drivers/leds/leds-turris-omnia.c -@@ -146,7 +146,7 @@ static int omnia_led_register(struct i2c - init_data.fwnode = &np->fwnode; - - cdev = &led->mc_cdev.led_cdev; -- cdev->max_brightness = 255; -+ cdev->max_brightness = 1; - cdev->brightness_set_blocking = omnia_led_brightness_set_blocking; - cdev->trigger_type = &omnia_hw_trigger_type; - cdev->default_trigger = omnia_hw_trigger.name; diff --git a/target/linux/mvebu/patches-6.1/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/mvebu/patches-6.1/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch index 7d40019020dd46..f3881a0d25e4b2 100644 --- a/target/linux/mvebu/patches-6.1/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/mvebu/patches-6.1/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch @@ -258,7 +258,7 @@ Signed-off-by: Michael Gray static int kernel_init(void *); extern void init_IRQ(void); -@@ -989,6 +993,18 @@ asmlinkage __visible void __init __no_sa +@@ -993,6 +997,18 @@ asmlinkage __visible void __init __no_sa page_alloc_init(); pr_notice("Kernel command line: %s\n", saved_command_line); 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 00000000000000..280fc5957e49ce --- /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/mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch b/target/linux/mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch index 307c46e7b801eb..15762be81d40ec 100644 --- a/target/linux/mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch +++ b/target/linux/mvebu/patches-6.1/700-mvneta-tx-queue-workaround.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -5222,6 +5222,16 @@ static int mvneta_setup_tc(struct net_de +@@ -5234,6 +5234,16 @@ static int mvneta_setup_tc(struct net_de } } @@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau static const struct net_device_ops mvneta_netdev_ops = { .ndo_open = mvneta_open, .ndo_stop = mvneta_stop, -@@ -5232,6 +5242,9 @@ static const struct net_device_ops mvnet +@@ -5244,6 +5254,9 @@ static const struct net_device_ops mvnet .ndo_fix_features = mvneta_fix_features, .ndo_get_stats64 = mvneta_get_stats64, .ndo_eth_ioctl = mvneta_ioctl, 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 f8d511b599012d..401aafe1674dd7 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 f354d08199a866..270e2a32648c15 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 9be52f917592f3..ad73a08a1e2454 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/octeontx/patches-5.15/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch b/target/linux/octeontx/patches-5.15/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch index 842bed4c427f7d..0400d1e9ddc841 100644 --- a/target/linux/octeontx/patches-5.15/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch +++ b/target/linux/octeontx/patches-5.15/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch @@ -22,7 +22,7 @@ Signed-off-by: Tim Harvey #include #include #include -@@ -5856,3 +5857,34 @@ static void nvidia_ion_ahci_fixup(struct +@@ -5879,3 +5880,34 @@ static void nvidia_ion_ahci_fixup(struct pdev->dev_flags |= PCI_DEV_FLAGS_HAS_MSI_MASKING; } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, 0x0ab8, nvidia_ion_ahci_fixup); diff --git a/target/linux/oxnas/config-5.15 b/target/linux/oxnas/config-5.15 index 9540a76774f5df..0cf06ee5809a7e 100644 --- a/target/linux/oxnas/config-5.15 +++ b/target/linux/oxnas/config-5.15 @@ -245,7 +245,6 @@ CONFIG_SERIO=y CONFIG_SERIO_LIBPS2=y CONFIG_SERIO_SERPORT=y CONFIG_SGL_ALLOC=y -CONFIG_SLUB_DEBUG=y CONFIG_SOCK_DIAG=y CONFIG_SPARSE_IRQ=y CONFIG_SPLIT_PTLOCK_CPUS=999999 diff --git a/target/linux/oxnas/patches-5.15/996-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/oxnas/patches-5.15/996-generic-Mangle-bootloader-s-kernel-arguments.patch index 1e04b9daf58fe9..f1fa6ca45fb28e 100644 --- a/target/linux/oxnas/patches-5.15/996-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/oxnas/patches-5.15/996-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -239,7 +239,7 @@ Signed-off-by: Adrian Panella static int kernel_init(void *); extern void init_IRQ(void); -@@ -988,6 +992,18 @@ asmlinkage __visible void __init __no_sa +@@ -992,6 +996,18 @@ asmlinkage __visible void __init __no_sa page_alloc_init(); pr_notice("Kernel command line: %s\n", saved_command_line); diff --git a/target/linux/oxnas/patches-5.15/999-libata-hacks.patch b/target/linux/oxnas/patches-5.15/999-libata-hacks.patch index f44f6b55ffe77c..27074071c2bcf5 100644 --- a/target/linux/oxnas/patches-5.15/999-libata-hacks.patch +++ b/target/linux/oxnas/patches-5.15/999-libata-hacks.patch @@ -36,7 +36,7 @@ --- a/include/linux/libata.h +++ b/include/linux/libata.h -@@ -923,6 +923,8 @@ struct ata_port_operations { +@@ -927,6 +927,8 @@ struct ata_port_operations { enum ata_completion_errors (*qc_prep)(struct ata_queued_cmd *qc); unsigned int (*qc_issue)(struct ata_queued_cmd *qc); bool (*qc_fill_rtf)(struct ata_queued_cmd *qc); @@ -45,7 +45,7 @@ /* * Configuration and exception handling -@@ -1013,6 +1015,9 @@ struct ata_port_operations { +@@ -1017,6 +1019,9 @@ struct ata_port_operations { void (*phy_reset)(struct ata_port *ap); void (*eng_timeout)(struct ata_port *ap); diff --git a/target/linux/pistachio/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/pistachio/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch index 7db6346c37e418..36f5331bd017f9 100644 --- a/target/linux/pistachio/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch +++ b/target/linux/pistachio/patches-5.15/401-mtd-nor-support-mtd-name-from-device-tree.patch @@ -34,7 +34,7 @@ Signed-off-by: Abhimanyu Vishwakarma mtd->type = MTD_NORFLASH; --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c -@@ -847,6 +847,17 @@ out_error: +@@ -870,6 +870,17 @@ out_error: */ static void mtd_set_dev_defaults(struct mtd_info *mtd) { diff --git a/target/linux/qoriq/base-files/etc/board.d/05_compat-version b/target/linux/qoriq/base-files/etc/board.d/05_compat-version new file mode 100644 index 00000000000000..2036fbcc954efb --- /dev/null +++ b/target/linux/qoriq/base-files/etc/board.d/05_compat-version @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +. /lib/functions.sh +. /lib/functions/uci-defaults.sh + +board_config_update + +case "$(board_name)" in + watchguard,firebox-m300) + ucidef_set_compat_version "1.1" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/qoriq/config-5.15 b/target/linux/qoriq/config-5.15 index 8ebee2bb14f8bb..39796daf1d73c3 100644 --- a/target/linux/qoriq/config-5.15 +++ b/target/linux/qoriq/config-5.15 @@ -83,14 +83,12 @@ CONFIG_CRYPTO_RSA=y CONFIG_CRYPTO_XTS=y CONFIG_DATA_SHIFT=12 CONFIG_DEBUG_INFO=y -# CONFIG_DEBUG_INFO_REDUCED is not set CONFIG_DEFAULT_UIMAGE=y CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y CONFIG_DMA_OF=y CONFIG_DMA_OPS=y CONFIG_DMA_OPS_BYPASS=y -CONFIG_DPAA_ERRATUM_A050385=y CONFIG_DTC=y CONFIG_DUMMY_CONSOLE=y CONFIG_E500=y @@ -274,7 +272,6 @@ CONFIG_OPTPROBES=y CONFIG_PACKING=y CONFIG_PADATA=y CONFIG_PAGE_OFFSET=0xc000000000000000 -CONFIG_PAHOLE_HAS_SPLIT_BTF=y CONFIG_PCI=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_MSI=y @@ -354,7 +351,6 @@ CONFIG_SERIAL_FSL_LPUART=y CONFIG_SERIAL_FSL_LPUART_CONSOLE=y CONFIG_SERIAL_MCTRL_GPIO=y CONFIG_SG_POOL=y -CONFIG_SLUB_DEBUG=y CONFIG_SMP=y CONFIG_SOCK_RX_QUEUE_MAPPING=y CONFIG_SOC_BUS=y diff --git a/target/linux/qoriq/image/Makefile b/target/linux/qoriq/image/Makefile index ec46e4d54321f5..69fea238b5e21d 100644 --- a/target/linux/qoriq/image/Makefile +++ b/target/linux/qoriq/image/Makefile @@ -13,7 +13,7 @@ define Build/sdcard-img $(foreach dtb,$(DEVICE_DTS),$(CP) $(KDIR)/image-$(dtb).dtb $@.boot), \ $(CP) $(KDIR)/image-/*.dtb $@.boot) - $(SCRIPT_DIR)/gen_image_generic.sh \ + PADDING=1 $(SCRIPT_DIR)/gen_image_generic.sh \ $@ \ $(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \ $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \ diff --git a/target/linux/qualcommax/config-6.1 b/target/linux/qualcommax/config-6.1 index 8bac3fa1872f05..7a983b961b393e 100644 --- a/target/linux/qualcommax/config-6.1 +++ b/target/linux/qualcommax/config-6.1 @@ -52,7 +52,6 @@ CONFIG_ARM_GIC_V3_ITS=y CONFIG_ARM_GIC_V3_ITS_PCI=y # CONFIG_ARM_MHU_V2 is not set CONFIG_ARM_PSCI_CPUIDLE=y -CONFIG_ARM_PSCI_CPUIDLE_DOMAIN=y CONFIG_ARM_PSCI_FW=y # CONFIG_ARM_QCOM_CPUFREQ_HW is not set CONFIG_ARM_QCOM_CPUFREQ_NVMEM=y @@ -135,7 +134,6 @@ CONFIG_DMA_ENGINE=y CONFIG_DMA_OF=y CONFIG_DMA_VIRTUAL_CHANNELS=y CONFIG_DTC=y -CONFIG_DT_IDLE_GENPD=y CONFIG_DT_IDLE_STATES=y CONFIG_EDAC_SUPPORT=y CONFIG_EXCLUSIVE_SYSTEM_RAM=y @@ -200,7 +198,7 @@ CONFIG_IPQ_APSS_PLL=y # CONFIG_IPQ_GCC_4019 is not set # CONFIG_IPQ_GCC_6018 is not set # CONFIG_IPQ_GCC_806X is not set -CONFIG_IPQ_GCC_8074=y +# CONFIG_IPQ_GCC_8074 is not set # CONFIG_IPQ_LCC_806X is not set CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y @@ -223,9 +221,7 @@ CONFIG_MDIO_IPQ4019=y # CONFIG_MDM_GCC_9615 is not set # CONFIG_MDM_LCC_9615 is not set CONFIG_MEMFD_CREATE=y -# CONFIG_MFD_HI6421_SPMI is not set # CONFIG_MFD_QCOM_RPM is not set -CONFIG_MFD_SPMI_PMIC=y CONFIG_MFD_SYSCON=y CONFIG_MIGRATION=y CONFIG_MMC=y @@ -279,7 +275,6 @@ CONFIG_NVIDIA_CARMEL_CNP_ERRATUM=y CONFIG_NVMEM=y CONFIG_NVMEM_QCOM_QFPROM=y # CONFIG_NVMEM_QCOM_SEC_QFPROM is not set -# CONFIG_NVMEM_SPMI_SDAM is not set CONFIG_NVMEM_SYSFS=y CONFIG_NVMEM_U_BOOT_ENV=y CONFIG_OF=y @@ -327,7 +322,7 @@ CONFIG_PHY_QCOM_QUSB2=y # CONFIG_PHY_QCOM_USB_SS is not set CONFIG_PINCTRL=y # CONFIG_PINCTRL_IPQ6018 is not set -CONFIG_PINCTRL_IPQ8074=y +# CONFIG_PINCTRL_IPQ8074 is not set CONFIG_PINCTRL_MSM=y # CONFIG_PINCTRL_MSM8916 is not set # CONFIG_PINCTRL_MSM8976 is not set @@ -335,7 +330,6 @@ CONFIG_PINCTRL_MSM=y # CONFIG_PINCTRL_MSM8996 is not set # CONFIG_PINCTRL_MSM8998 is not set # CONFIG_PINCTRL_QCM2290 is not set -CONFIG_PINCTRL_QCOM_SPMI_PMIC=y # CONFIG_PINCTRL_QCOM_SSBI_PMIC is not set # CONFIG_PINCTRL_QCS404 is not set # CONFIG_PINCTRL_SC7180 is not set @@ -348,15 +342,11 @@ CONFIG_PINCTRL_QCOM_SPMI_PMIC=y # CONFIG_PINCTRL_SM8250 is not set # CONFIG_PINCTRL_SM8450 is not set CONFIG_PM=y -# CONFIG_PM8916_WATCHDOG is not set CONFIG_PM_CLK=y -CONFIG_PM_GENERIC_DOMAINS=y -CONFIG_PM_GENERIC_DOMAINS_OF=y CONFIG_PM_OPP=y CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y CONFIG_POWER_RESET=y # CONFIG_POWER_RESET_MSM is not set -# CONFIG_POWER_RESET_QCOM_PON is not set CONFIG_POWER_SUPPLY=y CONFIG_PREEMPT_NONE_BUILD=y CONFIG_PRINTK_TIME=y @@ -366,18 +356,16 @@ CONFIG_PTP_1588_CLOCK_OPTIONAL=y # CONFIG_QCOM_A53PLL is not set # CONFIG_QCOM_AOSS_QMP is not set CONFIG_QCOM_APCS_IPC=y -CONFIG_QCOM_APM=y +# CONFIG_QCOM_APM is not set # CONFIG_QCOM_APR is not set CONFIG_QCOM_BAM_DMA=y # CONFIG_QCOM_CLK_APCC_MSM8996 is not set # CONFIG_QCOM_CLK_APCS_MSM8916 is not set # CONFIG_QCOM_CLK_APCS_SDX55 is not set -# CONFIG_QCOM_COINCELL is not set # CONFIG_QCOM_COMMAND_DB is not set # CONFIG_QCOM_CPR is not set # CONFIG_QCOM_EBI2 is not set # CONFIG_QCOM_FASTRPC is not set -CONFIG_QCOM_GDSC=y # CONFIG_QCOM_GENI_SE is not set # CONFIG_QCOM_GSBI is not set # CONFIG_QCOM_HFPLL is not set @@ -406,12 +394,9 @@ CONFIG_QCOM_SMP2P=y # CONFIG_QCOM_SMSM is not set CONFIG_QCOM_SOCINFO=y # CONFIG_QCOM_SPM is not set -CONFIG_QCOM_SPMI_ADC5=y -# CONFIG_QCOM_SPMI_RRADC is not set # CONFIG_QCOM_STATS is not set # CONFIG_QCOM_SYSMON is not set CONFIG_QCOM_TSENS=y -CONFIG_QCOM_VADC_COMMON=y # CONFIG_QCOM_WCNSS_CTRL is not set # CONFIG_QCOM_WCNSS_PIL is not set CONFIG_QCOM_WDT=y @@ -425,15 +410,9 @@ CONFIG_RAS=y CONFIG_RATIONAL=y CONFIG_REGMAP=y CONFIG_REGMAP_MMIO=y -CONFIG_REGMAP_SPMI=y CONFIG_REGULATOR=y -CONFIG_REGULATOR_CPR3=y -# CONFIG_REGULATOR_CPR3_NPU is not set -CONFIG_REGULATOR_CPR4_APSS=y +# CONFIG_REGULATOR_CPR3 is not set CONFIG_REGULATOR_FIXED_VOLTAGE=y -# CONFIG_REGULATOR_QCOM_LABIBB is not set -CONFIG_REGULATOR_QCOM_SPMI=y -# CONFIG_REGULATOR_QCOM_USB_VBUS is not set # CONFIG_REGULATOR_VQMMC_IPQ4019 is not set CONFIG_RELOCATABLE=y CONFIG_REMOTEPROC=y @@ -454,7 +433,6 @@ CONFIG_RPMSG_QCOM_SMD=y # CONFIG_RPMSG_TTY is not set CONFIG_RPS=y CONFIG_RTC_CLASS=y -CONFIG_RTC_DRV_PM8XXX=y CONFIG_RTC_I2C_AND_SPI=y CONFIG_RWSEM_SPIN_ON_OWNER=y # CONFIG_SCHED_CORE is not set @@ -512,10 +490,6 @@ CONFIG_SPI=y CONFIG_SPI_MASTER=y CONFIG_SPI_MEM=y CONFIG_SPI_QUP=y -CONFIG_SPMI=y -# CONFIG_SPMI_HISI3670 is not set -CONFIG_SPMI_MSM_PMIC_ARB=y -# CONFIG_SPMI_PMIC_CLKDIV is not set CONFIG_SRCU=y CONFIG_SWIOTLB=y CONFIG_SWPHY=y 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 2c9cbd5b3cd3ca..622b8662fa9b66 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,33 +271,11 @@ &switch { status = "okay"; - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x1e>; /* lan port bitmap */ - switch_wan_bmp = <0x20>; /* 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 c18cef52f39d8b..2bb2cce157ca45 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 @@ -151,28 +151,30 @@ reg = <0x800000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_dp2: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_dp3: macaddr@c { - reg = <0xc 0x6>; - }; - - macaddr_dp4: macaddr@12 { - reg = <0x12 0x6>; - }; - - macaddr_dp5: macaddr@18 { - reg = <0x18 0x6>; - }; - - caldata_qca9889: caldata@4d000 { - reg = <0x33000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_dp2: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_dp3: macaddr@c { + reg = <0xc 0x6>; + }; + + macaddr_dp4: macaddr@12 { + reg = <0x12 0x6>; + }; + + macaddr_dp5: macaddr@18 { + reg = <0x18 0x6>; + }; + + caldata_qca9889: caldata@4d000 { + reg = <0x33000 0x844>; + }; }; }; @@ -235,33 +237,24 @@ &switch { status = "okay"; - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x1e>; /* lan port bitmap */ - switch_wan_bmp = <0x20>; /* 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@0 { - 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 = <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 357b6368d9dc55..7067f9296879ca 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,22 +343,18 @@ &switch { status = "okay"; - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x3e>; /* lan port bitmap */ - switch_wan_bmp = <0x40>; /* 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-301w.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts index 5521a480b8a35e..a7d398ee0f10d1 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,14 +321,12 @@ &switch { status = "okay"; - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x3e>; /* lan port bitmap */ - switch_wan_bmp = <0xc0>; /* 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 new file mode 100644 index 00000000000000..73bc13cf320631 --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax880.dts @@ -0,0 +1,366 @@ +// SPDX-License-Identifier: MIT, GPL-2.0 or later +/* Copyright (c) 2023, Ruslan Isaev */ + +/dts-v1/; + +#include "ipq8074.dtsi" +#include "ipq8074-hk-cpu.dtsi" +#include "ipq8074-ess.dtsi" +#include +#include + +/ { + model = "Yuncore AX880"; + compatible = "yuncore,ax880", "qcom,ipq8074", "qcom,ipq8074-hk09"; + + aliases { + serial0 = &blsp1_uart5; + serial1 = &blsp1_uart3; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + /* Aliases as required by u-boot to patch MAC addresses */ + ethernet0 = &dp5_syn; + ethernet1 = &dp6_syn; + label-mac-device = &dp5_syn; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + keys { + compatible = "gpio-keys"; + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + + reset { + label = "reset"; + gpios = <&tlmm 57 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_system: system { + label = "system"; + color = "red"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + }; + + wlan2g { + label = "wlan2g"; + color = "green"; + linux,default-trigger = "phy0tpt"; + gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + }; + + wlan5g { + label = "wlan5g"; + color = "blue"; + linux,default-trigger = "phy1tpt"; + gpios = <&tlmm 9 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&tlmm { + mdio_pins: mdio-pins { + mdc { + pins = "gpio68"; + function = "mdc"; + drive-strength = <8>; + bias-pull-up; + }; + + mdio { + pins = "gpio69"; + function = "mdio"; + drive-strength = <8>; + bias-pull-up; + }; + }; + + button_pins: button_pins { + reset_button { + pins = "gpio57"; + function = "gpio"; + drive-strength = <8>; + bias-pull-up; + }; + }; +}; + +&blsp1_spi1 { + status = "okay"; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:sbl1"; + reg = <0x0 0x50000>; + read-only; + }; + + partition@50000 { + label = "0:mibib"; + reg = <0x50000 0x10000>; + read-only; + }; + + partition@60000 { + label = "0:bootconfig"; + reg = <0x60000 0x20000>; + read-only; + }; + + partition@80000 { + label = "0:bootconfig1"; + reg = <0x80000 0x20000>; + read-only; + }; + + partition@a0000 { + label = "0:qsee_1"; + reg = <0xa0000 0x180000>; + read-only; + }; + + partition@220000 { + label = "0:qsee"; + reg = <0x220000 0x180000>; + read-only; + }; + + partition@3a0000 { + label = "0:devcfg"; + reg = <0x3a0000 0x10000>; + read-only; + }; + + partition@3b0000 { + label = "0:devcfg_1"; + reg = <0x3b0000 0x10000>; + read-only; + }; + + partition@3c0000 { + label = "0:apdp"; + reg = <0x3c0000 0x10000>; + read-only; + }; + + partition@3d0000 { + label = "0:apdp_1"; + reg = <0x3d0000 0x10000>; + read-only; + }; + + partition@3e0000 { + label = "0:rpm_1"; + reg = <0x3e0000 0x40000>; + read-only; + }; + + partition@420000 { + label = "0:rpm"; + reg = <0x420000 0x40000>; + read-only; + }; + + partition@460000 { + label = "0:cdt_1"; + reg = <0x460000 0x10000>; + read-only; + }; + + partition@470000 { + label = "0:cdt"; + reg = <0x470000 0x10000>; + read-only; + }; + + partition@480000 { + label = "0:appsblenv"; + reg = <0x480000 0x10000>; + }; + + partition@490000 { + label = "0:appsbl_1"; + reg = <0x490000 0xa0000>; + read-only; + }; + + partition@550000 { + label = "0:appsbl"; + reg = <0x530000 0xa0000>; + read-only; + }; + + partition@610000 { + label = "0:art"; + reg = <0x5d0000 0x40000>; + read-only; + }; + + partition@650000 { + label = "0:ethphyfw"; + reg = <0x610000 0x80000>; + read-only; + }; + + }; + }; +}; + +//serial interface +&blsp1_uart3 { + status = "okay"; +}; + +&blsp1_uart5 { + status = "okay"; +}; + +&crypto { + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&prng { + status = "okay"; +}; + +&qpic_bam { + status = "okay"; +}; + +&qusb_phy_0 { + status = "okay"; +}; + +&ssphy_0 { + status = "okay"; +}; + +&usb_0 { + status = "okay"; +}; + +&qpic_nand { + status = "okay"; + + nand@0 { + reg = <0>; + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + nand-bus-width = <8>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "rootfs_1"; + reg = <0x0000000 0x3400000>; + }; + + partition@3400000 { + label = "0:wififw"; + reg = <0x3400000 0x800000>; + read-only; + }; + + rootfs: partition@3c00000 { + label = "rootfs"; + reg = <0x3c00000 0x3400000>; + }; + + partition@7000000 { + label = "0:wififw_1"; + reg = <0x7000000 0x800000>; + read-only; + }; + }; + }; +}; + +&mdio { + status = "okay"; + + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + + qca8081_24: ethernet-phy@24 { + compatible = "ethernet-phy-id004d.d101"; + reg = <24>; + reset-gpios = <&tlmm 33 GPIO_ACTIVE_LOW>; + }; + + qca8081_28: ethernet-phy@28 { + compatible = "ethernet-phy-id004d.d101"; + reg = <28>; + reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>; + }; +}; + +&switch { + status = "okay"; + + 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@5 { + port_id = <5>; + phy_address = <24>; + port_mac_sel = "QGMAC_PORT"; + }; + port@6 { + port_id = <6>; + phy_address = <28>; + port_mac_sel = "QGMAC_PORT"; + }; + }; +}; + +&edma { + status = "okay"; +}; + +&dp5_syn { + status = "okay"; + phy-handle = <&qca8081_24>; + label = "wan"; +}; + +&dp6_syn { + status = "okay"; + phy-handle = <&qca8081_28>; + label = "lan"; +}; + +&wifi { + status = "okay"; + qcom,ath11k-calibration-variant = "Yuncore-AX880"; +}; 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 801aa056045f44..0df16e9ad7d25b 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 @@ -280,32 +280,34 @@ reg = <0xf80000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_dp1: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_dp2: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_dp3: macaddr@c { - reg = <0xc 0x6>; - }; - - macaddr_dp4: macaddr@12 { - reg = <0x12 0x6>; - }; - - macaddr_dp5: macaddr@18 { - reg = <0x18 0x6>; - }; - - caldata_qca9889: caldata@4d000 { - reg = <0x4d000 0x844>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_dp1: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_dp2: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_dp3: macaddr@c { + reg = <0xc 0x6>; + }; + + macaddr_dp4: macaddr@12 { + reg = <0x12 0x6>; + }; + + macaddr_dp5: macaddr@18 { + reg = <0x18 0x6>; + }; + + caldata_qca9889: caldata@4d000 { + reg = <0x4d000 0x844>; + }; }; }; @@ -382,33 +384,29 @@ &switch { status = "okay"; - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x1e>; /* lan port bitmap */ - switch_wan_bmp = <0x20>; /* 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_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */ + switch_wan_bmp = ; /* wan port bitmap */ + 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 5468e9e1fb83f5..a4548a77831764 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 @@ -169,33 +169,29 @@ &switch { status = "okay"; - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x3e>; /* lan port bitmap */ - switch_wan_bmp = <0x40>; /* 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_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* 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@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 8a5200b4ebf50e..34499641596b5a 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 @@ -186,33 +186,30 @@ &switch { status = "okay"; - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x1e>; /* lan port bitmap */ - switch_wan_bmp = <0x60>; /* 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_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */ + switch_wan_bmp = ; /* wan port bitmap */ + 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 5bfcdcc8ca3ad1..33a618851c7b43 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,17 +89,12 @@ &switch { status = "okay"; - switch_cpu_bmp = <0x1>; - switch_lan_bmp = <0x3e>; - switch_wan_bmp = <0x40>; - 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 d1c3245c8baf0c..74dae6cbf3d593 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,17 +117,12 @@ &switch { status = "okay"; - switch_cpu_bmp = <0x01>; - switch_lan_bmp = <0x3e>; - switch_wan_bmp = <0x40>; - 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 9779070725b40e..a450fbca25ca5e 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 @@ -388,14 +388,11 @@ &switch { status = "okay"; - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_lan_bmp = <0x3e>; /* lan port bitmap */ - switch_wan_bmp = <0x40>; /* 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_lan_bmp = <(ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */ + switch_wan_bmp = ; /* wan port bitmap */ + 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 { @@ -410,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 129266c50d1d38..d3f4211ecf9095 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 @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only +#include + &clocks { bias_pll_cc_clk { compatible = "fixed-clock"; @@ -19,8 +21,26 @@ compatible = "qcom,ess-switch-ipq807x"; reg = <0x3a000000 0x1000000>; switch_access_mode = "local bus"; - switch_cpu_bmp = <0x1>; /* cpu port bitmap */ - switch_inner_bmp = <0x80>; /*inner port bitmap*/ + 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>, @@ -138,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 { @@ -441,7 +469,7 @@ status = "disabled"; }; - dp1: dp1 { + dp1: dp1@3a001000 { device_type = "network"; compatible = "qcom,nss-dp"; qcom,id = <1>; @@ -452,7 +480,7 @@ status = "disabled"; }; - dp2: dp2 { + dp2: dp2@3a001200 { device_type = "network"; compatible = "qcom,nss-dp"; qcom,id = <2>; @@ -463,7 +491,7 @@ status = "disabled"; }; - dp3: dp3 { + dp3: dp3@3a001400 { device_type = "network"; compatible = "qcom,nss-dp"; qcom,id = <3>; @@ -474,7 +502,7 @@ status = "disabled"; }; - dp4: dp4 { + dp4: dp4@3a001600 { device_type = "network"; compatible = "qcom,nss-dp"; qcom,id = <4>; @@ -485,7 +513,7 @@ status = "disabled"; }; - dp5: dp5 { + dp5: dp5@3a001800 { device_type = "network"; compatible = "qcom,nss-dp"; qcom,id = <5>; @@ -496,7 +524,7 @@ status = "disabled"; }; - dp6: dp6 { + dp6: dp6@3a001a00 { device_type = "network"; compatible = "qcom,nss-dp"; qcom,id = <6>; @@ -507,7 +535,7 @@ status = "disabled"; }; - dp5_syn: dp5-syn { + dp5_syn: dp5-syn@3a003000 { device_type = "network"; compatible = "qcom,nss-dp"; qcom,id = <5>; @@ -518,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 d113b233ecf970..5fb8f3b4de4f85 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,43 +298,40 @@ &switch { status = "okay"; - switch_cpu_bmp = <0x1>; - switch_lan_bmp = <0x3e>; - switch_wan_bmp = <0x40>; - 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 188ad03fe04993..0949d19171a6cf 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 = <0x3e>; /* lan port bitmap */ - switch_wan_bmp = <0x40>; /* 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 { @@ -444,34 +441,35 @@ reg = <0x1180000 0x0100000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_dp1: macaddr@0 { - reg = <0x0 0x6>; - }; + macaddr_dp1: macaddr@0 { + reg = <0x0 0x6>; + }; - macaddr_dp2: macaddr@1 { - reg = <0x6 0x6>; - }; + macaddr_dp2: macaddr@1 { + reg = <0x6 0x6>; + }; - macaddr_dp3: macaddr@2 { - reg = <0xc 0x6>; - }; + macaddr_dp3: macaddr@2 { + reg = <0xc 0x6>; + }; - macaddr_dp4: macaddr@3 { - reg = <0x12 0x6>; - }; + macaddr_dp4: macaddr@3 { + reg = <0x12 0x6>; + }; - macaddr_dp5: macaddr@4 { - reg = <0x18 0x6>; - }; + macaddr_dp5: macaddr@4 { + reg = <0x18 0x6>; + }; - macaddr_dp6_syn: macaddr@5 { - reg = <0x1e 0x6>; + macaddr_dp6_syn: macaddr@5 { + reg = <0x1e 0x6>; + }; }; - }; partition@1280000 { 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 new file mode 100644 index 00000000000000..685e4243ddbf94 --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wax630.dts @@ -0,0 +1,248 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "ipq8074.dtsi" +#include "ipq8074-hk-cpu.dtsi" +#include "ipq8074-ess.dtsi" +#include +#include +#include + +/ { + model = "Netgear WAX630"; + compatible = "netgear,wax630", "qcom,ipq8074"; + + aliases { + serial0 = &blsp1_uart5; + + ethernet0 = &dp6_syn; + ethernet1 = &dp4; + label-mac-device = &dp6_syn; + + led-boot = &led_system_blue; + led-failsafe = &led_system_red; + led-running = &led_system_green; + led-upgrade = &led_system_blue; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 54 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + led-spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + sck-gpios = <&tlmm 18 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&tlmm 19 GPIO_ACTIVE_HIGH>; + + led_gpio: led-gpio@0 { + compatible = "fairchild,74hc595"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + registers-number = <1>; + enable-gpios = <&tlmm 20 GPIO_ACTIVE_HIGH>; + spi-max-frequency = <1000000>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_system_red: system-red { + label = "system:red"; + gpios = <&tlmm 22 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led_system_green: system-green { + label = "system:green"; + gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led_system_blue: system-blue { + label = "system:blue"; + gpios = <&tlmm 21 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + lan1-green { + label = "lan1:green"; + gpios = <&tlmm 26 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + lan1-orange { + label = "lan1:orange"; + gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + lan2-green { + label = "lan2:green"; + gpios = <&tlmm 57 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + lan2-orange { + label = "lan2:orange"; + gpios = <&tlmm 60 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + 2g-blue { + label = "wlan2g:blue"; + gpios = <&tlmm 29 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + 2g-green { + label = "wlan2g:green"; + gpios = <&tlmm 30 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + 5g-low-blue { + label = "wlan5g_low:blue"; + gpios = <&tlmm 33 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + 5g-low-green { + label = "wlan5g_low:green"; + gpios = <&tlmm 34 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + 5g-high-blue { + label = "wlan5g_high:blue"; + gpios = <&tlmm 31 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + 5g-high-green { + label = "wlan5g_high:green"; + gpios = <&tlmm 32 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + }; +}; + +&edma { + status = "okay"; +}; + +&switch { + status = "okay"; + + switch_lan_bmp = <(ESS_PORT4 | ESS_PORT6)>; + switch_mac_mode = ; + switch_mac_mode2 = ; + + qcom,port_phyinfo { + port@4 { + port_id = <4>; + phy_address = <3>; + }; + + port@6 { + port_id = <6>; + phy_address = <28>; + port_mac_sel = "QGMAC_PORT"; + }; + }; +}; + +&tlmm { + mdio_pins: mdio-pins { + mdc { + pins = "gpio68"; + function = "mdc"; + drive-strength = <8>; + bias-pull-up; + }; + + mdio { + pins = "gpio69"; + function = "mdio"; + drive-strength = <8>; + bias-pull-up; + }; + }; +}; + +&mdio { + status = "okay"; + + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>; + + qca8075: ethernet-phy@3 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <3>; + }; + + qca8081: ethernet-phy@28 { + compatible = "ethernet-phy-id004d.d101"; + reg = <28>; + reset-gpios = <&tlmm 25 GPIO_ACTIVE_LOW>; + }; +}; + +&dp4 { + status = "okay"; + phy-handle = <&qca8075>; + label = "lan2"; +}; + +&dp6_syn { + status = "okay"; + phy-handle = <&qca8081>; + label = "lan1"; +}; + +&qpic_bam { + status = "okay"; +}; + +&qpic_nand { + status = "okay"; + + nand@0 { + reg = <0>; + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + nand-bus-width = <8>; + + partitions { + compatible = "qcom,smem-part"; + }; + }; +}; + +&blsp1_uart5 { + status = "okay"; +}; + +&wifi { + status = "okay"; + + qcom,ath11k-calibration-variant = "Netgear-WAX630"; +}; 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 32386dc93e0718..18386c766c3620 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,43 +267,40 @@ &switch { status = "okay"; - switch_cpu_bmp = <0x1>; - switch_lan_bmp = <0x3e>; - switch_wan_bmp = <0x40>; - 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 new file mode 100644 index 00000000000000..baa7c895648029 --- /dev/null +++ b/target/linux/qualcommax/files/include/dt-bindings/net/qcom-ipq-ess.h @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef _DT_BINDINGS_NET_QCOM_IPQ_ESS_H +#define _DT_BINDINGS_NET_QCOM_IPQ_ESS_H + +#define ESS_PORT0 0x1 +#define ESS_PORT1 0x2 +#define ESS_PORT2 0x4 +#define ESS_PORT3 0x8 +#define ESS_PORT4 0x10 +#define ESS_PORT5 0x20 +#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/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk index b61b721f3a4f55..ee7707540b7853 100644 --- a/target/linux/qualcommax/image/ipq807x.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -23,6 +23,16 @@ define Device/UbiFit IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef +define Build/wax6xx-netgear-tar + mkdir $@.tmp + mv $@ $@.tmp/nand-ipq807x-apps.img + md5sum $@.tmp/nand-ipq807x-apps.img | cut -c 1-32 > $@.tmp/nand-ipq807x-apps.md5sum + echo $(DEVICE_MODEL) > $@.tmp/metadata.txt + echo $(DEVICE_MODEL)"_V9.9.9.9" > $@.tmp/version + tar -C $@.tmp/ -cf $@ . + rm -rf $@.tmp +endef + define Device/buffalo_wxr-5950ax12 $(call Device/FitImage) DEVICE_VENDOR := Buffalo @@ -115,6 +125,25 @@ define Device/netgear_rax120v2 endef TARGET_DEVICES += netgear_rax120v2 +define Device/netgear_wax218 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Netgear + DEVICE_MODEL := WAX218 + DEVICE_DTS_CONFIG := config@hk07 + BLOCKSIZE := 128k + PAGESIZE := 2048 + SOC := ipq8072 +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + ARTIFACTS := web-ui-factory.fit + ARTIFACT/web-ui-factory.fit := append-image initramfs-uImage.itb | \ + ubinize-kernel | qsdk-ipq-factory-nand +endif + DEVICE_PACKAGES := kmod-spi-gpio kmod-spi-bitbang kmod-gpio-nxp-74hc164 \ + ipq-wifi-netgear_wax218 +endef +TARGET_DEVICES += netgear_wax218 + define Device/netgear_wax620 $(call Device/FitImage) $(call Device/UbiFit) @@ -129,22 +158,20 @@ define Device/netgear_wax620 endef TARGET_DEVICES += netgear_wax620 -define Device/netgear_wax218 +define Device/netgear_wax630 $(call Device/FitImage) $(call Device/UbiFit) - ARTIFACTS := web-ui-factory.fit DEVICE_VENDOR := Netgear - DEVICE_MODEL := WAX218 - DEVICE_DTS_CONFIG := config@hk07 + DEVICE_MODEL := WAX630 + DEVICE_DTS_CONFIG := config@hk01 BLOCKSIZE := 128k PAGESIZE := 2048 - SOC := ipq8072 - ARTIFACT/web-ui-factory.fit := append-image initramfs-uImage.itb | \ - ubinize-kernel | qsdk-ipq-factory-nand - DEVICE_PACKAGES := kmod-spi-gpio kmod-spi-bitbang kmod-gpio-nxp-74hc164 \ - ipq-wifi-netgear_wax218 + SOC := ipq8074 + IMAGES := ui-factory.tar factory.ubi sysupgrade.bin + IMAGE/ui-factory.tar := append-ubi | wax6xx-netgear-tar + DEVICE_PACKAGES += kmod-spi-gpio ipq-wifi-netgear_wax630 endef -TARGET_DEVICES += netgear_wax218 +TARGET_DEVICES += netgear_wax630 define Device/prpl_haze $(call Device/FitImage) @@ -226,3 +253,19 @@ define Device/zyxel_nbg7815 kmod-bluetooth endef TARGET_DEVICES += zyxel_nbg7815 + +define Device/yuncore_ax880 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Yuncore + DEVICE_MODEL := AX880 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@hk09 + SOC := ipq8072 + DEVICE_PACKAGES := ipq-wifi-yuncore_ax880 + IMAGES += factory.bin + IMAGE/factory.bin := append-ubi | qsdk-ipq-factory-nand +endef +TARGET_DEVICES += yuncore_ax880 + diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds index 913b58750c276d..fb14a667cb0f30 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds +++ b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds @@ -12,14 +12,18 @@ edgecore,eap102) netgear,rax120v2) ucidef_set_led_netdev "aqr" "AQR" "white:aqr" "lan5" ;; -netgear,wax620) - ucidef_set_led_netdev "lan" "LAN" "lan:green" "lan" - ;; netgear,wax218) ucidef_set_led_netdev "lan" "LAN" "blue:lan" "lan" ucidef_set_led_wlan "wlan5g" "WIFI 5GHz" "blue:wlan5g" "phy0radio" ucidef_set_led_wlan "wlan2g" "WIFI 2.4GHz" "blue:wlan2g" "phy1radio" ;; +netgear,wax620) + ucidef_set_led_netdev "lan" "LAN" "lan:green" "lan" + ;; +netgear,wax630) + ucidef_set_led_netdev "lan1" "LAN1" "lan1:green" "lan1" + ucidef_set_led_netdev "lan2" "LAN2" "lan2:green" "lan2" + ;; redmi,ax6|\ xiaomi,ax3600) ucidef_set_led_netdev "wan" "WAN" "blue:network" "wan" diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network index ad8e34e9fe3156..95f1ab4bdf5c7b 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network +++ b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network @@ -16,7 +16,8 @@ ipq807x_setup_interfaces() xiaomi,ax9000) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" ;; - edgecore,eap102) + edgecore,eap102|\ + yuncore,ax880) ucidef_set_interfaces_lan_wan "lan" "wan" ;; edimax,cax1800) @@ -29,6 +30,9 @@ ipq807x_setup_interfaces() netgear,wax620) ucidef_set_interface_lan "lan" "dhcp" ;; + netgear,wax630) + ucidef_set_interface_lan "lan1 lan2" "dhcp" + ;; prpl,haze) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" ;; diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata index cba1f84b7fab9a..f427009669e65e 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata +++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata @@ -17,10 +17,12 @@ case "$FIRMWARE" in netgear,rax120v2|\ netgear,wax218|\ netgear,wax620|\ + netgear,wax630|\ qnap,301w|\ redmi,ax6|\ xiaomi,ax3600|\ xiaomi,ax9000|\ + yuncore,ax880|\ zyxel,nbg7815) caldata_extract "0:art" 0x1000 0x20000 ;; diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount b/target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount index 6917446a9bb5df..84f826b3b846ba 100755 --- a/target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount +++ b/target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount @@ -4,7 +4,8 @@ START=99 boot() { case $(board_name) in - edgecore,eap102) + edgecore,eap102|\ + yuncore,ax880) fw_setenv upgrade_available 0 # Unset changed flag after sysupgrade complete fw_setenv changed diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh index 90ebff17d485db..19bd54cf4e45ac 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -70,7 +70,8 @@ platform_do_upgrade() { edimax,cax1800|\ netgear,rax120v2|\ netgear,wax218|\ - netgear,wax620) + netgear,wax620|\ + netgear,wax630) nand_do_upgrade "$1" ;; prpl,haze|\ @@ -112,6 +113,18 @@ platform_do_upgrade() { CI_ROOT_UBIPART="rootfs" nand_do_upgrade "$1" ;; + yuncore,ax880) + active="$(fw_printenv -n active)" + if [ "$active" -eq "1" ]; then + CI_UBIPART="rootfs_1" + else + CI_UBIPART="rootfs" + fi + # force altbootcmd which handles partition change in u-boot + fw_setenv bootcount 3 + fw_setenv upgrade_available 1 + nand_do_upgrade "$1" + ;; *) default_do_upgrade "$1" ;; diff --git a/target/linux/qualcommax/ipq807x/config-default b/target/linux/qualcommax/ipq807x/config-default new file mode 100644 index 00000000000000..18483d05b449a2 --- /dev/null +++ b/target/linux/qualcommax/ipq807x/config-default @@ -0,0 +1,30 @@ +CONFIG_ARM_PSCI_CPUIDLE_DOMAIN=y +CONFIG_DT_IDLE_GENPD=y +CONFIG_IPQ_GCC_8074=y +# CONFIG_MFD_HI6421_SPMI is not set +CONFIG_MFD_SPMI_PMIC=y +# CONFIG_NVMEM_SPMI_SDAM is not set +CONFIG_PINCTRL_IPQ8074=y +CONFIG_PINCTRL_QCOM_SPMI_PMIC=y +# CONFIG_PM8916_WATCHDOG is not set +CONFIG_PM_GENERIC_DOMAINS=y +CONFIG_PM_GENERIC_DOMAINS_OF=y +# CONFIG_POWER_RESET_QCOM_PON is not set +CONFIG_QCOM_APM=y +# CONFIG_QCOM_COINCELL is not set +CONFIG_QCOM_GDSC=y +CONFIG_QCOM_SPMI_ADC5=y +# CONFIG_QCOM_SPMI_RRADC is not set +CONFIG_QCOM_VADC_COMMON=y +CONFIG_REGMAP_SPMI=y +CONFIG_REGULATOR_CPR3=y +# CONFIG_REGULATOR_CPR3_NPU is not set +CONFIG_REGULATOR_CPR4_APSS=y +# CONFIG_REGULATOR_QCOM_LABIBB is not set +CONFIG_REGULATOR_QCOM_SPMI=y +# CONFIG_REGULATOR_QCOM_USB_VBUS is not set +CONFIG_RTC_DRV_PM8XXX=y +CONFIG_SPMI=y +# CONFIG_SPMI_HISI3670 is not set +CONFIG_SPMI_MSM_PMIC_ARB=y +# CONFIG_SPMI_PMIC_CLKDIV is not set diff --git a/target/linux/qualcommax/patches-6.1/0007-v6.2-clk-qcom-ipq8074-convert-to-parent-data.patch b/target/linux/qualcommax/patches-6.1/0007-v6.2-clk-qcom-ipq8074-convert-to-parent-data.patch index 9162ea538d3805..c209adbc06f326 100644 --- a/target/linux/qualcommax/patches-6.1/0007-v6.2-clk-qcom-ipq8074-convert-to-parent-data.patch +++ b/target/linux/qualcommax/patches-6.1/0007-v6.2-clk-qcom-ipq8074-convert-to-parent-data.patch @@ -390,8 +390,8 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com + &gpll0_main.clkr.hw }, .num_parents = 1, .ops = &clk_fixed_factor_ops, - .flags = CLK_SET_RATE_PARENT, -@@ -429,9 +86,8 @@ static struct clk_alpha_pll_postdiv gpll + }, +@@ -428,9 +85,8 @@ static struct clk_alpha_pll_postdiv gpll .width = 4, .clkr.hw.init = &(struct clk_init_data){ .name = "gpll0", @@ -403,7 +403,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, }, -@@ -445,8 +101,9 @@ static struct clk_alpha_pll gpll2_main = +@@ -444,8 +100,9 @@ static struct clk_alpha_pll gpll2_main = .enable_mask = BIT(2), .hw.init = &(struct clk_init_data){ .name = "gpll2_main", @@ -415,7 +415,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com }, .num_parents = 1, .ops = &clk_alpha_pll_ops, -@@ -461,9 +118,8 @@ static struct clk_alpha_pll_postdiv gpll +@@ -460,9 +117,8 @@ static struct clk_alpha_pll_postdiv gpll .width = 4, .clkr.hw.init = &(struct clk_init_data){ .name = "gpll2", @@ -426,8 +426,8 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com + &gpll2_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, -@@ -478,8 +134,9 @@ static struct clk_alpha_pll gpll4_main = + }, +@@ -476,8 +132,9 @@ static struct clk_alpha_pll gpll4_main = .enable_mask = BIT(5), .hw.init = &(struct clk_init_data){ .name = "gpll4_main", @@ -439,7 +439,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com }, .num_parents = 1, .ops = &clk_alpha_pll_ops, -@@ -494,9 +151,8 @@ static struct clk_alpha_pll_postdiv gpll +@@ -492,9 +149,8 @@ static struct clk_alpha_pll_postdiv gpll .width = 4, .clkr.hw.init = &(struct clk_init_data){ .name = "gpll4", @@ -450,8 +450,8 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com + &gpll4_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, -@@ -512,8 +168,9 @@ static struct clk_alpha_pll gpll6_main = + }, +@@ -509,8 +165,9 @@ static struct clk_alpha_pll gpll6_main = .enable_mask = BIT(7), .hw.init = &(struct clk_init_data){ .name = "gpll6_main", @@ -463,7 +463,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com }, .num_parents = 1, .ops = &clk_alpha_pll_ops, -@@ -528,9 +185,8 @@ static struct clk_alpha_pll_postdiv gpll +@@ -525,9 +182,8 @@ static struct clk_alpha_pll_postdiv gpll .width = 2, .clkr.hw.init = &(struct clk_init_data){ .name = "gpll6", @@ -474,8 +474,8 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com + &gpll6_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, -@@ -542,9 +198,8 @@ static struct clk_fixed_factor gpll6_out + }, +@@ -538,9 +194,8 @@ static struct clk_fixed_factor gpll6_out .div = 2, .hw.init = &(struct clk_init_data){ .name = "gpll6_out_main_div2", @@ -486,8 +486,8 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com + &gpll6_main.clkr.hw }, .num_parents = 1, .ops = &clk_fixed_factor_ops, - .flags = CLK_SET_RATE_PARENT, -@@ -560,8 +215,9 @@ static struct clk_alpha_pll ubi32_pll_ma + }, +@@ -555,8 +210,9 @@ static struct clk_alpha_pll ubi32_pll_ma .enable_mask = BIT(6), .hw.init = &(struct clk_init_data){ .name = "ubi32_pll_main", @@ -499,7 +499,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com }, .num_parents = 1, .ops = &clk_alpha_pll_huayra_ops, -@@ -575,9 +231,8 @@ static struct clk_alpha_pll_postdiv ubi3 +@@ -570,9 +226,8 @@ static struct clk_alpha_pll_postdiv ubi3 .width = 2, .clkr.hw.init = &(struct clk_init_data){ .name = "ubi32_pll", @@ -511,7 +511,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, .flags = CLK_SET_RATE_PARENT, -@@ -592,8 +247,9 @@ static struct clk_alpha_pll nss_crypto_p +@@ -587,8 +242,9 @@ static struct clk_alpha_pll nss_crypto_p .enable_mask = BIT(4), .hw.init = &(struct clk_init_data){ .name = "nss_crypto_pll_main", @@ -523,7 +523,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com }, .num_parents = 1, .ops = &clk_alpha_pll_ops, -@@ -607,9 +263,8 @@ static struct clk_alpha_pll_postdiv nss_ +@@ -602,9 +258,8 @@ static struct clk_alpha_pll_postdiv nss_ .width = 4, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_crypto_pll", @@ -534,8 +534,8 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com + &nss_crypto_pll_main.clkr.hw }, .num_parents = 1, .ops = &clk_alpha_pll_postdiv_ro_ops, - .flags = CLK_SET_RATE_PARENT, -@@ -623,6 +278,18 @@ static const struct freq_tbl ftbl_pcnoc_ + }, +@@ -617,6 +272,18 @@ static const struct freq_tbl ftbl_pcnoc_ { } }; @@ -554,7 +554,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 pcnoc_bfdcd_clk_src = { .cmd_rcgr = 0x27000, .freq_tbl = ftbl_pcnoc_bfdcd_clk_src, -@@ -630,8 +297,8 @@ static struct clk_rcg2 pcnoc_bfdcd_clk_s +@@ -624,8 +291,8 @@ static struct clk_rcg2 pcnoc_bfdcd_clk_s .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "pcnoc_bfdcd_clk_src", @@ -565,7 +565,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, .flags = CLK_IS_CRITICAL, }, -@@ -642,9 +309,8 @@ static struct clk_fixed_factor pcnoc_clk +@@ -636,9 +303,8 @@ static struct clk_fixed_factor pcnoc_clk .div = 1, .hw.init = &(struct clk_init_data){ .name = "pcnoc_clk_src", @@ -577,7 +577,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_fixed_factor_ops, .flags = CLK_SET_RATE_PARENT, -@@ -658,8 +324,9 @@ static struct clk_branch gcc_sleep_clk_s +@@ -652,8 +318,9 @@ static struct clk_branch gcc_sleep_clk_s .enable_mask = BIT(1), .hw.init = &(struct clk_init_data){ .name = "gcc_sleep_clk_src", @@ -589,7 +589,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com }, .num_parents = 1, .ops = &clk_branch2_ops, -@@ -682,8 +349,8 @@ static struct clk_rcg2 blsp1_qup1_i2c_ap +@@ -676,8 +343,8 @@ static struct clk_rcg2 blsp1_qup1_i2c_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup1_i2c_apps_clk_src", @@ -600,7 +600,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -708,8 +375,8 @@ static struct clk_rcg2 blsp1_qup1_spi_ap +@@ -702,8 +369,8 @@ static struct clk_rcg2 blsp1_qup1_spi_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup1_spi_apps_clk_src", @@ -611,7 +611,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -721,8 +388,8 @@ static struct clk_rcg2 blsp1_qup2_i2c_ap +@@ -715,8 +382,8 @@ static struct clk_rcg2 blsp1_qup2_i2c_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup2_i2c_apps_clk_src", @@ -622,7 +622,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -735,8 +402,8 @@ static struct clk_rcg2 blsp1_qup2_spi_ap +@@ -729,8 +396,8 @@ static struct clk_rcg2 blsp1_qup2_spi_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup2_spi_apps_clk_src", @@ -633,7 +633,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -748,8 +415,8 @@ static struct clk_rcg2 blsp1_qup3_i2c_ap +@@ -742,8 +409,8 @@ static struct clk_rcg2 blsp1_qup3_i2c_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup3_i2c_apps_clk_src", @@ -644,7 +644,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -762,8 +429,8 @@ static struct clk_rcg2 blsp1_qup3_spi_ap +@@ -756,8 +423,8 @@ static struct clk_rcg2 blsp1_qup3_spi_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup3_spi_apps_clk_src", @@ -655,7 +655,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -775,8 +442,8 @@ static struct clk_rcg2 blsp1_qup4_i2c_ap +@@ -769,8 +436,8 @@ static struct clk_rcg2 blsp1_qup4_i2c_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup4_i2c_apps_clk_src", @@ -666,7 +666,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -789,8 +456,8 @@ static struct clk_rcg2 blsp1_qup4_spi_ap +@@ -783,8 +450,8 @@ static struct clk_rcg2 blsp1_qup4_spi_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup4_spi_apps_clk_src", @@ -677,7 +677,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -802,8 +469,8 @@ static struct clk_rcg2 blsp1_qup5_i2c_ap +@@ -796,8 +463,8 @@ static struct clk_rcg2 blsp1_qup5_i2c_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup5_i2c_apps_clk_src", @@ -688,7 +688,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -816,8 +483,8 @@ static struct clk_rcg2 blsp1_qup5_spi_ap +@@ -810,8 +477,8 @@ static struct clk_rcg2 blsp1_qup5_spi_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup5_spi_apps_clk_src", @@ -699,7 +699,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -829,8 +496,8 @@ static struct clk_rcg2 blsp1_qup6_i2c_ap +@@ -823,8 +490,8 @@ static struct clk_rcg2 blsp1_qup6_i2c_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup6_i2c_apps_clk_src", @@ -710,7 +710,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -843,8 +510,8 @@ static struct clk_rcg2 blsp1_qup6_spi_ap +@@ -837,8 +504,8 @@ static struct clk_rcg2 blsp1_qup6_spi_ap .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_qup6_spi_apps_clk_src", @@ -721,7 +721,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -877,8 +544,8 @@ static struct clk_rcg2 blsp1_uart1_apps_ +@@ -871,8 +538,8 @@ static struct clk_rcg2 blsp1_uart1_apps_ .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_uart1_apps_clk_src", @@ -732,7 +732,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -891,8 +558,8 @@ static struct clk_rcg2 blsp1_uart2_apps_ +@@ -885,8 +552,8 @@ static struct clk_rcg2 blsp1_uart2_apps_ .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_uart2_apps_clk_src", @@ -743,7 +743,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -905,8 +572,8 @@ static struct clk_rcg2 blsp1_uart3_apps_ +@@ -899,8 +566,8 @@ static struct clk_rcg2 blsp1_uart3_apps_ .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_uart3_apps_clk_src", @@ -754,7 +754,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -919,8 +586,8 @@ static struct clk_rcg2 blsp1_uart4_apps_ +@@ -913,8 +580,8 @@ static struct clk_rcg2 blsp1_uart4_apps_ .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_uart4_apps_clk_src", @@ -765,7 +765,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -933,8 +600,8 @@ static struct clk_rcg2 blsp1_uart5_apps_ +@@ -927,8 +594,8 @@ static struct clk_rcg2 blsp1_uart5_apps_ .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_uart5_apps_clk_src", @@ -776,7 +776,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -947,8 +614,8 @@ static struct clk_rcg2 blsp1_uart6_apps_ +@@ -941,8 +608,8 @@ static struct clk_rcg2 blsp1_uart6_apps_ .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "blsp1_uart6_apps_clk_src", @@ -787,7 +787,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -958,6 +625,11 @@ static const struct clk_parent_data gcc_ +@@ -952,6 +619,11 @@ static const struct clk_parent_data gcc_ { .hw = &gpll0.clkr.hw }, }; @@ -799,7 +799,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static const struct freq_tbl ftbl_pcie_axi_clk_src[] = { F(19200000, P_XO, 1, 0, 0), F(200000000, P_GPLL0, 4, 0, 0), -@@ -972,7 +644,7 @@ static struct clk_rcg2 pcie0_axi_clk_src +@@ -966,7 +638,7 @@ static struct clk_rcg2 pcie0_axi_clk_src .clkr.hw.init = &(struct clk_init_data){ .name = "pcie0_axi_clk_src", .parent_data = gcc_xo_gpll0, @@ -808,7 +808,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -981,6 +653,18 @@ static const struct freq_tbl ftbl_pcie_a +@@ -975,6 +647,18 @@ static const struct freq_tbl ftbl_pcie_a F(19200000, P_XO, 1, 0, 0), }; @@ -827,7 +827,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 pcie0_aux_clk_src = { .cmd_rcgr = 0x75024, .freq_tbl = ftbl_pcie_aux_clk_src, -@@ -989,12 +673,22 @@ static struct clk_rcg2 pcie0_aux_clk_src +@@ -983,12 +667,22 @@ static struct clk_rcg2 pcie0_aux_clk_src .parent_map = gcc_xo_gpll0_sleep_clk_map, .clkr.hw.init = &(struct clk_init_data){ .name = "pcie0_aux_clk_src", @@ -852,7 +852,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_regmap_mux pcie0_pipe_clk_src = { .reg = 0x7501c, .shift = 8, -@@ -1003,8 +697,8 @@ static struct clk_regmap_mux pcie0_pipe_ +@@ -997,8 +691,8 @@ static struct clk_regmap_mux pcie0_pipe_ .clkr = { .hw.init = &(struct clk_init_data){ .name = "pcie0_pipe_clk_src", @@ -863,7 +863,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_regmap_mux_closest_ops, .flags = CLK_SET_RATE_PARENT, }, -@@ -1019,7 +713,7 @@ static struct clk_rcg2 pcie1_axi_clk_src +@@ -1013,7 +707,7 @@ static struct clk_rcg2 pcie1_axi_clk_src .clkr.hw.init = &(struct clk_init_data){ .name = "pcie1_axi_clk_src", .parent_data = gcc_xo_gpll0, @@ -872,7 +872,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1032,12 +726,22 @@ static struct clk_rcg2 pcie1_aux_clk_src +@@ -1026,12 +720,22 @@ static struct clk_rcg2 pcie1_aux_clk_src .parent_map = gcc_xo_gpll0_sleep_clk_map, .clkr.hw.init = &(struct clk_init_data){ .name = "pcie1_aux_clk_src", @@ -897,7 +897,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_regmap_mux pcie1_pipe_clk_src = { .reg = 0x7601c, .shift = 8, -@@ -1046,8 +750,8 @@ static struct clk_regmap_mux pcie1_pipe_ +@@ -1040,8 +744,8 @@ static struct clk_regmap_mux pcie1_pipe_ .clkr = { .hw.init = &(struct clk_init_data){ .name = "pcie1_pipe_clk_src", @@ -908,7 +908,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_regmap_mux_closest_ops, .flags = CLK_SET_RATE_PARENT, }, -@@ -1066,6 +770,20 @@ static const struct freq_tbl ftbl_sdcc_a +@@ -1060,6 +764,20 @@ static const struct freq_tbl ftbl_sdcc_a { } }; @@ -929,7 +929,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 sdcc1_apps_clk_src = { .cmd_rcgr = 0x42004, .freq_tbl = ftbl_sdcc_apps_clk_src, -@@ -1074,8 +792,8 @@ static struct clk_rcg2 sdcc1_apps_clk_sr +@@ -1068,8 +786,8 @@ static struct clk_rcg2 sdcc1_apps_clk_sr .parent_map = gcc_xo_gpll0_gpll2_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "sdcc1_apps_clk_src", @@ -940,7 +940,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_floor_ops, }, }; -@@ -1086,6 +804,20 @@ static const struct freq_tbl ftbl_sdcc_i +@@ -1080,6 +798,20 @@ static const struct freq_tbl ftbl_sdcc_i F(308570000, P_GPLL6, 3.5, 0, 0), }; @@ -961,7 +961,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 sdcc1_ice_core_clk_src = { .cmd_rcgr = 0x5d000, .freq_tbl = ftbl_sdcc_ice_core_clk_src, -@@ -1094,8 +826,8 @@ static struct clk_rcg2 sdcc1_ice_core_cl +@@ -1088,8 +820,8 @@ static struct clk_rcg2 sdcc1_ice_core_cl .parent_map = gcc_xo_gpll0_gpll6_gpll0_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "sdcc1_ice_core_clk_src", @@ -972,7 +972,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1108,8 +840,8 @@ static struct clk_rcg2 sdcc2_apps_clk_sr +@@ -1102,8 +834,8 @@ static struct clk_rcg2 sdcc2_apps_clk_sr .parent_map = gcc_xo_gpll0_gpll2_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "sdcc2_apps_clk_src", @@ -983,7 +983,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_floor_ops, }, }; -@@ -1121,6 +853,18 @@ static const struct freq_tbl ftbl_usb_ma +@@ -1115,6 +847,18 @@ static const struct freq_tbl ftbl_usb_ma { } }; @@ -1002,7 +1002,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 usb0_master_clk_src = { .cmd_rcgr = 0x3e00c, .freq_tbl = ftbl_usb_master_clk_src, -@@ -1129,8 +873,8 @@ static struct clk_rcg2 usb0_master_clk_s +@@ -1123,8 +867,8 @@ static struct clk_rcg2 usb0_master_clk_s .parent_map = gcc_xo_gpll0_out_main_div2_gpll0_map, .clkr.hw.init = &(struct clk_init_data){ .name = "usb0_master_clk_src", @@ -1013,7 +1013,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1148,8 +892,8 @@ static struct clk_rcg2 usb0_aux_clk_src +@@ -1142,8 +886,8 @@ static struct clk_rcg2 usb0_aux_clk_src .parent_map = gcc_xo_gpll0_sleep_clk_map, .clkr.hw.init = &(struct clk_init_data){ .name = "usb0_aux_clk_src", @@ -1024,7 +1024,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1161,6 +905,20 @@ static const struct freq_tbl ftbl_usb_mo +@@ -1155,6 +899,20 @@ static const struct freq_tbl ftbl_usb_mo { } }; @@ -1045,7 +1045,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 usb0_mock_utmi_clk_src = { .cmd_rcgr = 0x3e020, .freq_tbl = ftbl_usb_mock_utmi_clk_src, -@@ -1169,12 +927,22 @@ static struct clk_rcg2 usb0_mock_utmi_cl +@@ -1163,12 +921,22 @@ static struct clk_rcg2 usb0_mock_utmi_cl .parent_map = gcc_xo_gpll6_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "usb0_mock_utmi_clk_src", @@ -1070,7 +1070,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_regmap_mux usb0_pipe_clk_src = { .reg = 0x3e048, .shift = 8, -@@ -1183,8 +951,8 @@ static struct clk_regmap_mux usb0_pipe_c +@@ -1177,8 +945,8 @@ static struct clk_regmap_mux usb0_pipe_c .clkr = { .hw.init = &(struct clk_init_data){ .name = "usb0_pipe_clk_src", @@ -1081,7 +1081,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_regmap_mux_closest_ops, .flags = CLK_SET_RATE_PARENT, }, -@@ -1199,8 +967,8 @@ static struct clk_rcg2 usb1_master_clk_s +@@ -1193,8 +961,8 @@ static struct clk_rcg2 usb1_master_clk_s .parent_map = gcc_xo_gpll0_out_main_div2_gpll0_map, .clkr.hw.init = &(struct clk_init_data){ .name = "usb1_master_clk_src", @@ -1092,7 +1092,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1213,8 +981,8 @@ static struct clk_rcg2 usb1_aux_clk_src +@@ -1207,8 +975,8 @@ static struct clk_rcg2 usb1_aux_clk_src .parent_map = gcc_xo_gpll0_sleep_clk_map, .clkr.hw.init = &(struct clk_init_data){ .name = "usb1_aux_clk_src", @@ -1103,7 +1103,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1227,12 +995,22 @@ static struct clk_rcg2 usb1_mock_utmi_cl +@@ -1221,12 +989,22 @@ static struct clk_rcg2 usb1_mock_utmi_cl .parent_map = gcc_xo_gpll6_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "usb1_mock_utmi_clk_src", @@ -1128,7 +1128,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_regmap_mux usb1_pipe_clk_src = { .reg = 0x3f048, .shift = 8, -@@ -1241,8 +1019,8 @@ static struct clk_regmap_mux usb1_pipe_c +@@ -1235,8 +1013,8 @@ static struct clk_regmap_mux usb1_pipe_c .clkr = { .hw.init = &(struct clk_init_data){ .name = "usb1_pipe_clk_src", @@ -1139,7 +1139,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_regmap_mux_closest_ops, .flags = CLK_SET_RATE_PARENT, }, -@@ -1256,8 +1034,9 @@ static struct clk_branch gcc_xo_clk_src +@@ -1250,8 +1028,9 @@ static struct clk_branch gcc_xo_clk_src .enable_mask = BIT(1), .hw.init = &(struct clk_init_data){ .name = "gcc_xo_clk_src", @@ -1151,7 +1151,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com }, .num_parents = 1, .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, -@@ -1271,9 +1050,8 @@ static struct clk_fixed_factor gcc_xo_di +@@ -1265,9 +1044,8 @@ static struct clk_fixed_factor gcc_xo_di .div = 4, .hw.init = &(struct clk_init_data){ .name = "gcc_xo_div4_clk_src", @@ -1163,7 +1163,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_fixed_factor_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1291,6 +1069,20 @@ static const struct freq_tbl ftbl_system +@@ -1285,6 +1063,20 @@ static const struct freq_tbl ftbl_system { } }; @@ -1184,7 +1184,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 system_noc_bfdcd_clk_src = { .cmd_rcgr = 0x26004, .freq_tbl = ftbl_system_noc_bfdcd_clk_src, -@@ -1298,8 +1090,8 @@ static struct clk_rcg2 system_noc_bfdcd_ +@@ -1292,8 +1084,8 @@ static struct clk_rcg2 system_noc_bfdcd_ .parent_map = gcc_xo_gpll0_gpll6_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "system_noc_bfdcd_clk_src", @@ -1195,7 +1195,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, .flags = CLK_IS_CRITICAL, }, -@@ -1310,9 +1102,8 @@ static struct clk_fixed_factor system_no +@@ -1304,9 +1096,8 @@ static struct clk_fixed_factor system_no .div = 1, .hw.init = &(struct clk_init_data){ .name = "system_noc_clk_src", @@ -1207,7 +1207,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_fixed_factor_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1333,7 +1124,7 @@ static struct clk_rcg2 nss_ce_clk_src = +@@ -1327,7 +1118,7 @@ static struct clk_rcg2 nss_ce_clk_src = .clkr.hw.init = &(struct clk_init_data){ .name = "nss_ce_clk_src", .parent_data = gcc_xo_gpll0, @@ -1216,7 +1216,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1344,6 +1135,20 @@ static const struct freq_tbl ftbl_nss_no +@@ -1338,6 +1129,20 @@ static const struct freq_tbl ftbl_nss_no { } }; @@ -1237,7 +1237,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_noc_bfdcd_clk_src = { .cmd_rcgr = 0x68088, .freq_tbl = ftbl_nss_noc_bfdcd_clk_src, -@@ -1351,8 +1156,8 @@ static struct clk_rcg2 nss_noc_bfdcd_clk +@@ -1345,8 +1150,8 @@ static struct clk_rcg2 nss_noc_bfdcd_clk .parent_map = gcc_xo_bias_pll_nss_noc_clk_gpll0_gpll2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_noc_bfdcd_clk_src", @@ -1248,7 +1248,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1362,9 +1167,8 @@ static struct clk_fixed_factor nss_noc_c +@@ -1356,9 +1161,8 @@ static struct clk_fixed_factor nss_noc_c .div = 1, .hw.init = &(struct clk_init_data){ .name = "nss_noc_clk_src", @@ -1260,7 +1260,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_fixed_factor_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1377,6 +1181,18 @@ static const struct freq_tbl ftbl_nss_cr +@@ -1371,6 +1175,18 @@ static const struct freq_tbl ftbl_nss_cr { } }; @@ -1279,7 +1279,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_crypto_clk_src = { .cmd_rcgr = 0x68144, .freq_tbl = ftbl_nss_crypto_clk_src, -@@ -1385,8 +1201,8 @@ static struct clk_rcg2 nss_crypto_clk_sr +@@ -1379,8 +1195,8 @@ static struct clk_rcg2 nss_crypto_clk_sr .parent_map = gcc_xo_nss_crypto_pll_gpll0_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_crypto_clk_src", @@ -1290,7 +1290,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1400,6 +1216,24 @@ static const struct freq_tbl ftbl_nss_ub +@@ -1394,6 +1210,24 @@ static const struct freq_tbl ftbl_nss_ub { } }; @@ -1315,7 +1315,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_ubi0_clk_src = { .cmd_rcgr = 0x68104, .freq_tbl = ftbl_nss_ubi_clk_src, -@@ -1407,8 +1241,8 @@ static struct clk_rcg2 nss_ubi0_clk_src +@@ -1401,8 +1235,8 @@ static struct clk_rcg2 nss_ubi0_clk_src .parent_map = gcc_xo_ubi32_gpll0_gpll2_gpll4_gpll6_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_ubi0_clk_src", @@ -1326,7 +1326,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, .flags = CLK_SET_RATE_PARENT, }, -@@ -1421,9 +1255,8 @@ static struct clk_regmap_div nss_ubi0_di +@@ -1415,9 +1249,8 @@ static struct clk_regmap_div nss_ubi0_di .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_ubi0_div_clk_src", @@ -1338,7 +1338,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ro_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1438,8 +1271,8 @@ static struct clk_rcg2 nss_ubi1_clk_src +@@ -1432,8 +1265,8 @@ static struct clk_rcg2 nss_ubi1_clk_src .parent_map = gcc_xo_ubi32_gpll0_gpll2_gpll4_gpll6_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_ubi1_clk_src", @@ -1349,7 +1349,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, .flags = CLK_SET_RATE_PARENT, }, -@@ -1452,9 +1285,8 @@ static struct clk_regmap_div nss_ubi1_di +@@ -1446,9 +1279,8 @@ static struct clk_regmap_div nss_ubi1_di .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_ubi1_div_clk_src", @@ -1361,7 +1361,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ro_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1468,6 +1300,16 @@ static const struct freq_tbl ftbl_ubi_mp +@@ -1462,6 +1294,16 @@ static const struct freq_tbl ftbl_ubi_mp { } }; @@ -1378,7 +1378,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 ubi_mpt_clk_src = { .cmd_rcgr = 0x68090, .freq_tbl = ftbl_ubi_mpt_clk_src, -@@ -1475,8 +1317,8 @@ static struct clk_rcg2 ubi_mpt_clk_src = +@@ -1469,8 +1311,8 @@ static struct clk_rcg2 ubi_mpt_clk_src = .parent_map = gcc_xo_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "ubi_mpt_clk_src", @@ -1389,7 +1389,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1487,6 +1329,18 @@ static const struct freq_tbl ftbl_nss_im +@@ -1481,6 +1323,18 @@ static const struct freq_tbl ftbl_nss_im { } }; @@ -1408,7 +1408,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_imem_clk_src = { .cmd_rcgr = 0x68158, .freq_tbl = ftbl_nss_imem_clk_src, -@@ -1494,8 +1348,8 @@ static struct clk_rcg2 nss_imem_clk_src +@@ -1488,8 +1342,8 @@ static struct clk_rcg2 nss_imem_clk_src .parent_map = gcc_xo_gpll0_gpll4_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_imem_clk_src", @@ -1419,7 +1419,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1506,6 +1360,24 @@ static const struct freq_tbl ftbl_nss_pp +@@ -1500,6 +1354,24 @@ static const struct freq_tbl ftbl_nss_pp { } }; @@ -1444,7 +1444,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_ppe_clk_src = { .cmd_rcgr = 0x68080, .freq_tbl = ftbl_nss_ppe_clk_src, -@@ -1513,8 +1385,8 @@ static struct clk_rcg2 nss_ppe_clk_src = +@@ -1507,8 +1379,8 @@ static struct clk_rcg2 nss_ppe_clk_src = .parent_map = gcc_xo_bias_gpll0_gpll4_nss_ubi32_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_ppe_clk_src", @@ -1455,7 +1455,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1524,9 +1396,8 @@ static struct clk_fixed_factor nss_ppe_c +@@ -1518,9 +1390,8 @@ static struct clk_fixed_factor nss_ppe_c .div = 4, .hw.init = &(struct clk_init_data){ .name = "nss_ppe_cdiv_clk_src", @@ -1467,7 +1467,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_fixed_factor_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1540,6 +1411,22 @@ static const struct freq_tbl ftbl_nss_po +@@ -1534,6 +1405,22 @@ static const struct freq_tbl ftbl_nss_po { } }; @@ -1490,7 +1490,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_port1_rx_clk_src = { .cmd_rcgr = 0x68020, .freq_tbl = ftbl_nss_port1_rx_clk_src, -@@ -1547,8 +1434,8 @@ static struct clk_rcg2 nss_port1_rx_clk_ +@@ -1541,8 +1428,8 @@ static struct clk_rcg2 nss_port1_rx_clk_ .parent_map = gcc_xo_uniphy0_rx_tx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port1_rx_clk_src", @@ -1501,7 +1501,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1560,9 +1447,8 @@ static struct clk_regmap_div nss_port1_r +@@ -1554,9 +1441,8 @@ static struct clk_regmap_div nss_port1_r .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port1_rx_div_clk_src", @@ -1513,7 +1513,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1577,6 +1463,22 @@ static const struct freq_tbl ftbl_nss_po +@@ -1571,6 +1457,22 @@ static const struct freq_tbl ftbl_nss_po { } }; @@ -1536,7 +1536,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_port1_tx_clk_src = { .cmd_rcgr = 0x68028, .freq_tbl = ftbl_nss_port1_tx_clk_src, -@@ -1584,8 +1486,8 @@ static struct clk_rcg2 nss_port1_tx_clk_ +@@ -1578,8 +1480,8 @@ static struct clk_rcg2 nss_port1_tx_clk_ .parent_map = gcc_xo_uniphy0_tx_rx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port1_tx_clk_src", @@ -1547,7 +1547,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1597,9 +1499,8 @@ static struct clk_regmap_div nss_port1_t +@@ -1591,9 +1493,8 @@ static struct clk_regmap_div nss_port1_t .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port1_tx_div_clk_src", @@ -1559,7 +1559,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1614,8 +1515,8 @@ static struct clk_rcg2 nss_port2_rx_clk_ +@@ -1608,8 +1509,8 @@ static struct clk_rcg2 nss_port2_rx_clk_ .parent_map = gcc_xo_uniphy0_rx_tx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port2_rx_clk_src", @@ -1570,7 +1570,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1627,9 +1528,8 @@ static struct clk_regmap_div nss_port2_r +@@ -1621,9 +1522,8 @@ static struct clk_regmap_div nss_port2_r .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port2_rx_div_clk_src", @@ -1582,7 +1582,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1644,8 +1544,8 @@ static struct clk_rcg2 nss_port2_tx_clk_ +@@ -1638,8 +1538,8 @@ static struct clk_rcg2 nss_port2_tx_clk_ .parent_map = gcc_xo_uniphy0_tx_rx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port2_tx_clk_src", @@ -1593,7 +1593,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1657,9 +1557,8 @@ static struct clk_regmap_div nss_port2_t +@@ -1651,9 +1551,8 @@ static struct clk_regmap_div nss_port2_t .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port2_tx_div_clk_src", @@ -1605,7 +1605,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1674,8 +1573,8 @@ static struct clk_rcg2 nss_port3_rx_clk_ +@@ -1668,8 +1567,8 @@ static struct clk_rcg2 nss_port3_rx_clk_ .parent_map = gcc_xo_uniphy0_rx_tx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port3_rx_clk_src", @@ -1616,7 +1616,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1687,9 +1586,8 @@ static struct clk_regmap_div nss_port3_r +@@ -1681,9 +1580,8 @@ static struct clk_regmap_div nss_port3_r .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port3_rx_div_clk_src", @@ -1628,7 +1628,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1704,8 +1602,8 @@ static struct clk_rcg2 nss_port3_tx_clk_ +@@ -1698,8 +1596,8 @@ static struct clk_rcg2 nss_port3_tx_clk_ .parent_map = gcc_xo_uniphy0_tx_rx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port3_tx_clk_src", @@ -1639,7 +1639,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1717,9 +1615,8 @@ static struct clk_regmap_div nss_port3_t +@@ -1711,9 +1609,8 @@ static struct clk_regmap_div nss_port3_t .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port3_tx_div_clk_src", @@ -1651,7 +1651,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1734,8 +1631,8 @@ static struct clk_rcg2 nss_port4_rx_clk_ +@@ -1728,8 +1625,8 @@ static struct clk_rcg2 nss_port4_rx_clk_ .parent_map = gcc_xo_uniphy0_rx_tx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port4_rx_clk_src", @@ -1662,7 +1662,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1747,9 +1644,8 @@ static struct clk_regmap_div nss_port4_r +@@ -1741,9 +1638,8 @@ static struct clk_regmap_div nss_port4_r .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port4_rx_div_clk_src", @@ -1674,7 +1674,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1764,8 +1660,8 @@ static struct clk_rcg2 nss_port4_tx_clk_ +@@ -1758,8 +1654,8 @@ static struct clk_rcg2 nss_port4_tx_clk_ .parent_map = gcc_xo_uniphy0_tx_rx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port4_tx_clk_src", @@ -1685,7 +1685,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1777,9 +1673,8 @@ static struct clk_regmap_div nss_port4_t +@@ -1771,9 +1667,8 @@ static struct clk_regmap_div nss_port4_t .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port4_tx_div_clk_src", @@ -1697,7 +1697,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1799,6 +1694,27 @@ static const struct freq_tbl ftbl_nss_po +@@ -1793,6 +1688,27 @@ static const struct freq_tbl ftbl_nss_po { } }; @@ -1725,7 +1725,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_port5_rx_clk_src = { .cmd_rcgr = 0x68060, .freq_tbl = ftbl_nss_port5_rx_clk_src, -@@ -1806,8 +1722,8 @@ static struct clk_rcg2 nss_port5_rx_clk_ +@@ -1800,8 +1716,8 @@ static struct clk_rcg2 nss_port5_rx_clk_ .parent_map = gcc_xo_uniphy0_rx_tx_uniphy1_rx_tx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port5_rx_clk_src", @@ -1736,7 +1736,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1819,9 +1735,8 @@ static struct clk_regmap_div nss_port5_r +@@ -1813,9 +1729,8 @@ static struct clk_regmap_div nss_port5_r .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port5_rx_div_clk_src", @@ -1748,7 +1748,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1841,6 +1756,27 @@ static const struct freq_tbl ftbl_nss_po +@@ -1835,6 +1750,27 @@ static const struct freq_tbl ftbl_nss_po { } }; @@ -1776,7 +1776,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_port5_tx_clk_src = { .cmd_rcgr = 0x68068, .freq_tbl = ftbl_nss_port5_tx_clk_src, -@@ -1848,8 +1784,8 @@ static struct clk_rcg2 nss_port5_tx_clk_ +@@ -1842,8 +1778,8 @@ static struct clk_rcg2 nss_port5_tx_clk_ .parent_map = gcc_xo_uniphy0_tx_rx_uniphy1_tx_rx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port5_tx_clk_src", @@ -1787,7 +1787,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1861,9 +1797,8 @@ static struct clk_regmap_div nss_port5_t +@@ -1855,9 +1791,8 @@ static struct clk_regmap_div nss_port5_t .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port5_tx_div_clk_src", @@ -1799,7 +1799,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1883,6 +1818,22 @@ static const struct freq_tbl ftbl_nss_po +@@ -1877,6 +1812,22 @@ static const struct freq_tbl ftbl_nss_po { } }; @@ -1822,7 +1822,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_port6_rx_clk_src = { .cmd_rcgr = 0x68070, .freq_tbl = ftbl_nss_port6_rx_clk_src, -@@ -1890,8 +1841,8 @@ static struct clk_rcg2 nss_port6_rx_clk_ +@@ -1884,8 +1835,8 @@ static struct clk_rcg2 nss_port6_rx_clk_ .parent_map = gcc_xo_uniphy2_rx_tx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port6_rx_clk_src", @@ -1833,7 +1833,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1903,9 +1854,8 @@ static struct clk_regmap_div nss_port6_r +@@ -1897,9 +1848,8 @@ static struct clk_regmap_div nss_port6_r .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port6_rx_div_clk_src", @@ -1845,7 +1845,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1925,6 +1875,22 @@ static const struct freq_tbl ftbl_nss_po +@@ -1919,6 +1869,22 @@ static const struct freq_tbl ftbl_nss_po { } }; @@ -1868,7 +1868,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 nss_port6_tx_clk_src = { .cmd_rcgr = 0x68078, .freq_tbl = ftbl_nss_port6_tx_clk_src, -@@ -1932,8 +1898,8 @@ static struct clk_rcg2 nss_port6_tx_clk_ +@@ -1926,8 +1892,8 @@ static struct clk_rcg2 nss_port6_tx_clk_ .parent_map = gcc_xo_uniphy2_tx_rx_ubi32_bias_map, .clkr.hw.init = &(struct clk_init_data){ .name = "nss_port6_tx_clk_src", @@ -1879,7 +1879,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1945,9 +1911,8 @@ static struct clk_regmap_div nss_port6_t +@@ -1939,9 +1905,8 @@ static struct clk_regmap_div nss_port6_t .clkr = { .hw.init = &(struct clk_init_data){ .name = "nss_port6_tx_div_clk_src", @@ -1891,7 +1891,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .ops = &clk_regmap_div_ops, .flags = CLK_SET_RATE_PARENT, -@@ -1970,8 +1935,8 @@ static struct clk_rcg2 crypto_clk_src = +@@ -1964,8 +1929,8 @@ static struct clk_rcg2 crypto_clk_src = .parent_map = gcc_xo_gpll0_gpll0_out_main_div2_map, .clkr.hw.init = &(struct clk_init_data){ .name = "crypto_clk_src", @@ -1902,7 +1902,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -1981,6 +1946,22 @@ static struct freq_tbl ftbl_gp_clk_src[] +@@ -1975,6 +1940,22 @@ static struct freq_tbl ftbl_gp_clk_src[] { } }; @@ -1925,7 +1925,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com static struct clk_rcg2 gp1_clk_src = { .cmd_rcgr = 0x08004, .freq_tbl = ftbl_gp_clk_src, -@@ -1989,8 +1970,8 @@ static struct clk_rcg2 gp1_clk_src = { +@@ -1983,8 +1964,8 @@ static struct clk_rcg2 gp1_clk_src = { .parent_map = gcc_xo_gpll0_gpll6_gpll0_sleep_clk_map, .clkr.hw.init = &(struct clk_init_data){ .name = "gp1_clk_src", @@ -1936,7 +1936,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -2003,8 +1984,8 @@ static struct clk_rcg2 gp2_clk_src = { +@@ -1997,8 +1978,8 @@ static struct clk_rcg2 gp2_clk_src = { .parent_map = gcc_xo_gpll0_gpll6_gpll0_sleep_clk_map, .clkr.hw.init = &(struct clk_init_data){ .name = "gp2_clk_src", @@ -1947,7 +1947,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -2017,8 +1998,8 @@ static struct clk_rcg2 gp3_clk_src = { +@@ -2011,8 +1992,8 @@ static struct clk_rcg2 gp3_clk_src = { .parent_map = gcc_xo_gpll0_gpll6_gpll0_sleep_clk_map, .clkr.hw.init = &(struct clk_init_data){ .name = "gp3_clk_src", @@ -1958,7 +1958,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .ops = &clk_rcg2_ops, }, }; -@@ -2030,9 +2011,8 @@ static struct clk_branch gcc_blsp1_ahb_c +@@ -2024,9 +2005,8 @@ static struct clk_branch gcc_blsp1_ahb_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_ahb_clk", @@ -1970,7 +1970,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2047,9 +2027,8 @@ static struct clk_branch gcc_blsp1_qup1_ +@@ -2041,9 +2021,8 @@ static struct clk_branch gcc_blsp1_qup1_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup1_i2c_apps_clk", @@ -1982,7 +1982,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2064,9 +2043,8 @@ static struct clk_branch gcc_blsp1_qup1_ +@@ -2058,9 +2037,8 @@ static struct clk_branch gcc_blsp1_qup1_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup1_spi_apps_clk", @@ -1994,7 +1994,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2081,9 +2059,8 @@ static struct clk_branch gcc_blsp1_qup2_ +@@ -2075,9 +2053,8 @@ static struct clk_branch gcc_blsp1_qup2_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup2_i2c_apps_clk", @@ -2006,7 +2006,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2098,9 +2075,8 @@ static struct clk_branch gcc_blsp1_qup2_ +@@ -2092,9 +2069,8 @@ static struct clk_branch gcc_blsp1_qup2_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup2_spi_apps_clk", @@ -2018,7 +2018,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2115,9 +2091,8 @@ static struct clk_branch gcc_blsp1_qup3_ +@@ -2109,9 +2085,8 @@ static struct clk_branch gcc_blsp1_qup3_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup3_i2c_apps_clk", @@ -2030,7 +2030,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2132,9 +2107,8 @@ static struct clk_branch gcc_blsp1_qup3_ +@@ -2126,9 +2101,8 @@ static struct clk_branch gcc_blsp1_qup3_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup3_spi_apps_clk", @@ -2042,7 +2042,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2149,9 +2123,8 @@ static struct clk_branch gcc_blsp1_qup4_ +@@ -2143,9 +2117,8 @@ static struct clk_branch gcc_blsp1_qup4_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup4_i2c_apps_clk", @@ -2054,7 +2054,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2166,9 +2139,8 @@ static struct clk_branch gcc_blsp1_qup4_ +@@ -2160,9 +2133,8 @@ static struct clk_branch gcc_blsp1_qup4_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup4_spi_apps_clk", @@ -2066,7 +2066,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2183,9 +2155,8 @@ static struct clk_branch gcc_blsp1_qup5_ +@@ -2177,9 +2149,8 @@ static struct clk_branch gcc_blsp1_qup5_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup5_i2c_apps_clk", @@ -2078,7 +2078,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2200,9 +2171,8 @@ static struct clk_branch gcc_blsp1_qup5_ +@@ -2194,9 +2165,8 @@ static struct clk_branch gcc_blsp1_qup5_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup5_spi_apps_clk", @@ -2090,7 +2090,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2217,9 +2187,8 @@ static struct clk_branch gcc_blsp1_qup6_ +@@ -2211,9 +2181,8 @@ static struct clk_branch gcc_blsp1_qup6_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup6_i2c_apps_clk", @@ -2102,7 +2102,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2234,9 +2203,8 @@ static struct clk_branch gcc_blsp1_qup6_ +@@ -2228,9 +2197,8 @@ static struct clk_branch gcc_blsp1_qup6_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_qup6_spi_apps_clk", @@ -2114,7 +2114,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2251,9 +2219,8 @@ static struct clk_branch gcc_blsp1_uart1 +@@ -2245,9 +2213,8 @@ static struct clk_branch gcc_blsp1_uart1 .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_uart1_apps_clk", @@ -2126,7 +2126,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2268,9 +2235,8 @@ static struct clk_branch gcc_blsp1_uart2 +@@ -2262,9 +2229,8 @@ static struct clk_branch gcc_blsp1_uart2 .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_uart2_apps_clk", @@ -2138,7 +2138,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2285,9 +2251,8 @@ static struct clk_branch gcc_blsp1_uart3 +@@ -2279,9 +2245,8 @@ static struct clk_branch gcc_blsp1_uart3 .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_uart3_apps_clk", @@ -2150,7 +2150,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2302,9 +2267,8 @@ static struct clk_branch gcc_blsp1_uart4 +@@ -2296,9 +2261,8 @@ static struct clk_branch gcc_blsp1_uart4 .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_uart4_apps_clk", @@ -2162,7 +2162,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2319,9 +2283,8 @@ static struct clk_branch gcc_blsp1_uart5 +@@ -2313,9 +2277,8 @@ static struct clk_branch gcc_blsp1_uart5 .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_uart5_apps_clk", @@ -2174,7 +2174,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2336,9 +2299,8 @@ static struct clk_branch gcc_blsp1_uart6 +@@ -2330,9 +2293,8 @@ static struct clk_branch gcc_blsp1_uart6 .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_blsp1_uart6_apps_clk", @@ -2186,7 +2186,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2354,9 +2316,8 @@ static struct clk_branch gcc_prng_ahb_cl +@@ -2348,9 +2310,8 @@ static struct clk_branch gcc_prng_ahb_cl .enable_mask = BIT(8), .hw.init = &(struct clk_init_data){ .name = "gcc_prng_ahb_clk", @@ -2198,7 +2198,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2371,9 +2332,8 @@ static struct clk_branch gcc_qpic_ahb_cl +@@ -2365,9 +2326,8 @@ static struct clk_branch gcc_qpic_ahb_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_qpic_ahb_clk", @@ -2210,7 +2210,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2388,9 +2348,8 @@ static struct clk_branch gcc_qpic_clk = +@@ -2382,9 +2342,8 @@ static struct clk_branch gcc_qpic_clk = .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_qpic_clk", @@ -2222,7 +2222,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2405,9 +2364,8 @@ static struct clk_branch gcc_pcie0_ahb_c +@@ -2399,9 +2358,8 @@ static struct clk_branch gcc_pcie0_ahb_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie0_ahb_clk", @@ -2234,7 +2234,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2422,9 +2380,8 @@ static struct clk_branch gcc_pcie0_aux_c +@@ -2416,9 +2374,8 @@ static struct clk_branch gcc_pcie0_aux_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie0_aux_clk", @@ -2246,7 +2246,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2439,9 +2396,8 @@ static struct clk_branch gcc_pcie0_axi_m +@@ -2433,9 +2390,8 @@ static struct clk_branch gcc_pcie0_axi_m .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie0_axi_m_clk", @@ -2258,7 +2258,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2456,9 +2412,8 @@ static struct clk_branch gcc_pcie0_axi_s +@@ -2450,9 +2406,8 @@ static struct clk_branch gcc_pcie0_axi_s .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie0_axi_s_clk", @@ -2270,7 +2270,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2474,9 +2429,8 @@ static struct clk_branch gcc_pcie0_pipe_ +@@ -2468,9 +2423,8 @@ static struct clk_branch gcc_pcie0_pipe_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie0_pipe_clk", @@ -2282,7 +2282,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2491,9 +2445,8 @@ static struct clk_branch gcc_sys_noc_pci +@@ -2485,9 +2439,8 @@ static struct clk_branch gcc_sys_noc_pci .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sys_noc_pcie0_axi_clk", @@ -2294,7 +2294,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2508,9 +2461,8 @@ static struct clk_branch gcc_pcie1_ahb_c +@@ -2502,9 +2455,8 @@ static struct clk_branch gcc_pcie1_ahb_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie1_ahb_clk", @@ -2306,7 +2306,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2525,9 +2477,8 @@ static struct clk_branch gcc_pcie1_aux_c +@@ -2519,9 +2471,8 @@ static struct clk_branch gcc_pcie1_aux_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie1_aux_clk", @@ -2318,7 +2318,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2542,9 +2493,8 @@ static struct clk_branch gcc_pcie1_axi_m +@@ -2536,9 +2487,8 @@ static struct clk_branch gcc_pcie1_axi_m .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie1_axi_m_clk", @@ -2330,7 +2330,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2559,9 +2509,8 @@ static struct clk_branch gcc_pcie1_axi_s +@@ -2553,9 +2503,8 @@ static struct clk_branch gcc_pcie1_axi_s .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie1_axi_s_clk", @@ -2342,7 +2342,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2577,9 +2526,8 @@ static struct clk_branch gcc_pcie1_pipe_ +@@ -2571,9 +2520,8 @@ static struct clk_branch gcc_pcie1_pipe_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_pcie1_pipe_clk", @@ -2354,7 +2354,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2594,9 +2542,8 @@ static struct clk_branch gcc_sys_noc_pci +@@ -2588,9 +2536,8 @@ static struct clk_branch gcc_sys_noc_pci .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sys_noc_pcie1_axi_clk", @@ -2366,7 +2366,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2611,9 +2558,8 @@ static struct clk_branch gcc_usb0_aux_cl +@@ -2605,9 +2552,8 @@ static struct clk_branch gcc_usb0_aux_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb0_aux_clk", @@ -2378,7 +2378,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2628,9 +2574,8 @@ static struct clk_branch gcc_sys_noc_usb +@@ -2622,9 +2568,8 @@ static struct clk_branch gcc_sys_noc_usb .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sys_noc_usb0_axi_clk", @@ -2390,7 +2390,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2645,9 +2590,8 @@ static struct clk_branch gcc_usb0_master +@@ -2639,9 +2584,8 @@ static struct clk_branch gcc_usb0_master .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb0_master_clk", @@ -2402,7 +2402,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2662,9 +2606,8 @@ static struct clk_branch gcc_usb0_mock_u +@@ -2656,9 +2600,8 @@ static struct clk_branch gcc_usb0_mock_u .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb0_mock_utmi_clk", @@ -2414,7 +2414,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2679,9 +2622,8 @@ static struct clk_branch gcc_usb0_phy_cf +@@ -2673,9 +2616,8 @@ static struct clk_branch gcc_usb0_phy_cf .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb0_phy_cfg_ahb_clk", @@ -2426,7 +2426,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2697,9 +2639,8 @@ static struct clk_branch gcc_usb0_pipe_c +@@ -2691,9 +2633,8 @@ static struct clk_branch gcc_usb0_pipe_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb0_pipe_clk", @@ -2438,7 +2438,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2714,9 +2655,8 @@ static struct clk_branch gcc_usb0_sleep_ +@@ -2708,9 +2649,8 @@ static struct clk_branch gcc_usb0_sleep_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb0_sleep_clk", @@ -2450,7 +2450,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2731,9 +2671,8 @@ static struct clk_branch gcc_usb1_aux_cl +@@ -2725,9 +2665,8 @@ static struct clk_branch gcc_usb1_aux_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb1_aux_clk", @@ -2462,7 +2462,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2748,9 +2687,8 @@ static struct clk_branch gcc_sys_noc_usb +@@ -2742,9 +2681,8 @@ static struct clk_branch gcc_sys_noc_usb .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sys_noc_usb1_axi_clk", @@ -2474,7 +2474,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2765,9 +2703,8 @@ static struct clk_branch gcc_usb1_master +@@ -2759,9 +2697,8 @@ static struct clk_branch gcc_usb1_master .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb1_master_clk", @@ -2486,7 +2486,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2782,9 +2719,8 @@ static struct clk_branch gcc_usb1_mock_u +@@ -2776,9 +2713,8 @@ static struct clk_branch gcc_usb1_mock_u .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb1_mock_utmi_clk", @@ -2498,7 +2498,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2799,9 +2735,8 @@ static struct clk_branch gcc_usb1_phy_cf +@@ -2793,9 +2729,8 @@ static struct clk_branch gcc_usb1_phy_cf .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb1_phy_cfg_ahb_clk", @@ -2510,7 +2510,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2817,9 +2752,8 @@ static struct clk_branch gcc_usb1_pipe_c +@@ -2811,9 +2746,8 @@ static struct clk_branch gcc_usb1_pipe_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb1_pipe_clk", @@ -2522,7 +2522,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2834,9 +2768,8 @@ static struct clk_branch gcc_usb1_sleep_ +@@ -2828,9 +2762,8 @@ static struct clk_branch gcc_usb1_sleep_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_usb1_sleep_clk", @@ -2534,7 +2534,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2851,9 +2784,8 @@ static struct clk_branch gcc_sdcc1_ahb_c +@@ -2845,9 +2778,8 @@ static struct clk_branch gcc_sdcc1_ahb_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sdcc1_ahb_clk", @@ -2546,7 +2546,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2868,9 +2800,8 @@ static struct clk_branch gcc_sdcc1_apps_ +@@ -2862,9 +2794,8 @@ static struct clk_branch gcc_sdcc1_apps_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sdcc1_apps_clk", @@ -2558,7 +2558,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2885,9 +2816,8 @@ static struct clk_branch gcc_sdcc1_ice_c +@@ -2879,9 +2810,8 @@ static struct clk_branch gcc_sdcc1_ice_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sdcc1_ice_core_clk", @@ -2570,7 +2570,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2902,9 +2832,8 @@ static struct clk_branch gcc_sdcc2_ahb_c +@@ -2896,9 +2826,8 @@ static struct clk_branch gcc_sdcc2_ahb_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sdcc2_ahb_clk", @@ -2582,7 +2582,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2919,9 +2848,8 @@ static struct clk_branch gcc_sdcc2_apps_ +@@ -2913,9 +2842,8 @@ static struct clk_branch gcc_sdcc2_apps_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_sdcc2_apps_clk", @@ -2594,7 +2594,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2936,9 +2864,8 @@ static struct clk_branch gcc_mem_noc_nss +@@ -2930,9 +2858,8 @@ static struct clk_branch gcc_mem_noc_nss .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_mem_noc_nss_axi_clk", @@ -2606,7 +2606,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2953,9 +2880,8 @@ static struct clk_branch gcc_nss_ce_apb_ +@@ -2947,9 +2874,8 @@ static struct clk_branch gcc_nss_ce_apb_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_ce_apb_clk", @@ -2618,7 +2618,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2970,9 +2896,8 @@ static struct clk_branch gcc_nss_ce_axi_ +@@ -2964,9 +2890,8 @@ static struct clk_branch gcc_nss_ce_axi_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_ce_axi_clk", @@ -2630,7 +2630,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -2987,9 +2912,8 @@ static struct clk_branch gcc_nss_cfg_clk +@@ -2981,9 +2906,8 @@ static struct clk_branch gcc_nss_cfg_clk .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_cfg_clk", @@ -2642,7 +2642,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3004,9 +2928,8 @@ static struct clk_branch gcc_nss_crypto_ +@@ -2998,9 +2922,8 @@ static struct clk_branch gcc_nss_crypto_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_crypto_clk", @@ -2654,7 +2654,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3021,9 +2944,8 @@ static struct clk_branch gcc_nss_csr_clk +@@ -3015,9 +2938,8 @@ static struct clk_branch gcc_nss_csr_clk .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_csr_clk", @@ -2666,7 +2666,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3038,9 +2960,8 @@ static struct clk_branch gcc_nss_edma_cf +@@ -3032,9 +2954,8 @@ static struct clk_branch gcc_nss_edma_cf .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_edma_cfg_clk", @@ -2678,7 +2678,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3055,9 +2976,8 @@ static struct clk_branch gcc_nss_edma_cl +@@ -3049,9 +2970,8 @@ static struct clk_branch gcc_nss_edma_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_edma_clk", @@ -2690,7 +2690,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3072,9 +2992,8 @@ static struct clk_branch gcc_nss_imem_cl +@@ -3066,9 +2986,8 @@ static struct clk_branch gcc_nss_imem_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_imem_clk", @@ -2702,7 +2702,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3089,9 +3008,8 @@ static struct clk_branch gcc_nss_noc_clk +@@ -3083,9 +3002,8 @@ static struct clk_branch gcc_nss_noc_clk .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_noc_clk", @@ -2714,7 +2714,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3106,9 +3024,8 @@ static struct clk_branch gcc_nss_ppe_btq +@@ -3100,9 +3018,8 @@ static struct clk_branch gcc_nss_ppe_btq .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_ppe_btq_clk", @@ -2726,7 +2726,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3123,9 +3040,8 @@ static struct clk_branch gcc_nss_ppe_cfg +@@ -3117,9 +3034,8 @@ static struct clk_branch gcc_nss_ppe_cfg .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_ppe_cfg_clk", @@ -2738,7 +2738,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3140,9 +3056,8 @@ static struct clk_branch gcc_nss_ppe_clk +@@ -3134,9 +3050,8 @@ static struct clk_branch gcc_nss_ppe_clk .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_ppe_clk", @@ -2750,7 +2750,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3157,9 +3072,8 @@ static struct clk_branch gcc_nss_ppe_ipe +@@ -3151,9 +3066,8 @@ static struct clk_branch gcc_nss_ppe_ipe .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_ppe_ipe_clk", @@ -2762,7 +2762,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3174,9 +3088,8 @@ static struct clk_branch gcc_nss_ptp_ref +@@ -3168,9 +3082,8 @@ static struct clk_branch gcc_nss_ptp_ref .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_ptp_ref_clk", @@ -2774,7 +2774,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3192,9 +3105,8 @@ static struct clk_branch gcc_crypto_ppe_ +@@ -3186,9 +3099,8 @@ static struct clk_branch gcc_crypto_ppe_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_crypto_ppe_clk", @@ -2786,7 +2786,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3209,9 +3121,8 @@ static struct clk_branch gcc_nssnoc_ce_a +@@ -3203,9 +3115,8 @@ static struct clk_branch gcc_nssnoc_ce_a .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_ce_apb_clk", @@ -2798,7 +2798,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3226,9 +3137,8 @@ static struct clk_branch gcc_nssnoc_ce_a +@@ -3220,9 +3131,8 @@ static struct clk_branch gcc_nssnoc_ce_a .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_ce_axi_clk", @@ -2810,7 +2810,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3243,9 +3153,8 @@ static struct clk_branch gcc_nssnoc_cryp +@@ -3237,9 +3147,8 @@ static struct clk_branch gcc_nssnoc_cryp .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_crypto_clk", @@ -2822,7 +2822,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3260,9 +3169,8 @@ static struct clk_branch gcc_nssnoc_ppe_ +@@ -3254,9 +3163,8 @@ static struct clk_branch gcc_nssnoc_ppe_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_ppe_cfg_clk", @@ -2834,7 +2834,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3277,9 +3185,8 @@ static struct clk_branch gcc_nssnoc_ppe_ +@@ -3271,9 +3179,8 @@ static struct clk_branch gcc_nssnoc_ppe_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_ppe_clk", @@ -2846,7 +2846,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3294,9 +3201,8 @@ static struct clk_branch gcc_nssnoc_qosg +@@ -3288,9 +3195,8 @@ static struct clk_branch gcc_nssnoc_qosg .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_qosgen_ref_clk", @@ -2858,7 +2858,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3311,9 +3217,8 @@ static struct clk_branch gcc_nssnoc_snoc +@@ -3305,9 +3211,8 @@ static struct clk_branch gcc_nssnoc_snoc .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_snoc_clk", @@ -2870,7 +2870,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3328,9 +3233,8 @@ static struct clk_branch gcc_nssnoc_time +@@ -3322,9 +3227,8 @@ static struct clk_branch gcc_nssnoc_time .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_timeout_ref_clk", @@ -2882,7 +2882,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3345,9 +3249,8 @@ static struct clk_branch gcc_nssnoc_ubi0 +@@ -3339,9 +3243,8 @@ static struct clk_branch gcc_nssnoc_ubi0 .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_ubi0_ahb_clk", @@ -2894,7 +2894,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3362,9 +3265,8 @@ static struct clk_branch gcc_nssnoc_ubi1 +@@ -3356,9 +3259,8 @@ static struct clk_branch gcc_nssnoc_ubi1 .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nssnoc_ubi1_ahb_clk", @@ -2906,7 +2906,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3380,9 +3282,8 @@ static struct clk_branch gcc_ubi0_ahb_cl +@@ -3374,9 +3276,8 @@ static struct clk_branch gcc_ubi0_ahb_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi0_ahb_clk", @@ -2918,7 +2918,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3398,9 +3299,8 @@ static struct clk_branch gcc_ubi0_axi_cl +@@ -3392,9 +3293,8 @@ static struct clk_branch gcc_ubi0_axi_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi0_axi_clk", @@ -2930,7 +2930,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3416,9 +3316,8 @@ static struct clk_branch gcc_ubi0_nc_axi +@@ -3410,9 +3310,8 @@ static struct clk_branch gcc_ubi0_nc_axi .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi0_nc_axi_clk", @@ -2942,7 +2942,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3434,9 +3333,8 @@ static struct clk_branch gcc_ubi0_core_c +@@ -3428,9 +3327,8 @@ static struct clk_branch gcc_ubi0_core_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi0_core_clk", @@ -2954,7 +2954,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3452,9 +3350,8 @@ static struct clk_branch gcc_ubi0_mpt_cl +@@ -3446,9 +3344,8 @@ static struct clk_branch gcc_ubi0_mpt_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi0_mpt_clk", @@ -2966,7 +2966,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3470,9 +3367,8 @@ static struct clk_branch gcc_ubi1_ahb_cl +@@ -3464,9 +3361,8 @@ static struct clk_branch gcc_ubi1_ahb_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi1_ahb_clk", @@ -2978,7 +2978,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3488,9 +3384,8 @@ static struct clk_branch gcc_ubi1_axi_cl +@@ -3482,9 +3378,8 @@ static struct clk_branch gcc_ubi1_axi_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi1_axi_clk", @@ -2990,7 +2990,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3506,9 +3401,8 @@ static struct clk_branch gcc_ubi1_nc_axi +@@ -3500,9 +3395,8 @@ static struct clk_branch gcc_ubi1_nc_axi .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi1_nc_axi_clk", @@ -3002,7 +3002,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3524,9 +3418,8 @@ static struct clk_branch gcc_ubi1_core_c +@@ -3518,9 +3412,8 @@ static struct clk_branch gcc_ubi1_core_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi1_core_clk", @@ -3014,7 +3014,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3542,9 +3435,8 @@ static struct clk_branch gcc_ubi1_mpt_cl +@@ -3536,9 +3429,8 @@ static struct clk_branch gcc_ubi1_mpt_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_ubi1_mpt_clk", @@ -3026,7 +3026,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3559,9 +3451,8 @@ static struct clk_branch gcc_cmn_12gpll_ +@@ -3553,9 +3445,8 @@ static struct clk_branch gcc_cmn_12gpll_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_cmn_12gpll_ahb_clk", @@ -3038,7 +3038,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3576,9 +3467,8 @@ static struct clk_branch gcc_cmn_12gpll_ +@@ -3570,9 +3461,8 @@ static struct clk_branch gcc_cmn_12gpll_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_cmn_12gpll_sys_clk", @@ -3050,7 +3050,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3593,9 +3483,8 @@ static struct clk_branch gcc_mdio_ahb_cl +@@ -3587,9 +3477,8 @@ static struct clk_branch gcc_mdio_ahb_cl .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_mdio_ahb_clk", @@ -3062,7 +3062,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3610,9 +3499,8 @@ static struct clk_branch gcc_uniphy0_ahb +@@ -3604,9 +3493,8 @@ static struct clk_branch gcc_uniphy0_ahb .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_ahb_clk", @@ -3074,7 +3074,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3627,9 +3515,8 @@ static struct clk_branch gcc_uniphy0_sys +@@ -3621,9 +3509,8 @@ static struct clk_branch gcc_uniphy0_sys .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_sys_clk", @@ -3086,7 +3086,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3644,9 +3531,8 @@ static struct clk_branch gcc_uniphy1_ahb +@@ -3638,9 +3525,8 @@ static struct clk_branch gcc_uniphy1_ahb .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy1_ahb_clk", @@ -3098,7 +3098,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3661,9 +3547,8 @@ static struct clk_branch gcc_uniphy1_sys +@@ -3655,9 +3541,8 @@ static struct clk_branch gcc_uniphy1_sys .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy1_sys_clk", @@ -3110,7 +3110,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3678,9 +3563,8 @@ static struct clk_branch gcc_uniphy2_ahb +@@ -3672,9 +3557,8 @@ static struct clk_branch gcc_uniphy2_ahb .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy2_ahb_clk", @@ -3122,7 +3122,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3695,9 +3579,8 @@ static struct clk_branch gcc_uniphy2_sys +@@ -3689,9 +3573,8 @@ static struct clk_branch gcc_uniphy2_sys .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy2_sys_clk", @@ -3134,7 +3134,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3712,9 +3595,8 @@ static struct clk_branch gcc_nss_port1_r +@@ -3706,9 +3589,8 @@ static struct clk_branch gcc_nss_port1_r .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port1_rx_clk", @@ -3146,7 +3146,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3729,9 +3611,8 @@ static struct clk_branch gcc_nss_port1_t +@@ -3723,9 +3605,8 @@ static struct clk_branch gcc_nss_port1_t .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port1_tx_clk", @@ -3158,7 +3158,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3746,9 +3627,8 @@ static struct clk_branch gcc_nss_port2_r +@@ -3740,9 +3621,8 @@ static struct clk_branch gcc_nss_port2_r .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port2_rx_clk", @@ -3170,7 +3170,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3763,9 +3643,8 @@ static struct clk_branch gcc_nss_port2_t +@@ -3757,9 +3637,8 @@ static struct clk_branch gcc_nss_port2_t .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port2_tx_clk", @@ -3182,7 +3182,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3780,9 +3659,8 @@ static struct clk_branch gcc_nss_port3_r +@@ -3774,9 +3653,8 @@ static struct clk_branch gcc_nss_port3_r .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port3_rx_clk", @@ -3194,7 +3194,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3797,9 +3675,8 @@ static struct clk_branch gcc_nss_port3_t +@@ -3791,9 +3669,8 @@ static struct clk_branch gcc_nss_port3_t .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port3_tx_clk", @@ -3206,7 +3206,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3814,9 +3691,8 @@ static struct clk_branch gcc_nss_port4_r +@@ -3808,9 +3685,8 @@ static struct clk_branch gcc_nss_port4_r .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port4_rx_clk", @@ -3218,7 +3218,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3831,9 +3707,8 @@ static struct clk_branch gcc_nss_port4_t +@@ -3825,9 +3701,8 @@ static struct clk_branch gcc_nss_port4_t .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port4_tx_clk", @@ -3230,7 +3230,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3848,9 +3723,8 @@ static struct clk_branch gcc_nss_port5_r +@@ -3842,9 +3717,8 @@ static struct clk_branch gcc_nss_port5_r .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port5_rx_clk", @@ -3242,7 +3242,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3865,9 +3739,8 @@ static struct clk_branch gcc_nss_port5_t +@@ -3859,9 +3733,8 @@ static struct clk_branch gcc_nss_port5_t .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port5_tx_clk", @@ -3254,7 +3254,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3882,9 +3755,8 @@ static struct clk_branch gcc_nss_port6_r +@@ -3876,9 +3749,8 @@ static struct clk_branch gcc_nss_port6_r .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port6_rx_clk", @@ -3266,7 +3266,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3899,9 +3771,8 @@ static struct clk_branch gcc_nss_port6_t +@@ -3893,9 +3765,8 @@ static struct clk_branch gcc_nss_port6_t .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_nss_port6_tx_clk", @@ -3278,7 +3278,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3916,9 +3787,8 @@ static struct clk_branch gcc_port1_mac_c +@@ -3910,9 +3781,8 @@ static struct clk_branch gcc_port1_mac_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_port1_mac_clk", @@ -3290,7 +3290,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3933,9 +3803,8 @@ static struct clk_branch gcc_port2_mac_c +@@ -3927,9 +3797,8 @@ static struct clk_branch gcc_port2_mac_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_port2_mac_clk", @@ -3302,7 +3302,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3950,9 +3819,8 @@ static struct clk_branch gcc_port3_mac_c +@@ -3944,9 +3813,8 @@ static struct clk_branch gcc_port3_mac_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_port3_mac_clk", @@ -3314,7 +3314,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3967,9 +3835,8 @@ static struct clk_branch gcc_port4_mac_c +@@ -3961,9 +3829,8 @@ static struct clk_branch gcc_port4_mac_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_port4_mac_clk", @@ -3326,7 +3326,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -3984,9 +3851,8 @@ static struct clk_branch gcc_port5_mac_c +@@ -3978,9 +3845,8 @@ static struct clk_branch gcc_port5_mac_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_port5_mac_clk", @@ -3338,7 +3338,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4001,9 +3867,8 @@ static struct clk_branch gcc_port6_mac_c +@@ -3995,9 +3861,8 @@ static struct clk_branch gcc_port6_mac_c .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_port6_mac_clk", @@ -3350,7 +3350,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4018,9 +3883,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4012,9 +3877,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port1_rx_clk", @@ -3362,7 +3362,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4035,9 +3899,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4029,9 +3893,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port1_tx_clk", @@ -3374,7 +3374,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4052,9 +3915,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4046,9 +3909,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port2_rx_clk", @@ -3386,7 +3386,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4069,9 +3931,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4063,9 +3925,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port2_tx_clk", @@ -3398,7 +3398,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4086,9 +3947,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4080,9 +3941,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port3_rx_clk", @@ -3410,7 +3410,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4103,9 +3963,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4097,9 +3957,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port3_tx_clk", @@ -3422,7 +3422,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4120,9 +3979,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4114,9 +3973,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port4_rx_clk", @@ -3434,7 +3434,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4137,9 +3995,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4131,9 +3989,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port4_tx_clk", @@ -3446,7 +3446,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4154,9 +4011,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4148,9 +4005,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port5_rx_clk", @@ -3458,7 +3458,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4171,9 +4027,8 @@ static struct clk_branch gcc_uniphy0_por +@@ -4165,9 +4021,8 @@ static struct clk_branch gcc_uniphy0_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy0_port5_tx_clk", @@ -3470,7 +3470,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4188,9 +4043,8 @@ static struct clk_branch gcc_uniphy1_por +@@ -4182,9 +4037,8 @@ static struct clk_branch gcc_uniphy1_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy1_port5_rx_clk", @@ -3482,7 +3482,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4205,9 +4059,8 @@ static struct clk_branch gcc_uniphy1_por +@@ -4199,9 +4053,8 @@ static struct clk_branch gcc_uniphy1_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy1_port5_tx_clk", @@ -3494,7 +3494,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4222,9 +4075,8 @@ static struct clk_branch gcc_uniphy2_por +@@ -4216,9 +4069,8 @@ static struct clk_branch gcc_uniphy2_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy2_port6_rx_clk", @@ -3506,7 +3506,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4239,9 +4091,8 @@ static struct clk_branch gcc_uniphy2_por +@@ -4233,9 +4085,8 @@ static struct clk_branch gcc_uniphy2_por .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_uniphy2_port6_tx_clk", @@ -3518,7 +3518,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4257,9 +4108,8 @@ static struct clk_branch gcc_crypto_ahb_ +@@ -4251,9 +4102,8 @@ static struct clk_branch gcc_crypto_ahb_ .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_crypto_ahb_clk", @@ -3530,7 +3530,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4275,9 +4125,8 @@ static struct clk_branch gcc_crypto_axi_ +@@ -4269,9 +4119,8 @@ static struct clk_branch gcc_crypto_axi_ .enable_mask = BIT(1), .hw.init = &(struct clk_init_data){ .name = "gcc_crypto_axi_clk", @@ -3542,7 +3542,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4293,9 +4142,8 @@ static struct clk_branch gcc_crypto_clk +@@ -4287,9 +4136,8 @@ static struct clk_branch gcc_crypto_clk .enable_mask = BIT(2), .hw.init = &(struct clk_init_data){ .name = "gcc_crypto_clk", @@ -3554,7 +3554,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4310,9 +4158,8 @@ static struct clk_branch gcc_gp1_clk = { +@@ -4304,9 +4152,8 @@ static struct clk_branch gcc_gp1_clk = { .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_gp1_clk", @@ -3566,7 +3566,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4327,9 +4174,8 @@ static struct clk_branch gcc_gp2_clk = { +@@ -4321,9 +4168,8 @@ static struct clk_branch gcc_gp2_clk = { .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_gp2_clk", @@ -3578,7 +3578,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4344,9 +4190,8 @@ static struct clk_branch gcc_gp3_clk = { +@@ -4338,9 +4184,8 @@ static struct clk_branch gcc_gp3_clk = { .enable_mask = BIT(0), .hw.init = &(struct clk_init_data){ .name = "gcc_gp3_clk", @@ -3590,7 +3590,7 @@ Link: https://lore.kernel.org/r/20221030175703.1103224-1-robimarko@gmail.com .num_parents = 1, .flags = CLK_SET_RATE_PARENT, .ops = &clk_branch2_ops, -@@ -4368,7 +4213,7 @@ static struct clk_rcg2 pcie0_rchng_clk_s +@@ -4362,7 +4207,7 @@ static struct clk_rcg2 pcie0_rchng_clk_s .clkr.hw.init = &(struct clk_init_data){ .name = "pcie0_rchng_clk_src", .parent_data = gcc_xo_gpll0, diff --git a/target/linux/qualcommax/patches-6.1/0010-v6.2-clk-qcom-ipq8074-add-missing-networking-resets.patch b/target/linux/qualcommax/patches-6.1/0010-v6.2-clk-qcom-ipq8074-add-missing-networking-resets.patch index 212fc84869c190..81014ab24c9bda 100644 --- a/target/linux/qualcommax/patches-6.1/0010-v6.2-clk-qcom-ipq8074-add-missing-networking-resets.patch +++ b/target/linux/qualcommax/patches-6.1/0010-v6.2-clk-qcom-ipq8074-add-missing-networking-resets.patch @@ -18,7 +18,7 @@ Link: https://lore.kernel.org/r/20221107132901.489240-3-robimarko@gmail.com --- a/drivers/clk/qcom/gcc-ipq8074.c +++ b/drivers/clk/qcom/gcc-ipq8074.c -@@ -4671,6 +4671,20 @@ static const struct qcom_reset_map gcc_i +@@ -4665,6 +4665,20 @@ static const struct qcom_reset_map gcc_i [GCC_PCIE1_AXI_SLAVE_ARES] = { 0x76040, 4 }, [GCC_PCIE1_AHB_ARES] = { 0x76040, 5 }, [GCC_PCIE1_AXI_MASTER_STICKY_ARES] = { 0x76040, 6 }, diff --git a/target/linux/qualcommax/patches-6.1/0011-v6.2-clk-qcom-ipq8074-populate-fw_name-for-all-parents.patch b/target/linux/qualcommax/patches-6.1/0011-v6.2-clk-qcom-ipq8074-populate-fw_name-for-all-parents.patch index 7372b1da8eda8f..35a0a07c70b272 100644 --- a/target/linux/qualcommax/patches-6.1/0011-v6.2-clk-qcom-ipq8074-populate-fw_name-for-all-parents.patch +++ b/target/linux/qualcommax/patches-6.1/0011-v6.2-clk-qcom-ipq8074-populate-fw_name-for-all-parents.patch @@ -22,7 +22,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com --- a/drivers/clk/qcom/gcc-ipq8074.c +++ b/drivers/clk/qcom/gcc-ipq8074.c -@@ -680,7 +680,7 @@ static struct clk_rcg2 pcie0_aux_clk_src +@@ -674,7 +674,7 @@ static struct clk_rcg2 pcie0_aux_clk_src }; static const struct clk_parent_data gcc_pcie20_phy0_pipe_clk_xo[] = { @@ -31,7 +31,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com { .fw_name = "xo", .name = "xo" }, }; -@@ -733,7 +733,7 @@ static struct clk_rcg2 pcie1_aux_clk_src +@@ -727,7 +727,7 @@ static struct clk_rcg2 pcie1_aux_clk_src }; static const struct clk_parent_data gcc_pcie20_phy1_pipe_clk_xo[] = { @@ -40,7 +40,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com { .fw_name = "xo", .name = "xo" }, }; -@@ -1137,7 +1137,7 @@ static const struct freq_tbl ftbl_nss_no +@@ -1131,7 +1131,7 @@ static const struct freq_tbl ftbl_nss_no static const struct clk_parent_data gcc_xo_bias_pll_nss_noc_clk_gpll0_gpll2[] = { { .fw_name = "xo", .name = "xo" }, @@ -49,7 +49,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com { .hw = &gpll0.clkr.hw }, { .hw = &gpll2.clkr.hw }, }; -@@ -1362,7 +1362,7 @@ static const struct freq_tbl ftbl_nss_pp +@@ -1356,7 +1356,7 @@ static const struct freq_tbl ftbl_nss_pp static const struct clk_parent_data gcc_xo_bias_gpll0_gpll4_nss_ubi32[] = { { .fw_name = "xo", .name = "xo" }, @@ -58,7 +58,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com { .hw = &gpll0.clkr.hw }, { .hw = &gpll4.clkr.hw }, { .hw = &nss_crypto_pll.clkr.hw }, -@@ -1413,10 +1413,10 @@ static const struct freq_tbl ftbl_nss_po +@@ -1407,10 +1407,10 @@ static const struct freq_tbl ftbl_nss_po static const struct clk_parent_data gcc_xo_uniphy0_rx_tx_ubi32_bias[] = { { .fw_name = "xo", .name = "xo" }, @@ -72,7 +72,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com }; static const struct parent_map gcc_xo_uniphy0_rx_tx_ubi32_bias_map[] = { -@@ -1465,10 +1465,10 @@ static const struct freq_tbl ftbl_nss_po +@@ -1459,10 +1459,10 @@ static const struct freq_tbl ftbl_nss_po static const struct clk_parent_data gcc_xo_uniphy0_tx_rx_ubi32_bias[] = { { .fw_name = "xo", .name = "xo" }, @@ -86,7 +86,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com }; static const struct parent_map gcc_xo_uniphy0_tx_rx_ubi32_bias_map[] = { -@@ -1696,12 +1696,12 @@ static const struct freq_tbl ftbl_nss_po +@@ -1690,12 +1690,12 @@ static const struct freq_tbl ftbl_nss_po static const struct clk_parent_data gcc_xo_uniphy0_rx_tx_uniphy1_rx_tx_ubi32_bias[] = { { .fw_name = "xo", .name = "xo" }, @@ -104,7 +104,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com }; static const struct parent_map -@@ -1758,12 +1758,12 @@ static const struct freq_tbl ftbl_nss_po +@@ -1752,12 +1752,12 @@ static const struct freq_tbl ftbl_nss_po static const struct clk_parent_data gcc_xo_uniphy0_tx_rx_uniphy1_tx_rx_ubi32_bias[] = { { .fw_name = "xo", .name = "xo" }, @@ -122,7 +122,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com }; static const struct parent_map -@@ -1820,10 +1820,10 @@ static const struct freq_tbl ftbl_nss_po +@@ -1814,10 +1814,10 @@ static const struct freq_tbl ftbl_nss_po static const struct clk_parent_data gcc_xo_uniphy2_rx_tx_ubi32_bias[] = { { .fw_name = "xo", .name = "xo" }, @@ -136,7 +136,7 @@ Link: https://lore.kernel.org/r/20221116214655.1116467-1-robimarko@gmail.com }; static const struct parent_map gcc_xo_uniphy2_rx_tx_ubi32_bias_map[] = { -@@ -1877,10 +1877,10 @@ static const struct freq_tbl ftbl_nss_po +@@ -1871,10 +1871,10 @@ static const struct freq_tbl ftbl_nss_po static const struct clk_parent_data gcc_xo_uniphy2_tx_rx_ubi32_bias[] = { { .fw_name = "xo", .name = "xo" }, diff --git a/target/linux/qualcommax/patches-6.1/0020-v6.3-PCI-qcom-Add-support-for-IPQ8074-Gen3-port.patch b/target/linux/qualcommax/patches-6.1/0020-v6.3-PCI-qcom-Add-support-for-IPQ8074-Gen3-port.patch index 8f4ef91b7620ed..3d5c2182e9b556 100644 --- a/target/linux/qualcommax/patches-6.1/0020-v6.3-PCI-qcom-Add-support-for-IPQ8074-Gen3-port.patch +++ b/target/linux/qualcommax/patches-6.1/0020-v6.3-PCI-qcom-Add-support-for-IPQ8074-Gen3-port.patch @@ -16,7 +16,7 @@ Signed-off-by: Bjorn Helgaas --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c -@@ -1764,6 +1764,7 @@ static const struct of_device_id qcom_pc +@@ -1762,6 +1762,7 @@ static const struct of_device_id qcom_pc { .compatible = "qcom,pcie-ipq8064", .data = &cfg_2_1_0 }, { .compatible = "qcom,pcie-ipq8064-v2", .data = &cfg_2_1_0 }, { .compatible = "qcom,pcie-ipq8074", .data = &cfg_2_3_3 }, diff --git a/target/linux/qualcommax/patches-6.1/0021-v6.3-clk-qcom-ipq8074-populate-fw_name-for-usb3phy-s.patch b/target/linux/qualcommax/patches-6.1/0021-v6.3-clk-qcom-ipq8074-populate-fw_name-for-usb3phy-s.patch index eb772be4cee807..e0e8125ba654ad 100644 --- a/target/linux/qualcommax/patches-6.1/0021-v6.3-clk-qcom-ipq8074-populate-fw_name-for-usb3phy-s.patch +++ b/target/linux/qualcommax/patches-6.1/0021-v6.3-clk-qcom-ipq8074-populate-fw_name-for-usb3phy-s.patch @@ -18,7 +18,7 @@ Signed-off-by: Robert Marko --- a/drivers/clk/qcom/gcc-ipq8074.c +++ b/drivers/clk/qcom/gcc-ipq8074.c -@@ -934,7 +934,7 @@ static struct clk_rcg2 usb0_mock_utmi_cl +@@ -928,7 +928,7 @@ static struct clk_rcg2 usb0_mock_utmi_cl }; static const struct clk_parent_data gcc_usb3phy_0_cc_pipe_clk_xo[] = { @@ -27,7 +27,7 @@ Signed-off-by: Robert Marko { .fw_name = "xo", .name = "xo" }, }; -@@ -1002,7 +1002,7 @@ static struct clk_rcg2 usb1_mock_utmi_cl +@@ -996,7 +996,7 @@ static struct clk_rcg2 usb1_mock_utmi_cl }; static const struct clk_parent_data gcc_usb3phy_1_cc_pipe_clk_xo[] = { diff --git a/target/linux/qualcommax/patches-6.1/0024-v6.7-dt-bindings-arm-qcom-ids-Add-IDs-for-IPQ8174-family.patch b/target/linux/qualcommax/patches-6.1/0024-v6.7-dt-bindings-arm-qcom-ids-Add-IDs-for-IPQ8174-family.patch new file mode 100644 index 00000000000000..4eb0f097cc4cce --- /dev/null +++ b/target/linux/qualcommax/patches-6.1/0024-v6.7-dt-bindings-arm-qcom-ids-Add-IDs-for-IPQ8174-family.patch @@ -0,0 +1,29 @@ +From 93e161c8f4b9b051e5e746814138cb5520b4b897 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Fri, 1 Sep 2023 20:10:04 +0200 +Subject: [PATCH] dt-bindings: arm: qcom,ids: Add IDs for IPQ8174 family + +IPQ8174 (Oak) family is part of the IPQ8074 family, but the ID-s for it +are missing so lets add them. + +Signed-off-by: Robert Marko +Reviewed-by: Kathiravan T +Acked-by: Conor Dooley +Link: https://lore.kernel.org/r/20230901181041.1538999-1-robimarko@gmail.com +Signed-off-by: Bjorn Andersson +--- + include/dt-bindings/arm/qcom,ids.h | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/include/dt-bindings/arm/qcom,ids.h ++++ b/include/dt-bindings/arm/qcom,ids.h +@@ -121,6 +121,9 @@ + #define QCOM_ID_SM6125 394 + #define QCOM_ID_IPQ8070A 395 + #define QCOM_ID_IPQ8071A 396 ++#define QCOM_ID_IPQ8172 397 ++#define QCOM_ID_IPQ8173 398 ++#define QCOM_ID_IPQ8174 399 + #define QCOM_ID_IPQ6018 402 + #define QCOM_ID_IPQ6028 403 + #define QCOM_ID_IPQ6000 421 diff --git a/target/linux/qualcommax/patches-6.1/0128-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch b/target/linux/qualcommax/patches-6.1/0025-v6.7-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch similarity index 75% rename from target/linux/qualcommax/patches-6.1/0128-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch rename to target/linux/qualcommax/patches-6.1/0025-v6.7-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch index 09abbfa2e59d69..61cc2a459bb1b5 100644 --- a/target/linux/qualcommax/patches-6.1/0128-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch +++ b/target/linux/qualcommax/patches-6.1/0025-v6.7-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch @@ -1,10 +1,11 @@ -From 11592aa862e67f4477dee7e94d5c8244d893de1b Mon Sep 17 00:00:00 2001 +From df75a00c60c6e58bc36e4c63e9d7f1910412b132 Mon Sep 17 00:00:00 2001 From: Robert Marko -Date: Sat, 31 Dec 2022 13:03:41 +0100 +Date: Fri, 13 Oct 2023 19:20:02 +0200 Subject: [PATCH] cpufreq: qcom-nvmem: add support for IPQ8074 -IPQ8074 comes in 2 families: +IPQ8074 comes in 3 families: * IPQ8070A/IPQ8071A (Acorn) up to 1.4GHz +* IPQ8172/IPQ8173/IPQ8174 (Oak) up to 1.4GHz * IPQ8072A/IPQ8074A/IPQ8076A/IPQ8078A (Hawkeye) up to 2.2GHz So, in order to be able to share one OPP table lets add support for IPQ8074 @@ -14,14 +15,12 @@ IPQ8074 compatible is blacklisted from DT platdev as the cpufreq device will get created by NVMEM CPUFreq driver. Signed-off-by: Robert Marko ---- -Changes in v2: -* Print an error if SMEM ID is not part of the IPQ8074 family -and restrict the speed to Acorn variant (1.4GHz) +Acked-by: Konrad Dybcio +Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq-dt-platdev.c | 1 + - drivers/cpufreq/qcom-cpufreq-nvmem.c | 43 ++++++++++++++++++++++++++++ - 2 files changed, 44 insertions(+) + drivers/cpufreq/qcom-cpufreq-nvmem.c | 48 ++++++++++++++++++++++++++++ + 2 files changed, 49 insertions(+) --- a/drivers/cpufreq/cpufreq-dt-platdev.c +++ b/drivers/cpufreq/cpufreq-dt-platdev.c @@ -35,17 +34,19 @@ and restrict the speed to Acorn variant (1.4GHz) { .compatible = "qcom,msm8960", }, --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c -@@ -31,6 +31,9 @@ +@@ -31,6 +31,11 @@ #include -+#define IPQ8074_HAWKEYE_VERSION BIT(0) -+#define IPQ8074_ACORN_VERSION BIT(1) ++enum ipq8074_versions { ++ IPQ8074_HAWKEYE_VERSION = 0, ++ IPQ8074_ACORN_VERSION, ++}; + struct qcom_cpufreq_drv; struct qcom_cpufreq_match_data { -@@ -204,6 +207,41 @@ len_error: +@@ -204,6 +209,44 @@ len_error: return ret; } @@ -65,19 +66,22 @@ and restrict the speed to Acorn variant (1.4GHz) + switch (msm_id) { + case QCOM_ID_IPQ8070A: + case QCOM_ID_IPQ8071A: -+ drv->versions = IPQ8074_ACORN_VERSION; ++ case QCOM_ID_IPQ8172: ++ case QCOM_ID_IPQ8173: ++ case QCOM_ID_IPQ8174: ++ drv->versions = BIT(IPQ8074_ACORN_VERSION); + break; + case QCOM_ID_IPQ8072A: + case QCOM_ID_IPQ8074A: + case QCOM_ID_IPQ8076A: + case QCOM_ID_IPQ8078A: -+ drv->versions = IPQ8074_HAWKEYE_VERSION; ++ drv->versions = BIT(IPQ8074_HAWKEYE_VERSION); + break; + default: + dev_err(cpu_dev, + "SoC ID %u is not part of IPQ8074 family, limiting to 1.4GHz!\n", + msm_id); -+ drv->versions = IPQ8074_ACORN_VERSION; ++ drv->versions = BIT(IPQ8074_ACORN_VERSION); + break; + } + @@ -87,7 +91,7 @@ and restrict the speed to Acorn variant (1.4GHz) static const struct qcom_cpufreq_match_data match_data_kryo = { .get_version = qcom_cpufreq_kryo_name_version, }; -@@ -218,6 +256,10 @@ static const struct qcom_cpufreq_match_d +@@ -218,6 +261,10 @@ static const struct qcom_cpufreq_match_d .genpd_names = qcs404_genpd_names, }; @@ -98,7 +102,7 @@ and restrict the speed to Acorn variant (1.4GHz) static int qcom_cpufreq_probe(struct platform_device *pdev) { struct qcom_cpufreq_drv *drv; -@@ -363,6 +405,7 @@ static const struct of_device_id qcom_cp +@@ -363,6 +410,7 @@ static const struct of_device_id qcom_cp { .compatible = "qcom,msm8996", .data = &match_data_kryo }, { .compatible = "qcom,qcs404", .data = &match_data_qcs404 }, { .compatible = "qcom,ipq8064", .data = &match_data_krait }, diff --git a/target/linux/qualcommax/patches-6.1/0027-v6.7-clk-qcom-apss-ipq6018-add-the-GPLL0-clock-also-as-cl.patch b/target/linux/qualcommax/patches-6.1/0027-v6.7-clk-qcom-apss-ipq6018-add-the-GPLL0-clock-also-as-cl.patch new file mode 100644 index 00000000000000..ddd53f9d4272e8 --- /dev/null +++ b/target/linux/qualcommax/patches-6.1/0027-v6.7-clk-qcom-apss-ipq6018-add-the-GPLL0-clock-also-as-cl.patch @@ -0,0 +1,43 @@ +From c917237a7cb17b97cc48e073881a9873f3caeaa2 Mon Sep 17 00:00:00 2001 +From: Kathiravan Thirumoorthy +Date: Thu, 14 Sep 2023 12:29:57 +0530 +Subject: [PATCH] clk: qcom: apss-ipq6018: add the GPLL0 clock also as clock + provider + +While the kernel is booting up, APSS PLL will be running at 800MHz with +GPLL0 as source. Once the cpufreq driver is available, APSS PLL will be +configured and select the rate based on the opp table and the source will +be changed to APSS_PLL_EARLY. + +Without this patch, CPU Freq driver reports that CPU is running at 24MHz +instead of the 800MHz. + +Reviewed-by: Konrad Dybcio +Tested-by: Robert Marko +Signed-off-by: Kathiravan Thirumoorthy +--- + drivers/clk/qcom/apss-ipq6018.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/clk/qcom/apss-ipq6018.c ++++ b/drivers/clk/qcom/apss-ipq6018.c +@@ -20,16 +20,19 @@ + + enum { + P_XO, ++ P_GPLL0, + P_APSS_PLL_EARLY, + }; + + static const struct clk_parent_data parents_apcs_alias0_clk_src[] = { + { .fw_name = "xo" }, ++ { .fw_name = "gpll0" }, + { .fw_name = "pll" }, + }; + + static const struct parent_map parents_apcs_alias0_clk_src_map[] = { + { P_XO, 0 }, ++ { P_GPLL0, 4 }, + { P_APSS_PLL_EARLY, 5 }, + }; + diff --git a/target/linux/qualcommax/patches-6.1/0028-v6.7-arm64-dts-qcom-ipq8074-include-the-GPLL0-as-clock-pr.patch b/target/linux/qualcommax/patches-6.1/0028-v6.7-arm64-dts-qcom-ipq8074-include-the-GPLL0-as-clock-pr.patch new file mode 100644 index 00000000000000..5ae4fb56716f81 --- /dev/null +++ b/target/linux/qualcommax/patches-6.1/0028-v6.7-arm64-dts-qcom-ipq8074-include-the-GPLL0-as-clock-pr.patch @@ -0,0 +1,32 @@ +From 3b48a7d925a757b3fa53c04baaf68bb8313c3ffb Mon Sep 17 00:00:00 2001 +From: Kathiravan Thirumoorthy +Date: Thu, 14 Sep 2023 12:29:58 +0530 +Subject: [PATCH] arm64: dts: qcom: ipq8074: include the GPLL0 as clock + provider for mailbox + +While the kernel is booting up, APSS PLL will be running at 800MHz with +GPLL0 as source. Once the cpufreq driver is available, APSS PLL will be +configured to the rate based on the opp table and the source also will +be changed to APSS_PLL_EARLY. So allow the mailbox to consume the GPLL0, +with this inclusion, CPU Freq correctly reports that CPU is running at +800MHz rather than 24MHz. + +Signed-off-by: Kathiravan Thirumoorthy +Reviewed-by: Konrad Dybcio +--- + arch/arm64/boot/dts/qcom/ipq8074.dtsi | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi ++++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi +@@ -682,8 +682,8 @@ + apcs_glb: mailbox@b111000 { + compatible = "qcom,ipq8074-apcs-apps-global"; + reg = <0x0b111000 0x1000>; +- clocks = <&a53pll>, <&xo>; +- clock-names = "pll", "xo"; ++ clocks = <&a53pll>, <&xo>, <&gcc GPLL0>; ++ clock-names = "pll", "xo", "gpll0"; + + #clock-cells = <1>; + #mbox-cells = <1>; diff --git a/target/linux/qualcommax/patches-6.1/0029-v6.3-dt-bindings-arm-qcom-ids-Add-IDs-for-IPQ5332-and-its.patch b/target/linux/qualcommax/patches-6.1/0029-v6.3-dt-bindings-arm-qcom-ids-Add-IDs-for-IPQ5332-and-its.patch new file mode 100644 index 00000000000000..61bb3f6c374879 --- /dev/null +++ b/target/linux/qualcommax/patches-6.1/0029-v6.3-dt-bindings-arm-qcom-ids-Add-IDs-for-IPQ5332-and-its.patch @@ -0,0 +1,27 @@ +From c0877a26b7ee54ef30d16ffdcdd37f2bcffe518e Mon Sep 17 00:00:00 2001 +From: Kathiravan T +Date: Wed, 8 Feb 2023 11:27:08 +0530 +Subject: [PATCH] dt-bindings: arm: qcom,ids: Add IDs for IPQ5332 and its + variant + +Add SOC ID for Qualcomm IPQ5332 and IPQ5322 variants. + +Signed-off-by: Kathiravan T +Acked-by: Krzysztof Kozlowski +Signed-off-by: Bjorn Andersson +Link: https://lore.kernel.org/r/20230208055709.13162-2-quic_kathirav@quicinc.com +--- + include/dt-bindings/arm/qcom,ids.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/include/dt-bindings/arm/qcom,ids.h ++++ b/include/dt-bindings/arm/qcom,ids.h +@@ -143,6 +143,8 @@ + #define QCOM_ID_SC7280 487 + #define QCOM_ID_SC7180P 495 + #define QCOM_ID_SM6375 507 ++#define QCOM_ID_IPQ5332 592 ++#define QCOM_ID_IPQ5322 593 + + /* + * The board type and revision information, used by Qualcomm bootloaders and diff --git a/target/linux/qualcommax/patches-6.1/0030-v6.4-dt-bindings-arm-qcom-ids-Add-IDs-for-IPQ9574-and-its.patch b/target/linux/qualcommax/patches-6.1/0030-v6.4-dt-bindings-arm-qcom-ids-Add-IDs-for-IPQ9574-and-its.patch new file mode 100644 index 00000000000000..7d80e4c1fdd5c0 --- /dev/null +++ b/target/linux/qualcommax/patches-6.1/0030-v6.4-dt-bindings-arm-qcom-ids-Add-IDs-for-IPQ9574-and-its.patch @@ -0,0 +1,33 @@ +From 725352e15e1d030885611a546eb1f2884851a407 Mon Sep 17 00:00:00 2001 +From: Varadarajan Narayanan +Date: Tue, 14 Mar 2023 11:43:33 +0530 +Subject: [PATCH] dt-bindings: arm: qcom,ids: Add IDs for IPQ9574 and its + variants + +Add SOC ID for Qualcomm IPQ9574, IPQ9570, IPQ9554, IPQ9550, +IPQ9514 and IPQ9510 + +Signed-off-by: Varadarajan Narayanan +Acked-by: Krzysztof Kozlowski +Reviewed-by: Kathiravan T +Signed-off-by: Bjorn Andersson +Link: https://lore.kernel.org/r/1678774414-14414-2-git-send-email-quic_varada@quicinc.com +--- + include/dt-bindings/arm/qcom,ids.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/include/dt-bindings/arm/qcom,ids.h ++++ b/include/dt-bindings/arm/qcom,ids.h +@@ -143,6 +143,12 @@ + #define QCOM_ID_SC7280 487 + #define QCOM_ID_SC7180P 495 + #define QCOM_ID_SM6375 507 ++#define QCOM_ID_IPQ9514 510 ++#define QCOM_ID_IPQ9550 511 ++#define QCOM_ID_IPQ9554 512 ++#define QCOM_ID_IPQ9570 513 ++#define QCOM_ID_IPQ9574 514 ++#define QCOM_ID_IPQ9510 521 + #define QCOM_ID_IPQ5332 592 + #define QCOM_ID_IPQ5322 593 + diff --git a/target/linux/qualcommax/patches-6.1/0031-v6.5-dt-bindings-arm-qcom-ids-add-SoC-ID-for-IPQ5312-and-.patch b/target/linux/qualcommax/patches-6.1/0031-v6.5-dt-bindings-arm-qcom-ids-add-SoC-ID-for-IPQ5312-and-.patch new file mode 100644 index 00000000000000..ad70e7b6c9e4d4 --- /dev/null +++ b/target/linux/qualcommax/patches-6.1/0031-v6.5-dt-bindings-arm-qcom-ids-add-SoC-ID-for-IPQ5312-and-.patch @@ -0,0 +1,28 @@ +From 614c778cf0d570642c50715adfa0b70930d8cf29 Mon Sep 17 00:00:00 2001 +From: Kathiravan T +Date: Tue, 9 May 2023 09:05:30 +0530 +Subject: [PATCH] dt-bindings: arm: qcom,ids: add SoC ID for IPQ5312 and + IPQ5302 + +Add the SoC ID for IPQ5312 and IPQ5302, which belong to the family of +IPQ5332 SoC. + +Reviewed-by: Krzysztof Kozlowski +Signed-off-by: Kathiravan T +Signed-off-by: Bjorn Andersson +Link: https://lore.kernel.org/r/20230509033531.21468-2-quic_kathirav@quicinc.com +--- + include/dt-bindings/arm/qcom,ids.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/include/dt-bindings/arm/qcom,ids.h ++++ b/include/dt-bindings/arm/qcom,ids.h +@@ -151,6 +151,8 @@ + #define QCOM_ID_IPQ9510 521 + #define QCOM_ID_IPQ5332 592 + #define QCOM_ID_IPQ5322 593 ++#define QCOM_ID_IPQ5312 594 ++#define QCOM_ID_IPQ5302 595 + + /* + * The board type and revision information, used by Qualcomm bootloaders and diff --git a/target/linux/qualcommax/patches-6.1/0032-v6.5-dt-bindings-arm-qcom-ids-add-SoC-ID-for-IPQ5300.patch b/target/linux/qualcommax/patches-6.1/0032-v6.5-dt-bindings-arm-qcom-ids-add-SoC-ID-for-IPQ5300.patch new file mode 100644 index 00000000000000..7925a0994d80f6 --- /dev/null +++ b/target/linux/qualcommax/patches-6.1/0032-v6.5-dt-bindings-arm-qcom-ids-add-SoC-ID-for-IPQ5300.patch @@ -0,0 +1,25 @@ +From b3c72f2795467e3d43ee429b0ebd5f523ec08f60 Mon Sep 17 00:00:00 2001 +From: Kathiravan T +Date: Mon, 5 Jun 2023 13:35:28 +0530 +Subject: [PATCH] dt-bindings: arm: qcom,ids: add SoC ID for IPQ5300 + +Add the SoC ID for IPQ5300, which belong to the family of IPQ5332 SoC. + +Acked-by: Krzysztof Kozlowski +Signed-off-by: Kathiravan T +Signed-off-by: Bjorn Andersson +Link: https://lore.kernel.org/r/20230605080531.3879-2-quic_kathirav@quicinc.com +--- + include/dt-bindings/arm/qcom,ids.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/include/dt-bindings/arm/qcom,ids.h ++++ b/include/dt-bindings/arm/qcom,ids.h +@@ -153,6 +153,7 @@ + #define QCOM_ID_IPQ5322 593 + #define QCOM_ID_IPQ5312 594 + #define QCOM_ID_IPQ5302 595 ++#define QCOM_ID_IPQ5300 624 + + /* + * The board type and revision information, used by Qualcomm bootloaders and diff --git a/target/linux/qualcommax/patches-6.1/0100-clk-qcom-clk-rcg2-introduce-support-for-multiple-con.patch b/target/linux/qualcommax/patches-6.1/0100-clk-qcom-clk-rcg2-introduce-support-for-multiple-con.patch index 5713775948dca2..9aa0a7952c9f3c 100644 --- a/target/linux/qualcommax/patches-6.1/0100-clk-qcom-clk-rcg2-introduce-support-for-multiple-con.patch +++ b/target/linux/qualcommax/patches-6.1/0100-clk-qcom-clk-rcg2-introduce-support-for-multiple-con.patch @@ -64,7 +64,7 @@ Signed-off-by: Christian Marangi /** --- a/drivers/clk/qcom/clk-rcg2.c +++ b/drivers/clk/qcom/clk-rcg2.c -@@ -209,11 +209,60 @@ clk_rcg2_recalc_rate(struct clk_hw *hw, +@@ -203,11 +203,60 @@ clk_rcg2_recalc_rate(struct clk_hw *hw, return __clk_rcg2_recalc_rate(hw, parent_rate, cfg); } @@ -125,7 +125,7 @@ Signed-off-by: Christian Marangi struct clk_hw *p; struct clk_rcg2 *rcg = to_clk_rcg2(hw); int index; -@@ -232,7 +281,15 @@ static int _freq_tbl_determine_rate(stru +@@ -226,7 +275,15 @@ static int _freq_tbl_determine_rate(stru if (!f) return -EINVAL; @@ -142,7 +142,7 @@ Signed-off-by: Christian Marangi if (index < 0) return index; -@@ -242,18 +299,18 @@ static int _freq_tbl_determine_rate(stru +@@ -236,18 +293,18 @@ static int _freq_tbl_determine_rate(stru return -EINVAL; if (clk_flags & CLK_SET_RATE_PARENT) { @@ -167,7 +167,7 @@ Signed-off-by: Christian Marangi rate = tmp; } } else { -@@ -261,7 +318,7 @@ static int _freq_tbl_determine_rate(stru +@@ -255,7 +312,7 @@ static int _freq_tbl_determine_rate(stru } req->best_parent_hw = p; req->best_parent_rate = rate; @@ -176,7 +176,7 @@ Signed-off-by: Christian Marangi return 0; } -@@ -357,6 +414,7 @@ static int __clk_rcg2_set_rate(struct cl +@@ -351,6 +408,7 @@ static int __clk_rcg2_set_rate(struct cl { struct clk_rcg2 *rcg = to_clk_rcg2(hw); const struct freq_tbl *f; @@ -184,7 +184,7 @@ Signed-off-by: Christian Marangi switch (policy) { case FLOOR: -@@ -372,7 +430,15 @@ static int __clk_rcg2_set_rate(struct cl +@@ -366,7 +424,15 @@ static int __clk_rcg2_set_rate(struct cl if (!f) return -EINVAL; diff --git a/target/linux/qualcommax/patches-6.1/0101-clk-qcom-gcc-ipq8074-rework-nss_port5-6-clock-to-mul.patch b/target/linux/qualcommax/patches-6.1/0101-clk-qcom-gcc-ipq8074-rework-nss_port5-6-clock-to-mul.patch index 32fb2d9d872735..62a30bbb228131 100644 --- a/target/linux/qualcommax/patches-6.1/0101-clk-qcom-gcc-ipq8074-rework-nss_port5-6-clock-to-mul.patch +++ b/target/linux/qualcommax/patches-6.1/0101-clk-qcom-gcc-ipq8074-rework-nss_port5-6-clock-to-mul.patch @@ -23,7 +23,7 @@ Signed-off-by: Christian Marangi --- a/drivers/clk/qcom/gcc-ipq8074.c +++ b/drivers/clk/qcom/gcc-ipq8074.c -@@ -1682,13 +1682,21 @@ static struct clk_regmap_div nss_port4_t +@@ -1676,13 +1676,21 @@ static struct clk_regmap_div nss_port4_t }, }; @@ -49,7 +49,7 @@ Signed-off-by: Christian Marangi F(156250000, P_UNIPHY1_RX, 2, 0, 0), F(312500000, P_UNIPHY1_RX, 1, 0, 0), { } -@@ -1744,13 +1752,21 @@ static struct clk_regmap_div nss_port5_r +@@ -1738,13 +1746,21 @@ static struct clk_regmap_div nss_port5_r }, }; @@ -75,7 +75,7 @@ Signed-off-by: Christian Marangi F(156250000, P_UNIPHY1_TX, 2, 0, 0), F(312500000, P_UNIPHY1_TX, 1, 0, 0), { } -@@ -1806,13 +1822,21 @@ static struct clk_regmap_div nss_port5_t +@@ -1800,13 +1816,21 @@ static struct clk_regmap_div nss_port5_t }, }; @@ -101,7 +101,7 @@ Signed-off-by: Christian Marangi F(156250000, P_UNIPHY2_RX, 2, 0, 0), F(312500000, P_UNIPHY2_RX, 1, 0, 0), { } -@@ -1863,13 +1887,21 @@ static struct clk_regmap_div nss_port6_r +@@ -1857,13 +1881,21 @@ static struct clk_regmap_div nss_port6_r }, }; diff --git a/target/linux/qualcommax/patches-6.1/0118-clk-qcom-Add-WCSSAON-reset.patch b/target/linux/qualcommax/patches-6.1/0118-clk-qcom-Add-WCSSAON-reset.patch index 791531775ef0f8..be0524338daf20 100644 --- a/target/linux/qualcommax/patches-6.1/0118-clk-qcom-Add-WCSSAON-reset.patch +++ b/target/linux/qualcommax/patches-6.1/0118-clk-qcom-Add-WCSSAON-reset.patch @@ -15,7 +15,7 @@ Acked-by: Stephen Boyd --- a/drivers/clk/qcom/gcc-ipq8074.c +++ b/drivers/clk/qcom/gcc-ipq8074.c -@@ -4717,6 +4717,7 @@ static const struct qcom_reset_map gcc_i +@@ -4711,6 +4711,7 @@ static const struct qcom_reset_map gcc_i [GCC_NSSPORT4_RESET] = { .reg = 0x68014, .bitmask = BIT(27) | GENMASK(9, 8) }, [GCC_NSSPORT5_RESET] = { .reg = 0x68014, .bitmask = BIT(28) | GENMASK(11, 10) }, [GCC_NSSPORT6_RESET] = { .reg = 0x68014, .bitmask = BIT(29) | GENMASK(13, 12) }, diff --git a/target/linux/qualcommax/patches-6.1/0134-PCI-qcom-Fixing-broken-pcie-enumeration-for-2_3_3-co.patch b/target/linux/qualcommax/patches-6.1/0134-PCI-qcom-Fixing-broken-pcie-enumeration-for-2_3_3-co.patch deleted file mode 100644 index 1b34cdda461e9a..00000000000000 --- a/target/linux/qualcommax/patches-6.1/0134-PCI-qcom-Fixing-broken-pcie-enumeration-for-2_3_3-co.patch +++ /dev/null @@ -1,44 +0,0 @@ -From f92c2f22197b7beed59b81f2aa179e16987c02e4 Mon Sep 17 00:00:00 2001 -From: Sricharan Ramabadhran -Date: Mon, 24 Jul 2023 12:04:29 +0530 -Subject: [PATCH] PCI: qcom: Fixing broken pcie enumeration for 2_3_3 configs - ops - -PARF_SLV_ADDR_SPACE_SIZE_2_3_3 macro is used for IPQ8074 2_3_3 post_init. -PCIe slave addr register offset is 0x358, but was wrongly changed to -0x168 as a part of commit 39171b33f652 ("PCI: qcom: Remove PCIE20_ prefix -from register definitions"). Fixing it, by using the right macro and remove -the unused PARF_SLV_ADDR_SPACE_SIZE_2_3_3. - -Without this access to the registers of slave addr space like iATU etc -are broken leading to pcie enumeration failure. - -Fixes: 39171b33f652 ("PCI: qcom: Remove PCIE20_ prefix from register definitions") -Cc: -Reviewed-by: Manivannan Sadhasivam -Reviewed-by: Konrad Dybcio -Signed-off-by: Sricharan Ramabadhran ---- - drivers/pci/controller/dwc/pcie-qcom.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - ---- a/drivers/pci/controller/dwc/pcie-qcom.c -+++ b/drivers/pci/controller/dwc/pcie-qcom.c -@@ -40,7 +40,6 @@ - #define PARF_PHY_REFCLK 0x4c - #define PARF_CONFIG_BITS 0x50 - #define PARF_DBI_BASE_ADDR 0x168 --#define PARF_SLV_ADDR_SPACE_SIZE_2_3_3 0x16c /* Register offset specific to IP ver 2.3.3 */ - #define PARF_MHI_CLOCK_RESET_CTRL 0x174 - #define PARF_AXI_MSTR_WR_ADDR_HALT 0x178 - #define PARF_AXI_MSTR_WR_ADDR_HALT_V2 0x1a8 -@@ -1148,8 +1147,7 @@ static int qcom_pcie_post_init_2_3_3(str - u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP); - u32 val; - -- writel(SLV_ADDR_SPACE_SZ, -- pcie->parf + PARF_SLV_ADDR_SPACE_SIZE_2_3_3); -+ writel(SLV_ADDR_SPACE_SZ, pcie->parf + PARF_SLV_ADDR_SPACE_SIZE); - - val = readl(pcie->parf + PARF_PHY_CTRL); - val &= ~BIT(0); diff --git a/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts b/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts index 1142746c7afea5..bbd8c47a829498 100644 --- a/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts +++ b/target/linux/ramips/dts/mt7620a_aigale_ai-br100.dts @@ -76,6 +76,20 @@ label = "factory"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@40000 { @@ -110,15 +124,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts b/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts index 19b6d5fdfbadea..8ac74f70628a23 100644 --- a/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts +++ b/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts @@ -84,7 +84,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -135,6 +136,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -147,15 +166,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts b/target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts index 09afc018e8d28a..2325d53153daa7 100644 --- a/target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts +++ b/target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts @@ -192,6 +192,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -208,15 +222,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts b/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts index a90f9b2775d932..f5fa410090890e 100644 --- a/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts +++ b/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts @@ -165,6 +165,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -179,13 +189,3 @@ &wmac { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts b/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts index 4c72c642724b00..a32cb96f66fa88 100644 --- a/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts +++ b/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts @@ -123,6 +123,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; partition@50000 { @@ -143,7 +157,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -167,6 +182,7 @@ compatible = "pci1814,5592"; reg = <0x0000 0 0 0 0>; ralink,2ghz = <0>; - ralink,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts b/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts index 0710b255710186..b482b6dfc91371 100644 --- a/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts +++ b/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts @@ -8,6 +8,7 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_asus_rt-ac54u.dts b/target/linux/ramips/dts/mt7620a_asus_rt-ac54u.dts index acc60807b68705..2a94f5d29d0fd3 100644 --- a/target/linux/ramips/dts/mt7620a_asus_rt-ac54u.dts +++ b/target/linux/ramips/dts/mt7620a_asus_rt-ac54u.dts @@ -10,7 +10,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi b/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi index f61843095d555f..92119ff8127ccd 100644 --- a/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi +++ b/target/linux/ramips/dts/mt7620a_asus_rt-ac5x.dtsi @@ -82,6 +82,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -129,19 +147,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts b/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts index b95a428656e6d7..4d442825a97b4e 100644 --- a/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts +++ b/target/linux/ramips/dts/mt7620a_bdcom_wap2100-sk.dts @@ -85,6 +85,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -124,7 +142,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -134,7 +153,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -145,13 +165,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts index f71545815d62ae..17bf2f8272eed9 100644 --- a/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts +++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts @@ -117,6 +117,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -159,7 +177,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -170,17 +189,8 @@ wifi@0,0 { compatible = "pci0,0"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts index 4b960da312b965..85946ca1e0bb13 100644 --- a/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts +++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts @@ -117,6 +117,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -146,18 +160,9 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts index d943e3abef7d86..b571d122cf366e 100644 --- a/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts +++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts @@ -117,6 +117,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -146,7 +164,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -157,16 +176,7 @@ wifi@0,0 { compatible = "pci1814,5592"; reg = <0x0000 0 0 0 0>; - ralink,mtd-eeprom = <&factory 0x8000>; - }; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_cameo_810.dtsi b/target/linux/ramips/dts/mt7620a_cameo_810.dtsi index d0113f55603b42..d09f4d292ebdf0 100644 --- a/target/linux/ramips/dts/mt7620a_cameo_810.dtsi +++ b/target/linux/ramips/dts/mt7620a_cameo_810.dtsi @@ -84,6 +84,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + compatible = "mac-base"; + reg = <0x28 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; factory5g: partition@50000 { @@ -127,7 +147,7 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_28>; + nvmem-cells = <&macaddr_factory_28 0>; nvmem-cell-names = "mac-address"; mediatek,portmap = "llllw"; @@ -141,10 +161,8 @@ pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; - - ralink,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_factory_28>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_28 0>; + nvmem-cell-names = "eeprom", "mac-address"; }; &pcie { @@ -154,20 +172,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_28>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; - }; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_28 2>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts b/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts index 2884bfdb0460dc..6d5d461c8fa5fe 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts @@ -122,6 +122,20 @@ label = "factory"; reg = <0x34000 0x4000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; nvram: partition@38000 { @@ -173,18 +187,9 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts b/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts index 1d29bed6f0650c..febfd2e32eda96 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts @@ -97,6 +97,22 @@ label = "config"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_config_e05d: eeprom@e05d { + reg = <0xe05d 0x200>; + }; + + macaddr_config_e490: macaddr@e490 { + compatible = "mac-base"; + reg = <0xe490 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -117,10 +133,8 @@ &pcie0 { mt76x0e@0,0 { reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_config_e490>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(2)>; - mediatek,mtd-eeprom = <&config 0xe05d>; + nvmem-cells = <&eeprom_config_e05d>, <&macaddr_config_e490 2>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -130,13 +144,3 @@ function = "gpio"; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_e490: macaddr@e490 { - reg = <0xe490 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts b/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts old mode 100755 new mode 100644 index b7fc063b7fb266..52739f511461f9 --- a/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dir-806a-b1.dts @@ -94,6 +94,32 @@ label = "Factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_8004: macaddr@8004 { + compatible = "mac-base"; + reg = <0x8004 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -114,9 +140,8 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &wmac { @@ -124,10 +149,8 @@ pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; - ralink,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4 (-1)>; + nvmem-cell-names = "eeprom", "mac-address"; }; &pcie { @@ -137,29 +160,12 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - - nvmem-cells = <&macaddr_factory_8004>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(-3)>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_8004 (-3)>; + nvmem-cell-names = "eeprom", "mac-address"; led { led-active-low; }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts index 8ae566d448b999..97fc4f0935c45b 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts @@ -118,6 +118,22 @@ label = "config"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_config_e083: eeprom@e083 { + reg = <0xe083 0x200>; + }; + + macaddr_config_e496: macaddr@e496 { + compatible = "mac-base"; + reg = <0xe496 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -145,10 +161,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_config_e496>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(2)>; - mediatek,mtd-eeprom = <&config 0xe083>; + nvmem-cells = <&eeprom_config_e083>, <&macaddr_config_e496 2>; + nvmem-cell-names = "eeprom", "mac-address"; led { led-sources = <0>; @@ -192,13 +206,3 @@ mediatek,port4-gmac; mediatek,ephy-base = /bits/ 8 <8>; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_e496: macaddr@e496 { - reg = <0xe496 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts index 42f5c861609b8a..5f11b73ad9e40d 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts @@ -115,6 +115,18 @@ label = "config"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_e4a8: macaddr@e4a8 { + compatible = "mac-base"; + reg = <0xe4a8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -143,9 +155,8 @@ wifi@0,0 { reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_config_e4a8>; + nvmem-cells = <&macaddr_config_e4a8 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(2)>; led { led-sources = <2>; @@ -180,13 +191,3 @@ mediatek,port4-gmac; mediatek,ephy-base = /bits/ 8 <2>; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_e4a8: macaddr@e4a8 { - reg = <0xe4a8 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-960.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-960.dts index 3de9533edc7bff..c1fff81452154d 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-960.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-960.dts @@ -30,5 +30,6 @@ }; &wifi { - mediatek,mtd-eeprom = <&config 0xe08e>; + nvmem-cells = <&eeprom_config_e08e>, <&macaddr_config_e50e 2>; + nvmem-cell-names = "eeprom", "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-961-a1.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-961-a1.dts index 7eae66666881b4..c4220592e8496f 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-961-a1.dts +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-961-a1.dts @@ -58,5 +58,6 @@ }; &wifi { - mediatek,mtd-eeprom = <&config 0xe29e>; + nvmem-cells = <&eeprom_config_e29e>, <&macaddr_config_e50e 2>; + nvmem-cell-names = "eeprom", "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-96x.dtsi b/target/linux/ramips/dts/mt7620a_dlink_dwr-96x.dtsi index a5fd705eba9e94..11cd15922cc161 100644 --- a/target/linux/ramips/dts/mt7620a_dlink_dwr-96x.dtsi +++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-96x.dtsi @@ -120,9 +120,6 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_config_e50e>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(2)>; }; }; @@ -154,16 +151,28 @@ }; config: partition@ff0000 { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - label = "config"; reg = <0xff0000 0x10000>; read-only; - macaddr_config_e50e: macaddr@e50e { - reg = <0xe50e 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_config_e08e: eeprom@e08e { + reg = <0xe08e 0x200>; + }; + + eeprom_config_e29e: eeprom@e29e { + reg = <0xe29e 0x200>; + }; + + macaddr_config_e50e: macaddr@e50e { + compatible = "mac-base"; + reg = <0xe50e 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7620a_domywifi.dtsi b/target/linux/ramips/dts/mt7620a_domywifi.dtsi index 9a96b0a2759ff9..778de63f1bc9db 100644 --- a/target/linux/ramips/dts/mt7620a_domywifi.dtsi +++ b/target/linux/ramips/dts/mt7620a_domywifi.dtsi @@ -117,6 +117,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -164,7 +182,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -175,15 +194,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts b/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts index ba1a2becdab6b9..821aa04f9531e9 100644 --- a/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts +++ b/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts @@ -82,6 +82,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; partition@50000 { @@ -153,7 +163,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts b/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts index 5f1c01b35e9090..34b62a025aa0ad 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_br-6208ac-v2.dts @@ -144,6 +144,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + }; }; // Cimage @@ -187,7 +209,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -197,21 +220,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts index cc902888baec5a..486f6399df4911 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts @@ -102,6 +102,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -183,7 +201,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -193,8 +212,9 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - mediatek,2ghz = <0>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; + ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -205,13 +225,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts index bc73c197c0dfba..5759774f6ee210 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts @@ -94,6 +94,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -175,7 +193,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -185,8 +204,9 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - mediatek,2ghz = <0>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; + ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -197,13 +217,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi index abac0208d0722b..eb21ff7d6f9676 100644 --- a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi +++ b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi @@ -83,6 +83,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -122,7 +142,7 @@ pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &mdio_pins &phy_reset_pins>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; phy-reset-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; @@ -174,9 +194,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4 0>; + nvmem-cell-names = "eeprom", "mac-address"; }; &pcie { @@ -186,20 +205,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; - }; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_4 2>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_engenius_epg600.dts b/target/linux/ramips/dts/mt7620a_engenius_epg600.dts index 311103f3e86e52..f64676d8fbb433 100644 --- a/target/linux/ramips/dts/mt7620a_engenius_epg600.dts +++ b/target/linux/ramips/dts/mt7620a_engenius_epg600.dts @@ -119,12 +119,36 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + }; }; rf: partition@50000 { label = "rf"; reg = <0x50000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_rf_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_rf_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@60000 { @@ -194,12 +218,14 @@ wifi@0,1,0 { compatible = "pci1814,3091"; reg = <0x0 1 0 0 0>; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; &wmac { - ralink,mtd-eeprom = <&rf 0x0>; + nvmem-cells = <&eeprom_rf_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -216,13 +242,3 @@ function = "gpio"; }; }; - -&rf { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_rf_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_engenius_esr600.dts b/target/linux/ramips/dts/mt7620a_engenius_esr600.dts index 267525a0fcebbd..beee73f11c8749 100644 --- a/target/linux/ramips/dts/mt7620a_engenius_esr600.dts +++ b/target/linux/ramips/dts/mt7620a_engenius_esr600.dts @@ -101,12 +101,36 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + }; }; iNIC_rf: partition@50000 { label = "iNIC_rf"; reg = <0x50000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_iNIC_rf_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_iNIC_rf_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@60000 { @@ -179,12 +203,14 @@ wifi@0,0 { compatible = "pci1814,5592"; reg = <0x0 0 0 0 0>; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; &wmac { - ralink,mtd-eeprom = <&iNIC_rf 0x0>; + nvmem-cells = <&eeprom_iNIC_rf_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -194,13 +220,3 @@ &ohci { status = "okay"; }; - -&iNIC_rf { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_iNIC_rf_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_fon_fon2601.dts b/target/linux/ramips/dts/mt7620a_fon_fon2601.dts index 8f95204ad19deb..7adf0faf868d22 100644 --- a/target/linux/ramips/dts/mt7620a_fon_fon2601.dts +++ b/target/linux/ramips/dts/mt7620a_fon_fon2601.dts @@ -80,6 +80,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -142,7 +160,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>, <&wled_pins>; @@ -156,7 +175,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -168,13 +188,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts index 9c9b3d3bf9fcf5..122654d6792616 100644 --- a/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts +++ b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts @@ -98,6 +98,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4000: macaddr@4000 { + reg = <0x4000 0x6>; + }; + }; }; partition@50000 { @@ -134,7 +148,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -143,13 +158,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4000: macaddr@4000 { - reg = <0x4000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts index 70d0827ed2bbe2..9b21689d8d1195 100644 --- a/target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts +++ b/target/linux/ramips/dts/mt7620a_glinet_gl-mt300n.dts @@ -93,6 +93,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4000: macaddr@4000 { + reg = <0x4000 0x6>; + }; + }; }; partition@50000 { @@ -125,7 +139,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -134,13 +149,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4000: macaddr@4000 { - reg = <0x4000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts b/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts index 9ee19686b760d9..b595c581fe9468 100644 --- a/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts +++ b/target/linux/ramips/dts/mt7620a_glinet_gl-mt750.dts @@ -93,6 +93,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4000: macaddr@4000 { + reg = <0x4000 0x6>; + }; + }; }; partition@50000 { @@ -129,7 +147,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -139,7 +158,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; @@ -149,13 +169,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4000: macaddr@4000 { - reg = <0x4000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts b/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts index 10c9958e0a6e5a..db00daaec225e2 100644 --- a/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts +++ b/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts @@ -85,6 +85,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; firmware: partition@50000 { @@ -156,7 +174,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -175,7 +194,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -183,13 +203,3 @@ &uart { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_hiwifi_hc5761.dts b/target/linux/ramips/dts/mt7620a_hiwifi_hc5761.dts index d1a7f69e176549..741a466769632d 100644 --- a/target/linux/ramips/dts/mt7620a_hiwifi_hc5761.dts +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5761.dts @@ -64,7 +64,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts b/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts index 87eacb13d7802f..3f3ed3313f0fe3 100644 --- a/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts @@ -70,7 +70,7 @@ ðernet { pinctrl-names = "default"; - pinctrl-0 = <&rgmii1_pins &mdio_pins>; + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; nvmem-cells = <&macaddr_factory_4>; nvmem-cell-names = "mac-address"; @@ -93,6 +93,10 @@ }; }; +&gsw { + mediatek,ephy-base = /bits/ 8 <12>; +}; + &pcie { status = "okay"; }; @@ -101,7 +105,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi b/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi index 4c24857df1d102..885c1bac49c17b 100644 --- a/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5x61.dtsi @@ -55,6 +55,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -96,7 +114,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -105,13 +124,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_hnet_c108.dts b/target/linux/ramips/dts/mt7620a_hnet_c108.dts index 4c241a84de7092..60c6b2a7d4ae51 100644 --- a/target/linux/ramips/dts/mt7620a_hnet_c108.dts +++ b/target/linux/ramips/dts/mt7620a_hnet_c108.dts @@ -112,6 +112,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -141,7 +155,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -154,13 +169,3 @@ &pcie { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_humax_e2.dts b/target/linux/ramips/dts/mt7620a_humax_e2.dts index 2a2ad9043d8dd4..453208eb34ed90 100644 --- a/target/linux/ramips/dts/mt7620a_humax_e2.dts +++ b/target/linux/ramips/dts/mt7620a_humax_e2.dts @@ -92,12 +92,22 @@ reg = <0x40000 0x30000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_10007: macaddr@10007 { - reg = <0x10007 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_10007: macaddr@10007 { + reg = <0x10007 0x6>; + }; }; }; @@ -125,13 +135,15 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { diff --git a/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts b/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts index 5eca06fcb93cc9..6f95bd015149f4 100644 --- a/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts +++ b/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts @@ -94,12 +94,36 @@ label = "factory"; reg = <0x40000 0x8000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; iNIC_rf: partition@48000 { label = "iNIC_rf"; reg = <0x48000 0x8000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_iNIC_rf_0: eeprom@0 { + reg = <0x0 0x200>; + }; + }; }; partition@50000 { @@ -203,21 +227,13 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&iNIC_rf 0x0>; + nvmem-cells = <&eeprom_iNIC_rf_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts b/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts index 9997e5cecf399d..bc674fa4b3044f 100644 --- a/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts +++ b/target/linux/ramips/dts/mt7620a_iodata_wn-ac733gr3.dts @@ -108,12 +108,36 @@ label = "factory"; reg = <0x40000 0x8000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; iNIC_rf: partition@48000 { label = "iNIC_rf"; reg = <0x48000 0x8000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_iNIC_rf_0: eeprom@0 { + reg = <0x0 0x200>; + }; + }; }; partition@50000 { @@ -181,21 +205,13 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&iNIC_rf 0x0>; + nvmem-cells = <&eeprom_iNIC_rf_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_iptime.dtsi b/target/linux/ramips/dts/mt7620a_iptime.dtsi index 26727893715f18..2b7421de9b79f5 100644 --- a/target/linux/ramips/dts/mt7620a_iptime.dtsi +++ b/target/linux/ramips/dts/mt7620a_iptime.dtsi @@ -32,6 +32,24 @@ label = "u-boot"; reg = <0x0 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_uboot_1f400: eeprom@1f400 { + reg = <0x1f400 0x200>; + }; + + eeprom_uboot_1f800: eeprom@1f800 { + reg = <0x1f800 0x200>; + }; + + macaddr_uboot_1fc20: macaddr@1fc20 { + reg = <0x1fc20 0x6>; + }; + }; }; partition@20000 { @@ -69,7 +87,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&uboot 0x1f800>; + nvmem-cells = <&eeprom_uboot_1f800>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -82,16 +101,6 @@ &wmac { pinctrl-names = "default"; pinctrl-0 = <&wled_pins>; - - ralink,mtd-eeprom = <&uboot 0x1f400>; -}; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc20: macaddr@1fc20 { - reg = <0x1fc20 0x6>; - }; + nvmem-cells = <&eeprom_uboot_1f400>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_kimax_u25awf-h1.dts b/target/linux/ramips/dts/mt7620a_kimax_u25awf-h1.dts index 87e6222c534e8f..772cab32e2ae0b 100644 --- a/target/linux/ramips/dts/mt7620a_kimax_u25awf-h1.dts +++ b/target/linux/ramips/dts/mt7620a_kimax_u25awf-h1.dts @@ -76,6 +76,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -101,7 +115,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -110,13 +125,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts index 07355a05a5ad3f..f43aa2d3bca643 100644 --- a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts +++ b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts @@ -95,6 +95,22 @@ label = "config"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_config_e08a: eeprom@e08a { + reg = <0xe08a 0x200>; + }; + + macaddr_config_e07e: macaddr@e07e { + compatible = "mac-base"; + reg = <0xe07e 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -150,10 +166,8 @@ &pcie0 { mt76x0e@0,0 { reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_config_e07e>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(2)>; - mediatek,mtd-eeprom = <&config 0xe08a>; + nvmem-cells = <&eeprom_config_e08a>, <&macaddr_config_e07e 2>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -163,13 +177,3 @@ function = "gpio"; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_e07e: macaddr@e07e { - reg = <0xe07e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts b/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts index 5368f939a2b6ea..cefc3c3e925de8 100644 --- a/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts +++ b/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts @@ -68,6 +68,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -141,7 +159,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -153,7 +172,8 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; led { led-sources = <2>; @@ -169,13 +189,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts index bff117b7295196..24b79711c5e4af 100644 --- a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts +++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts @@ -58,13 +58,3 @@ mediatek,portmap = "llllw"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi index 5e834d291dc6b2..4ba9779dfdc796 100644 --- a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi +++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dtsi @@ -58,6 +58,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -84,7 +102,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -93,8 +112,8 @@ pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; - - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { diff --git a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts index 2b59351bd89e83..f1d2c873371166 100644 --- a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts +++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts @@ -115,13 +115,3 @@ mediatek,port4-gmac; mediatek,ephy-base = /bits/ 8 <8>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_linksys_e1700.dts b/target/linux/ramips/dts/mt7620a_linksys_e1700.dts index 862f28e399f556..4310f9dfc7fadf 100644 --- a/target/linux/ramips/dts/mt7620a_linksys_e1700.dts +++ b/target/linux/ramips/dts/mt7620a_linksys_e1700.dts @@ -79,6 +79,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -150,15 +164,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts b/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts index ceecafa0669849..afba7a06f33a0e 100644 --- a/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts +++ b/target/linux/ramips/dts/mt7620a_microduino_microwrt.dts @@ -57,6 +57,20 @@ label = "factory"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@40000 { @@ -87,7 +101,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -96,13 +111,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts b/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts index 25287ebc0bc6be..34c3d4f42d878e 100644 --- a/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts +++ b/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts @@ -96,6 +96,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -115,8 +129,9 @@ }; ðernet { - mtd-mac-address = <&factory 0x28>; mediatek,portmap = "llllw"; + nvmem-cells = <&macaddr_factory_28>; + nvmem-cell-names = "mac-address"; }; &ehci { @@ -128,5 +143,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts b/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts index e09d9c607b8866..79b622b1bb38c1 100644 --- a/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts +++ b/target/linux/ramips/dts/mt7620a_netgear_ex2700.dts @@ -115,6 +115,24 @@ label = "art"; reg = <0x3f0000 0x10000>; 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>; + }; + + eeprom_art_1000: eeprom@1000 { + reg = <0x1000 0x200>; + }; + }; }; }; }; @@ -126,10 +144,8 @@ }; &wmac { - ralink,mtd-eeprom = <&art 0x1000>; - - nvmem-cells = <&macaddr_art_6>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_art_1000>, <&macaddr_art_6>; + nvmem-cell-names = "eeprom", "mac-address"; }; &state_default { @@ -138,17 +154,3 @@ function = "gpio"; }; }; - -&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/ramips/dts/mt7620a_netgear_ex3x00_ex61xx.dtsi b/target/linux/ramips/dts/mt7620a_netgear_ex3x00_ex61xx.dtsi index 6884bf7943af86..fe26c3b8594945 100644 --- a/target/linux/ramips/dts/mt7620a_netgear_ex3x00_ex61xx.dtsi +++ b/target/linux/ramips/dts/mt7620a_netgear_ex3x00_ex61xx.dtsi @@ -101,6 +101,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -131,7 +149,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -142,7 +161,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -152,12 +172,3 @@ }; }; -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_netgear_wn3x00rp.dtsi b/target/linux/ramips/dts/mt7620a_netgear_wn3x00rp.dtsi index 914d4e6bba4088..8810742e6718d4 100644 --- a/target/linux/ramips/dts/mt7620a_netgear_wn3x00rp.dtsi +++ b/target/linux/ramips/dts/mt7620a_netgear_wn3x00rp.dtsi @@ -119,6 +119,24 @@ label = "art"; reg = <0x7f0000 0x10000>; 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>; + }; + + eeprom_art_1000: eeprom@1000 { + reg = <0x1000 0x200>; + }; + }; }; }; }; @@ -130,10 +148,8 @@ }; &wmac { - ralink,mtd-eeprom = <&art 0x1000>; - - nvmem-cells = <&macaddr_art_6>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_art_1000>, <&macaddr_art_6>; + nvmem-cell-names = "eeprom", "mac-address"; }; &state_default { @@ -142,17 +158,3 @@ function = "gpio"; }; }; - -&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/ramips/dts/mt7620a_netis_wf2770.dts b/target/linux/ramips/dts/mt7620a_netis_wf2770.dts index 2a0e52cee261e8..c2ef1426231388 100644 --- a/target/linux/ramips/dts/mt7620a_netis_wf2770.dts +++ b/target/linux/ramips/dts/mt7620a_netis_wf2770.dts @@ -77,6 +77,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -155,21 +173,13 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts b/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts index a691f4203fef53..2c503db80dece9 100644 --- a/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts +++ b/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts @@ -76,6 +76,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -105,7 +119,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &sdhci { @@ -119,13 +134,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_phicomm_k2x.dtsi b/target/linux/ramips/dts/mt7620a_phicomm_k2x.dtsi index a8a900eac19e75..588789239f09e3 100644 --- a/target/linux/ramips/dts/mt7620a_phicomm_k2x.dtsi +++ b/target/linux/ramips/dts/mt7620a_phicomm_k2x.dtsi @@ -72,6 +72,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; }; }; @@ -91,7 +109,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -102,15 +121,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts b/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts index 4e123c32bde5c0..74faef8dea62f1 100644 --- a/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts +++ b/target/linux/ramips/dts/mt7620a_phicomm_psg1208.dts @@ -67,19 +67,37 @@ read-only; }; - partition@20000 { + partition@30000 { label = "u-boot-env"; reg = <0x30000 0x10000>; read-only; }; - factory: partition@30000 { + factory: partition@40000 { label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; - partition@40000 { + partition@50000 { compatible = "denx,uimage"; label = "firmware"; reg = <0x50000 0x7b0000>; @@ -112,21 +130,13 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts b/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts index e095401c4e6a9c..eeeb7cf65766fa 100644 --- a/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts +++ b/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts @@ -83,6 +83,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -136,15 +150,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts b/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts index 7d875c24fcb0a0..53c0215e0ce619 100644 --- a/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts +++ b/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts @@ -67,6 +67,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -96,15 +110,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts index bfa4dac6f1ba6f..3c6f7c582ef7ab 100644 --- a/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts @@ -87,6 +87,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -116,7 +134,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -126,16 +145,7 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - }; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts index ab53f678f5cda8..2879f6d870f473 100644 --- a/target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-ex300np.dts @@ -102,6 +102,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -136,15 +150,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts index 6fc95214a29951..de4df5d277d4b7 100644 --- a/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts +++ b/target/linux/ramips/dts/mt7620a_planex_mzk-ex750np.dts @@ -107,6 +107,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -141,7 +159,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -151,16 +170,7 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - }; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts index b7a71c3e25ad10..02481e5e5575b8 100644 --- a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts +++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts @@ -53,6 +53,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; partition@50000 { @@ -82,7 +92,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_rostelecom_rt-fl-1.dts b/target/linux/ramips/dts/mt7620a_rostelecom_rt-fl-1.dts new file mode 100644 index 00000000000000..14081ba72efada --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_rostelecom_rt-fl-1.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620a_sercomm_cpj.dtsi" + +/ { + compatible = "rostelecom,rt-fl-1", "ralink,mt7620a-soc"; + model = "Rostelecom RT-FL-1"; +}; diff --git a/target/linux/ramips/dts/mt7620a_rostelecom_s1010.dts b/target/linux/ramips/dts/mt7620a_rostelecom_s1010.dts new file mode 100644 index 00000000000000..37ce9eda41f3a2 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_rostelecom_s1010.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620a_sercomm_cpj.dtsi" + +/ { + compatible = "rostelecom,s1010", "ralink,mt7620a-soc"; + model = "Rostelecom S1010"; +}; diff --git a/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts b/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts index 6b1edabc1ab7fc..415ecf1bd9fab1 100644 --- a/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts +++ b/target/linux/ramips/dts/mt7620a_sanlinking_d240.dts @@ -114,6 +114,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -147,7 +161,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -174,13 +189,3 @@ &pcie { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_sercomm_cpj.dtsi b/target/linux/ramips/dts/mt7620a_sercomm_cpj.dtsi new file mode 100644 index 00000000000000..e903f9f7298478 --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_sercomm_cpj.dtsi @@ -0,0 +1,309 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620a.dtsi" + +#include +#include +#include + +/ { + aliases { + label-mac-device = ðernet; + + led-boot = &status_green; + led-failsafe = &status_amber; + led-running = &status_green; + led-upgrade = &status_amber; + }; + + keys { + compatible = "gpio-keys"; + + button-0 { + label = "reset"; + linux,code = ; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + button-1 { + label = "wps"; + linux,code = ; + gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + status_green: led-0 { + label = "green:status"; + gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + }; + + status_amber: led-1 { + label = "amber:status"; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + }; + + led-2 { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; + }; + + led-3 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; + }; + + led-4 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; + }; + + led-5 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; + gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; + }; + + led-6 { + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <4>; + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + }; + + led-7 { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <24>; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&fwconcat0 &fwconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,uimage"; + /* sercomm krnl hdr with fw chksums */ + openwrt,offset = <0x100>; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_label 0>; + nvmem-cell-names = "mac-address"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +/* mt7612 */ +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <5000000 6000000>; + + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_label 6>; + nvmem-cell-names = "eeprom", "mac-address"; + + /* 5 GHz WLAN phy green led */ + led { + led-sources = <2>; + led-active-low; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <70000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* whole flash */ + partition@0_all { + label = "ALL"; + reg = <0x0 0x1000000>; + read-only; + }; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "ftd_and_bootflag"; + reg = <0x30000 0x20000>; + }; + + partition@50000 { + label = "Factory"; + reg = <0x50000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; + }; + + partition@60000 { + label = "SC Nvram(permanent data)"; + reg = <0x60000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_label: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + fwconcat0: partition@70000 { + label = "Firmware"; + reg = <0x70000 0x790000>; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Kernel"; + reg = <0x0 0x200000>; + }; + + partition@200000 { + label = "RootFS"; + reg = <0x200000 0x590000>; + }; + }; + + fwconcat1: partition@800000 { + label = "Firmware2"; + reg = <0x800000 0x790000>; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Kernel2"; + reg = <0x0 0x200000>; + }; + + partition@200000 { + label = "RootFS2"; + reg = <0x200000 0x590000>; + }; + }; + + partition@f90000 { + label = "MAC IP"; + reg = <0xf90000 0x10000>; + read-only; + }; + + partition@fa0000 { + label = "Critical Log"; + reg = <0xfa0000 0x10000>; + read-only; + }; + + partition@fb000 { + label = "Critical Log Bak"; + reg = <0xfb0000 0x10000>; + read-only; + }; + + partition@fc0000 { + label = "Xml Config"; + reg = <0xfc0000 0x20000>; + read-only; + }; + + partition@fe0000 { + label = "Xml Config Bak"; + reg = <0xfe0000 0x20000>; + read-only; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "ephy", "rgmii1", "uartf", "wled"; + function = "gpio"; + }; +}; + +/* mt7620 */ +&wmac { + nvmem-cells = <&eeprom_factory_0>, <&macaddr_label 2>; + nvmem-cell-names = "eeprom", "mac-address"; +}; diff --git a/target/linux/ramips/dts/mt7620a_sitecom_wlr-4100-v1-002.dts b/target/linux/ramips/dts/mt7620a_sitecom_wlr-4100-v1-002.dts index 614a6103b84a4a..d94331a87d9872 100644 --- a/target/linux/ramips/dts/mt7620a_sitecom_wlr-4100-v1-002.dts +++ b/target/linux/ramips/dts/mt7620a_sitecom_wlr-4100-v1-002.dts @@ -106,6 +106,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -173,9 +187,8 @@ }; &wmac { - status = "okay"; - - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -184,13 +197,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts index 63643927d51f07..88d241601019ab 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c2-v1.dts @@ -109,6 +109,18 @@ label = "rom"; reg = <0x7d0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_rom_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@7e0000 { @@ -121,6 +133,20 @@ label = "radio"; reg = <0x7f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; }; }; @@ -130,7 +156,7 @@ pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; - nvmem-cells = <&macaddr_rom_f100>; + nvmem-cells = <&macaddr_rom_f100 0>; nvmem-cell-names = "mac-address"; port@5 { @@ -164,9 +190,8 @@ }; &wmac { - ralink,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_rom_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_rom_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; }; &ehci { @@ -184,19 +209,7 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - nvmem-cells = <&macaddr_rom_f100>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; - }; -}; - -&rom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_rom_f100: macaddr@f100 { - reg = <0xf100 0x6>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_rom_f100 (-1)>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts index 8fe5b9c3a2c779..e631f6f4e48fcc 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c20-v1.dts @@ -73,13 +73,11 @@ pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; - nvmem-cells = <&macaddr_rom_f100>; + nvmem-cells = <&macaddr_rom_f100 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &wifi { - nvmem-cells = <&macaddr_rom_f100>; + nvmem-cells = <&macaddr_rom_f100 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts index 88165c02be2acf..d00d2195eeb5f2 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c20i.dts @@ -53,12 +53,11 @@ }; &wmac { - nvmem-cells = <&macaddr_rom_f100>; + nvmem-cells = <&macaddr_rom_f100 0>; nvmem-cell-names = "mac-address"; }; &wifi { - nvmem-cells = <&macaddr_rom_f100>; + nvmem-cells = <&macaddr_rom_f100 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts index 4dbd1b2a98670e..439bc36dc3a21d 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-c50-v1.dts @@ -73,13 +73,11 @@ pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; - nvmem-cells = <&macaddr_rom_f100>; + nvmem-cells = <&macaddr_rom_f100 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &wifi { - nvmem-cells = <&macaddr_rom_f100>; + nvmem-cells = <&macaddr_rom_f100 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts index 1222ff2fcd5c1b..cc947e212e5120 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts +++ b/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts @@ -142,6 +142,16 @@ label = "rom"; reg = <0x7d0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_rom_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; + }; }; partition@7e0000 { @@ -154,6 +164,20 @@ label = "radio"; reg = <0x7f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; }; }; @@ -180,7 +204,8 @@ }; &wmac { - ralink,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&eeprom_radio_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -190,16 +215,7 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - }; -}; - -&rom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_rom_f100: macaddr@f100 { - reg = <0xf100 0x6>; + nvmem-cells = <&eeprom_radio_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi b/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi index 743d1e8db66460..50a91be8ec5fcd 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi +++ b/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi @@ -72,6 +72,18 @@ label = "rom"; reg = <0x7d0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_rom_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@7e0000 { @@ -84,6 +96,20 @@ label = "radio"; reg = <0x7f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; }; }; @@ -107,7 +133,8 @@ }; &wmac { - ralink,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&eeprom_radio_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -117,17 +144,8 @@ &pcie0 { wifi: mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; + nvmem-cells = <&eeprom_radio_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; - -&rom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_rom_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_tplink_re2x0-v1.dtsi b/target/linux/ramips/dts/mt7620a_tplink_re2x0-v1.dtsi index e6d9b8576d98d7..02f03afc487e60 100644 --- a/target/linux/ramips/dts/mt7620a_tplink_re2x0-v1.dtsi +++ b/target/linux/ramips/dts/mt7620a_tplink_re2x0-v1.dtsi @@ -48,6 +48,18 @@ label = "u-boot"; reg = <0x0 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + compatible = "mac-base"; + reg = <0x1fc00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -66,20 +78,33 @@ label = "radio"; reg = <0x7f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; }; }; }; ðernet { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; &wmac { - ralink,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_uboot_1fc00>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_uboot_1fc00 0>; + nvmem-cell-names = "eeprom", "mac-address"; }; &pcie { @@ -89,20 +114,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - nvmem-cells = <&macaddr_uboot_1fc00>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; ieee80211-freq-limit = <5000000 6000000>; - }; -}; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc00: macaddr@1fc00 { - reg = <0x1fc00 0x6>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_uboot_1fc00 2>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; diff --git a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn530hg4.dts b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn530hg4.dts index 9f58fb86ee83ce..687b3ced37b4a7 100644 --- a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn530hg4.dts +++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn530hg4.dts @@ -75,6 +75,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -125,7 +143,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -134,16 +153,6 @@ pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; - - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts index bbb3e01add9673..48f1a7f3c0df96 100644 --- a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts +++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn535k1.dts @@ -97,12 +97,22 @@ reg = <0x40000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; }; }; @@ -128,7 +138,8 @@ &pcie0 { wifi0: wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -174,7 +185,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { diff --git a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts index ce617198ce9f8d..b2b762d63a7f75 100644 --- a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts +++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts @@ -124,6 +124,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -154,7 +172,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -201,7 +220,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -210,13 +230,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_wevo_air-duo.dts b/target/linux/ramips/dts/mt7620a_wevo_air-duo.dts index 8f7458e976e7d6..05e61fe614e34e 100644 --- a/target/linux/ramips/dts/mt7620a_wevo_air-duo.dts +++ b/target/linux/ramips/dts/mt7620a_wevo_air-duo.dts @@ -86,12 +86,22 @@ reg = <0x40000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; @@ -184,7 +194,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -197,6 +208,6 @@ &wmac { pinctrl-names = "default"; pinctrl-0 = <&wled_pins>; - - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts b/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts index 95868c9be99f49..8ed6b7764dcff3 100644 --- a/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts +++ b/target/linux/ramips/dts/mt7620a_xiaomi_miwifi-mini.dts @@ -101,6 +101,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -144,11 +162,11 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; - pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -158,7 +176,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -169,13 +188,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_youku_x2.dts b/target/linux/ramips/dts/mt7620a_youku_x2.dts index ad9e252f65f5d4..da1e61e4fe57a2 100644 --- a/target/linux/ramips/dts/mt7620a_youku_x2.dts +++ b/target/linux/ramips/dts/mt7620a_youku_x2.dts @@ -27,7 +27,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi index 5af7b343d9b4d6..fc758a455648d3 100644 --- a/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi +++ b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi @@ -83,6 +83,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; firmware: partition@50000 { @@ -113,8 +131,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; - + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; @@ -131,13 +149,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_yukai_bocco.dts b/target/linux/ramips/dts/mt7620a_yukai_bocco.dts index 96ef110bdac425..db00c20f4f3554 100644 --- a/target/linux/ramips/dts/mt7620a_yukai_bocco.dts +++ b/target/linux/ramips/dts/mt7620a_yukai_bocco.dts @@ -106,6 +106,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -143,15 +157,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts index ceb348e1d24e6b..e41a9947330a56 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-ape522ii.dts @@ -83,6 +83,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -105,11 +123,11 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; - pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; pinctrl-1 = <&pa_gpio_pins>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -119,7 +137,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -130,13 +149,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi index f86ac1a88aeec5..39c50c7366df56 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026-5g.dtsi @@ -44,7 +44,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi index 57f3b4b7a62024..30d2fba263d3ac 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we1026.dtsi @@ -56,6 +56,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; firmware: partition@50000 { @@ -92,7 +110,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -101,13 +120,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi index 27876fc1408b38..b3032af63f388e 100644 --- a/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi +++ b/target/linux/ramips/dts/mt7620a_zbtlink_zbt-we826.dtsi @@ -78,6 +78,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; firmware: partition@50000 { @@ -117,7 +131,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -130,13 +145,3 @@ &pcie { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_zte_q7.dts b/target/linux/ramips/dts/mt7620a_zte_q7.dts index c2dc1110082dcc..3848f7317e606e 100644 --- a/target/linux/ramips/dts/mt7620a_zte_q7.dts +++ b/target/linux/ramips/dts/mt7620a_zte_q7.dts @@ -72,6 +72,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -98,7 +112,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &sdhci { @@ -112,13 +127,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts b/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts index a79578aa0150b1..abeb4c2a2d1630 100644 --- a/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts +++ b/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts @@ -115,6 +115,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -163,7 +177,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -173,13 +188,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts b/target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts index be1f9ee02687db..29350a85565791 100644 --- a/target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts +++ b/target/linux/ramips/dts/mt7620n_asus_rt-n12p.dts @@ -94,6 +94,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -113,7 +127,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -122,13 +137,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts b/target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts index ee68ebb2d27da3..c467ed0dde54ac 100644 --- a/target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts +++ b/target/linux/ramips/dts/mt7620n_asus_rt-n14u.dts @@ -99,6 +99,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -126,7 +140,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -135,13 +150,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts b/target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts index 4ecd3204c6111b..a714960b7f336e 100644 --- a/target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts +++ b/target/linux/ramips/dts/mt7620n_buffalo_wmr-300.dts @@ -83,6 +83,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -102,7 +116,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -111,13 +126,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_comfast_cf-wr800n.dts b/target/linux/ramips/dts/mt7620n_comfast_cf-wr800n.dts index b87e5a3530e522..19e968bf948a38 100644 --- a/target/linux/ramips/dts/mt7620n_comfast_cf-wr800n.dts +++ b/target/linux/ramips/dts/mt7620n_comfast_cf-wr800n.dts @@ -89,6 +89,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -106,7 +120,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -115,13 +130,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts b/target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts index 9d66b191cb21d7..afb14b118895e5 100644 --- a/target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts +++ b/target/linux/ramips/dts/mt7620n_elecom_wrh-300cr.dts @@ -86,6 +86,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + }; }; partition@50000 { @@ -119,7 +133,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -128,13 +143,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_kimax_u35wf.dts b/target/linux/ramips/dts/mt7620n_kimax_u35wf.dts index 14e328842b3415..9296d54d5927af 100644 --- a/target/linux/ramips/dts/mt7620n_kimax_u35wf.dts +++ b/target/linux/ramips/dts/mt7620n_kimax_u35wf.dts @@ -76,6 +76,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -101,7 +115,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -110,13 +125,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_kingston_mlw221.dts b/target/linux/ramips/dts/mt7620n_kingston_mlw221.dts index 1e8fe0d833e96a..ce1f0e9f8b864b 100644 --- a/target/linux/ramips/dts/mt7620n_kingston_mlw221.dts +++ b/target/linux/ramips/dts/mt7620n_kingston_mlw221.dts @@ -82,6 +82,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -114,7 +128,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -123,13 +138,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts b/target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts index 5a30dee05f3700..0293b89bfa329b 100644 --- a/target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts +++ b/target/linux/ramips/dts/mt7620n_kingston_mlwg2.dts @@ -82,6 +82,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -114,7 +128,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -123,13 +138,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_netgear_n300.dtsi b/target/linux/ramips/dts/mt7620n_netgear_n300.dtsi index 1fe2cbaabc5254..1c2e5174663535 100644 --- a/target/linux/ramips/dts/mt7620n_netgear_n300.dtsi +++ b/target/linux/ramips/dts/mt7620n_netgear_n300.dtsi @@ -60,6 +60,20 @@ label = "factory"; reg = <0x3f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; }; }; @@ -73,7 +87,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -82,13 +97,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts b/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts index 6b4dde543217e1..f06b97498221ac 100644 --- a/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts +++ b/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts @@ -107,12 +107,32 @@ label = "factory"; reg = <0xf60000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + }; }; board_data: partition@f70000 { label = "board_data"; reg = <0xf70000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_board_data_b0: macaddr@b0 { + reg = <0xb0 0x6>; + }; + }; }; partition@f80000 { @@ -166,8 +186,9 @@ }; ðernet { - mtd-mac-address = <&board_data 0xb0>; mediatek,portmap = "wllll"; + nvmem-cells = <&macaddr_board_data_b0>; + nvmem-cell-names = "mac-address"; }; &ehci { @@ -179,8 +200,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; - mtd-mac-address = <&board_data 0xb0>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_board_data_b0>; + nvmem-cell-names = "eeprom", "mac-address"; }; &state_default { diff --git a/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi b/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi index 7f17f1957f8dfe..8903ab5c36ab46 100644 --- a/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi +++ b/target/linux/ramips/dts/mt7620n_nexx_wt3020.dtsi @@ -63,6 +63,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; firmware: partition@50000 { @@ -86,7 +100,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -95,13 +110,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_snr_cpe-w4n-mt.dts b/target/linux/ramips/dts/mt7620n_snr_cpe-w4n-mt.dts index 97e604364290ea..25af8d53301477 100644 --- a/target/linux/ramips/dts/mt7620n_snr_cpe-w4n-mt.dts +++ b/target/linux/ramips/dts/mt7620n_snr_cpe-w4n-mt.dts @@ -92,8 +92,18 @@ factory: partition@40000 { label = "Factory"; - reg = <0x40000 0x100000>; + reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + }; }; partition@50000 { @@ -118,5 +128,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620n_sunvalley_filehub.dtsi b/target/linux/ramips/dts/mt7620n_sunvalley_filehub.dtsi index cd9e6cacce7e1b..88958bba141e8d 100644 --- a/target/linux/ramips/dts/mt7620n_sunvalley_filehub.dtsi +++ b/target/linux/ramips/dts/mt7620n_sunvalley_filehub.dtsi @@ -83,6 +83,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -128,7 +142,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -137,13 +152,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts b/target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts index 88a968d33b983d..53229ed8656dbb 100644 --- a/target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts +++ b/target/linux/ramips/dts/mt7620n_vonets_var11n-300.dts @@ -63,6 +63,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -82,7 +96,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -91,13 +106,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_wrtnode_wrtnode.dts b/target/linux/ramips/dts/mt7620n_wrtnode_wrtnode.dts index 4ab1b818108ec7..8e608bba2e4c29 100644 --- a/target/linux/ramips/dts/mt7620n_wrtnode_wrtnode.dts +++ b/target/linux/ramips/dts/mt7620n_wrtnode_wrtnode.dts @@ -56,6 +56,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -83,7 +97,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -92,13 +107,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts index 8a3e96ff266713..1510b19b17d535 100644 --- a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-cpe102.dts @@ -79,6 +79,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -106,7 +120,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -115,13 +130,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts index 69d5474bf65ba5..52c497645b0c13 100644 --- a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wa05.dts @@ -87,6 +87,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -114,7 +128,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -123,13 +138,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts index 7c92f45e7b0c66..7000447c6ce5e2 100644 --- a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-we2026.dts @@ -80,6 +80,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -99,7 +113,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -108,13 +123,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts index 2ac2415736f422..20063e2b47d790 100644 --- a/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts +++ b/target/linux/ramips/dts/mt7620n_zbtlink_zbt-wr8305rt.dts @@ -83,6 +83,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -113,7 +127,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -122,13 +137,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-lite-iii-a.dts b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-lite-iii-a.dts index 0d1c4696d79472..2241b27673a652 100644 --- a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-lite-iii-a.dts +++ b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-lite-iii-a.dts @@ -111,6 +111,16 @@ label = "RF-EEPROM"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + }; }; partition@50000 { @@ -140,5 +150,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts index 917a1934bd3c66..1937c3a14c1f65 100644 --- a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts +++ b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni-ii.dts @@ -111,6 +111,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -137,7 +151,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -147,13 +162,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts index 9cea6ad667c3d4..8faab1cc6b2049 100644 --- a/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts +++ b/target/linux/ramips/dts/mt7620n_zyxel_keenetic-omni.dts @@ -111,6 +111,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -137,7 +151,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -147,13 +162,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_adslr_g7.dts b/target/linux/ramips/dts/mt7621_adslr_g7.dts index 956733f7c3e8a6..ef3a64e031a23b 100644 --- a/target/linux/ramips/dts/mt7621_adslr_g7.dts +++ b/target/linux/ramips/dts/mt7621_adslr_g7.dts @@ -67,6 +67,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e00c: macaddr@e00c { + compatible = "mac-base"; + reg = <0xe00c 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -86,7 +106,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -95,13 +116,14 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_e00c>; + nvmem-cells = <&macaddr_factory_e00c 0>; nvmem-cell-names = "mac-address"; }; @@ -110,9 +132,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_e00c>; + nvmem-cells = <&macaddr_factory_e00c 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -151,13 +172,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e00c: macaddr@e00c { - reg = <0xe00c 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts b/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts index 8d33f542dc1af0..d63ae33311fb96 100644 --- a/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts +++ b/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts @@ -74,6 +74,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -93,7 +113,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -107,7 +128,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -118,7 +140,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -127,9 +149,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -168,13 +189,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_alfa-network_ax1800rm.dts b/target/linux/ramips/dts/mt7621_alfa-network_ax1800rm.dts index 1ef1f7fb31f08e..e07cddefc58044 100644 --- a/target/linux/ramips/dts/mt7621_alfa-network_ax1800rm.dts +++ b/target/linux/ramips/dts/mt7621_alfa-network_ax1800rm.dts @@ -117,7 +117,6 @@ }; partition@50000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x50000 0x10000>; read-only; diff --git a/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts b/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts index cc048d44879be6..2bc0fad9c58d92 100644 --- a/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts +++ b/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts @@ -245,6 +245,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -263,17 +277,3 @@ &uartlite3 { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi b/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi index 7736b06e438757..35274afbf3acf5 100644 --- a/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi +++ b/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi @@ -64,7 +64,8 @@ wifi@0,0 { compatible = "pci14c3,7615"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -73,7 +74,8 @@ wifi@0,0 { compatible = "pci14c3,7615"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -108,6 +110,20 @@ label = "factory"; reg = <0x100000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; }; /* diff --git a/target/linux/ramips/dts/mt7621_arcadyan_we420223-99.dts b/target/linux/ramips/dts/mt7621_arcadyan_we420223-99.dts index 3ae441f8e3be55..fbf276c320e15b 100644 --- a/target/linux/ramips/dts/mt7621_arcadyan_we420223-99.dts +++ b/target/linux/ramips/dts/mt7621_arcadyan_we420223-99.dts @@ -133,6 +133,16 @@ label = "Factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + }; }; partition@50000 { @@ -214,6 +224,7 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi b/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi index b924d71190fbda..7b3f316a8c4495 100644 --- a/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi +++ b/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi @@ -83,18 +83,24 @@ reg = <0x200000 0x100000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - /* We keep the block below to prevent eth0 MAC - * from randomization. Unique WAN, LAN, WLAN MACs - * are stored in u-boot-env. - */ - - /* Default Ralink MAC (00:0c:43:28:80:xx) */ - macaddr_factory_fff0: macaddr@fff0 { - reg = <0xfff0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + /* We keep the block below to prevent eth0 MAC + * from randomization. Unique WAN, LAN, WLAN MACs + * are stored in u-boot-env. + */ + + /* Default Ralink MAC (00:0c:43:28:80:xx) */ + macaddr_factory_fff0: macaddr@fff0 { + reg = <0xfff0 0x6>; + }; }; }; @@ -162,7 +168,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts b/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts index 5e57842d6812db..2d4bc016c1dd95 100644 --- a/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts +++ b/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts @@ -7,22 +7,6 @@ model = "AsiaRF AP7621-001"; }; -&gmac1 { - status = "okay"; - label = "wan"; - phy-handle = <ðphy4>; - - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&mdio { - ethphy4: ethernet-phy@4 { - reg = <4>; - }; -}; - &switch0 { ports { port@0 { diff --git a/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts b/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts index dabc1a3bd34018..f6914e43599c28 100644 --- a/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts +++ b/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts @@ -7,22 +7,6 @@ model = "AsiaRF AP7621-NV1"; }; -&gmac1 { - status = "okay"; - label = "wan"; - phy-handle = <ðphy0>; - - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&mdio { - ethphy0: ethernet-phy@0 { - reg = <0>; - }; -}; - &switch0 { ports { port@2 { diff --git a/target/linux/ramips/dts/mt7621_asiarf_ap7621.dtsi b/target/linux/ramips/dts/mt7621_asiarf_ap7621.dtsi index bea0b79df5eb95..acb2c81a0d8858 100644 --- a/target/linux/ramips/dts/mt7621_asiarf_ap7621.dtsi +++ b/target/linux/ramips/dts/mt7621_asiarf_ap7621.dtsi @@ -78,6 +78,18 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -99,8 +111,23 @@ status = "okay"; }; +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; }; @@ -110,13 +137,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts b/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts index 50047999be7a84..d9fdb3b675f832 100644 --- a/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts +++ b/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts @@ -140,12 +140,22 @@ reg = <0x40000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; @@ -188,7 +198,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -197,7 +208,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_asus_rp-ac87.dts b/target/linux/ramips/dts/mt7621_asus_rp-ac87.dts index 98af8752814033..34e64182cf5649 100644 --- a/target/linux/ramips/dts/mt7621_asus_rp-ac87.dts +++ b/target/linux/ramips/dts/mt7621_asus_rp-ac87.dts @@ -114,12 +114,22 @@ reg = <0x40000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; }; }; @@ -140,7 +150,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -149,7 +160,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts b/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts index bb1c86c2d5df83..6790b37d1aefa7 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts @@ -89,6 +89,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -108,7 +130,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; led { led-sources = <2>; @@ -121,7 +144,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; led { led-active-low; @@ -179,17 +203,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi b/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi index 59b93db5dec19d..7c607f962dbbbe 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi +++ b/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi @@ -83,6 +83,24 @@ label = "factory"; reg = <0x1e0000 0x100000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + }; }; factory2: partition@2e0000 { @@ -116,7 +134,8 @@ wifi0: wifi@0,0 { compatible = "pci14c3,7615"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -125,7 +144,8 @@ wifi1: wifi@0,0 { compatible = "pci14c3,7615"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -180,13 +200,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts b/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts index d740d00c6dffd7..d18a503b85f585 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts @@ -99,12 +99,14 @@ reg = <0x1e0000 0x100000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts b/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts index 3191692e4ef30a..8466cda587bf0e 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts @@ -91,12 +91,14 @@ reg = <0x1e0000 0x100000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts b/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts index c8d286e7ed154b..cfc8330fe5c55f 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts @@ -108,6 +108,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; + }; }; partition@50000 { @@ -127,7 +149,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; @@ -135,7 +158,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -189,17 +213,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts index 22fc065eb29907..f2a99a63a89db7 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts @@ -99,12 +99,24 @@ sercomm,scpart-id = <2>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_21000: macaddr@21000 { - reg = <0x21000 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_21000: macaddr@21000 { + compatible = "mac-base"; + reg = <0x21000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -175,12 +187,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_21000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(5)>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_21000 5>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -188,17 +198,15 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; ieee80211-freq-limit = <2400000 2500000>; - nvmem-cells = <&macaddr_factory_21000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(4)>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_21000 4>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 0>; nvmem-cell-names = "mac-address"; }; @@ -207,9 +215,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(1)>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-pro.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-pro.dts index e3e248d48f960e..e2c0165e6bb3a7 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-pro.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-pro.dts @@ -116,3 +116,14 @@ * 0x10000000-0xfc00000=0x400000 */ }; + +&pcie1 { + wlan_2g: wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <2400000 2500000>; + + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_1000 0>; + nvmem-cell-names = "eeprom", "mac-address"; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts index 507920bac22c0e..00f4957c574d2b 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo-plus.dts @@ -105,12 +105,24 @@ sercomm,scpart-id = <2>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_21000: macaddr@21000 { - reg = <0x21000 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_21000: macaddr@21000 { + compatible = "mac-base"; + reg = <0x21000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -168,12 +180,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_21000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(5)>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_21000 5>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -181,17 +191,15 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; ieee80211-freq-limit = <2400000 2500000>; - nvmem-cells = <&macaddr_factory_21000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(4)>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_21000 4>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 0>; nvmem-cell-names = "mac-address"; }; @@ -200,9 +208,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(1)>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo.dts b/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo.dts index df80f49e97ea37..f9b53ae0b368fa 100644 --- a/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo.dts +++ b/target/linux/ramips/dts/mt7621_beeline_smartbox-turbo.dts @@ -9,22 +9,19 @@ &pcie0 { wifi@0,0 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 5>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(5)>; }; }; &pcie1 { wifi@0,0 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 4>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(4)>; }; }; &gmac1 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(1)>; }; diff --git a/target/linux/ramips/dts/mt7621_belkin_rt1800.dts b/target/linux/ramips/dts/mt7621_belkin_rt1800.dts index 16ae7324290355..e7acc55e500f4e 100644 --- a/target/linux/ramips/dts/mt7621_belkin_rt1800.dts +++ b/target/linux/ramips/dts/mt7621_belkin_rt1800.dts @@ -89,6 +89,16 @@ label = "Factory"; reg = <0x100000 0x80000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + }; }; partition@180000 { @@ -133,7 +143,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_bolt_arion.dts b/target/linux/ramips/dts/mt7621_bolt_arion.dts index 7ba413932ea9fa..83855f9dc898bf 100644 --- a/target/linux/ramips/dts/mt7621_bolt_arion.dts +++ b/target/linux/ramips/dts/mt7621_bolt_arion.dts @@ -103,6 +103,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + compatible = "mac-base"; + reg = <0x28 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -122,7 +142,8 @@ wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -131,15 +152,15 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_4000>; + nvmem-cells = <&macaddr_factory_28 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; }; &switch0 { @@ -152,7 +173,7 @@ wan: port@1 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_4000>; + nvmem-cells = <&macaddr_factory_28 0>; nvmem-cell-names = "mac-address"; }; @@ -173,13 +194,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4000: macaddr@4000 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts index a8d76b544e2576..f176691aacc8e0 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts @@ -136,6 +136,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; partition@50000 { @@ -202,7 +216,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -210,7 +225,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts index be85e8ee6ecbbd..b4ba1519d3df37 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts @@ -134,6 +134,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -164,9 +184,8 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &gmac1 { @@ -174,9 +193,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &mdio { @@ -217,7 +235,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -226,7 +245,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -241,13 +261,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts index f46bc256d0c064..e1b82816f0cfa4 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts @@ -136,6 +136,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -161,14 +179,16 @@ &pcie0 { rt5592@0,0 { reg = <0x0000 0 0 0 0>; - ralink,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -219,13 +239,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts b/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts index 80600470e77ec2..ac0c19c0228607 100644 --- a/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts +++ b/target/linux/ramips/dts/mt7621_comfast_cf-e390ax.dts @@ -90,6 +90,18 @@ label = "factory"; reg = <0x50000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@90000 { @@ -101,18 +113,8 @@ }; }; -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; - &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -121,9 +123,8 @@ port@0 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; port@4 { diff --git a/target/linux/ramips/dts/mt7621_comfast_cf-ew72-v2.dts b/target/linux/ramips/dts/mt7621_comfast_cf-ew72-v2.dts index 8b7b4a035ea2d3..a915a5d79f0f8a 100644 --- a/target/linux/ramips/dts/mt7621_comfast_cf-ew72-v2.dts +++ b/target/linux/ramips/dts/mt7621_comfast_cf-ew72-v2.dts @@ -107,13 +107,22 @@ factory: partition@40000 { label = "factory"; - compatible = "nvmem-cells"; reg = <0x40000 0x10000>; read-only; + nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + macaddr_factory_e000: macaddr@e000 { compatible = "mac-base"; reg = <0xe000 0x6>; @@ -152,7 +161,8 @@ wifi_2_4_ghz: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; // Wi-Fi device reads it's MAC address from EEPROM (&factory + 4) // adding anything related to mac-address here will cause use random MAC }; @@ -162,7 +172,8 @@ wifi_5_0_ghz: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; // Wi-Fi device reads it's MAC address from EEPROM, (&factory + 0x8000 + 4) // adding anything related to mac-address here will cause use random MAC. }; diff --git a/target/linux/ramips/dts/mt7621_cudy_m1800.dts b/target/linux/ramips/dts/mt7621_cudy_m1800.dts index 314fdb206ca112..29d6f9e41a98f5 100644 --- a/target/linux/ramips/dts/mt7621_cudy_m1800.dts +++ b/target/linux/ramips/dts/mt7621_cudy_m1800.dts @@ -53,9 +53,8 @@ }; &gmac0 { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &gmac1 { @@ -63,7 +62,7 @@ label = "lan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; nvmem-cell-names = "mac-address"; }; @@ -148,12 +147,16 @@ reg = <0x1ff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_bdinfo_de00: macaddr@de00 { - reg = <0xde00 0x6>; + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts b/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts index cc1afdc95bd6a5..e87209fbb1d866 100644 --- a/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts +++ b/target/linux/ramips/dts/mt7621_cudy_wr1300-v1.dts @@ -88,6 +88,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; partition@50000 { @@ -112,6 +126,18 @@ label = "bdinfo"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -125,9 +151,8 @@ wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; - nvmem-cells = <&macaddr_bdinfo_de00>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_de00 0>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -140,10 +165,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - nvmem-cells = <&macaddr_bdinfo_de00>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_de00 2>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -154,7 +177,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; nvmem-cell-names = "mac-address"; }; @@ -163,9 +186,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -204,13 +226,3 @@ function = "gpio"; }; }; - -&bdinfo { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdinfo_de00: macaddr@de00 { - reg = <0xde00 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts b/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts index a5d2fc46079343..a33279e596d8c5 100644 --- a/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts +++ b/target/linux/ramips/dts/mt7621_cudy_wr1300-v2.dts @@ -1,126 +1,19 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7621.dtsi" - -#include -#include +#include "mt7621_cudy_wr1300-v2v3.dtsi" / { compatible = "cudy,wr1300-v2", "mediatek,mt7621-soc"; model = "Cudy WR1300 v2"; - - aliases { - led-boot = &led_sys; - led-failsafe = &led_sys; - led-running = &led_sys; - led-upgrade = &led_sys; - label-mac-device = &gmac0; - }; - - chosen { - bootargs = "console=ttyS0,115200"; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio 18 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wps { - label = "wps"; - gpios = <&gpio 7 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - - leds { - compatible = "gpio-leds"; - - led_sys: sys { - label = "green:sys"; - gpios = <&gpio 15 GPIO_ACTIVE_LOW>; - }; - - wps { - label = "green:wps"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - }; - }; -}; - -&spi0 { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <40000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x50000 0xf80000>; - }; - - partition@fd0000 { - label = "debug"; - reg = <0xfd0000 0x10000>; - read-only; - }; - - partition@fe0000 { - label = "backup"; - reg = <0xfe0000 0x10000>; - read-only; - }; - - bdinfo: partition@ff0000 { - label = "bdinfo"; - reg = <0xff0000 0x10000>; - read-only; - }; - }; - }; -}; - -&pcie { - status = "okay"; }; &pcie1 { wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; - nvmem-cells = <&macaddr_bdinfo_de00>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_de00 0>; + nvmem-cell-names = "eeprom", "mac-address"; + ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -128,71 +21,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - nvmem-cells = <&macaddr_bdinfo_de00>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; - }; -}; - -&gmac0 { - nvmem-cells = <&macaddr_bdinfo_de00>; - nvmem-cell-names = "mac-address"; -}; - -&gmac1 { - status = "okay"; - label = "wan"; - phy-handle = <ðphy4>; - - nvmem-cells = <&macaddr_bdinfo_de00>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&mdio { - ethphy4: ethernet-phy@4 { - reg = <4>; - }; -}; - -&switch0 { - ports { - port@0 { - status = "okay"; - label = "lan4"; - }; - - port@1 { - status = "okay"; - label = "lan3"; - }; - - port@2 { - status = "okay"; - label = "lan2"; - }; - - port@3 { - status = "okay"; - label = "lan1"; - }; - }; -}; - -&state_default { - gpio { - groups = "wdt", "i2c", "jtag"; - function = "gpio"; - }; -}; - -&bdinfo { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdinfo_de00: macaddr@de00 { - reg = <0xde00 0x6>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_de00 2>; + nvmem-cell-names = "eeprom", "mac-address"; + ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr1300-v2v3.dtsi b/target/linux/ramips/dts/mt7621_cudy_wr1300-v2v3.dtsi new file mode 100644 index 00000000000000..b4c61fb7c66765 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_cudy_wr1300-v2v3.dtsi @@ -0,0 +1,189 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_sys: sys { + label = "green:sys"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "green:wps"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xf80000>; + }; + + partition@fd0000 { + label = "debug"; + reg = <0xfd0000 0x10000>; + read-only; + }; + + partition@fe0000 { + label = "backup"; + reg = <0xfe0000 0x10000>; + read-only; + }; + + partition@ff0000 { + label = "bdinfo"; + reg = <0xff0000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&gmac0 { + nvmem-cells = <&macaddr_bdinfo_de00 0>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_bdinfo_de00 1>; + nvmem-cell-names = "mac-address"; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan4"; + }; + + port@1 { + status = "okay"; + label = "lan3"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan1"; + }; + }; +}; + +&state_default { + gpio { + groups = "wdt", "i2c", "jtag"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr1300-v3.dts b/target/linux/ramips/dts/mt7621_cudy_wr1300-v3.dts new file mode 100644 index 00000000000000..cb75703a0aff01 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_cudy_wr1300-v3.dts @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621_cudy_wr1300-v2v3.dtsi" + +/ { + compatible = "cudy,wr1300-v3", "mediatek,mt7621-soc"; + model = "Cudy WR1300 v3"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_de00 0>; + nvmem-cell-names = "eeprom", "mac-address"; + ieee80211-freq-limit = <2400000 2500000>; + + led { + led-sources = <0>; + led-active-low; + }; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_de00 2>; + nvmem-cell-names = "eeprom", "mac-address"; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_cudy_wr2100.dts b/target/linux/ramips/dts/mt7621_cudy_wr2100.dts index b2e75762a5d132..fc38e27ac1857b 100644 --- a/target/linux/ramips/dts/mt7621_cudy_wr2100.dts +++ b/target/linux/ramips/dts/mt7621_cudy_wr2100.dts @@ -78,7 +78,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; nvmem-cell-names = "mac-address"; }; @@ -90,7 +90,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -99,7 +100,8 @@ wifi@1,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -133,6 +135,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; }; partition@50000 { @@ -157,6 +173,18 @@ label = "bdinfo"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -174,9 +202,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -208,13 +235,3 @@ }; }; }; - -&bdinfo { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdinfo_de00: macaddr@de00 { - reg = <0xde00 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_cudy_x6-v1.dts b/target/linux/ramips/dts/mt7621_cudy_x6-v1.dts index cfae15e5659aa8..940a0598c10f1e 100644 --- a/target/linux/ramips/dts/mt7621_cudy_x6-v1.dts +++ b/target/linux/ramips/dts/mt7621_cudy_x6-v1.dts @@ -31,28 +31,31 @@ reg = <0x1ff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdinfo_de00: macaddr@de00 { - reg = <0xde00 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; &gmac0 { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; nvmem-cell-names = "mac-address"; }; &gmac1 { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wifi { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7621_cudy_x6-v2.dts b/target/linux/ramips/dts/mt7621_cudy_x6-v2.dts index 16fa15befc4d1e..70e6a845a4bbda 100644 --- a/target/linux/ramips/dts/mt7621_cudy_x6-v2.dts +++ b/target/linux/ramips/dts/mt7621_cudy_x6-v2.dts @@ -31,28 +31,31 @@ reg = <0xff0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdinfo_de00: macaddr@de00 { - reg = <0xde00 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; &gmac0 { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; nvmem-cell-names = "mac-address"; }; &gmac1 { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wifi { - nvmem-cells = <&macaddr_bdinfo_de00>; + nvmem-cells = <&macaddr_bdinfo_de00 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts b/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts index 33deb21dcaa061..82160cff03f20c 100644 --- a/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts +++ b/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts @@ -118,6 +118,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -136,7 +158,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -144,7 +167,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -190,17 +214,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts b/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts index 03b593e093d11c..29c212671cccb8 100644 --- a/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts +++ b/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts @@ -132,6 +132,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -162,7 +184,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -170,7 +193,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -220,17 +244,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; 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 00000000000000..c06c5e36baaeda --- /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/mt7621_dlink_dap-x1860-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dap-x1860-a1.dts index 818d2d8c413191..73f6247b47788e 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dap-x1860-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dap-x1860-a1.dts @@ -129,12 +129,14 @@ reg = <0x100000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-1935-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-1935-a1.dts index a6a0eb8ba044f4..0ce07141a377e1 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-1935-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-1935-a1.dts @@ -21,17 +21,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts index d352d27b76c50a..e0a714c9dc6461 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-1960-a1.dts @@ -15,15 +15,3 @@ linux,default-trigger = "usbport"; }; }; - -&wifi0 { - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&wifi1 { - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts index 127a9a3417f3ad..d4b8069a333089 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-2640-a1.dts @@ -22,15 +22,3 @@ linux,default-trigger = "usbport"; }; }; - -&wifi0 { - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&wifi1 { - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts index 02fd35d60e92c4..a4590cb35fc5a7 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-2660-a1.dts @@ -22,15 +22,3 @@ linux,default-trigger = "usbport"; }; }; - -&wifi0 { - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&wifi1 { - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts index 943143ad634de2..1cca6f6b57851c 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts @@ -114,6 +114,30 @@ label = "factory"; reg = <0x100000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@140000 { @@ -163,11 +187,9 @@ wifi0: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; ieee80211-freq-limit = <2400000 6000000>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000 1>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -175,16 +197,14 @@ wifi1: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000 3>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -225,17 +245,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-853-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-853-a1.dts index 2b6b811abe6550..8e5e35945a6469 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-853-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-853-a1.dts @@ -111,6 +111,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -144,7 +162,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; /* The correct Mac addresses are set in 10_fix_wifi_mac. */ }; @@ -200,17 +219,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts b/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts index 5408e5139997f2..747d1de18a0649 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts @@ -108,6 +108,28 @@ label = "factory"; reg = <0x100000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@140000 { @@ -156,11 +178,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; /* 5 GHz (phy1) does not take the address from calibration data, but setting it manually here works */ - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -214,21 +235,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts index 8ec6ef3a7d29b6..bce0e6996befa2 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts @@ -95,19 +95,16 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; - /* 5 GHz (phy1) does not take the address from calibration data, but setting it manually here works */ - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4 0>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &gmac1 { @@ -115,9 +112,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &mdio { @@ -156,13 +152,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts index fac41f206bb9f9..451722743d96ce 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts @@ -86,6 +86,24 @@ label = "radio"; reg = <0x34000 0x4000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_radio_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_radio_2000: eeprom@2000 { + reg = <0x2000 0x200>; + }; + }; }; factory: partition@38000 { @@ -163,7 +181,8 @@ &pcie0 { wifi0: mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x2000>; + nvmem-cells = <&eeprom_radio_2000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -171,7 +190,8 @@ &pcie1 { wifi1: mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&eeprom_radio_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -182,13 +202,3 @@ function = "gpio"; }; }; - -&radio { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_radio_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts index ae0cc8fc8a923e..ab5a110333507b 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts @@ -21,17 +21,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts index 31b41f8384736f..f9ed0ddcefdfd6 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts @@ -21,17 +21,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-878-r1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-878-r1.dts index dbde89b2207b12..1a17dddc115bfe 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-878-r1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-878-r1.dts @@ -21,17 +21,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts index d6206427bf0ee5..2f45eda02d282a 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts @@ -37,17 +37,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts index 6288d19c8a8521..019ad7edcf30a7 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts @@ -37,17 +37,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi index b570d074c6f7e8..bd8fd6f8a15d64 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi @@ -68,7 +68,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -81,7 +82,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi index 07f84592e4b02f..6eb3f3cdd9bf7d 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi @@ -79,6 +79,30 @@ label = "factory"; reg = <0x100000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@140000 { @@ -127,7 +151,8 @@ wifi0: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&macaddr_factory_e000 1>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -140,7 +165,8 @@ wifi1: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&macaddr_factory_e000 2>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -150,7 +176,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -199,17 +225,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_dlink_dxx-1xx0-x1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dxx-1xx0-x1.dtsi index 8fb6de7c480235..a933b14925094e 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dxx-1xx0-x1.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_dxx-1xx0-x1.dtsi @@ -97,12 +97,18 @@ reg = <0x40000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; }; @@ -123,7 +129,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; /* The correct MAC addresses are set in 10_fix_wifi_mac. */ }; }; diff --git a/target/linux/ramips/dts/mt7621_dlink_flash-16m-a1.dtsi b/target/linux/ramips/dts/mt7621_dlink_flash-16m-a1.dtsi index 911de595d07772..021c9e17c6581a 100644 --- a/target/linux/ramips/dts/mt7621_dlink_flash-16m-a1.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_flash-16m-a1.dtsi @@ -29,6 +29,28 @@ label = "factory"; reg = <0x40000 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@60000 { diff --git a/target/linux/ramips/dts/mt7621_dlink_flash-16m-r1.dtsi b/target/linux/ramips/dts/mt7621_dlink_flash-16m-r1.dtsi index 3f71ab971ca5d6..bccd19b12d8e4c 100644 --- a/target/linux/ramips/dts/mt7621_dlink_flash-16m-r1.dtsi +++ b/target/linux/ramips/dts/mt7621_dlink_flash-16m-r1.dtsi @@ -29,6 +29,34 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { diff --git a/target/linux/ramips/dts/mt7621_dual-q_h721.dts b/target/linux/ramips/dts/mt7621_dual-q_h721.dts index 2a18b3982d91d9..2c35a8839cb637 100644 --- a/target/linux/ramips/dts/mt7621_dual-q_h721.dts +++ b/target/linux/ramips/dts/mt7621_dual-q_h721.dts @@ -122,12 +122,16 @@ reg = <0x40000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -174,9 +178,8 @@ status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; @@ -186,7 +189,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7621_edimax_re23s.dts b/target/linux/ramips/dts/mt7621_edimax_re23s.dts index 1a3181e4e39dd9..80a271f6e33d4a 100644 --- a/target/linux/ramips/dts/mt7621_edimax_re23s.dts +++ b/target/linux/ramips/dts/mt7621_edimax_re23s.dts @@ -89,6 +89,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; + }; }; partition@50000 { @@ -122,7 +140,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -131,7 +150,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -160,13 +180,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi b/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi index 1301f1375c8856..464e2a74441997 100644 --- a/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi +++ b/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi @@ -84,6 +84,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -103,7 +121,8 @@ wifi0: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -112,7 +131,8 @@ wifi1: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -171,13 +191,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts index 2fdb62840a68ad..9c0353ae28b737 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts @@ -67,7 +67,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -139,6 +139,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -177,27 +197,11 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000 1>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts index 81ace64e44bcbf..9ed7acac9429b7 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts @@ -50,25 +50,28 @@ }; &wifi { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; - macaddr_factory_fff4: macaddr@fff4 { - reg = <0xfff4 0x6>; - }; + macaddr_factory_fff4: macaddr@fff4 { + reg = <0xfff4 0x6>; + }; - macaddr_factory_fffa: macaddr@fffa { - reg = <0xfffa 0x6>; + macaddr_factory_fffa: macaddr@fffa { + reg = <0xfffa 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts index cb2e2027937546..d7510c292b7e6f 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts @@ -50,21 +50,24 @@ }; &wifi { - nvmem-cells = <&macaddr_factory_e006>; + nvmem-cells = <&macaddr_factory_e006 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + compatible = "mac-base"; + reg = <0xe006 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts index 8450af59074032..c01533fafdd0c5 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts @@ -50,15 +50,17 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gst2.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gst2.dts index a57a4290affa8f..4157fb6c1351cd 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gst2.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gst2.dts @@ -50,15 +50,17 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts index f01f6fc25f0313..d978ff8238840d 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts @@ -50,15 +50,17 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts index ec433e265de34f..5e3b47e2746d3e 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts @@ -50,15 +50,17 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk.dtsi index e9f968dbe021ed..618b07e798ded9 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk.dtsi @@ -103,6 +103,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; }; }; }; @@ -159,7 +173,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -168,7 +183,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gs2.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gs2.dts index 7e88f7be04f426..77fcb8c4298b2d 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gs2.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gs2.dts @@ -50,15 +50,17 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_fff4: macaddr@fff4 { - reg = <0xfff4 0x6>; - }; + macaddr_factory_fff4: macaddr@fff4 { + reg = <0xfff4 0x6>; + }; - macaddr_factory_fffa: macaddr@fffa { - reg = <0xfffa 0x6>; + macaddr_factory_fffa: macaddr@fffa { + reg = <0xfffa 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts index 1d174006bd0d2e..481734a51c1b74 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts @@ -48,15 +48,17 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts index b71a2b4390f178..e7c06ff359dcfe 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts @@ -50,15 +50,17 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi index 7495453d458079..8901680bf5b899 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi @@ -25,6 +25,7 @@ wifi: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi index 98ce0b199409d3..50fc0b6e949728 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-2pci.dtsi @@ -13,7 +13,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -27,7 +28,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi index acd3004eb7b6aa..30b8d4e0104c93 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi @@ -148,6 +148,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7621_etisalat_s3.dts b/target/linux/ramips/dts/mt7621_etisalat_s3.dts index 65d168fd803259..64e21bb704a1db 100644 --- a/target/linux/ramips/dts/mt7621_etisalat_s3.dts +++ b/target/linux/ramips/dts/mt7621_etisalat_s3.dts @@ -105,12 +105,24 @@ sercomm,scpart-id = <2>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_21000: macaddr@21000 { - reg = <0x21000 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_21000: macaddr@21000 { + compatible = "mac-base"; + reg = <0x21000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -168,12 +180,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_21000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(3)>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_21000 3>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -181,17 +191,15 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; ieee80211-freq-limit = <2400000 2500000>; - nvmem-cells = <&macaddr_factory_21000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(2)>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_21000 2>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 0>; nvmem-cell-names = "mac-address"; }; @@ -200,9 +208,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 11>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(11)>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_firefly_firewrt.dts b/target/linux/ramips/dts/mt7621_firefly_firewrt.dts index 46954b616f01f8..c2c2acac9f2841 100644 --- a/target/linux/ramips/dts/mt7621_firefly_firewrt.dts +++ b/target/linux/ramips/dts/mt7621_firefly_firewrt.dts @@ -73,6 +73,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -91,7 +111,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -99,7 +120,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -109,7 +131,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -138,9 +160,8 @@ port@4 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; @@ -151,13 +172,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts b/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts index cb9f9bdad1eb0a..d224fd388d7fc7 100644 --- a/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts +++ b/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts @@ -71,6 +71,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -89,14 +109,16 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; &pcie1 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -107,7 +129,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -116,9 +138,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -152,13 +173,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts b/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts index d5440b3a5108e0..891fe7c730f26a 100644 --- a/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts +++ b/target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts @@ -91,6 +91,22 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_4000: macaddr@4000 { + compatible = "mac-base"; + reg = <0x4000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -110,14 +126,14 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_4000>; + nvmem-cells = <&macaddr_factory_4000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &gmac1 { @@ -125,7 +141,7 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_4000>; + nvmem-cells = <&macaddr_factory_4000 0>; nvmem-cell-names = "mac-address"; }; @@ -159,13 +175,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4000: macaddr@4000 { - reg = <0x4000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts b/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts index 5d28e22776c8e1..6bdba25b2b4ce6 100644 --- a/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts +++ b/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts @@ -75,6 +75,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + }; }; partition@50000 { @@ -125,13 +135,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts index d4998113456d7c..9a2cffeb97cfae 100644 --- a/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts +++ b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts @@ -95,6 +95,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + }; }; partition@50000 { @@ -151,13 +161,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi b/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi index fe374bfa6b01f0..59b49fbefc8b02 100644 --- a/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi +++ b/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi @@ -100,6 +100,16 @@ label = "factory"; reg = <0x0180000 0x0080000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + }; }; partition@200000 { @@ -133,7 +143,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; diff --git a/target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi b/target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi index 4dd6f3b0ae5533..6549abaec95697 100644 --- a/target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi +++ b/target/linux/ramips/dts/mt7621_haier-sim_wr1800k.dtsi @@ -63,7 +63,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_8004>; + nvmem-cells = <&macaddr_factory_8004 0>; nvmem-cell-names = "mac-address"; }; @@ -72,9 +72,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_8004>; + nvmem-cells = <&macaddr_factory_8004 (-3)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-3)>; }; &mdio { @@ -107,12 +106,20 @@ reg = <0x0100000 0x0080000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; + macaddr_factory_8004: macaddr@8004 { + compatible = "mac-base"; + reg = <0x8004 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -147,7 +154,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; diff --git a/target/linux/ramips/dts/mt7621_hanyang_hyc-g920.dts b/target/linux/ramips/dts/mt7621_hanyang_hyc-g920.dts index c4e28b96df5da6..5737c0ce68f126 100644 --- a/target/linux/ramips/dts/mt7621_hanyang_hyc-g920.dts +++ b/target/linux/ramips/dts/mt7621_hanyang_hyc-g920.dts @@ -78,6 +78,30 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; + }; }; partition@50000 { @@ -115,7 +139,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -129,7 +154,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -140,7 +166,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; }; @@ -149,9 +175,8 @@ port@0 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; port@1 { @@ -182,17 +207,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts b/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts index 3fb267d78216d6..41ed5088c0ab7e 100644 --- a/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts +++ b/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts @@ -50,6 +50,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; partition@50000 { @@ -105,7 +115,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts index d9ca1012ceaf41..a21a6a455b3ad5 100644 --- a/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts +++ b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts @@ -84,6 +84,20 @@ label = "factory"; reg = <0x100000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; partition@140000 { @@ -116,7 +130,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -124,7 +139,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts b/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts index fe77f6520746a5..9b9a9831087731 100644 --- a/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts +++ b/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts @@ -97,12 +97,22 @@ reg = <0x40000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; }; @@ -123,7 +133,8 @@ wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -131,7 +142,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_humax_e10.dts b/target/linux/ramips/dts/mt7621_humax_e10.dts index 638d73c3effe1e..be5f23ca7d6e6a 100644 --- a/target/linux/ramips/dts/mt7621_humax_e10.dts +++ b/target/linux/ramips/dts/mt7621_humax_e10.dts @@ -92,6 +92,28 @@ label = "factory"; reg = <0x40000 0x30000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_10007: macaddr@10007 { + reg = <0x10007 0x6>; + }; + + macaddr_factory_1000d: macaddr@1000d { + reg = <0x1000d 0x6>; + }; + }; }; partition@70000 { @@ -113,7 +135,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -122,7 +145,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -162,17 +186,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_10007: macaddr@10007 { - reg = <0x10007 0x6>; - }; - - macaddr_factory_1000d: macaddr@1000d { - reg = <0x1000d 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts index 69c79d7dc768db..b46ba87f39407d 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts @@ -92,12 +92,42 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; iNIC_rf: partition@50000 { label = "iNIC_rf"; reg = <0x50000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_iNIC_rf_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_iNIC_rf_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@60000 { @@ -137,9 +167,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -186,14 +215,16 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&iNIC_rf 0x0>; + nvmem-cells = <&eeprom_iNIC_rf_0>; + nvmem-cell-names = "eeprom"; }; }; &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -201,23 +232,3 @@ &xhci { status = "disabled"; }; - -&iNIC_rf { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_iNIC_rf_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-deax1800gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-deax1800gr.dts index 10959a1fcdc7ba..b9b901a6ce0079 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-deax1800gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-deax1800gr.dts @@ -119,7 +119,6 @@ }; partition@100000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x100000 0x80000>; read-only; @@ -130,7 +129,7 @@ #size-cells = <1>; eeprom: eeprom@0 { - reg = <0x0 0x1aa20>; + reg = <0x0 0xe00>; }; macaddr_factory_4: macaddr@4 { diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts index 653132bc6192f2..9680aadfbbf970 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts @@ -83,6 +83,28 @@ factory: partition@200000 { label = "factory"; reg = <0x200000 0x200000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_1e000: macaddr@1e000 { + reg = <0x1e000 0x6>; + }; + + macaddr_factory_1e006: macaddr@1e006 { + reg = <0x1e006 0x6>; + }; + }; }; partition@400000 { @@ -183,9 +205,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - - mediatek,mtd-eeprom = <&factory 0x0>; ieee80211-freq-limit = <2400000 2500000>; + + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -193,9 +216,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; + + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; @@ -209,17 +233,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_1e000: macaddr@1e000 { - reg = <0x1e000 0x6>; - }; - - macaddr_factory_1e006: macaddr@1e006 { - reg = <0x1e006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts index 8a09675bffbe7a..6bd5e733f4a6fd 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts @@ -92,6 +92,22 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -128,7 +144,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; }; @@ -137,9 +153,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -186,20 +201,11 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi b/target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi index 4b42fcb7de72e5..f25d2db9b30975 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi +++ b/target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi @@ -80,6 +80,20 @@ factory: partition@200000 { label = "factory"; reg = <0x0200000 0x0100000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@300000 { @@ -180,17 +194,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts b/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts index 871327f8a70ccc..1c46f57e584b2d 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts @@ -96,6 +96,24 @@ label = "factory"; reg = <0x040000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -178,7 +196,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -187,7 +206,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -195,13 +215,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_iptime_a3002mesh.dts b/target/linux/ramips/dts/mt7621_iptime_a3002mesh.dts index 678ce0680643b7..05346a10d4a7d5 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a3002mesh.dts +++ b/target/linux/ramips/dts/mt7621_iptime_a3002mesh.dts @@ -73,12 +73,16 @@ reg = <0x0 0x20000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc40: macaddr@1fc40 { - reg = <0x1fc40 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc40: macaddr@1fc40 { + compatible = "mac-base"; + reg = <0x1fc40 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -92,6 +96,16 @@ label = "factory"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + }; }; partition@40000 { @@ -104,9 +118,8 @@ }; &gmac0 { - nvmem-cells = <&macaddr_uboot_1fc40>; + nvmem-cells = <&macaddr_uboot_1fc40 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(2)>; }; &gmac1 { @@ -114,7 +127,7 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_uboot_1fc40>; + nvmem-cells = <&macaddr_uboot_1fc40 0>; nvmem-cell-names = "mac-address"; }; @@ -146,7 +159,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts b/target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts index c08b6427e7697b..3bf0600e5fec7d 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts +++ b/target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts @@ -66,6 +66,20 @@ label = "u-boot"; reg = <0x0 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc20: macaddr@1fc20 { + reg = <0x1fc20 0x6>; + }; + + macaddr_uboot_1fc40: macaddr@1fc40 { + reg = <0x1fc40 0x6>; + }; + }; }; partition@20000 { @@ -78,6 +92,20 @@ label = "factory"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; partition@40000 { @@ -141,7 +169,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -155,7 +184,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -171,17 +201,3 @@ function = "gpio"; }; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc20: macaddr@1fc20 { - reg = <0x1fc20 0x6>; - }; - - macaddr_uboot_1fc40: macaddr@1fc40 { - reg = <0x1fc40 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_iptime_a3004t.dts b/target/linux/ramips/dts/mt7621_iptime_a3004t.dts index 97b6b1c3ee0f37..2394a343c2464e 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a3004t.dts +++ b/target/linux/ramips/dts/mt7621_iptime_a3004t.dts @@ -80,16 +80,24 @@ reg = <0xa0000 0x20000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; }; }; @@ -115,9 +123,8 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(3)>; }; &gmac1 { @@ -125,9 +132,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(1)>; }; &mdio { @@ -168,7 +174,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_iptime_a6004ns-m.dtsi b/target/linux/ramips/dts/mt7621_iptime_a6004ns-m.dtsi index b00fbeb47f9138..ef58382ab61cd6 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a6004ns-m.dtsi +++ b/target/linux/ramips/dts/mt7621_iptime_a6004ns-m.dtsi @@ -77,6 +77,20 @@ label = "u-boot"; reg = <0x0 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc20: macaddr@1fc20 { + reg = <0x1fc20 0x6>; + }; + + macaddr_uboot_1fc40: macaddr@1fc40 { + reg = <0x1fc40 0x6>; + }; + }; }; partition@20000 { @@ -89,6 +103,20 @@ label = "factory"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; }; partition@40000 { @@ -159,7 +187,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -168,21 +197,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc20: macaddr@1fc20 { - reg = <0x1fc20 0x6>; - }; - - macaddr_uboot_1fc40: macaddr@1fc40 { - reg = <0x1fc40 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_iptime_a8004t.dts b/target/linux/ramips/dts/mt7621_iptime_a8004t.dts index 0f5870140fb701..7be11315c540e9 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a8004t.dts +++ b/target/linux/ramips/dts/mt7621_iptime_a8004t.dts @@ -71,6 +71,20 @@ label = "u-boot"; reg = <0x0 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc20: macaddr@1fc20 { + reg = <0x1fc20 0x6>; + }; + + macaddr_uboot_1fc40: macaddr@1fc40 { + reg = <0x1fc40 0x6>; + }; + }; }; partition@20000 { @@ -83,6 +97,20 @@ label = "factory"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; }; partition@40000 { @@ -146,7 +174,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -155,7 +184,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -166,17 +196,3 @@ function = "gpio"; }; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc20: macaddr@1fc20 { - reg = <0x1fc20 0x6>; - }; - - macaddr_uboot_1fc40: macaddr@1fc40 { - reg = <0x1fc40 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts b/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts index 554d73ce3d4cd3..ec02679c23bc8d 100644 --- a/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts +++ b/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts @@ -77,12 +77,16 @@ reg = <0x100000 0x80000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -115,9 +119,8 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; }; &gmac1 { @@ -125,9 +128,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts b/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts index 5d346be1d274e6..fd9bd66bf8c74b 100644 --- a/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts +++ b/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts @@ -87,6 +87,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + }; }; partition@50000 { @@ -106,7 +128,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -119,7 +142,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -178,17 +202,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_jcg_q20.dts b/target/linux/ramips/dts/mt7621_jcg_q20.dts index 34236954d0b6d4..349773e22cd906 100644 --- a/target/linux/ramips/dts/mt7621_jcg_q20.dts +++ b/target/linux/ramips/dts/mt7621_jcg_q20.dts @@ -91,6 +91,24 @@ label = "Factory"; reg = <0x100000 0x80000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_3fff4: macaddr@3fff4 { + reg = <0x3fff4 0x6>; + }; + + macaddr_factory_3fffa: macaddr@3fffa { + reg = <0x3fffa 0x6>; + }; + }; }; partition@180000 { @@ -139,7 +157,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; @@ -184,17 +203,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_3fff4: macaddr@3fff4 { - reg = <0x3fff4 0x6>; - }; - - macaddr_factory_3fffa: macaddr@3fffa { - reg = <0x3fffa 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_jcg_y2.dts b/target/linux/ramips/dts/mt7621_jcg_y2.dts index f8ae9b41df8035..2cec1af23e2033 100644 --- a/target/linux/ramips/dts/mt7621_jcg_y2.dts +++ b/target/linux/ramips/dts/mt7621_jcg_y2.dts @@ -65,6 +65,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -84,7 +102,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -138,17 +157,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts b/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts index 69080df6822ae4..264c908c45b61b 100644 --- a/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts +++ b/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts @@ -126,6 +126,28 @@ label = "rf-eeprom"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_400: eeprom@400 { + reg = <0x400 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; firmware1: partition@50000 { @@ -229,7 +251,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -238,21 +261,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0400>; + nvmem-cells = <&eeprom_factory_400>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts b/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts index 810ca3361af51f..dd8d22445429b3 100644 --- a/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts +++ b/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts @@ -107,6 +107,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -125,7 +147,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -133,7 +156,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -177,17 +201,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_linksys_e5600.dts b/target/linux/ramips/dts/mt7621_linksys_e5600.dts index 3b23a25f8b5163..3f23aa69a4325d 100644 --- a/target/linux/ramips/dts/mt7621_linksys_e5600.dts +++ b/target/linux/ramips/dts/mt7621_linksys_e5600.dts @@ -86,6 +86,20 @@ label = "factory"; reg = <0xc0000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; }; partition@100000 { @@ -136,7 +150,8 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -144,7 +159,8 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_linksys_e7350.dts b/target/linux/ramips/dts/mt7621_linksys_e7350.dts index ea8a6841488a8f..2bce2d75901922 100644 --- a/target/linux/ramips/dts/mt7621_linksys_e7350.dts +++ b/target/linux/ramips/dts/mt7621_linksys_e7350.dts @@ -83,6 +83,16 @@ label = "Factory"; reg = <0x100000 0x80000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + }; }; partition@180000 { @@ -127,7 +137,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_linksys_re6500.dts b/target/linux/ramips/dts/mt7621_linksys_re6500.dts index 0d0c5c3be5c726..3a682245268551 100644 --- a/target/linux/ramips/dts/mt7621_linksys_re6500.dts +++ b/target/linux/ramips/dts/mt7621_linksys_re6500.dts @@ -74,6 +74,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + }; }; partition@50000 { @@ -99,7 +117,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -107,7 +126,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -154,13 +174,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_linksys_re7000.dts b/target/linux/ramips/dts/mt7621_linksys_re7000.dts index 5e33f4891590ae..9b9c84a048762f 100644 --- a/target/linux/ramips/dts/mt7621_linksys_re7000.dts +++ b/target/linux/ramips/dts/mt7621_linksys_re7000.dts @@ -87,6 +87,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + }; }; partition@50000 { @@ -112,7 +130,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -120,7 +139,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -142,13 +162,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts b/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts index 557abcc21af2ea..8e2d866b3b913b 100644 --- a/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts +++ b/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts @@ -97,6 +97,18 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_5: macaddr@5 { + compatible = "mac-base"; + reg = <0x5 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -113,7 +125,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_5>; + nvmem-cells = <&macaddr_factory_5 0>; nvmem-cell-names = "mac-address"; }; @@ -122,9 +134,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_5>; + nvmem-cells = <&macaddr_factory_5 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -160,13 +171,3 @@ &pcie { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_5: macaddr@5 { - reg = <0x5 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_meig_slt866.dts b/target/linux/ramips/dts/mt7621_meig_slt866.dts new file mode 100644 index 00000000000000..d364a917942eb5 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_meig_slt866.dts @@ -0,0 +1,243 @@ +#include "mt7621.dtsi" +#include +#include +#include + +/ { + compatible = "meig,slt866", "mediatek,mt7621-soc"; + model = "MeiG SLT866"; + + aliases { + led-boot = &led_internet; + led-failsafe = &led_internet; + led-upgrade = &led_internet; + label-mac-device = &gmac1; + }; + + leds { + compatible = "gpio-leds"; + + signal4 { + label = "blue:signal4"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + }; + + lanwan { + label = "blue:lanwan"; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + }; + + led_internet: internet { + label = "blue:internet"; + gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; + }; + + wifi { + label = "blue:wifi"; + gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + signal3 { + label = "blue:signal3"; + gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; + }; + + signal2 { + label = "blue:signal2"; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + }; + + signal1 { + label = "blue:signal1"; + gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + regulator-pa-5g { + compatible = "regulator-fixed"; + regulator-name = "pa-5g"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio 7 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-boot-on; + regulator-always-on; + }; +}; + +&state_default { + gpio { + groups = "jtag", "uart2", "uart3", "wdt"; + function = "gpio"; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + reg = <0>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <20000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Bootloader"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "Config"; + reg = <0x30000 0x10000>; + }; + + partition@40000 { + label = "Factory"; + reg = <0x40000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; + }; + + partition@50000 { + label = "firmware"; + compatible = "denx,uimage"; + reg = <0x50000 0xf90000>; + }; + + partition@fe0000 { + label = "m_custom"; + reg = <0xfe0000 0x20000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + + #address-cells = <1>; + #size-cells = <1>; + + macaddr_custom_0: macaddr@0 { + reg = <0x0 0xc>; + compatible = "mac-base"; + #nvmem-cell-cells = <1>; + }; + + macaddr_custom_40: macaddr@40 { + reg = <0x40 0xc>; + compatible = "mac-base"; + #nvmem-cell-cells = <1>; + }; + + macaddr_custom_100: macaddr@100 { + reg = <0x100 0xc>; + compatible = "mac-base"; + #nvmem-cell-cells = <1>; + }; + + macaddr_custom_140: macaddr@140 { + reg = <0x140 0xc>; + compatible = "mac-base"; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@1000000 { + label = "fota_bak"; + reg = <0x1000000 0x1000000>; + read-only; + }; + }; + }; +}; + +ðernet { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; +}; + +&gmac0 { + nvmem-cells = <&macaddr_custom_40 0>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_custom_0 0>; + nvmem-cell-names = "mac-address"; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +&switch0 { + ports { + port@3 { + status = "okay"; + label = "lan"; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + mt76@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_custom_100 0>; + nvmem-cell-names = "eeprom", "mac-address"; + }; +}; + +&pcie1 { + mt76@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <5000000 6000000>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_custom_140 0>; + nvmem-cell-names = "eeprom", "mac-address"; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts b/target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts index 245d130a1fcdab..d663dc63b24e1c 100644 --- a/target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts +++ b/target/linux/ramips/dts/mt7621_mercusys_mr70x-v1.dts @@ -7,7 +7,7 @@ / { compatible = "mercusys,mr70x-v1", "mediatek,mt7621-soc"; - model = "Mercusys MR70X v1"; + model = "MERCUSYS MR70X v1"; aliases { led-boot = &led_power_green; @@ -75,6 +75,18 @@ label = "config"; reg = <0xfa0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@fb0000 { @@ -101,14 +113,14 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 0>; nvmem-cell-names = "mac-address"; mediatek,disable-radar-background; }; }; &gmac0 { - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 0>; nvmem-cell-names = "mac-address"; }; @@ -117,9 +129,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -153,13 +164,3 @@ function = "gpio"; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_mqmaker_witi.dts b/target/linux/ramips/dts/mt7621_mqmaker_witi.dts index d785d741b1c471..0052040f369321 100644 --- a/target/linux/ramips/dts/mt7621_mqmaker_witi.dts +++ b/target/linux/ramips/dts/mt7621_mqmaker_witi.dts @@ -60,6 +60,26 @@ factory: partition@40000 { label = "factory"; reg = <0x40000 0x10000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -78,25 +98,23 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000 0>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; ieee80211-freq-limit = <2400000 2500000>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000 0>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -106,9 +124,8 @@ phy-mode = "rgmii-rxid"; phy-handle = <ðphy5>; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -143,9 +160,8 @@ status = "okay"; label = "wan1"; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; @@ -156,13 +172,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_mtc_wr1201.dts b/target/linux/ramips/dts/mt7621_mtc_wr1201.dts index 0f45743d6f4f8f..43b021fa13ae81 100644 --- a/target/linux/ramips/dts/mt7621_mtc_wr1201.dts +++ b/target/linux/ramips/dts/mt7621_mtc_wr1201.dts @@ -81,6 +81,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -103,7 +123,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; }; @@ -132,9 +152,8 @@ port@4 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; @@ -150,8 +169,9 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; led { led-sources = <2>; @@ -163,8 +183,9 @@ &pcie1 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; ieee80211-freq-limit = <2400000 2500000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; led { led-sources = <2>; @@ -179,13 +200,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_netgear_ex6150.dts b/target/linux/ramips/dts/mt7621_netgear_ex6150.dts index 1695e9c845cc36..41e603c16058b3 100644 --- a/target/linux/ramips/dts/mt7621_netgear_ex6150.dts +++ b/target/linux/ramips/dts/mt7621_netgear_ex6150.dts @@ -121,6 +121,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -214,7 +232,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -222,7 +241,8 @@ &pcie1 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -251,13 +271,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_netgear_r6220.dts b/target/linux/ramips/dts/mt7621_netgear_r6220.dts index f960d8f66fee98..132210cb0ce9bd 100644 --- a/target/linux/ramips/dts/mt7621_netgear_r6220.dts +++ b/target/linux/ramips/dts/mt7621_netgear_r6220.dts @@ -42,7 +42,6 @@ }; factory: partition@2e00000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0x2e00000 0x100000>; read-only; diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi index ab96b8fdd121e4..f5cffb4a2a42b2 100644 --- a/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi @@ -162,7 +162,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; }; @@ -171,9 +171,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &mdio { @@ -216,6 +215,7 @@ reg = <0x20>; gpio-controller; + interrupt-controller; }; }; @@ -342,6 +342,18 @@ reg = <0x4600000 0x200000>; sercomm,scpart-id = <16>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@4800000 { @@ -429,13 +441,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi index cd9582e5412072..fd73bfcb3edad2 100644 --- a/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi @@ -96,7 +96,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; }; @@ -105,9 +105,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &mdio { @@ -270,6 +269,18 @@ reg = <0x4600000 0x200000>; sercomm,scpart-id = <16>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@4800000 { @@ -357,13 +368,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_netgear_wac104.dts b/target/linux/ramips/dts/mt7621_netgear_wac104.dts index 97aa4a90d1b2a7..48a3302e79c454 100644 --- a/target/linux/ramips/dts/mt7621_netgear_wac104.dts +++ b/target/linux/ramips/dts/mt7621_netgear_wac104.dts @@ -99,6 +99,24 @@ label = "factory"; reg = <0x2e00000 0x100000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@4200000 { @@ -117,7 +135,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -126,7 +145,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -175,13 +195,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_netgear_wax202.dts b/target/linux/ramips/dts/mt7621_netgear_wax202.dts index fbe17ef0d38cbb..c0c3500af25ad9 100644 --- a/target/linux/ramips/dts/mt7621_netgear_wax202.dts +++ b/target/linux/ramips/dts/mt7621_netgear_wax202.dts @@ -116,6 +116,16 @@ label = "Factory"; reg = <0x100000 0x80000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + }; }; partition@180000 { @@ -213,7 +223,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_netis_wf2881.dts b/target/linux/ramips/dts/mt7621_netis_wf2881.dts index af09073e3d3624..c58e32377e800b 100644 --- a/target/linux/ramips/dts/mt7621_netis_wf2881.dts +++ b/target/linux/ramips/dts/mt7621_netis_wf2881.dts @@ -66,6 +66,28 @@ label = "factory"; reg = <0x100000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@140000 { @@ -97,7 +119,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -111,7 +134,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -171,17 +195,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_oraybox_x3a.dts b/target/linux/ramips/dts/mt7621_oraybox_x3a.dts index fe26e5af6f9c91..239159996337e2 100644 --- a/target/linux/ramips/dts/mt7621_oraybox_x3a.dts +++ b/target/linux/ramips/dts/mt7621_oraybox_x3a.dts @@ -80,6 +80,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + }; }; partition@50000 { @@ -93,12 +103,16 @@ reg = <0xfe0000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_bdinfo_9: macaddr@9 { - reg = <0x9 0x6>; + macaddr_bdinfo_9: macaddr@9 { + compatible = "mac-base"; + reg = <0x9 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -119,12 +133,13 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; &gmac0 { - nvmem-cells = <&macaddr_bdinfo_9>; + nvmem-cells = <&macaddr_bdinfo_9 0>; nvmem-cell-names = "mac-address"; }; @@ -133,9 +148,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_bdinfo_9>; + nvmem-cells = <&macaddr_bdinfo_9 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { diff --git a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts index b18d12608acc75..85cf8ecfd3ef60 100644 --- a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts +++ b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts @@ -73,6 +73,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -98,12 +120,11 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; /* 5 GHz (phy1) does not take the address from calibration data, but setting it manually here works */ - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -157,21 +178,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_planex_vr500.dts b/target/linux/ramips/dts/mt7621_planex_vr500.dts index 1da6d2cca12583..93e7280b4c06f9 100644 --- a/target/linux/ramips/dts/mt7621_planex_vr500.dts +++ b/target/linux/ramips/dts/mt7621_planex_vr500.dts @@ -63,6 +63,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -124,17 +138,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts b/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts index 07297df08330b7..4a9e420370a47b 100644 --- a/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts +++ b/target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts @@ -81,8 +81,6 @@ reg = <0x80000 0x80000>; read-only; - compatible = "nvmem-cells"; - nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; @@ -107,12 +105,18 @@ reg = <0x100000 0x40000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; @@ -136,11 +140,10 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; /* 5 GHz (phy1) does not take the address from calibration data, but setting it manually here works */ - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; diff --git a/target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts b/target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts index c56c2f1554c023..8a32a86e7bb045 100644 --- a/target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts +++ b/target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts @@ -71,6 +71,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -90,10 +110,9 @@ wifi0: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; }; }; @@ -101,18 +120,15 @@ wifi1: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_4 1>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &gmac1 { @@ -120,9 +136,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &mdio { @@ -155,13 +170,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_rostelecom_rt-sf-1.dts b/target/linux/ramips/dts/mt7621_rostelecom_rt-sf-1.dts index c476cf94957318..b722df5bbb8260 100644 --- a/target/linux/ramips/dts/mt7621_rostelecom_rt-sf-1.dts +++ b/target/linux/ramips/dts/mt7621_rostelecom_rt-sf-1.dts @@ -9,22 +9,19 @@ &pcie0 { wifi@0,0 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(3)>; }; }; &pcie1 { wifi@0,0 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(2)>; }; }; &gmac1 { - nvmem-cells = <&macaddr_factory_21000>; + nvmem-cells = <&macaddr_factory_21000 11>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(11)>; }; diff --git a/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts b/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts index d1f51feddddf6a..c3c5a2ff4a8200 100644 --- a/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts +++ b/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts @@ -75,6 +75,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -93,7 +115,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -101,7 +124,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -155,17 +179,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi b/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi index a0534bdabd9582..36d576108d7fb5 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi +++ b/target/linux/ramips/dts/mt7621_sercomm_dxx_nand_256m.dtsi @@ -103,12 +103,24 @@ sercomm,scpart-id = <2>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_21000: macaddr@21000 { - reg = <0x21000 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_21000: macaddr@21000 { + compatible = "mac-base"; + reg = <0x21000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -172,7 +184,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -181,7 +194,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_sercomm_na502.dts b/target/linux/ramips/dts/mt7621_sercomm_na502.dts index 9ec4cf77888cf8..44b1077bc60abc 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_na502.dts +++ b/target/linux/ramips/dts/mt7621_sercomm_na502.dts @@ -100,7 +100,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -127,6 +127,26 @@ factory: partition@100000 { label = "factory"; reg = <0x100000 0x40000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@140000 { @@ -174,10 +194,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000 1>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -186,10 +204,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000 2>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -217,13 +233,3 @@ &uartlite3 { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_sercomm_na502s.dts b/target/linux/ramips/dts/mt7621_sercomm_na502s.dts index dc71dbd050297a..bea5998935f6bd 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_na502s.dts +++ b/target/linux/ramips/dts/mt7621_sercomm_na502s.dts @@ -204,7 +204,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -231,6 +231,26 @@ factory: partition@100000 { label = "factory"; reg = <0x100000 0x40000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@140000 { @@ -278,10 +298,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000 1>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -290,10 +308,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; - nvmem-cells = <&macaddr_factory_e000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000 2>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -317,6 +333,7 @@ reg = <0x22>; gpio-controller; + interrupt-controller; }; gpio_expander0: gpio-expander0@20 { @@ -326,6 +343,7 @@ reg = <0x20>; gpio-controller; + interrupt-controller; }; gpio_expander1: gpio-expander1@21 { @@ -335,6 +353,7 @@ reg = <0x21>; gpio-controller; + interrupt-controller; }; }; @@ -350,13 +369,3 @@ &uartlite2 { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi b/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi index 91053f15bc1468..09862b8067a15f 100644 --- a/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi +++ b/target/linux/ramips/dts/mt7621_sercomm_s1500.dtsi @@ -158,7 +158,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_1000>; + nvmem-cells = <&macaddr_factory_1000 0>; nvmem-cell-names = "mac-address"; }; @@ -181,12 +181,24 @@ reg = <0x100000 0x100000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_1000: macaddr@1000 { - reg = <0x1000 0x6>; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_1000: macaddr@1000 { + compatible = "mac-base"; + reg = <0x1000 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -220,23 +232,9 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; ieee80211-freq-limit = <5000000 6000000>; - mediatek,mtd-eeprom = <&factory 0x8000>; - - nvmem-cells = <&macaddr_factory_1000>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; - }; -}; - -&pcie1 { - wlan_2g: wifi@0,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - ieee80211-freq-limit = <2400000 2500000>; - mediatek,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_factory_1000>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_1000 2>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -273,9 +271,8 @@ status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_1000>; + nvmem-cells = <&macaddr_factory_1000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; diff --git a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts index 7f0dbf772df631..7383ba1e20942e 100644 --- a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts +++ b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts @@ -104,7 +104,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -113,7 +114,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -148,16 +150,26 @@ reg = <0x40000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-lite.dts b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-lite.dts index 38cd1cd8fd87c0..51425b9a1569f1 100644 --- a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-lite.dts +++ b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-lite.dts @@ -77,6 +77,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -144,7 +166,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -153,21 +176,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-sfp.dts b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-sfp.dts index 2a5dfe379c64e0..65f33f615bec2e 100644 --- a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-sfp.dts +++ b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-sfp.dts @@ -116,6 +116,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -200,20 +218,7 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; - }; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts b/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts index 833e1b07d0c946..60817edbbff7bb 100644 --- a/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts +++ b/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts @@ -70,6 +70,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e006: macaddr@e006 { + compatible = "mac-base"; + reg = <0xe006 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -88,7 +108,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -96,13 +117,14 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_e006>; + nvmem-cells = <&macaddr_factory_e006 0>; nvmem-cell-names = "mac-address"; }; @@ -111,9 +133,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_e006>; + nvmem-cells = <&macaddr_factory_e006 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -152,13 +173,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts b/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts index 23e85f990229d8..4d8fa7f320d94a 100644 --- a/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts +++ b/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts @@ -109,6 +109,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e006: macaddr@e006 { + compatible = "mac-base"; + reg = <0xe006 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; firmware: partition@50000 { @@ -125,7 +145,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e006>; + nvmem-cells = <&macaddr_factory_e006 0>; nvmem-cell-names = "mac-address"; }; @@ -154,9 +174,8 @@ port@4 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_e006>; + nvmem-cells = <&macaddr_factory_e006 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; @@ -176,7 +195,8 @@ wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -185,7 +205,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -193,13 +214,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts b/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts index 2d91d1c481a171..7b1e5d863b5c1c 100644 --- a/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts +++ b/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts @@ -105,13 +105,14 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; }; @@ -120,9 +121,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &mdio { @@ -197,6 +197,22 @@ label = "factory"; reg = <0x50000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@90000 { @@ -207,13 +223,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_thunder_timecloud.dts b/target/linux/ramips/dts/mt7621_thunder_timecloud.dts index 917a6beb512228..da1db0366f461e 100644 --- a/target/linux/ramips/dts/mt7621_thunder_timecloud.dts +++ b/target/linux/ramips/dts/mt7621_thunder_timecloud.dts @@ -82,6 +82,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + }; }; partition@50000 { @@ -113,13 +123,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_totolink_a7000r.dts b/target/linux/ramips/dts/mt7621_totolink_a7000r.dts index bba0d4a5d37090..dd6cc5d844b783 100644 --- a/target/linux/ramips/dts/mt7621_totolink_a7000r.dts +++ b/target/linux/ramips/dts/mt7621_totolink_a7000r.dts @@ -66,6 +66,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -85,7 +105,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -94,13 +115,14 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -109,9 +131,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -150,13 +171,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_totolink_x5000r.dts b/target/linux/ramips/dts/mt7621_totolink_x5000r.dts index 79667caf73d49f..d2c242be6f4328 100644 --- a/target/linux/ramips/dts/mt7621_totolink_x5000r.dts +++ b/target/linux/ramips/dts/mt7621_totolink_x5000r.dts @@ -73,6 +73,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -92,7 +110,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; @@ -147,17 +166,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tozed_zlt-s12-pro.dts b/target/linux/ramips/dts/mt7621_tozed_zlt-s12-pro.dts index 5a94bbda829de0..2d8717e3cdd082 100644 --- a/target/linux/ramips/dts/mt7621_tozed_zlt-s12-pro.dts +++ b/target/linux/ramips/dts/mt7621_tozed_zlt-s12-pro.dts @@ -164,12 +164,22 @@ reg = <0x40000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; }; }; @@ -190,7 +200,8 @@ wifi0: mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -199,7 +210,8 @@ wifi1: mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts b/target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts index 50834c586643ec..1bc3f7e4f50de6 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts @@ -108,6 +108,18 @@ label = "config"; reg = <0xfa0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@fb0000 { @@ -134,14 +146,14 @@ compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 0>; nvmem-cell-names = "mac-address"; mediatek,disable-radar-background; }; }; &gmac0 { - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 0>; nvmem-cell-names = "mac-address"; }; @@ -150,9 +162,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -191,13 +202,3 @@ function = "gpio"; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts index c626df1ef4e6f4..522408b220c809 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts @@ -119,6 +119,18 @@ label = "config"; reg = <0xfa0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@fb0000 { @@ -131,6 +143,20 @@ label = "radio"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; }; }; }; @@ -144,9 +170,8 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_8>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8 0>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -155,16 +180,14 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - nvmem-cells = <&macaddr_config_8>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_8 (-1)>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <5000000 6000000>; }; }; &gmac0 { - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 0>; nvmem-cell-names = "mac-address"; }; @@ -173,9 +196,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -218,13 +240,3 @@ &xhci { vbus-supply = <®_usb_vbus>; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi b/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi index 217c1b60fe429f..d3db8cd602cb76 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi +++ b/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi @@ -4,6 +4,7 @@ #include #include +#include / { aliases { @@ -21,14 +22,14 @@ keys { compatible = "gpio-keys"; - wps { + button-wps { label = "wps"; - gpios = <&gpio 28 GPIO_ACTIVE_LOW>; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; debounce-interval = <60>; linux,code = ; }; - reset { + button-reset { label = "reset"; gpios = <&gpio 8 GPIO_ACTIVE_LOW>; debounce-interval = <60>; @@ -39,35 +40,44 @@ leds { compatible = "gpio-leds"; - led_power: power { + led_power: led-power { label = "green:power"; + color = ; + function = LED_FUNCTION_POWER; gpios = <&gpio 4 GPIO_ACTIVE_LOW>; }; - wan_orange { - label = "orange:wan"; + led-wan-amber { + color = ; + function = LED_FUNCTION_WAN; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; }; - lan { - label = "green:lan"; + led-lan { + color = ; + function = LED_FUNCTION_LAN; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; }; - wifi5g { - label = "green:wifi5g"; + led-wifi5g { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <5>; gpios = <&gpio 16 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy1tpt"; }; - wifi2g { - label = "green:wifi2g"; + led-wifi2g { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <2>; gpios = <&gpio 18 GPIO_ACTIVE_LOW>; linux,default-trigger = "phy0tpt"; }; - wan_green { - label = "green:wan"; + led-wan-green { + color = ; + function = LED_FUNCTION_WAN; gpios = <&gpio 45 GPIO_ACTIVE_LOW>; }; }; @@ -102,12 +112,38 @@ label = "config"; reg = <0xfa0000 0x50000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; radio: partition@ff0000 { label = "radio"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; }; }; }; @@ -128,10 +164,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_8>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8 1>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -140,10 +174,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - nvmem-cells = <&macaddr_config_8>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_8 2>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -153,7 +185,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_config_8>; + nvmem-cells = <&macaddr_config_8 0>; nvmem-cell-names = "mac-address"; }; @@ -185,13 +217,3 @@ }; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts b/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts index 3d17dbf599cdcb..087910233e28c1 100644 --- a/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts +++ b/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts @@ -131,12 +131,14 @@ reg = <0xfa0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_8: macaddr@8 { - reg = <0x8 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_8: macaddr@8 { + reg = <0x8 0x6>; + }; }; }; @@ -150,6 +152,20 @@ label = "radio"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; }; }; }; @@ -188,7 +204,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&eeprom_radio_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -197,7 +214,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; + nvmem-cells = <&eeprom_radio_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts b/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts index cd7cae635509ca..a91a18efc75808 100644 --- a/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts @@ -85,6 +85,18 @@ label = "product-info"; reg = <0x90000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@a0000 { @@ -117,6 +129,20 @@ label = "radio"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; }; }; }; @@ -136,25 +162,22 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_info_8>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_info_8 0>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; &pcie1 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_info_8>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_info_8 1>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; &gmac0 { - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; @@ -163,7 +186,7 @@ label = "lan0"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_info_8>; + nvmem-cells = <&macaddr_info_8 0>; nvmem-cell-names = "mac-address"; }; @@ -191,13 +214,3 @@ }; }; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts b/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts index d25bf5756022e5..cf08452c50dba4 100644 --- a/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_eap613-v1.dts @@ -70,16 +70,18 @@ }; partition@90000 { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - label = "product-info"; reg = <0x90000 0x10000>; read-only; - macaddr: macaddr@8 { - reg = <0x8 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr: macaddr@8 { + reg = <0x8 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts index 58e4bbf75741f0..f9bbd9b39286e1 100644 --- a/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts @@ -93,6 +93,16 @@ label = "product-info"; reg = <0x90000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_info_8: macaddr@8 { + reg = <0x8 0x6>; + }; + }; }; partition@a0000 { @@ -186,13 +196,3 @@ }; }; }; - -&info { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_info_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts b/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts index 537b6f70a73d27..84b3efe8df9d71 100644 --- a/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_ec330-g5u-v1.dts @@ -73,7 +73,7 @@ function = LED_FUNCTION_WLAN; function-enumerator = <0>; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1radio"; + linux,default-trigger = "phy1tpt"; }; led-6 { @@ -82,7 +82,7 @@ function = LED_FUNCTION_WLAN; function-enumerator = <1>; gpios = <&gpio 16 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0radio"; + linux,default-trigger = "phy0tpt"; }; led_power: led-7 { @@ -229,21 +229,25 @@ reg = <0x7800000 0x400000>; read-only; - compatible = "nvmem-cells"; - nvmem-layout { compatible = "fixed-layout"; #address-cells = <1>; #size-cells = <1>; + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + eeprom_factory_14000: eeprom@14000 { + reg = <0x14000 0x4da8>; + }; + macaddr_factory_165: macaddr@165 { compatible = "mac-base"; reg = <0x165 0x11>; #nvmem-cell-cells = <1>; }; }; - - }; partition@0_wholeflash { @@ -262,11 +266,9 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <2400000 2500000>; - - nvmem-cells = <&macaddr_factory_165 0>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_165 0>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -274,11 +276,9 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x14000>; ieee80211-freq-limit = <5000000 6000000>; - - nvmem-cells = <&macaddr_factory_165 2>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_14000>, <&macaddr_factory_165 2>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_ex220-v1.dts b/target/linux/ramips/dts/mt7621_tplink_ex220-v1.dts new file mode 100644 index 00000000000000..c809cb0c0b28b4 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_tplink_ex220-v1.dts @@ -0,0 +1,245 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "tplink,ex220-v1", "mediatek,mt7621-soc"; + model = "TP-Link EX220 v1"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + button-wps { + label = "rfkill"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + button-reset { + label = "reset"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-wps { + color = ; + function = LED_FUNCTION_WPS; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + led-lan { + color = ; + function = LED_FUNCTION_LAN; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + led-wan-orange { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + led-wan-green { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + led-wifi5g { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <5>; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + led-wifi2g { + color = ; + function = LED_FUNCTION_WLAN; + function-enumerator = <2>; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_power: led-power { + label = "green:power"; // to be removed once #13837 is merged + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "boot"; + reg = <0x00 0x30000>; + read-only; + }; + + partition@30000 { + label = "boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "config"; + reg = <0x50000 0x10000>; + read-only; + }; + + partition@60000 { + label = "isp_config"; + reg = <0x60000 0x10000>; + read-only; + }; + + partition@70000 { + label = "rom_file"; + reg = <0x70000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_rom_file_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@80000 { + label = "cloud"; + reg = <0x80000 0x10000>; + read-only; + }; + + radio: partition@90000 { + label = "radio"; + reg = <0x90000 0x20000>; + read-only; + }; + + partition@b0000 { + label = "config_bak"; + reg = <0xb0000 0x10000>; + read-only; + }; + + partition@c0000 { + compatible = "denx,fit"; + label = "firmware"; + reg = <0xc0000 0xf30000>; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&macaddr_rom_file_f100 0>; + nvmem-cell-names = "mac-address"; + mediatek,disable-radar-background; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_rom_file_f100 0>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_rom_file_f100 1>; + nvmem-cell-names = "mac-address"; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan1"; + }; + + port@1 { + status = "okay"; + label = "lan2"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + + port@3 { + status = "okay"; + label = "lan4"; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart3", "jtag", "wdt"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_tplink_mr600-v2-eu.dts b/target/linux/ramips/dts/mt7621_tplink_mr600-v2-eu.dts index b7475ec15badb1..6b73ffff24f182 100644 --- a/target/linux/ramips/dts/mt7621_tplink_mr600-v2-eu.dts +++ b/target/linux/ramips/dts/mt7621_tplink_mr600-v2-eu.dts @@ -112,6 +112,18 @@ label = "romfile"; reg = <0xfc0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_romfile_f100: romfile@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@fd0000 { @@ -124,6 +136,20 @@ label = "radio"; reg = <0xfe0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; }; }; }; @@ -138,10 +164,8 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&macaddr_romfile_f100>; - nvmem-cell-names = "mac-address"; - mediatek,mtd-eeprom = <&radio 0x0>; - mtd-mac-address = <&romfile 0xf100>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_romfile_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -150,16 +174,14 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_romfile_f100>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_romfile_f100 (-1)>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; &gmac0 { - nvmem-cells = <&macaddr_romfile_f100>; + nvmem-cells = <&macaddr_romfile_f100 0>; nvmem-cell-names = "mac-address"; }; @@ -168,7 +190,7 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_romfile_f100>; + nvmem-cells = <&macaddr_romfile_f100 0>; nvmem-cell-names = "mac-address"; }; @@ -195,13 +217,3 @@ }; }; }; - -&romfile { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_romfile_f100: romfile@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts b/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts index 866abf87c613a1..be23abf4c83edf 100644 --- a/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts @@ -111,12 +111,38 @@ label = "config"; reg = <0x600000 0x50000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_10008: macaddr@10008 { + compatible = "mac-base"; + reg = <0x10008 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; radio: partition@7f0000 { label = "radio"; reg = <0x7f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; }; }; @@ -129,21 +155,17 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008 1>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008 2>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -152,7 +174,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_config_10008>; + nvmem-cells = <&macaddr_config_10008 0>; nvmem-cell-names = "mac-address"; }; @@ -171,13 +193,3 @@ function = "gpio"; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_10008: macaddr@10008 { - reg = <0x10008 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_re650-v2.dts b/target/linux/ramips/dts/mt7621_tplink_re650-v2.dts index aa65b68f0635d9..7dcd5e553cd79c 100644 --- a/target/linux/ramips/dts/mt7621_tplink_re650-v2.dts +++ b/target/linux/ramips/dts/mt7621_tplink_re650-v2.dts @@ -120,12 +120,38 @@ label = "config"; reg = <0x7c0000 0x2d440>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_10008: macaddr@10008 { + compatible = "mac-base"; + reg = <0x10008 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; radio: partition@7f0000 { label = "radio"; reg = <0x7f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; }; }; }; @@ -146,10 +172,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008 1>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -158,10 +182,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008 2>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -171,7 +193,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_config_10008>; + nvmem-cells = <&macaddr_config_10008 0>; nvmem-cell-names = "mac-address"; }; @@ -183,13 +205,3 @@ }; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_10008: macaddr@10008 { - reg = <0x10008 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi b/target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi index f67c0e3c6d9011..3784a4f3c952f9 100644 --- a/target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi +++ b/target/linux/ramips/dts/mt7621_tplink_rexx0-v1.dtsi @@ -117,6 +117,18 @@ label = "config"; reg = <0xe00000 0x50000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_10008: macaddr@10008 { + compatible = "mac-base"; + reg = <0x10008 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; /* range 0xe50000 to 0xff0000 is empty in vendor @@ -127,6 +139,20 @@ label = "radio"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; }; }; }; @@ -147,10 +173,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008 1>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -159,10 +183,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008 2>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -172,7 +194,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_config_10008>; + nvmem-cells = <&macaddr_config_10008 0>; nvmem-cell-names = "mac-address"; }; @@ -184,13 +206,3 @@ }; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_10008: macaddr@10008 { - reg = <0x10008 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts b/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts index 0d466f1e6610cf..1e0fd2023970ca 100644 --- a/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts +++ b/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts @@ -115,12 +115,38 @@ label = "config"; reg = <0x730000 0xc0000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_2008: macaddr@2008 { + compatible = "mac-base"; + reg = <0x2008 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; radio: partition@7f0000 { label = "radio"; reg = <0x7f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + }; }; }; }; @@ -141,9 +167,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x0>; - nvmem-cells = <&macaddr_config_2008>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_2008 0>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -152,10 +177,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - nvmem-cells = <&macaddr_config_2008>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_2008 1>; + nvmem-cell-names = "eeprom", "mac-address"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -165,7 +188,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_config_2008>; + nvmem-cells = <&macaddr_config_2008 0>; nvmem-cell-names = "mac-address"; }; @@ -192,13 +215,3 @@ }; }; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_2008: macaddr@2008 { - reg = <0x2008 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi index 411bf6a85ac6e5..b2b78aba6322d9 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi +++ b/target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dtsi @@ -83,7 +83,6 @@ }; factory: partition@e0000 { - compatible = "nvmem-cells"; label = "factory"; reg = <0xe0000 0x60000>; diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts index 54e372eca396b0..cd19893e1451df 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-6-lite.dts @@ -40,12 +40,38 @@ label = "factory"; reg = <0x70000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + }; }; eeprom: partition@b0000 { label = "eeprom"; reg = <0xb0000 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 { + compatible = "mac-base"; + reg = <0x6 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@c0000 { @@ -79,10 +105,8 @@ }; &wlan_2g { - mediatek,mtd-eeprom = <&factory 0x0>; - - nvmem-cells = <&macaddr_eeprom_0>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_eeprom_0>; + nvmem-cell-names = "eeprom", "mac-address"; }; &wlan_5g { @@ -90,9 +114,6 @@ mediatek,mtd-eeprom = <&factory 0x20000>; - nvmem-cells = <&macaddr_eeprom_6>; - nvmem-cell-names = "mac-address"; - /* This is a workaround. * * Ubiquiti uses a +2 offset in the first octet relative @@ -105,23 +126,10 @@ * mac80211 increases the first octet by two for each VAP, leading * to conflicting MAC addresses for subsequent interfaces. */ - mac-address-increment = <1>; + nvmem-cells = <&macaddr_eeprom_6 1>; + nvmem-cell-names = "mac-address"; ieee80211-freq-limit = <5000000 6000000>; mediatek,disable-radar-background; }; - -&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/ramips/dts/mt7621_ubnt_unifi-flexhd.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-flexhd.dts index 615bdf4e13b7fe..36df3ef883dcc8 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-flexhd.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-flexhd.dts @@ -67,6 +67,18 @@ label = "eeprom"; reg = <0x80000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_eeprom_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@90000 { @@ -95,18 +107,8 @@ }; }; -&eeprom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_eeprom_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; - &gmac0 { - nvmem-cells = <&macaddr_eeprom_0>; + nvmem-cells = <&macaddr_eeprom_0 0>; nvmem-cell-names = "mac-address"; }; @@ -129,9 +131,8 @@ mediatek,mtd-eeprom = <&factory 0x0>; // On newer devices there is a MediaTek MAC in the above // device EEPROM, so override it with a calculated one. - nvmem-cells = <&macaddr_eeprom_0>; + nvmem-cells = <&macaddr_eeprom_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; @@ -141,9 +142,8 @@ mediatek,mtd-eeprom = <&factory 0x8000>; // On newer devices there is a MediaTek MAC in the above // device EEPROM, so override it with a calculated one. - nvmem-cells = <&macaddr_eeprom_0>; + nvmem-cells = <&macaddr_eeprom_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; }; diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts index 2762a777a3533a..b4000464f7be6e 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts @@ -42,6 +42,16 @@ label = "eeprom"; reg = <0x80000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_eeprom_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; }; partition@90000 { @@ -82,13 +92,3 @@ &wlan_5g { mediatek,mtd-eeprom = <&factory 0x8000>; }; - -&eeprom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_eeprom_0: macaddr@0 { - reg = <0x0 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_ubnt_usw-flex.dts b/target/linux/ramips/dts/mt7621_ubnt_usw-flex.dts index ff328bd858b397..f09ccba58556fb 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_usw-flex.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_usw-flex.dts @@ -138,17 +138,18 @@ }; part_eeprom: partition@80000 { - compatible = "nvmem-cells"; - - #address-cells = <1>; - #size-cells = <1>; - label = "eeprom"; reg = <0x80000 0x10000>; read-only; - macaddr_eeprom: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_eeprom: macaddr@0 { + reg = <0x0 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts b/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts index 8780b17b80b8f0..c933e443c12e6b 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts @@ -36,6 +36,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -56,17 +78,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi b/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi index f2900e48060be2..32527835248b43 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi @@ -54,7 +54,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -63,7 +64,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts b/target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts index 212c0009425f04..c51b6eebee0aca 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; firmware: partition@50000 { @@ -61,17 +75,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-06-32m.dts b/target/linux/ramips/dts/mt7621_unielec_u7621-06-32m.dts index dc9a9773a240fd..4d34a787b6682d 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-06-32m.dts +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06-32m.dts @@ -42,6 +42,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; firmware: partition@50000 { @@ -62,17 +76,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts b/target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts index f196432111b688..edc3a7723a2618 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts @@ -42,6 +42,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; firmware: partition@50000 { @@ -62,17 +76,3 @@ nvmem-cells = <&macaddr_factory_e006>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_wavlink_wl-wn53xax.dtsi b/target/linux/ramips/dts/mt7621_wavlink_wl-wn53xax.dtsi index 843e9a30c7e341..e0db05724e7b90 100644 --- a/target/linux/ramips/dts/mt7621_wavlink_wl-wn53xax.dtsi +++ b/target/linux/ramips/dts/mt7621_wavlink_wl-wn53xax.dtsi @@ -95,6 +95,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -178,17 +192,3 @@ &uartlite2 { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts b/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts old mode 100755 new mode 100644 index d8a94c85b9fa69..dd2150c1a6bf2e --- a/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts +++ b/target/linux/ramips/dts/mt7621_wavlink_wl-wn573hx1.dts @@ -86,9 +86,19 @@ reg = <0x30000 0x10000>; }; - factory:partition@50000 { + factory: partition@50000 { label = "factory"; reg = <0x50000 0x40000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_3fff4: macaddr@3fff4 { + reg = <0x3fff4 0x6>; + }; + }; }; partition@90000 { @@ -119,15 +129,3 @@ }; }; }; - - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_3fff4: macaddr@3fff4 { - reg = <0x3fff4 0x6>; - }; - -}; diff --git a/target/linux/ramips/dts/mt7621_wavlink_ws-wn572hp3-4g.dts b/target/linux/ramips/dts/mt7621_wavlink_ws-wn572hp3-4g.dts index 60d0708a80e83f..55e828a29557f1 100644 --- a/target/linux/ramips/dts/mt7621_wavlink_ws-wn572hp3-4g.dts +++ b/target/linux/ramips/dts/mt7621_wavlink_ws-wn572hp3-4g.dts @@ -87,6 +87,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -109,10 +131,12 @@ }; &pcie0 { - wifi0: mt76@0,0 { + mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + ieee80211-freq-limit = <2400000 2500000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -120,7 +144,9 @@ wifi1: mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; @@ -159,26 +185,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; - -&wifi0{ - ieee80211-freq-limit = <2400000 2500000>; -}; - -&wifi1{ - ieee80211-freq-limit = <5000000 6000000>; -}; - diff --git a/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi b/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi index cfd2344d21c687..8b018e18ae4402 100644 --- a/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi +++ b/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi @@ -66,6 +66,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + }; }; partition@50000 { @@ -85,7 +107,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; led { led-sources = <0>; @@ -98,7 +121,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -153,17 +177,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_wifire_s1500-nbn.dts b/target/linux/ramips/dts/mt7621_wifire_s1500-nbn.dts index 6c0e2965aa0d10..4ffe9881536315 100644 --- a/target/linux/ramips/dts/mt7621_wifire_s1500-nbn.dts +++ b/target/linux/ramips/dts/mt7621_wifire_s1500-nbn.dts @@ -76,6 +76,13 @@ */ }; -&wlan_2g { - mac-address-increment = <1>; +&pcie1 { + wlan_2g: wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <2400000 2500000>; + + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_1000 1>; + nvmem-cell-names = "eeprom", "mac-address"; + }; }; diff --git a/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts b/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts index ec81839d1d2490..78f81314fc1274 100644 --- a/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts +++ b/target/linux/ramips/dts/mt7621_winstars_ws-wn583a6.dts @@ -87,6 +87,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -106,7 +128,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -114,7 +137,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; @@ -153,17 +177,3 @@ &xhci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts index 34d0e4a03188c2..a403cd3e14ff18 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts @@ -135,6 +135,28 @@ label = "factory"; reg = <0x0c0000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@100000 { @@ -179,7 +201,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -188,7 +211,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -238,17 +262,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts index c13c0c95709994..763973a193fde2 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts @@ -132,17 +132,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4.dts index 232a720e5492cf..8340ca5d287f39 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4.dts @@ -104,17 +104,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-common.dtsi b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-common.dtsi index efc32733e9bc16..7ce9aea3351fec 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-common.dtsi +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-common.dtsi @@ -64,6 +64,20 @@ label = "factory"; reg = <0x50000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@60000 { @@ -122,17 +136,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dtsi b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dtsi index 14ad0f26ba1c34..d1a2c08c6dee62 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dtsi +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dtsi @@ -89,6 +89,24 @@ label = "Factory"; reg = <0x100000 0x80000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_3fff4: macaddr@3fff4 { + reg = <0x3fff4 0x6>; + }; + + macaddr_factory_3fffa: macaddr@3fffa { + reg = <0x3fffa 0x6>; + }; + }; }; partition@180000 { @@ -135,7 +153,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; mediatek,disable-radar-background; }; }; @@ -185,17 +204,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_3fff4: macaddr@3fff4 { - reg = <0x3fff4 0x6>; - }; - - macaddr_factory_3fffa: macaddr@3fffa { - reg = <0x3fffa 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_nand_128m.dtsi b/target/linux/ramips/dts/mt7621_xiaomi_nand_128m.dtsi index 12e6bccc2e2696..1dc91d8b47eeef 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_nand_128m.dtsi +++ b/target/linux/ramips/dts/mt7621_xiaomi_nand_128m.dtsi @@ -50,6 +50,20 @@ label = "factory"; reg = <0x100000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@140000 { diff --git a/target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi b/target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi index 78f154b3aed18b..c7d6c574aa0c67 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi +++ b/target/linux/ramips/dts/mt7621_xiaomi_router-ac2100.dtsi @@ -69,17 +69,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts b/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts index e4de0b82310fd7..7bb90e542ec230 100644 --- a/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts +++ b/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts @@ -70,6 +70,18 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -86,7 +98,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; }; @@ -95,9 +107,8 @@ label = "wan"; phy-handle = <ðphy4>; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -136,13 +147,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts b/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts index 32f7e5056a313c..147713ddce19cf 100644 --- a/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts +++ b/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts @@ -116,6 +116,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -139,7 +159,8 @@ wifi@0,0 { compatible = "pci1400,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -147,7 +168,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -157,7 +179,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -186,9 +208,8 @@ port@4 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; @@ -199,13 +220,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts b/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts index 2d61b8756052bf..e715237a401243 100644 --- a/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts +++ b/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts @@ -89,6 +89,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -107,14 +129,16 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -174,17 +198,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_youku_yk-l2.dts b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts index 5342b40507af3f..98d2e6892254b0 100644 --- a/target/linux/ramips/dts/mt7621_youku_yk-l2.dts +++ b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts @@ -92,6 +92,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -112,7 +134,8 @@ wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { led-active-low; @@ -124,7 +147,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { led-sources = <2>; @@ -183,17 +207,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_yuncore_ax820.dts b/target/linux/ramips/dts/mt7621_yuncore_ax820.dts index 1aba94a9125591..bbd546f300994f 100644 --- a/target/linux/ramips/dts/mt7621_yuncore_ax820.dts +++ b/target/linux/ramips/dts/mt7621_yuncore_ax820.dts @@ -115,6 +115,18 @@ label = "Factory"; reg = <0x50000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@90000 { @@ -140,7 +152,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -149,9 +161,8 @@ label = "wan"; phy-handle = <ðphy0>; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &mdio { @@ -178,13 +189,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_yuncore_fap640.dts b/target/linux/ramips/dts/mt7621_yuncore_fap640.dts index d525dde385b4d9..8c662b86cd4b57 100644 --- a/target/linux/ramips/dts/mt7621_yuncore_fap640.dts +++ b/target/linux/ramips/dts/mt7621_yuncore_fap640.dts @@ -123,6 +123,20 @@ label = "Factory"; reg = <0x50000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_0004: macaddr@0004 { + reg = <0x0004 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@90000 { @@ -201,18 +215,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_0004: macaddr@0004 { - reg = <0x0004 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; - diff --git a/target/linux/ramips/dts/mt7621_yuncore_fap690.dts b/target/linux/ramips/dts/mt7621_yuncore_fap690.dts index a998b95d4c51ee..ce6a60215e27b5 100644 --- a/target/linux/ramips/dts/mt7621_yuncore_fap690.dts +++ b/target/linux/ramips/dts/mt7621_yuncore_fap690.dts @@ -93,6 +93,16 @@ label = "Factory"; reg = <0x50000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_0004: macaddr@0004 { + reg = <0x0004 0x6>; + }; + }; }; partition@90000 { @@ -137,13 +147,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_0004: macaddr@0004 { - reg = <0x0004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts index 99b9652b7ab31c..2c78dea114f6e8 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts @@ -62,6 +62,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; partition@50000 { @@ -125,7 +147,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -139,7 +162,8 @@ wifi1: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; led { @@ -152,17 +176,3 @@ &sdhci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts index a6d0e9a7c2053d..571b50d3c770d3 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts @@ -59,6 +59,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; firmware: partition@50000 { @@ -78,7 +100,8 @@ wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -91,7 +114,8 @@ wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -145,17 +169,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi index 64492af4d8a276..1a3387326a6b90 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602-v04.dtsi @@ -114,6 +114,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; firmware: partition@50000 { @@ -132,7 +154,8 @@ wifi0: wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -140,7 +163,8 @@ wifi1: wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -199,17 +223,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi index c80544cfc95ddf..e92982a8796b8f 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1602.dtsi @@ -113,6 +113,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; + }; }; firmware: partition@50000 { @@ -131,7 +153,8 @@ wifi0: wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -139,7 +162,8 @@ wifi1: wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -198,17 +222,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi index 303708fab0e842..d1697060a84d42 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg1608.dtsi @@ -88,18 +88,27 @@ reg = <0x40000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; - - macaddr_factory_e006: macaddr@e006 { - reg = <0xe006 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + + macaddr_factory_e006: macaddr@e006 { + reg = <0xe006 0x6>; + }; }; - }; firmware: partition@50000 { @@ -118,7 +127,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -126,7 +136,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts index e764cb636b01d9..3756baa14efe01 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts @@ -75,6 +75,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -96,7 +116,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -104,7 +125,8 @@ &pcie1 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <2400000 2500000>; }; }; @@ -114,7 +136,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -143,9 +165,8 @@ port@4 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; @@ -156,13 +177,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi index 9af057378d184b..87ed1c71297058 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi @@ -75,6 +75,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + compatible = "mac-base"; + reg = <0xe000 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; firmware: partition@50000 { @@ -93,7 +113,8 @@ wifi0: wifi@0,0 { compatible = "pci14c3,7603"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -101,7 +122,8 @@ wifi1: wifi@0,0 { compatible = "pci14c3,7662"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -115,7 +137,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 0>; nvmem-cell-names = "mac-address"; }; @@ -144,9 +166,8 @@ port@4 { status = "okay"; label = "wan"; - nvmem-cells = <&macaddr_factory_e000>; + nvmem-cells = <&macaddr_factory_e000 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; }; @@ -157,13 +178,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts b/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts index ed8260534e68aa..abbb61d5341880 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts @@ -128,6 +128,22 @@ factory: partition@100000 { label = "factory"; reg = <0x100000 0x40000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x4da8>; + }; + + macaddr_factory_fe6e: macaddr@fe6e { + compatible = "mac-base"; + reg = <0xfe6e 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@140000 { label = "Kernel"; @@ -161,7 +177,7 @@ }; &gmac0 { - nvmem-cells = <&macaddr_factory_fe6e>; + nvmem-cells = <&macaddr_factory_fe6e 0>; nvmem-cell-names = "mac-address"; }; @@ -197,21 +213,8 @@ compatible = "pci14c3,7615"; reg = <0x0000 0 0 0 0>; mediatek,firmware-eeprom = "mt7615e_eeprom.bin"; - mediatek,mtd-eeprom = <&factory 0x0000>; - nvmem-cells = <&macaddr_factory_fe6e>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(1)>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_fe6e 1>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - mtd-mac-address = <&factory 0xfe6e>; - - macaddr_factory_fe6e: macaddr@fe6e { - reg = <0xfe6e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts b/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts new file mode 100644 index 00000000000000..307819e746e903 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_zyxel_lte5398-m904.dts @@ -0,0 +1,231 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "zyxel,lte5398-m904", "mediatek,mt7621-soc"; + model = "ZyXEL LTE5398-M904"; + + aliases { + label-mac-device = &gmac0; + led-boot = &led_power_green; + led-failsafe = &led_power_green; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power_green: power_green { + label = "green:power"; + gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + }; + + power_blue { + label = "blue:power"; + gpios = <&gpio 22 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "usbport"; + trigger-sources = <&ehci_port2>; + }; + + internet { + label = "green:internet"; + gpios = <&gpio 23 GPIO_ACTIVE_HIGH>; + }; + + wifi { + label = "green:wifi"; + gpios = <&gpio 24 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + voice { + label = "green:voice"; + gpios = <&gpio 25 GPIO_ACTIVE_HIGH>; + }; + + lte_green { + label = "green:lte"; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + }; + + lte_orange { + label = "orange:lte"; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + }; + + lte_red { + label = "red:lte"; + gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + lte_power { + gpio-export,name = "lte_power"; + gpio-export,output = <0>; + gpios = <&gpio 27 GPIO_ACTIVE_LOW>; + }; + + usb_power { + gpio-export,name = "usb_power"; + gpio-export,output = <1>; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&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>; + }; + + factory: partition@100000 { + label = "Factory"; + reg = <0x100000 0x40000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x4da8>; + }; + + macaddr_factory_fe6e: macaddr@fe6e { + reg = <0xfe6e 0x6>; + }; + }; + }; + + partition@140000 { + label = "Kernel"; + reg = <0x140000 0x1ec0000>; + }; + + partition@540000 { + label = "ubi"; + reg = <0x540000 0x1ac0000>; + }; + + partition@2140000 { + label = "Kernel2"; + reg = <0x2140000 0x1ec0000>; + }; + + partition@4000000 { + label = "wwan"; + reg = <0x4000000 0x100000>; + }; + + partition@4100000 { + label = "data"; + reg = <0x4100000 0x1000000>; + }; + + partition@5100000 { + label = "rom-d"; + reg = <0x5100000 0x100000>; + read-only; + }; + + partition@5200000 { + label = "reserve"; + reg = <0x5200000 0x80000>; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + +&state_default { + gpio { + groups = "i2c", "rgmii2", "uart3", "jtag", "wdt"; + function = "gpio"; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_fe6e>; + nvmem-cell-names = "mac-address"; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan1"; + }; + port@2 { + status = "okay"; + label = "lan2"; + }; + }; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts b/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts index 63d992973aa027..2ceb6228b26040 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts @@ -92,6 +92,20 @@ label = "Factory"; reg = <0x100000 0x40000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + }; }; partition@140000 { @@ -139,7 +153,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -163,13 +178,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi b/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi index fa7e23dd47133c..85dbe2d8579575 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi +++ b/target/linux/ramips/dts/mt7621_zyxel_nwa-ax.dtsi @@ -96,6 +96,16 @@ label = "mrd"; reg = <0x7780000 0x80000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mrd_1fff8: macaddr@1fff8 { + reg = <0x1fff8 0x6>; + }; + }; }; }; }; @@ -129,16 +139,6 @@ }; }; -&mrd { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_mrd_1fff8: macaddr@1fff8 { - reg = <0x1fff8 0x6>; - }; -}; - &state_default { gpio { groups = "uart3"; diff --git a/target/linux/ramips/dts/mt7621_zyxel_wap6805.dts b/target/linux/ramips/dts/mt7621_zyxel_wap6805.dts index a4672366409926..2f6654da5c3e87 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_wap6805.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_wap6805.dts @@ -77,6 +77,20 @@ label = "Factory"; reg = <0x200000 0x100000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + }; }; partition@300000 { @@ -123,7 +137,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; }; @@ -172,13 +187,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts b/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts index 299d982dc11795..0cd1f3274cce3d 100644 --- a/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts +++ b/target/linux/ramips/dts/mt7621_zyxel_wsm20.dts @@ -106,6 +106,20 @@ reg = <0x200000 0x1c0000>; label = "Factory"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_1fdfa: macaddr@1fdfa { + reg = <0x1fdfa 0x6>; + }; + + macaddr_factory_1fdf4: macaddr@1fdf4 { + reg = <0x1fdf4 0x6>; + }; + }; }; partition@3c0000 { @@ -217,17 +231,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_1fdfa: macaddr@1fdfa { - reg = <0x1fdfa 0x6>; - }; - - macaddr_factory_1fdf4: macaddr@1fdf4 { - reg = <0x1fdf4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_alfa-network_awusfree1.dts b/target/linux/ramips/dts/mt7628an_alfa-network_awusfree1.dts index f5cff3bb609a63..641844ccc0d864 100644 --- a/target/linux/ramips/dts/mt7628an_alfa-network_awusfree1.dts +++ b/target/linux/ramips/dts/mt7628an_alfa-network_awusfree1.dts @@ -117,6 +117,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + }; }; partition@50000 { @@ -131,15 +145,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_asus_rt-ac1200-v2.dts b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200-v2.dts index 2dd38fba4b1031..3edb6dad550bbb 100644 --- a/target/linux/ramips/dts/mt7628an_asus_rt-ac1200-v2.dts +++ b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200-v2.dts @@ -7,6 +7,11 @@ model = "ASUS RT-AC1200 V2"; }; +&eeprom_factory_8000 { + /* V2 has different eeprom size '0x4da8' for MT7613 */ + reg = <0x8000 0x4da8>; +}; + &state_default { spis { groups = "spis"; diff --git a/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi index dbba801425e654..e91f1b60297913 100644 --- a/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi +++ b/target/linux/ramips/dts/mt7628an_asus_rt-ac1200.dtsi @@ -77,12 +77,22 @@ reg = <0x40000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; }; }; @@ -117,7 +127,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -128,7 +139,8 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { diff --git a/target/linux/ramips/dts/mt7628an_asus_rt-n1x.dtsi b/target/linux/ramips/dts/mt7628an_asus_rt-n1x.dtsi index 8fd86dcb16f1da..aa642da11fdd50 100644 --- a/target/linux/ramips/dts/mt7628an_asus_rt-n1x.dtsi +++ b/target/linux/ramips/dts/mt7628an_asus_rt-n1x.dtsi @@ -78,6 +78,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -101,7 +115,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -122,13 +137,3 @@ &ohci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts b/target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts index c3ea41bbf6684d..1b9e0047ccc735 100644 --- a/target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts +++ b/target/linux/ramips/dts/mt7628an_buffalo_wcr-1166ds.dts @@ -102,7 +102,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -143,6 +144,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; partition@50000 { @@ -175,5 +190,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts b/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts index 81734ed4fbfb55..1d6304cfa771ad 100644 --- a/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts +++ b/target/linux/ramips/dts/mt7628an_comfast_cf-wr617ac.dts @@ -73,6 +73,30 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_8004: macaddr@8004 { + compatible = "mac-base"; + reg = <0x8004 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + }; }; partition@50000 { @@ -92,10 +116,9 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - mtd-mac-address = < 0x8004>; - mac-address-increment = <2>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_8004 2>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -110,14 +133,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_factory_e000: macaddr@4 { - reg = <0xe000 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac-v2.dts b/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac-v2.dts index bc476f2617e479..b5a789f8a684e7 100644 --- a/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac-v2.dts +++ b/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac-v2.dts @@ -6,3 +6,8 @@ compatible = "comfast,cf-wr758ac-v2", "mediatek,mt7628an-soc"; model = "COMFAST CF-WR758AC V2"; }; + +&eeprom_factory_8000 { + /* V2 has different eeprom size '0x4da8' for MT7613 */ + reg = <0x8000 0x4da8>; +}; diff --git a/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac.dtsi b/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac.dtsi index 6ac53adf520079..9cab562bda2d01 100644 --- a/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac.dtsi +++ b/target/linux/ramips/dts/mt7628an_comfast_cf-wr758ac.dtsi @@ -53,7 +53,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -87,6 +88,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + }; }; partition@50000 { @@ -101,7 +120,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -112,13 +132,3 @@ &esw { mediatek,portdisable = <0x2f>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_e000: macaddr@e000 { - reg = <0xe000 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts b/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts index 82f0e7c690a0e7..883459d2f303ec 100644 --- a/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts +++ b/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts @@ -92,6 +92,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -119,7 +137,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; led { @@ -132,7 +151,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -143,13 +163,3 @@ &esw { mediatek,portmap = <0x2f>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_d-team_pbr-d1.dts b/target/linux/ramips/dts/mt7628an_d-team_pbr-d1.dts index 5a0aeaf5f25191..f5e9a169d4da7e 100644 --- a/target/linux/ramips/dts/mt7628an_d-team_pbr-d1.dts +++ b/target/linux/ramips/dts/mt7628an_d-team_pbr-d1.dts @@ -116,6 +116,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -160,13 +170,3 @@ status = "okay"; mediatek,cd-high; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_dlink_dap-1325-a1.dts b/target/linux/ramips/dts/mt7628an_dlink_dap-1325-a1.dts index 5b50674f0b4201..3ad34c51c1a9e3 100644 --- a/target/linux/ramips/dts/mt7628an_dlink_dap-1325-a1.dts +++ b/target/linux/ramips/dts/mt7628an_dlink_dap-1325-a1.dts @@ -82,7 +82,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; nvmem-cells = <&macaddr_factory_28>; nvmem-cell-names = "mac-address"; @@ -117,6 +118,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -127,13 +142,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_duzun_dm06.dts b/target/linux/ramips/dts/mt7628an_duzun_dm06.dts index b9a105b0e3bae3..e37b90d38ee684 100644 --- a/target/linux/ramips/dts/mt7628an_duzun_dm06.dts +++ b/target/linux/ramips/dts/mt7628an_duzun_dm06.dts @@ -120,6 +120,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -130,13 +140,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_elecom_wrc-1167fs.dts b/target/linux/ramips/dts/mt7628an_elecom_wrc-1167fs.dts index f716ad9f23ba27..9d8b360c6a3faf 100644 --- a/target/linux/ramips/dts/mt7628an_elecom_wrc-1167fs.dts +++ b/target/linux/ramips/dts/mt7628an_elecom_wrc-1167fs.dts @@ -105,6 +105,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -148,7 +166,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -163,15 +182,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts b/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts index a3ce8cc59212cf..d84290d4c12354 100644 --- a/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts +++ b/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts @@ -88,7 +88,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &spi0 { @@ -120,6 +121,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -134,13 +149,3 @@ &uart1 { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_glinet_vixmini_microuter.dtsi b/target/linux/ramips/dts/mt7628an_glinet_vixmini_microuter.dtsi index 089a3f3c42780b..a40be00887f185 100644 --- a/target/linux/ramips/dts/mt7628an_glinet_vixmini_microuter.dtsi +++ b/target/linux/ramips/dts/mt7628an_glinet_vixmini_microuter.dtsi @@ -60,7 +60,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &spi0 { @@ -92,6 +93,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; /* @@ -105,13 +120,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_hak5_wifi-pineapple-mk7.dts b/target/linux/ramips/dts/mt7628an_hak5_wifi-pineapple-mk7.dts index 2901a2af51a82c..aebbc7fa888b75 100644 --- a/target/linux/ramips/dts/mt7628an_hak5_wifi-pineapple-mk7.dts +++ b/target/linux/ramips/dts/mt7628an_hak5_wifi-pineapple-mk7.dts @@ -104,6 +104,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -125,15 +139,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts b/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts index b7c3af796d5aa8..69e22f6dd7d673 100644 --- a/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts +++ b/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts @@ -70,6 +70,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -89,15 +103,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_hilink_hlk-7688a.dts b/target/linux/ramips/dts/mt7628an_hilink_hlk-7688a.dts index 2c7299af72fa13..121a24b5025052 100644 --- a/target/linux/ramips/dts/mt7628an_hilink_hlk-7688a.dts +++ b/target/linux/ramips/dts/mt7628an_hilink_hlk-7688a.dts @@ -84,6 +84,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -115,15 +129,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_hiwifi_hc5761a.dts b/target/linux/ramips/dts/mt7628an_hiwifi_hc5761a.dts index 828e5b8b2d09cd..5ec041c8048e98 100644 --- a/target/linux/ramips/dts/mt7628an_hiwifi_hc5761a.dts +++ b/target/linux/ramips/dts/mt7628an_hiwifi_hc5761a.dts @@ -58,7 +58,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; diff --git a/target/linux/ramips/dts/mt7628an_hiwifi_hc5861b.dts b/target/linux/ramips/dts/mt7628an_hiwifi_hc5861b.dts index 08bdcd73adab1b..44ebef2ad5c0a7 100644 --- a/target/linux/ramips/dts/mt7628an_hiwifi_hc5861b.dts +++ b/target/linux/ramips/dts/mt7628an_hiwifi_hc5861b.dts @@ -42,10 +42,9 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; - nvmem-cells = <&macaddr_factory_2e>; - nvmem-cell-names = "mac-address"; ieee80211-freq-limit = <5000000 6000000>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_2e>; + nvmem-cell-names = "eeprom", "mac-address"; led { led-sources = <2>; @@ -53,13 +52,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi b/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi index bfc510e06feae0..034a6de6c2dfb0 100644 --- a/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi +++ b/target/linux/ramips/dts/mt7628an_hiwifi_hc5x61a.dtsi @@ -60,6 +60,28 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + }; }; partition@50000 { @@ -97,15 +119,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_iptime.dtsi b/target/linux/ramips/dts/mt7628an_iptime.dtsi index ccc6debfc9bcf3..9c98c6f5ca10e2 100644 --- a/target/linux/ramips/dts/mt7628an_iptime.dtsi +++ b/target/linux/ramips/dts/mt7628an_iptime.dtsi @@ -46,6 +46,16 @@ label = "u-boot"; reg = <0x0 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc20: macaddr@1fc20 { + reg = <0x1fc20 0x6>; + }; + }; }; partition@20000 { @@ -58,6 +68,20 @@ label = "factory"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; partition@40000 { @@ -97,7 +121,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -105,15 +130,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_1fc20: macaddr@1fc20 { - reg = <0x1fc20 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi b/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi index 2d2f8a58b8d062..643f599246c045 100644 --- a/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi +++ b/target/linux/ramips/dts/mt7628an_jotale_js76x8.dtsi @@ -84,6 +84,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; firmware: partition@50000 { @@ -124,15 +138,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts b/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts index 4281682503a39d..475426896619a7 100644 --- a/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts +++ b/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts @@ -133,6 +133,24 @@ label = "rf-eeprom"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_400: eeprom@400 { + reg = <0x400 0x4da8>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; firmware1: partition@50000 { @@ -196,7 +214,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -207,17 +226,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x0400>; + nvmem-cells = <&eeprom_factory_400>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_kroks.dtsi b/target/linux/ramips/dts/mt7628an_kroks.dtsi index dc1eee9ccaba4a..bfe29398a9f36a 100644 --- a/target/linux/ramips/dts/mt7628an_kroks.dtsi +++ b/target/linux/ramips/dts/mt7628an_kroks.dtsi @@ -67,6 +67,20 @@ factory: partition@40000 { label = "factory"; reg = <0x40000 0x10000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -90,16 +104,6 @@ }; }; -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; - ðernet { nvmem-cells = <&macaddr_factory_4>; nvmem-cell-names = "mac-address"; @@ -108,7 +112,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &uart1 { diff --git a/target/linux/ramips/dts/mt7628an_linksys_e5400.dts b/target/linux/ramips/dts/mt7628an_linksys_e5400.dts index 3a6403fe7f8df9..26ff86dac2d255 100644 --- a/target/linux/ramips/dts/mt7628an_linksys_e5400.dts +++ b/target/linux/ramips/dts/mt7628an_linksys_e5400.dts @@ -82,12 +82,24 @@ reg = <0x40000 0x10000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + compatible = "mac-base"; + reg = <0x28 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -116,7 +128,7 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_28>; + nvmem-cells = <&macaddr_factory_28 0>; nvmem-cell-names = "mac-address"; }; @@ -132,12 +144,10 @@ wifi5: wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_28>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_28 3>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; @@ -155,9 +165,7 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; - nvmem-cells = <&macaddr_factory_28>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_28 2>; + nvmem-cell-names = "eeprom", "mac-address"; }; diff --git a/target/linux/ramips/dts/mt7628an_mediatek_linkit-smart-7688.dts b/target/linux/ramips/dts/mt7628an_mediatek_linkit-smart-7688.dts index 57624c302ebfa7..1bd7f8e6daa15e 100644 --- a/target/linux/ramips/dts/mt7628an_mediatek_linkit-smart-7688.dts +++ b/target/linux/ramips/dts/mt7628an_mediatek_linkit-smart-7688.dts @@ -111,6 +111,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + }; }; partition@50000 { @@ -159,15 +173,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_mediatek_mt7628an-eval-board.dts b/target/linux/ramips/dts/mt7628an_mediatek_mt7628an-eval-board.dts index 4dede4287f5980..7f19ab6947591a 100644 --- a/target/linux/ramips/dts/mt7628an_mediatek_mt7628an-eval-board.dts +++ b/target/linux/ramips/dts/mt7628an_mediatek_mt7628an-eval-board.dts @@ -41,6 +41,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + }; }; partition@50000 { @@ -55,5 +65,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts b/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts index 37975659082254..074011fbb9b2c4 100644 --- a/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts +++ b/target/linux/ramips/dts/mt7628an_mercury_mac1200r-v2.dts @@ -46,12 +46,36 @@ label = "factory_info"; reg = <0x1d800 0x800>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_d: macaddr@d { + reg = <0xd 0x6>; + }; + }; }; art: partition@1e000 { label = "art"; reg = <0x1e000 0x2000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_art_1000: eeprom@1000 { + reg = <0x1000 0x200>; + }; + }; }; partition@20000 { @@ -86,8 +110,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; - ralink,mtd-eeprom = <&art 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -97,17 +121,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&art 0x1000>; + nvmem-cells = <&eeprom_art_1000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_d: macaddr@d { - reg = <0xd 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_minew_g1-c.dts b/target/linux/ramips/dts/mt7628an_minew_g1-c.dts index 92fbf7c6ae5ab1..a1b40e09d0134d 100644 --- a/target/linux/ramips/dts/mt7628an_minew_g1-c.dts +++ b/target/linux/ramips/dts/mt7628an_minew_g1-c.dts @@ -108,6 +108,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -131,20 +145,11 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &sdhci { status = "okay"; mediatek,cd-high; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_motorola_mwr03.dts b/target/linux/ramips/dts/mt7628an_motorola_mwr03.dts index 2179c48b22835a..ebaa4326aea988 100644 --- a/target/linux/ramips/dts/mt7628an_motorola_mwr03.dts +++ b/target/linux/ramips/dts/mt7628an_motorola_mwr03.dts @@ -71,6 +71,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -102,9 +122,8 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &esw { @@ -119,7 +138,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -127,15 +147,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_netgear_r6120.dts b/target/linux/ramips/dts/mt7628an_netgear_r6120.dts index e9fc6d7090fb8d..e3ee55873e969e 100644 --- a/target/linux/ramips/dts/mt7628an_netgear_r6120.dts +++ b/target/linux/ramips/dts/mt7628an_netgear_r6120.dts @@ -44,7 +44,6 @@ }; &wifi5 { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(2)>; }; diff --git a/target/linux/ramips/dts/mt7628an_netgear_r6xxx.dtsi b/target/linux/ramips/dts/mt7628an_netgear_r6xxx.dtsi index e6374e7bac829e..98d132e891f1ab 100644 --- a/target/linux/ramips/dts/mt7628an_netgear_r6xxx.dtsi +++ b/target/linux/ramips/dts/mt7628an_netgear_r6xxx.dtsi @@ -83,6 +83,26 @@ label = "factory"; reg = <0x40000 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@60000 { @@ -97,11 +117,12 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; }; @@ -112,17 +133,8 @@ &pcie0 { wifi5: wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_onion_omega2.dtsi b/target/linux/ramips/dts/mt7628an_onion_omega2.dtsi index b10d448a30a299..001dc227bc0949 100644 --- a/target/linux/ramips/dts/mt7628an_onion_omega2.dtsi +++ b/target/linux/ramips/dts/mt7628an_onion_omega2.dtsi @@ -121,6 +121,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; firmware: partition@50000 { @@ -164,15 +178,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_oraybox_x1.dts b/target/linux/ramips/dts/mt7628an_oraybox_x1.dts index eb9a20aae05653..9f43e46fac0cc0 100644 --- a/target/linux/ramips/dts/mt7628an_oraybox_x1.dts +++ b/target/linux/ramips/dts/mt7628an_oraybox_x1.dts @@ -91,6 +91,16 @@ label = "bdinfo"; reg = <0xfe0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_9: macaddr@9 { + reg = <0x9 0x6>; + }; + }; }; partition@ff0000 { @@ -117,13 +127,3 @@ &wmac { status = "okay"; }; - -&bdinfo { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_bdinfo_9: macaddr@9 { - reg = <0x9 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts b/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts index 61f78c162cbc92..46dca444b57fe9 100644 --- a/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts +++ b/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts @@ -55,6 +55,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -94,15 +108,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts b/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts index 5c3b14f87f2af3..7c0e7551ce2aad 100644 --- a/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts +++ b/target/linux/ramips/dts/mt7628an_ravpower_rp-wd009.dts @@ -106,7 +106,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5470000 6000000>; }; }; @@ -140,6 +141,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -183,20 +202,11 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { nvmem-cells = <&macaddr_factory_4>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts b/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts index 174272f95fdd0d..fc111019a7d9f0 100644 --- a/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts +++ b/target/linux/ramips/dts/mt7628an_skylab_skw92a.dts @@ -54,7 +54,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &spi0 { @@ -86,6 +87,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -100,13 +115,3 @@ &uart1 { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tama_w06.dts b/target/linux/ramips/dts/mt7628an_tama_w06.dts index 7a202eb6ef7f08..dfe5192e12c5b9 100644 --- a/target/linux/ramips/dts/mt7628an_tama_w06.dts +++ b/target/linux/ramips/dts/mt7628an_tama_w06.dts @@ -78,6 +78,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -98,15 +112,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts b/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts index 9d1c930d762dd3..83bde6b9ecfe89 100644 --- a/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts +++ b/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts @@ -100,7 +100,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -108,7 +109,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -145,6 +147,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -155,13 +175,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi index d7c65d4703e28f..a5c9267c8d7ac6 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_8m-split-uboot.dtsi @@ -56,6 +56,18 @@ label = "rom"; reg = <0x7d0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_rom_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@7e0000 { @@ -67,6 +79,20 @@ label = "radio"; reg = <0x7f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; }; }; @@ -75,27 +101,15 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&radio 0x0>; - - nvmem-cells = <&macaddr_rom_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_rom_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; }; ðernet { - nvmem-cells = <&macaddr_rom_f100>; + nvmem-cells = <&macaddr_rom_f100 0>; nvmem-cell-names = "mac-address"; }; &esw { mediatek,portmap = <0x3e>; }; - -&rom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_rom_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi index ecb6ce1e4eaf69..3db4bb9b9c24c1 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_8m.dtsi @@ -48,31 +48,32 @@ label = "factory"; reg = <0x7d0000 0x30000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; + + eeprom_factory_20000: eeprom@20000 { + reg = <0x20000 0x400>; + }; + + eeprom_factory_28000: eeprom@28000 { + reg = <0x28000 0x200>; + }; + }; }; }; }; }; -&wmac { - status = "okay"; - - mediatek,mtd-eeprom = <&factory 0x20000>; - - nvmem-cells = <&macaddr_factory_f100>; - nvmem-cell-names = "mac-address"; -}; - ðernet { - nvmem-cells = <&macaddr_factory_f100>; + nvmem-cells = <&macaddr_factory_f100 0>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts index 02d0144f4aec6c..0d09e5434564d2 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v4.dts @@ -78,7 +78,10 @@ }; &wmac { - mac-address-increment = <(-2)>; + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 (-2)>; + nvmem-cell-names = "eeprom", "mac-address"; }; &esw { @@ -99,10 +102,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x28000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_f100>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; + nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100 (-1)>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts index 7f5b3d557a5d2f..93695660aebb7c 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c20-v5.dts @@ -94,10 +94,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_rom_f100>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_rom_f100 (-1)>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts index ab81b094934e5c..bfb39b3531ceba 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v3.dts @@ -83,6 +83,13 @@ }; }; +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; + &esw { mediatek,portmap = <0x3e>; }; @@ -94,10 +101,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x28000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_f100>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; + nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100 (-1)>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts index 164cf7a170f7e3..302a9d9c6a2aba 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v4.dts @@ -92,10 +92,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_rom_f100>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_rom_f100 (-1)>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; 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 00000000000000..c3a890bc2ddd66 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v6.dts @@ -0,0 +1,99 @@ +// 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 (-1)>; + nvmem-cell-names = "eeprom", "mac-address"; + }; +}; + +&eeprom_radio_8000 { + /* V2 has different eeprom size '0x4da8' for MT7613 */ + reg = <0x8000 0x4da8>; +}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_re200.dtsi b/target/linux/ramips/dts/mt7628an_tplink_re200.dtsi index 1a8b26b1cce3e8..8826365bebfd20 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_re200.dtsi +++ b/target/linux/ramips/dts/mt7628an_tplink_re200.dtsi @@ -99,12 +99,38 @@ label = "config"; reg = <0x7c0000 0x30000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_2008: macaddr@2008 { + compatible = "mac-base"; + reg = <0x2008 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; radio: partition@7f0000 { label = "radio"; reg = <0x7f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; }; }; @@ -119,18 +145,15 @@ }; ðernet { - nvmem-cells = <&macaddr_config_2008>; + nvmem-cells = <&macaddr_config_2008 0>; nvmem-cell-names = "mac-address"; }; &wmac { status = "okay"; - mediatek,mtd-eeprom = <&radio 0x0>; - - nvmem-cells = <&macaddr_config_2008>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_2008 1>; + nvmem-cell-names = "eeprom", "mac-address"; }; &pcie { @@ -140,20 +163,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_config_2008>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; - }; -}; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_2008: macaddr@2008 { - reg = <0x2008 0x6>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_2008 2>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts b/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts index 7948668b84781d..9e0bea7cd116a9 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts @@ -36,6 +36,18 @@ label = "config"; reg = <0x600000 0x50000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_10008: macaddr@10008 { + compatible = "mac-base"; + reg = <0x10008 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; /* @@ -47,38 +59,36 @@ label = "radio"; reg = <0x7f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; }; }; }; &wlan5g { - mediatek,mtd-eeprom = <&radio 0x8000>; - - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_10008 2>; + nvmem-cell-names = "eeprom", "mac-address"; }; &wmac { - mediatek,mtd-eeprom = <&radio 0x0>; - - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_10008 1>; + nvmem-cell-names = "eeprom", "mac-address"; }; ðernet { - nvmem-cells = <&macaddr_config_10008>; + nvmem-cells = <&macaddr_config_10008 0>; nvmem-cell-names = "mac-address"; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_10008: macaddr@10008 { - reg = <0x10008 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts index 21df0fb3e69d6f..d37febfbc87d00 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts @@ -36,44 +36,54 @@ label = "config"; reg = <0x7c0000 0x30000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_2008: macaddr@2008 { + compatible = "mac-base"; + reg = <0x2008 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; radio: partition@7f0000 { label = "radio"; reg = <0x7f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_radio_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_radio_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; }; }; }; &wlan5g { - mediatek,mtd-eeprom = <&radio 0x8000>; - - nvmem-cells = <&macaddr_config_2008>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_2008 (-2)>; + nvmem-cell-names = "eeprom", "mac-address"; }; &wmac { - mediatek,mtd-eeprom = <&radio 0x0>; - - nvmem-cells = <&macaddr_config_2008>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; + nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_2008 (-1)>; + nvmem-cell-names = "eeprom", "mac-address"; }; ðernet { - nvmem-cells = <&macaddr_config_2008>; + nvmem-cells = <&macaddr_config_2008 0>; nvmem-cell-names = "mac-address"; }; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_2008: macaddr@2008 { - reg = <0x2008 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts index 3ffa732541113a..5f35cb4c7fac4e 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3020-v3.dts @@ -124,6 +124,20 @@ label = "factory"; reg = <0x7d0000 0x30000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_20000: eeprom@20000 { + reg = <0x20000 0x400>; + }; + + macaddr_factory_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; + }; }; }; }; @@ -139,23 +153,11 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x20000>; - - nvmem-cells = <&macaddr_factory_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100>; + nvmem-cell-names = "eeprom", "mac-address"; }; ðernet { nvmem-cells = <&macaddr_factory_f100>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts index 173b4cddcad175..297e7b441d4f9e 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr3420-v5.dts @@ -76,6 +76,13 @@ }; }; +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; + &esw { mediatek,portmap = <0x3e>; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts index 1dfb89d52851f7..d0350f9924d985 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v4.dts @@ -93,11 +93,13 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_1f100: macaddr@1f100 { - reg = <0x1f100 0x6>; + macaddr_factory_1f100: macaddr@1f100 { + reg = <0x1f100 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts index 408f12aeaede2d..f77f1acbf2a72b 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-mr6400-v5.dts @@ -93,11 +93,13 @@ }; &factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_factory_1f100: macaddr@1f100 { - reg = <0x1f100 0x6>; + macaddr_factory_1f100: macaddr@1f100 { + reg = <0x1f100 0x6>; + }; }; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts index de9a48445adc00..44a483ed6d6b0c 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wa801nd-v5.dts @@ -73,3 +73,10 @@ function = "gpio"; }; }; + +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts index 46c18d6b2d82a1..01cbba2024481f 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr802n-v4.dts @@ -49,6 +49,13 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_f100>; + nvmem-cells = <&macaddr_factory_f100 0>; nvmem-cell-names = "mac-address"; }; + +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts index 8a8ba81ec309c3..e480395ffd46fb 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v4.dts @@ -66,6 +66,13 @@ }; }; +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; + &esw { mediatek,portmap = <0x3e>; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts index 01a1a7f09e288f..3e639668bbaa0d 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr840n-v5.dts @@ -73,6 +73,20 @@ label = "factory"; reg = <0x3f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; + }; }; }; }; @@ -89,10 +103,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; - - nvmem-cells = <&macaddr_factory_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_f100>; + nvmem-cell-names = "eeprom", "mac-address"; }; ðernet { @@ -110,13 +122,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts index 5c7f9836b6a9ae..e1e77eba237eaf 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v13.dts @@ -92,6 +92,13 @@ }; }; +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; + &esw { mediatek,portmap = <0x3e>; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts index ff2c8d48d15274..5b3bcbe63ab8f4 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr841n-v14.dts @@ -84,6 +84,20 @@ label = "factory"; reg = <0x3f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_f100: macaddr@f100 { + reg = <0xf100 0x6>; + }; + }; }; }; }; @@ -100,10 +114,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; - - nvmem-cells = <&macaddr_factory_f100>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_f100>; + nvmem-cell-names = "eeprom", "mac-address"; }; ðernet { @@ -129,13 +141,3 @@ output-high; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts index 9077ec00cecfba..b5c3bd9ab5b8cc 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr842n-v5.dts @@ -76,6 +76,13 @@ }; }; +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; + &esw { mediatek,portmap = <0x3e>; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts index 7abeae9c07b694..9fc7f97ae51085 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr850n-v2.dts @@ -69,6 +69,13 @@ }; }; +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; + &esw { mediatek,portmap = <0x3e>; }; diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts index 9be8529bbf884b..0029be21e0f904 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v3.dts @@ -83,6 +83,13 @@ }; }; +&wmac { + status = "okay"; + + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; + &pcie { status = "okay"; }; @@ -90,10 +97,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x28000>; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_factory_f100>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; + nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100 (-1)>; + nvmem-cell-names = "eeprom", "mac-address"; }; }; diff --git a/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts b/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts index 8037b3a304aff2..77d8b9fce6530d 100644 --- a/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts +++ b/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -56,13 +70,3 @@ nvmem-cells = <&macaddr_factory_28>; nvmem-cell-names = "mac-address"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi b/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi index f25e28abd81865..b31ffba8090781 100644 --- a/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi +++ b/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi @@ -88,7 +88,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { diff --git a/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi b/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi index 9100e0225e8d3c..73ee4484b4ecd3 100644 --- a/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi +++ b/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi @@ -43,6 +43,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; firmware: partition@50000 { @@ -64,7 +78,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -96,13 +111,3 @@ &uart2 { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts index 2a09ce6f38584a..1ae08ed84079f3 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn531a3.dts @@ -77,7 +77,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -111,6 +112,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -125,7 +144,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -136,13 +156,3 @@ &esw { mediatek,portmap = <0x2f>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts index dcba4b64e28297..76e89b77b6c82f 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn570ha1.dts @@ -67,7 +67,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -101,6 +102,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + }; }; partition@50000 { @@ -115,7 +134,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -126,13 +146,3 @@ &esw { mediatek,portmap = <0x2f>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts index 83e269b3660ab4..7b12dac350c28e 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn575a3.dts @@ -62,7 +62,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -96,6 +97,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -110,7 +129,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -121,13 +141,3 @@ &esw { mediatek,portmap = <0x2f>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts index bb1ddd0040be50..fa06c44e3fc012 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts @@ -101,7 +101,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -135,6 +136,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -149,7 +168,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -172,13 +192,3 @@ &ohci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts index b4e6905624a56b..d2b45faa25d741 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn577a2.dts @@ -66,7 +66,8 @@ &pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -100,6 +101,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -114,7 +133,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -137,13 +157,3 @@ &ohci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts index 1d5c99da318675..a9b98683042e1a 100644 --- a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts @@ -96,7 +96,8 @@ &pcie0 { wifi@0,0 { reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -130,6 +131,24 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -144,7 +163,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -167,13 +187,3 @@ &ohci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_widora_neo.dtsi b/target/linux/ramips/dts/mt7628an_widora_neo.dtsi index fd146e926444a8..47ed0431d2f065 100644 --- a/target/linux/ramips/dts/mt7628an_widora_neo.dtsi +++ b/target/linux/ramips/dts/mt7628an_widora_neo.dtsi @@ -77,6 +77,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; firmware: partition@50000 { @@ -167,15 +181,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts b/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts index 9ce585021ecc61..3bdb06cec92c85 100644 --- a/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts +++ b/target/linux/ramips/dts/mt7628an_wiznet_wizfi630s.dts @@ -120,6 +120,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + }; }; partition@50000 { @@ -161,15 +175,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi b/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi index bb35357808e5d8..207fea28e978bd 100644 --- a/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi +++ b/target/linux/ramips/dts/mt7628an_wrtnode_wrtnode2.dtsi @@ -51,6 +51,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -90,15 +104,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts index 173bcd992d73e7..8859038c30e333 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-ra75.dts @@ -84,7 +84,8 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -95,10 +96,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; - &esw { mediatek,portmap = <0x3e>; mediatek,portdisable = <0x2a>; @@ -111,22 +112,3 @@ &ohci { status = "disabled"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; - }; -}; - - diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi index 59d269bf03eeae..7655da40db9bb0 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4.dtsi @@ -50,6 +50,34 @@ label = "factory"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + + macaddr_factory_8004: macaddr@8004 { + reg = <0x8004 0x6>; + }; + }; }; partition@40000 { @@ -79,5 +107,6 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts index 863191bc4b7cfc..49ca637cb9e6eb 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m-intl.dts @@ -57,28 +57,18 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; ðernet { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &esw { mediatek,portmap = <0x3e>; mediatek,portdisable = <0x2a>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts index 5ddc7af4621e93..f40717267c7a80 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4a-100m.dts @@ -57,28 +57,18 @@ wifi@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; ðernet { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 (-1)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-1)>; }; &esw { mediatek,portmap = <0x3e>; mediatek,portdisable = <0x2a>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts index e9bbf76e4baa28..27348b3ad7d60d 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_mi-router-4c.dts @@ -71,13 +71,3 @@ mediatek,portmap = <0x3d>; mediatek,portdisable = <0x29>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts index c45f94b2f171d9..2adb6ba8e36895 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts @@ -74,7 +74,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -116,6 +117,20 @@ label = "factory"; reg = <0x50000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@60000 { @@ -144,13 +159,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts index f9adca9d71488e..66297232e3a532 100644 --- a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts +++ b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts @@ -72,7 +72,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -108,6 +109,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -118,13 +133,3 @@ }; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts b/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts index aca4555a40bd9e..64f3d6d83f3f15 100644 --- a/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts +++ b/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts @@ -89,6 +89,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + }; }; partition@50000 { @@ -103,7 +117,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; ðernet { @@ -114,13 +129,3 @@ &esw { mediatek,portmap = <0x2f>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts b/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts index c53289debf0934..95eb9cfd9e675c 100644 --- a/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts +++ b/target/linux/ramips/dts/mt7628an_zyxel_keenetic-extra-ii.dts @@ -124,6 +124,24 @@ label = "rf-eeprom"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x400>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; firmware1: partition@50000 { @@ -193,7 +211,8 @@ &wmac { status = "okay"; - mediatek,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pcie { @@ -204,7 +223,8 @@ mt76@0,0 { compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; ieee80211-freq-limit = <5000000 6000000>; }; }; @@ -215,13 +235,3 @@ function = "gpio"; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts b/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts index 52d56466106d6c..dc61cd9da506d4 100644 --- a/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts +++ b/target/linux/ramips/dts/rt2880_airlink101_ar670w.dts @@ -34,6 +34,20 @@ reg = <0x30000 0x10000>; label = "factory"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_2000: eeprom@2000 { + reg = <0x2000 0x200>; + }; + + macaddr_factory_2004: macaddr@2004 { + reg = <0x2004 0x6>; + }; + }; }; partition@40000 { @@ -104,16 +118,6 @@ }; &wmac { - status = "okay"; - ralink,mtd-eeprom = <&factory 0x2000>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2004: macaddr@2004 { - reg = <0x2004 0x6>; - }; + nvmem-cells = <&eeprom_factory_2000>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts b/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts index bb3795aafac80d..f41a9b8561edfc 100644 --- a/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts +++ b/target/linux/ramips/dts/rt2880_airlink101_ar725w.dts @@ -39,6 +39,20 @@ reg = <0x40000 0x10000>; label = "factory"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -114,16 +128,6 @@ }; &wmac { - status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_asus_rt-n15.dts b/target/linux/ramips/dts/rt2880_asus_rt-n15.dts index 3bf3e21a4702ac..0275a84bde0f44 100644 --- a/target/linux/ramips/dts/rt2880_asus_rt-n15.dts +++ b/target/linux/ramips/dts/rt2880_asus_rt-n15.dts @@ -43,6 +43,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -113,15 +127,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts b/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts index 59cc965f23d457..1c2b9a18da76d0 100644 --- a/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts +++ b/target/linux/ramips/dts/rt2880_belkin_f5d8235-v1.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -233,16 +247,6 @@ }; &wmac { - status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_buffalo_wli-tx4-ag300n.dts b/target/linux/ramips/dts/rt2880_buffalo_wli-tx4-ag300n.dts index 1bab37fc5eac37..37288e5fc4014e 100644 --- a/target/linux/ramips/dts/rt2880_buffalo_wli-tx4-ag300n.dts +++ b/target/linux/ramips/dts/rt2880_buffalo_wli-tx4-ag300n.dts @@ -43,6 +43,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -116,15 +130,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts b/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts index b3ada11220ae0f..bc01bf23ef6d50 100644 --- a/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts +++ b/target/linux/ramips/dts/rt2880_buffalo_wzr-agl300nh.dts @@ -43,6 +43,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -138,15 +152,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts b/target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts index ff714d12730bf8..105a3c49d486ca 100644 --- a/target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts +++ b/target/linux/ramips/dts/rt2880_dlink_dap-1522-a1.dts @@ -35,6 +35,20 @@ label = "factory"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_2000: eeprom@2000 { + reg = <0x2000 0x200>; + }; + + macaddr_factory_2004: macaddr@2004 { + reg = <0x2004 0x6>; + }; + }; }; partition@40000 { @@ -138,15 +152,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x2000>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2004: macaddr@2004 { - reg = <0x2004 0x6>; - }; + nvmem-cells = <&eeprom_factory_2000>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt2880_ralink_v11st-fe.dts b/target/linux/ramips/dts/rt2880_ralink_v11st-fe.dts index 39045bf0267806..3f4142f50895c4 100644 --- a/target/linux/ramips/dts/rt2880_ralink_v11st-fe.dts +++ b/target/linux/ramips/dts/rt2880_ralink_v11st-fe.dts @@ -40,6 +40,16 @@ reg = <0x00040000 0x00010000>; label = "factory"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + }; }; partition@50000 { @@ -80,5 +90,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_8devices_carambola.dts b/target/linux/ramips/dts/rt3050_8devices_carambola.dts index 820bbd3e99e37e..8cc586207f04cf 100644 --- a/target/linux/ramips/dts/rt3050_8devices_carambola.dts +++ b/target/linux/ramips/dts/rt3050_8devices_carambola.dts @@ -38,6 +38,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -72,19 +86,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi b/target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi index 13933e335c3e14..f7b64c63261c6c 100644 --- a/target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi +++ b/target/linux/ramips/dts/rt3050_allnet_all0256n.dtsi @@ -66,6 +66,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; firmware: partition@50000 { @@ -94,15 +108,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts index 52b8668be926df..1d66023ceba7c5 100644 --- a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts +++ b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-16m.dts @@ -58,6 +58,20 @@ label = "devdata"; reg = <0xff0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; + + macaddr_devdata_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; + }; }; }; }; @@ -67,13 +81,3 @@ nvmem-cells = <&macaddr_devdata_4004>; nvmem-cell-names = "mac-address"; }; - -&devdata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devdata_4004: macaddr@4004 { - reg = <0x4004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts index 4e03f7beb74ee8..41ed37d808af24 100644 --- a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts +++ b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555-8m.dts @@ -28,6 +28,20 @@ label = "uboot-env"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; + + macaddr_devdata_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; + }; }; partition@40000 { @@ -61,13 +75,3 @@ nvmem-cells = <&macaddr_devdata_4004>; nvmem-cell-names = "mac-address"; }; - -&devdata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devdata_4004: macaddr@4004 { - reg = <0x4004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555.dtsi b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555.dtsi index 6cd75da68bf130..41985278632a0d 100644 --- a/target/linux/ramips/dts/rt3050_alphanetworks_asl26555.dtsi +++ b/target/linux/ramips/dts/rt3050_alphanetworks_asl26555.dtsi @@ -89,7 +89,8 @@ }; &wmac { - ralink,mtd-eeprom = <&devdata 0x4000>; + nvmem-cells = <&eeprom_devdata_4000>; + nvmem-cell-names = "eeprom"; }; &otg { diff --git a/target/linux/ramips/dts/rt3050_arcwireless_freestation5.dts b/target/linux/ramips/dts/rt3050_arcwireless_freestation5.dts index 036d3105610555..9b696b3431382d 100644 --- a/target/linux/ramips/dts/rt3050_arcwireless_freestation5.dts +++ b/target/linux/ramips/dts/rt3050_arcwireless_freestation5.dts @@ -38,6 +38,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -103,19 +117,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_asus_rt-g32-b1.dts b/target/linux/ramips/dts/rt3050_asus_rt-g32-b1.dts index 0d4d8f4cfd5560..e112a1b33db132 100644 --- a/target/linux/ramips/dts/rt3050_asus_rt-g32-b1.dts +++ b/target/linux/ramips/dts/rt3050_asus_rt-g32-b1.dts @@ -54,6 +54,20 @@ label = "devconf"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devconf_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_devconf_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -82,15 +96,6 @@ }; &wmac { - ralink,mtd-eeprom = <&devconf 0x0>; -}; - -&devconf { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devconf_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_devconf_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_asus_rt-n10-plus.dts b/target/linux/ramips/dts/rt3050_asus_rt-n10-plus.dts index af6ebf00628f90..a452a44202fcef 100644 --- a/target/linux/ramips/dts/rt3050_asus_rt-n10-plus.dts +++ b/target/linux/ramips/dts/rt3050_asus_rt-n10-plus.dts @@ -41,6 +41,20 @@ label = "devconf"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devconf_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_devconf_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -88,15 +102,6 @@ }; &wmac { - ralink,mtd-eeprom = <&devconf 0x0>; -}; - -&devconf { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devconf_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_devconf_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_asus_wl-330n.dts b/target/linux/ramips/dts/rt3050_asus_wl-330n.dts index 2202cf3127d92c..938f5d440c8743 100644 --- a/target/linux/ramips/dts/rt3050_asus_wl-330n.dts +++ b/target/linux/ramips/dts/rt3050_asus_wl-330n.dts @@ -75,6 +75,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -103,15 +117,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_asus_wl-330n3g.dts b/target/linux/ramips/dts/rt3050_asus_wl-330n3g.dts index 4b9add1fda56fc..4f8b7e73ea4c4a 100644 --- a/target/linux/ramips/dts/rt3050_asus_wl-330n3g.dts +++ b/target/linux/ramips/dts/rt3050_asus_wl-330n3g.dts @@ -80,6 +80,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -108,19 +122,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_dlink_dcs-930.dts b/target/linux/ramips/dts/rt3050_dlink_dcs-930.dts index 6620b1e858420d..e3a26bd4cf6164 100644 --- a/target/linux/ramips/dts/rt3050_dlink_dcs-930.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dcs-930.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -105,19 +119,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_dlink_dir-300-b1.dts b/target/linux/ramips/dts/rt3050_dlink_dir-300-b1.dts index e1397d92f91921..a05122b6040ce7 100644 --- a/target/linux/ramips/dts/rt3050_dlink_dir-300-b1.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dir-300-b1.dts @@ -35,6 +35,20 @@ label = "devdata"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; + + macaddr_devdata_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; + }; }; partition@40000 { @@ -115,15 +129,6 @@ }; &wmac { - ralink,mtd-eeprom = <&devdata 0x4000>; -}; - -&devdata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devdata_4004: macaddr@4004 { - reg = <0x4004 0x6>; - }; + nvmem-cells = <&eeprom_devdata_4000>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_dlink_dir-600-b1.dts b/target/linux/ramips/dts/rt3050_dlink_dir-600-b1.dts index b0f734e4e06a88..73e65128e592e7 100644 --- a/target/linux/ramips/dts/rt3050_dlink_dir-600-b1.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dir-600-b1.dts @@ -35,6 +35,20 @@ label = "devdata"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; + + macaddr_devdata_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; + }; }; factory: partition@40000 { @@ -115,15 +129,6 @@ }; &wmac { - ralink,mtd-eeprom = <&devdata 0x4000>; -}; - -&devdata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devdata_4004: macaddr@4004 { - reg = <0x4004 0x6>; - }; + nvmem-cells = <&eeprom_devdata_4000>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_dlink_dir-615-d.dts b/target/linux/ramips/dts/rt3050_dlink_dir-615-d.dts index e84c9d9cb78a67..0d81f7e09662f7 100644 --- a/target/linux/ramips/dts/rt3050_dlink_dir-615-d.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dir-615-d.dts @@ -36,6 +36,16 @@ label = "devdata"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; + }; }; partition@40000 { @@ -105,7 +115,8 @@ }; &wmac { - ralink,mtd-eeprom = <&devdata 0x4000>; + nvmem-cells = <&eeprom_devdata_4000>; + nvmem-cell-names = "eeprom"; }; &state_default { diff --git a/target/linux/ramips/dts/rt3050_dlink_dir-620-a1.dts b/target/linux/ramips/dts/rt3050_dlink_dir-620-a1.dts index 4580a070633093..3a5624d125ee7b 100644 --- a/target/linux/ramips/dts/rt3050_dlink_dir-620-a1.dts +++ b/target/linux/ramips/dts/rt3050_dlink_dir-620-a1.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -120,19 +134,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_edimax_3g-6200n.dts b/target/linux/ramips/dts/rt3050_edimax_3g-6200n.dts index c8f3951384d504..62686b5489bf7b 100644 --- a/target/linux/ramips/dts/rt3050_edimax_3g-6200n.dts +++ b/target/linux/ramips/dts/rt3050_edimax_3g-6200n.dts @@ -42,6 +42,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@3e0000 { @@ -116,19 +130,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_edimax_3g-6200nl.dts b/target/linux/ramips/dts/rt3050_edimax_3g-6200nl.dts index 3767afb4527c9b..c0fdb9995deac0 100644 --- a/target/linux/ramips/dts/rt3050_edimax_3g-6200nl.dts +++ b/target/linux/ramips/dts/rt3050_edimax_3g-6200nl.dts @@ -42,6 +42,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@3e0000 { @@ -103,19 +117,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_huawei_d105.dts b/target/linux/ramips/dts/rt3050_huawei_d105.dts index 05d3847e71e603..5e217aa3625807 100644 --- a/target/linux/ramips/dts/rt3050_huawei_d105.dts +++ b/target/linux/ramips/dts/rt3050_huawei_d105.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -96,19 +110,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_jcg_jhr-n805r.dts b/target/linux/ramips/dts/rt3050_jcg_jhr-n805r.dts index f449b0d0f8027a..61fac83b14661a 100644 --- a/target/linux/ramips/dts/rt3050_jcg_jhr-n805r.dts +++ b/target/linux/ramips/dts/rt3050_jcg_jhr-n805r.dts @@ -71,6 +71,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + }; }; partition@50000 { @@ -92,15 +106,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_netcore_nw718.dts b/target/linux/ramips/dts/rt3050_netcore_nw718.dts index f9fda94ec0d744..beceb3f35d6920 100644 --- a/target/linux/ramips/dts/rt3050_netcore_nw718.dts +++ b/target/linux/ramips/dts/rt3050_netcore_nw718.dts @@ -82,6 +82,20 @@ label = "factory"; reg = <0x50000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@60000 { @@ -110,19 +124,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_sparklan_wcr-150gn.dts b/target/linux/ramips/dts/rt3050_sparklan_wcr-150gn.dts index c00feb42889604..a241e91bafbbde 100644 --- a/target/linux/ramips/dts/rt3050_sparklan_wcr-150gn.dts +++ b/target/linux/ramips/dts/rt3050_sparklan_wcr-150gn.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -102,19 +116,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_teltonika_rut5xx.dts b/target/linux/ramips/dts/rt3050_teltonika_rut5xx.dts index 6be2590a0cda2e..95faff03b44fe7 100644 --- a/target/linux/ramips/dts/rt3050_teltonika_rut5xx.dts +++ b/target/linux/ramips/dts/rt3050_teltonika_rut5xx.dts @@ -73,6 +73,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -101,19 +115,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3050_tenda_w150m.dts b/target/linux/ramips/dts/rt3050_tenda_w150m.dts index b921b7d1788de3..d9a3f5ac6b41dc 100644 --- a/target/linux/ramips/dts/rt3050_tenda_w150m.dts +++ b/target/linux/ramips/dts/rt3050_tenda_w150m.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -120,15 +134,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3050_trendnet_tew-638apb-v2.dts b/target/linux/ramips/dts/rt3050_trendnet_tew-638apb-v2.dts index 36171ae591c05c..2accb51c3f9b35 100644 --- a/target/linux/ramips/dts/rt3050_trendnet_tew-638apb-v2.dts +++ b/target/linux/ramips/dts/rt3050_trendnet_tew-638apb-v2.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -100,15 +114,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_accton_wr6202.dts b/target/linux/ramips/dts/rt3052_accton_wr6202.dts index a1c179c286bc31..a62f7757c7f80a 100644 --- a/target/linux/ramips/dts/rt3052_accton_wr6202.dts +++ b/target/linux/ramips/dts/rt3052_accton_wr6202.dts @@ -69,6 +69,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -108,19 +122,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_alfa-network_w502u.dts b/target/linux/ramips/dts/rt3052_alfa-network_w502u.dts index 97b37706fbdc32..0b9270461bd226 100644 --- a/target/linux/ramips/dts/rt3052_alfa-network_w502u.dts +++ b/target/linux/ramips/dts/rt3052_alfa-network_w502u.dts @@ -45,6 +45,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -106,19 +120,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_argus_atp-52b.dts b/target/linux/ramips/dts/rt3052_argus_atp-52b.dts index dffa5beefa762a..94baf5fb89aa7f 100644 --- a/target/linux/ramips/dts/rt3052_argus_atp-52b.dts +++ b/target/linux/ramips/dts/rt3052_argus_atp-52b.dts @@ -39,6 +39,20 @@ factory: partition@40000 { label = "factory"; reg = <0x40000 0x10000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -98,19 +112,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_asiarf_awapn2403.dts b/target/linux/ramips/dts/rt3052_asiarf_awapn2403.dts index 5d73043425b6c6..49965d4e5e8fb8 100644 --- a/target/linux/ramips/dts/rt3052_asiarf_awapn2403.dts +++ b/target/linux/ramips/dts/rt3052_asiarf_awapn2403.dts @@ -64,6 +64,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + }; }; partition@50000 { @@ -87,5 +97,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_asus_rt-n13u.dts b/target/linux/ramips/dts/rt3052_asus_rt-n13u.dts index cbd586232e0dc8..d60dabb5ea6bbb 100644 --- a/target/linux/ramips/dts/rt3052_asus_rt-n13u.dts +++ b/target/linux/ramips/dts/rt3052_asus_rt-n13u.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -100,19 +114,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_aximcom_mr-102n.dts b/target/linux/ramips/dts/rt3052_aximcom_mr-102n.dts index ada957fc52887e..456bc204157fc4 100644 --- a/target/linux/ramips/dts/rt3052_aximcom_mr-102n.dts +++ b/target/linux/ramips/dts/rt3052_aximcom_mr-102n.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -118,19 +132,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_aztech_hw550-3g.dts b/target/linux/ramips/dts/rt3052_aztech_hw550-3g.dts index c547c9df69a32a..4a23d65628c2a8 100644 --- a/target/linux/ramips/dts/rt3052_aztech_hw550-3g.dts +++ b/target/linux/ramips/dts/rt3052_aztech_hw550-3g.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -118,19 +132,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts b/target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts index 444a5af4f53fef..13b16921b995cf 100644 --- a/target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts +++ b/target/linux/ramips/dts/rt3052_belkin_f5d8235-v2.dts @@ -29,6 +29,20 @@ label = "uboot"; reg = <0x0 0x50000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_uboot_40000: eeprom@40000 { + reg = <0x40000 0x200>; + }; + + macaddr_uboot_40004: macaddr@40004 { + reg = <0x40004 0x6>; + }; + }; }; partition@50000 { @@ -135,19 +149,10 @@ }; &wmac { - ralink,mtd-eeprom = <&uboot 0x40000>; + nvmem-cells = <&eeprom_uboot_40000>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&uboot { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_40004: macaddr@40004 { - reg = <0x40004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_buffalo_whr-g300n.dts b/target/linux/ramips/dts/rt3052_buffalo_whr-g300n.dts index 5d61c757754605..286fe0a566b080 100644 --- a/target/linux/ramips/dts/rt3052_buffalo_whr-g300n.dts +++ b/target/linux/ramips/dts/rt3052_buffalo_whr-g300n.dts @@ -40,6 +40,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -122,15 +136,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_dlink_dap-1350.dts b/target/linux/ramips/dts/rt3052_dlink_dap-1350.dts index e33a7ef5b5eb67..75cc1385cdd35f 100644 --- a/target/linux/ramips/dts/rt3052_dlink_dap-1350.dts +++ b/target/linux/ramips/dts/rt3052_dlink_dap-1350.dts @@ -39,6 +39,20 @@ label = "devdata"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devdata_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_devdata_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + }; }; partition@40000 { @@ -127,19 +141,10 @@ }; &wmac { - ralink,mtd-eeprom = <&devdata 0x0>; + nvmem-cells = <&eeprom_devdata_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&devdata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devdata_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_engenius_esr-9753.dts b/target/linux/ramips/dts/rt3052_engenius_esr-9753.dts index 4501a44c41ff10..2c3b759c041a1d 100644 --- a/target/linux/ramips/dts/rt3052_engenius_esr-9753.dts +++ b/target/linux/ramips/dts/rt3052_engenius_esr-9753.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -100,15 +114,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_fon_fonera-20n.dts b/target/linux/ramips/dts/rt3052_fon_fonera-20n.dts index b9fb232aa121f5..9a256e65dc834d 100644 --- a/target/linux/ramips/dts/rt3052_fon_fonera-20n.dts +++ b/target/linux/ramips/dts/rt3052_fon_fonera-20n.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -146,19 +160,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_hauppauge_broadway.dts b/target/linux/ramips/dts/rt3052_hauppauge_broadway.dts index 9d5d4ceb1e96e9..f7420e20920ef2 100644 --- a/target/linux/ramips/dts/rt3052_hauppauge_broadway.dts +++ b/target/linux/ramips/dts/rt3052_hauppauge_broadway.dts @@ -34,6 +34,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -89,19 +103,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_huawei_hg255d.dts b/target/linux/ramips/dts/rt3052_huawei_hg255d.dts index 1cb19d018469e4..dc00110f1b7b3b 100644 --- a/target/linux/ramips/dts/rt3052_huawei_hg255d.dts +++ b/target/linux/ramips/dts/rt3052_huawei_hg255d.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x60000 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@80000 { @@ -134,19 +148,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_jcg_jhr-n825r.dts b/target/linux/ramips/dts/rt3052_jcg_jhr-n825r.dts index 0641a4e796839f..6fb85b237400eb 100644 --- a/target/linux/ramips/dts/rt3052_jcg_jhr-n825r.dts +++ b/target/linux/ramips/dts/rt3052_jcg_jhr-n825r.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + }; }; partition@50000 { @@ -87,15 +101,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_jcg_jhr-n926r.dts b/target/linux/ramips/dts/rt3052_jcg_jhr-n926r.dts index 6573159985e40c..6096019b1031e6 100644 --- a/target/linux/ramips/dts/rt3052_jcg_jhr-n926r.dts +++ b/target/linux/ramips/dts/rt3052_jcg_jhr-n926r.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_2e: macaddr@2e { + reg = <0x2e 0x6>; + }; + }; }; partition@50000 { @@ -133,15 +147,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_2e: macaddr@2e { - reg = <0x2e 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts b/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts index 245f01c79777b0..e1d1197d70929e 100644 --- a/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts +++ b/target/linux/ramips/dts/rt3052_mofinetwork_mofi3500-3gn.dts @@ -41,6 +41,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + }; }; partition@50000 { @@ -113,8 +123,8 @@ }; &wmac { - status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { diff --git a/target/linux/ramips/dts/rt3052_netgear_wnce2001.dts b/target/linux/ramips/dts/rt3052_netgear_wnce2001.dts index c65fc100d8cd61..856dc85679dc43 100644 --- a/target/linux/ramips/dts/rt3052_netgear_wnce2001.dts +++ b/target/linux/ramips/dts/rt3052_netgear_wnce2001.dts @@ -95,6 +95,20 @@ label = "factory"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@40000 { @@ -142,15 +156,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_nexaira_bc2.dts b/target/linux/ramips/dts/rt3052_nexaira_bc2.dts index c72d9372a548c0..b95e919591e3a8 100644 --- a/target/linux/ramips/dts/rt3052_nexaira_bc2.dts +++ b/target/linux/ramips/dts/rt3052_nexaira_bc2.dts @@ -34,6 +34,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -84,19 +98,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_omnima_miniembwifi.dts b/target/linux/ramips/dts/rt3052_omnima_miniembwifi.dts index 4399467b290af3..7dcecc078bd516 100644 --- a/target/linux/ramips/dts/rt3052_omnima_miniembwifi.dts +++ b/target/linux/ramips/dts/rt3052_omnima_miniembwifi.dts @@ -66,6 +66,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -94,19 +108,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_petatel_psr-680w.dts b/target/linux/ramips/dts/rt3052_petatel_psr-680w.dts index ec46584381c651..5461ee2f956821 100644 --- a/target/linux/ramips/dts/rt3052_petatel_psr-680w.dts +++ b/target/linux/ramips/dts/rt3052_petatel_psr-680w.dts @@ -45,6 +45,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -93,19 +107,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_planex_mzk-w300nh2.dts b/target/linux/ramips/dts/rt3052_planex_mzk-w300nh2.dts index 779443e70e2c90..c3d7993ae66a28 100644 --- a/target/linux/ramips/dts/rt3052_planex_mzk-w300nh2.dts +++ b/target/linux/ramips/dts/rt3052_planex_mzk-w300nh2.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@3e0000 { @@ -117,15 +131,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_planex_mzk-wdpr.dts b/target/linux/ramips/dts/rt3052_planex_mzk-wdpr.dts index 7e6d47cc0214b3..5d445298986958 100644 --- a/target/linux/ramips/dts/rt3052_planex_mzk-wdpr.dts +++ b/target/linux/ramips/dts/rt3052_planex_mzk-wdpr.dts @@ -38,6 +38,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@7f0000 { @@ -82,19 +96,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_poray_ip2202.dts b/target/linux/ramips/dts/rt3052_poray_ip2202.dts index 2f340c4c3108da..0361004d84ea29 100644 --- a/target/linux/ramips/dts/rt3052_poray_ip2202.dts +++ b/target/linux/ramips/dts/rt3052_poray_ip2202.dts @@ -41,6 +41,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -96,13 +106,3 @@ &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_prolink_pwh2004.dts b/target/linux/ramips/dts/rt3052_prolink_pwh2004.dts index 312007c68f0768..495f187a37e5c1 100644 --- a/target/linux/ramips/dts/rt3052_prolink_pwh2004.dts +++ b/target/linux/ramips/dts/rt3052_prolink_pwh2004.dts @@ -41,6 +41,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + }; }; partition@50000 { @@ -89,5 +99,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_ralink_v22rw-2x2.dts b/target/linux/ramips/dts/rt3052_ralink_v22rw-2x2.dts index 2689febf7fc33a..1b5ba03feb8dca 100644 --- a/target/linux/ramips/dts/rt3052_ralink_v22rw-2x2.dts +++ b/target/linux/ramips/dts/rt3052_ralink_v22rw-2x2.dts @@ -41,6 +41,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + }; }; partition@50000 { @@ -95,7 +105,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { diff --git a/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts b/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts index 13f1ae4e59d1fa..82c3783e1f63d7 100644 --- a/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts +++ b/target/linux/ramips/dts/rt3052_sitecom_wl-351.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -122,19 +136,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_skyline_sl-r7205.dts b/target/linux/ramips/dts/rt3052_skyline_sl-r7205.dts index c897aac7c49b73..8a4120175e1bfa 100644 --- a/target/linux/ramips/dts/rt3052_skyline_sl-r7205.dts +++ b/target/linux/ramips/dts/rt3052_skyline_sl-r7205.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -95,19 +109,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_tenda_3g300m.dts b/target/linux/ramips/dts/rt3052_tenda_3g300m.dts index 4ae42d71a58103..304d3bef1c58ab 100644 --- a/target/linux/ramips/dts/rt3052_tenda_3g300m.dts +++ b/target/linux/ramips/dts/rt3052_tenda_3g300m.dts @@ -97,6 +97,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -125,19 +139,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_tenda_w306r-v2.dts b/target/linux/ramips/dts/rt3052_tenda_w306r-v2.dts index 8a60184959f21d..a4d11072ea573e 100644 --- a/target/linux/ramips/dts/rt3052_tenda_w306r-v2.dts +++ b/target/linux/ramips/dts/rt3052_tenda_w306r-v2.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -94,15 +108,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-4m.dts b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-4m.dts index eee3ac9552db01..6002342fc9e585 100644 --- a/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-4m.dts +++ b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-4m.dts @@ -31,6 +31,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + }; }; partition@50000 { diff --git a/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-8m.dts b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-8m.dts index 99693865cbc73b..16495ddc885af9 100644 --- a/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-8m.dts +++ b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn-8m.dts @@ -31,6 +31,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + }; }; partition@50000 { diff --git a/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn.dtsi b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn.dtsi index dad0da16d54e79..869cf32d787931 100644 --- a/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn.dtsi +++ b/target/linux/ramips/dts/rt3052_unbranded_wr512-3gn.dtsi @@ -72,7 +72,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { diff --git a/target/linux/ramips/dts/rt3052_unbranded_xdx-rn502j.dts b/target/linux/ramips/dts/rt3052_unbranded_xdx-rn502j.dts index 88c4c1fc8928a3..ec5e4af5e28aa7 100644 --- a/target/linux/ramips/dts/rt3052_unbranded_xdx-rn502j.dts +++ b/target/linux/ramips/dts/rt3052_unbranded_xdx-rn502j.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -94,19 +108,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_upvel_ur-326n4g.dts b/target/linux/ramips/dts/rt3052_upvel_ur-326n4g.dts index 211db1cbaba395..8104bf60538771 100644 --- a/target/linux/ramips/dts/rt3052_upvel_ur-326n4g.dts +++ b/target/linux/ramips/dts/rt3052_upvel_ur-326n4g.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; + }; }; partition@50000 { @@ -115,19 +129,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4004: macaddr@4004 { - reg = <0x4004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_upvel_ur-336un.dts b/target/linux/ramips/dts/rt3052_upvel_ur-336un.dts index 735f59f06706a3..050ce21a753649 100644 --- a/target/linux/ramips/dts/rt3052_upvel_ur-336un.dts +++ b/target/linux/ramips/dts/rt3052_upvel_ur-336un.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; + }; }; partition@50000 { @@ -115,19 +129,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4004: macaddr@4004 { - reg = <0x4004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_zyxel_keenetic.dts b/target/linux/ramips/dts/rt3052_zyxel_keenetic.dts index c2f44ee5653620..2c16736c962a09 100644 --- a/target/linux/ramips/dts/rt3052_zyxel_keenetic.dts +++ b/target/linux/ramips/dts/rt3052_zyxel_keenetic.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -114,19 +128,10 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &otg { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3052_zyxel_nbg-419n.dts b/target/linux/ramips/dts/rt3052_zyxel_nbg-419n.dts index c5990977dc572f..18dcf6b6760dd3 100644 --- a/target/linux/ramips/dts/rt3052_zyxel_nbg-419n.dts +++ b/target/linux/ramips/dts/rt3052_zyxel_nbg-419n.dts @@ -41,6 +41,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -100,15 +114,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3352_allnet_all5002.dts b/target/linux/ramips/dts/rt3352_allnet_all5002.dts index 28c677041a583e..6483e935dde568 100644 --- a/target/linux/ramips/dts/rt3352_allnet_all5002.dts +++ b/target/linux/ramips/dts/rt3352_allnet_all5002.dts @@ -72,6 +72,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -100,7 +114,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -110,13 +125,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3352_dlink_dir-615-h1.dts b/target/linux/ramips/dts/rt3352_dlink_dir-615-h1.dts index 01393c2383b6bd..dc2c49cd0b80ee 100644 --- a/target/linux/ramips/dts/rt3352_dlink_dir-615-h1.dts +++ b/target/linux/ramips/dts/rt3352_dlink_dir-615-h1.dts @@ -92,6 +92,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -122,15 +136,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3352_dlink_dir-620-d1.dts b/target/linux/ramips/dts/rt3352_dlink_dir-620-d1.dts index bb36279016473e..de020706dfd64d 100644 --- a/target/linux/ramips/dts/rt3352_dlink_dir-620-d1.dts +++ b/target/linux/ramips/dts/rt3352_dlink_dir-620-d1.dts @@ -69,6 +69,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -99,7 +113,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -109,13 +124,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3352_zte_mf283plus.dts b/target/linux/ramips/dts/rt3352_zte_mf283plus.dts index b733d68586e24f..01455b0d5af5a5 100644 --- a/target/linux/ramips/dts/rt3352_zte_mf283plus.dts +++ b/target/linux/ramips/dts/rt3352_zte_mf283plus.dts @@ -88,6 +88,20 @@ label = "factory"; reg = <0x70000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@80000 { @@ -120,7 +134,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -130,13 +145,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3352_zyxel_nbg-419n-v2.dts b/target/linux/ramips/dts/rt3352_zyxel_nbg-419n-v2.dts index 8b7c47e88b57ce..0ac89bce43b284 100644 --- a/target/linux/ramips/dts/rt3352_zyxel_nbg-419n-v2.dts +++ b/target/linux/ramips/dts/rt3352_zyxel_nbg-419n-v2.dts @@ -86,6 +86,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -114,7 +128,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -124,13 +139,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts b/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts index 38191d2643a0aa..7837a4ca3da9c7 100644 --- a/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts +++ b/target/linux/ramips/dts/rt3662_asus_rt-n56u.dts @@ -40,6 +40,24 @@ reg = <0x00040000 0x00010000>; label = "factory"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -129,14 +147,15 @@ wifi@0,0 { compatible = "pci1814,3091"; reg = <0x10000 0 0 0 0>; - ralink,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; &wmac { - status = "okay"; ralink,2ghz = <0>; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -146,13 +165,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3662_dlink_dir-645.dts b/target/linux/ramips/dts/rt3662_dlink_dir-645.dts index b02c6b692af8f6..87d52d679c120a 100644 --- a/target/linux/ramips/dts/rt3662_dlink_dir-645.dts +++ b/target/linux/ramips/dts/rt3662_dlink_dir-645.dts @@ -97,6 +97,20 @@ label = "factory"; reg = <0x34000 0x4000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@38000 { @@ -137,7 +151,8 @@ &wmac { ralink,5ghz = <0>; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -147,13 +162,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts b/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts index fc3a5549f20722..60ec3dacf501c2 100644 --- a/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts +++ b/target/linux/ramips/dts/rt3662_edimax_br-6475nd.dts @@ -75,15 +75,39 @@ }; factory: partition@40000 { - reg = <0x00040000 0x00010000>; label = "factory"; + reg = <0x00040000 0x00010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; devdata: partition@50000 { - reg = <0x00050000 0x00020000>; label = "devdata"; + reg = <0x00050000 0x00020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_devdata_d: macaddr@d { + reg = <0xd 0x6>; + }; + }; }; partition@70000 { @@ -148,8 +172,8 @@ }; &wmac { - status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pci { @@ -163,7 +187,8 @@ compatible = "pci0,0"; reg = <0x10000 0 0 0 0>; ralink,5ghz = <0>; - ralink,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; @@ -174,13 +199,3 @@ &ohci { status = "okay"; }; - -&devdata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devdata_d: macaddr@d { - reg = <0xd 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3662_engenius_esr600h.dts b/target/linux/ramips/dts/rt3662_engenius_esr600h.dts index cce44ed4c3aaeb..6770e4cc9a3db4 100644 --- a/target/linux/ramips/dts/rt3662_engenius_esr600h.dts +++ b/target/linux/ramips/dts/rt3662_engenius_esr600h.dts @@ -92,6 +92,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; partition@50000 { @@ -151,15 +165,15 @@ compatible = "pci1814,3091"; reg = <0x0 1 0 0 0>; ralink,5ghz = <0>; - ralink,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; &wmac { - status = "okay"; - ralink,2ghz = <0>; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { diff --git a/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts b/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts index 2501c1725154ad..1da233ba78f043 100644 --- a/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts +++ b/target/linux/ramips/dts/rt3662_loewe_wmdr-143n.dts @@ -34,6 +34,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + }; }; partition@50000 { @@ -61,6 +71,6 @@ }; &wmac { - status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt3662_omnima_hpm.dts b/target/linux/ramips/dts/rt3662_omnima_hpm.dts index 84ca468e3d2a58..e06e6986ec2b52 100644 --- a/target/linux/ramips/dts/rt3662_omnima_hpm.dts +++ b/target/linux/ramips/dts/rt3662_omnima_hpm.dts @@ -113,6 +113,20 @@ reg = <0x00040000 0x00010000>; label = "factory"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -147,7 +161,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -157,13 +172,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts b/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts index ad417856b3a81a..b022b5c2be709a 100644 --- a/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts +++ b/target/linux/ramips/dts/rt3662_samsung_cy-swr1100.dts @@ -40,6 +40,20 @@ label = "factory"; reg = <0x34000 0x4000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_2000: eeprom@2000 { + reg = <0x2000 0x200>; + }; + }; }; partition@38000 { @@ -135,14 +149,15 @@ wifi@0,0 { compatible = "pci1814,3091"; reg = <0x10000 0 0 0 0>; - ralink,mtd-eeprom = <&factory 0x2000>; + nvmem-cells = <&eeprom_factory_2000>; + nvmem-cell-names = "eeprom"; }; }; &wmac { - status = "okay"; ralink,2ghz = <0>; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { diff --git a/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi b/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi index 0b2c7602d1c6b1..4a64d8a7fe2925 100644 --- a/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi +++ b/target/linux/ramips/dts/rt3883_belkin_f9k110x.dtsi @@ -45,6 +45,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + }; }; partition@50000 { @@ -77,8 +91,8 @@ }; &wmac { - status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &pci { @@ -92,7 +106,8 @@ compatible = "pci1814,3091"; reg = <0x10000 0 0 0 0>; ralink,5ghz = <0>; - ralink,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; diff --git a/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts b/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts index fc437c1f62c860..17f3c10bc90e40 100644 --- a/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts +++ b/target/linux/ramips/dts/rt3883_sitecom_wlr-6000.dts @@ -64,9 +64,8 @@ ðernet { status = "okay"; - nvmem-cells = <&macaddr_factory_8004>; + nvmem-cells = <&macaddr_factory_8004 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; port@0 { phy-handle = <&phy0>; @@ -125,6 +124,26 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_8004: macaddr@8004 { + compatible = "mac-base"; + reg = <0x8004 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -164,14 +183,15 @@ wifi@0,0 { compatible = "pci1814,3091"; reg = <0x10000 0 0 0 0>; - ralink,mtd-eeprom = <&factory 0x8000>; + nvmem-cells = <&eeprom_factory_8000>; + nvmem-cell-names = "eeprom"; }; }; &wmac { - status = "okay"; ralink,2ghz = <0>; - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &ehci { @@ -181,13 +201,3 @@ &ohci { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_8004: macaddr@8004 { - reg = <0x8004 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts b/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts index fe503289a3d625..f23dc1cb039098 100644 --- a/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts +++ b/target/linux/ramips/dts/rt3883_trendnet_tew-691gr.dts @@ -40,6 +40,22 @@ reg = <0x00040000 0x00010000>; label = "factory"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -95,7 +111,7 @@ }; ðernet { - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; port@0 { @@ -114,20 +130,7 @@ }; &wmac { - status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; ralink,5ghz = <0>; - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4 1>; + nvmem-cell-names = "eeprom", "mac-address"; }; diff --git a/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts b/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts index 26c8dfe2f29509..ee2ca91af7ff5d 100644 --- a/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts +++ b/target/linux/ramips/dts/rt3883_trendnet_tew-692gr.dts @@ -40,6 +40,22 @@ reg = <0x00040000 0x00010000>; label = "factory"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@50000 { @@ -95,7 +111,7 @@ ðernet { status = "okay"; - nvmem-cells = <&macaddr_factory_4>; + nvmem-cells = <&macaddr_factory_4 0>; nvmem-cell-names = "mac-address"; port@0 { @@ -140,20 +156,7 @@ }; &wmac { - status = "okay"; - ralink,mtd-eeprom = <&factory 0x0>; ralink,5ghz = <0>; - nvmem-cells = <&macaddr_factory_4>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4 3>; + nvmem-cell-names = "eeprom", "mac-address"; }; diff --git a/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi b/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi index 2d43e0a30d1f0e..26db035c8e6e66 100644 --- a/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi +++ b/target/linux/ramips/dts/rt5350_7links_px-4885.dtsi @@ -70,6 +70,20 @@ label = "devconf"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devconf_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_devconf_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; firmware: partition@50000 { @@ -98,15 +112,6 @@ }; &wmac { - ralink,mtd-eeprom = <&devconf 0x0>; -}; - -&devconf { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devconf_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_devconf_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_airlive_air3gii.dts b/target/linux/ramips/dts/rt5350_airlive_air3gii.dts index 0082af958dc802..e46b3365959086 100644 --- a/target/linux/ramips/dts/rt5350_airlive_air3gii.dts +++ b/target/linux/ramips/dts/rt5350_airlive_air3gii.dts @@ -64,6 +64,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -92,15 +106,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_allnet_all5003.dts b/target/linux/ramips/dts/rt5350_allnet_all5003.dts index e4e0ef1b62a475..496f1958013d0d 100644 --- a/target/linux/ramips/dts/rt5350_allnet_all5003.dts +++ b/target/linux/ramips/dts/rt5350_allnet_all5003.dts @@ -72,6 +72,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -100,15 +114,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi index 18e59431fbacf8..b9905f62f59967 100644 --- a/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi +++ b/target/linux/ramips/dts/rt5350_asiarf_awm002-evb.dtsi @@ -72,6 +72,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; firmware: partition@50000 { @@ -89,7 +103,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { @@ -102,13 +117,3 @@ &esw { mediatek,portmap = <0x3f>; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt5350_belkin_f7c027.dts b/target/linux/ramips/dts/rt5350_belkin_f7c027.dts index e3691b75bdb47e..b1a897a85950e1 100644 --- a/target/linux/ramips/dts/rt5350_belkin_f7c027.dts +++ b/target/linux/ramips/dts/rt5350_belkin_f7c027.dts @@ -91,6 +91,16 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + }; }; partition@50000 { @@ -128,7 +138,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &state_default { diff --git a/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts b/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts index 5b504bea650d6d..1e561136fae547 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dcs-930l-b1.dts @@ -75,6 +75,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -103,15 +117,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts b/target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts index 62c68a3fc2a417..13100edf046177 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dir-300-b7.dts @@ -75,6 +75,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -104,17 +118,7 @@ }; &wmac { - status = "okay"; ralink,led-polarity = <1>; - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts b/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts index 5c5517ccb2931a..577b3a0a3e7c8b 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dir-320-b1.dts @@ -97,6 +97,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -126,15 +140,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts b/target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts index 261346ce867d76..7467900e4268a0 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dir-610-a1.dts @@ -69,6 +69,20 @@ label = "devdata"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_devdata_4000: eeprom@4000 { + reg = <0x4000 0x200>; + }; + + macaddr_devdata_4004: macaddr@4004 { + reg = <0x4004 0x6>; + }; + }; }; factory: partition@40000 { @@ -105,17 +119,7 @@ }; &wmac { - status = "okay"; ralink,led-polarity = <1>; - ralink,mtd-eeprom = <&devdata 0x4000>; -}; - -&devdata { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_devdata_4004: macaddr@4004 { - reg = <0x4004 0x6>; - }; + nvmem-cells = <&eeprom_devdata_4000>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_dlink_dwr-512-b.dts b/target/linux/ramips/dts/rt5350_dlink_dwr-512-b.dts index 7bb1d81abf9623..3475f4ccf70be9 100644 --- a/target/linux/ramips/dts/rt5350_dlink_dwr-512-b.dts +++ b/target/linux/ramips/dts/rt5350_dlink_dwr-512-b.dts @@ -105,6 +105,20 @@ config: partition@7f0000 { label = "config"; reg = <0x7f0000 0x10000>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_e07e: macaddr@e07e { + reg = <0xe07e 0x6>; + }; + + eeprom_config_e08a: eeprom@e08a { + reg = <0xe08a 0x200>; + }; + }; }; }; }; @@ -140,18 +154,7 @@ }; &wmac { - ralink,mtd-eeprom = <&config 0xe08a>; ralink,led-polarity = <1>; - nvmem-cells = <&macaddr_config_e07e>; - nvmem-cell-names = "mac-address"; -}; - -&config { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_config_e07e: macaddr@e07e { - reg = <0xe07e 0x6>; - }; + nvmem-cells = <&eeprom_config_e08a>, <&macaddr_config_e07e>; + nvmem-cell-names = "eeprom", "mac-address"; }; diff --git a/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts b/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts index 1b80382f681159..9d7792867a608b 100644 --- a/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts +++ b/target/linux/ramips/dts/rt5350_easyacc_wizard-8800.dts @@ -34,6 +34,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -62,15 +76,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts b/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts index a246c22c215271..9a9580a3fba06c 100644 --- a/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts +++ b/target/linux/ramips/dts/rt5350_hame_mpr-a1.dts @@ -86,6 +86,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -114,15 +128,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts b/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts index 710fd2d6be28b8..5a06ef46fb35a0 100644 --- a/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts +++ b/target/linux/ramips/dts/rt5350_hame_mpr-a2.dts @@ -86,6 +86,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -115,15 +129,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts b/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts index 7dc56673a0496d..3cc425d5af9d60 100644 --- a/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts +++ b/target/linux/ramips/dts/rt5350_hilink_hlk-rm04.dts @@ -79,6 +79,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -108,15 +122,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts b/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts index 387e4adfdc170c..70acc3fc439384 100644 --- a/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts +++ b/target/linux/ramips/dts/rt5350_hootoo_ht-tm02.dts @@ -76,6 +76,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -105,15 +119,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_intenso_memory2move.dts b/target/linux/ramips/dts/rt5350_intenso_memory2move.dts index 8df91594b7e025..b1a28815f6a6bf 100644 --- a/target/linux/ramips/dts/rt5350_intenso_memory2move.dts +++ b/target/linux/ramips/dts/rt5350_intenso_memory2move.dts @@ -79,6 +79,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -107,15 +121,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi b/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi index 9783e5a7e5ab36..cc55507a95f445 100644 --- a/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi +++ b/target/linux/ramips/dts/rt5350_nexx_wt1520.dtsi @@ -47,6 +47,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; firmware: partition@50000 { @@ -71,15 +85,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi b/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi index ea10d501827b9c..ce7751540bb8d7 100644 --- a/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi +++ b/target/linux/ramips/dts/rt5350_nixcore_x1.dtsi @@ -137,6 +137,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; firmware: partition@50000 { @@ -178,15 +192,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi b/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi index 2d5d86ee1bc0e9..59cbbad2313991 100644 --- a/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi +++ b/target/linux/ramips/dts/rt5350_olimex_rt5350f-olinuxino.dtsi @@ -37,6 +37,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -70,8 +84,9 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &i2c { @@ -81,13 +96,3 @@ &uart { status = "okay"; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts b/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts index 0e69cf8919c060..ca98ab3599f797 100644 --- a/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts +++ b/target/linux/ramips/dts/rt5350_omnima_miniembplug.dts @@ -89,6 +89,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -110,15 +124,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_planex_mzk-dp150n.dts b/target/linux/ramips/dts/rt5350_planex_mzk-dp150n.dts index 89a774a060a36c..db349de5e10423 100644 --- a/target/linux/ramips/dts/rt5350_planex_mzk-dp150n.dts +++ b/target/linux/ramips/dts/rt5350_planex_mzk-dp150n.dts @@ -64,6 +64,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -100,16 +114,7 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_poray_m3.dts b/target/linux/ramips/dts/rt5350_poray_m3.dts index f02e7b024d3c9c..505fba650e60c0 100644 --- a/target/linux/ramips/dts/rt5350_poray_m3.dts +++ b/target/linux/ramips/dts/rt5350_poray_m3.dts @@ -71,6 +71,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -100,16 +114,7 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_poray_m4.dtsi b/target/linux/ramips/dts/rt5350_poray_m4.dtsi index 4addfcbef8a146..fd358ff8efd57c 100644 --- a/target/linux/ramips/dts/rt5350_poray_m4.dtsi +++ b/target/linux/ramips/dts/rt5350_poray_m4.dtsi @@ -63,6 +63,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; firmware: partition@50000 { @@ -92,16 +106,7 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_poray_x5.dts b/target/linux/ramips/dts/rt5350_poray_x5.dts index 20e2a5257fa491..d441fd3144a737 100644 --- a/target/linux/ramips/dts/rt5350_poray_x5.dts +++ b/target/linux/ramips/dts/rt5350_poray_x5.dts @@ -103,6 +103,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -132,16 +146,7 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_poray_x8.dts b/target/linux/ramips/dts/rt5350_poray_x8.dts index e84f28f783c4d7..f02eac27b128ef 100644 --- a/target/linux/ramips/dts/rt5350_poray_x8.dts +++ b/target/linux/ramips/dts/rt5350_poray_x8.dts @@ -64,6 +64,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -93,16 +107,7 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_tenda_3g150b.dts b/target/linux/ramips/dts/rt5350_tenda_3g150b.dts index 19b6d78009effb..93dc25007e8e3e 100644 --- a/target/linux/ramips/dts/rt5350_tenda_3g150b.dts +++ b/target/linux/ramips/dts/rt5350_tenda_3g150b.dts @@ -82,6 +82,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -110,16 +124,7 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; ralink,led-polarity = <1>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts b/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts index a03f33f3fc129f..2810b7a70103d2 100644 --- a/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts +++ b/target/linux/ramips/dts/rt5350_trendnet_tew-714tru.dts @@ -85,6 +85,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -114,15 +128,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts b/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts index 5f2bad2b898bf2..64fd8c6b15e692 100644 --- a/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts +++ b/target/linux/ramips/dts/rt5350_unbranded_a5-v11.dts @@ -87,6 +87,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -116,15 +130,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi b/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi index 652f9384e56cba..f3ef0edfe48dfa 100644 --- a/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi +++ b/target/linux/ramips/dts/rt5350_vocore_vocore.dtsi @@ -185,6 +185,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; firmware: partition@50000 { @@ -222,7 +236,8 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; &spi1 { @@ -234,13 +249,3 @@ reg = <0>; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; -}; diff --git a/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts b/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts index 911e3e44edf004..fd3af22eb33064 100644 --- a/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts +++ b/target/linux/ramips/dts/rt5350_wansview_ncs601w.dts @@ -34,6 +34,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -62,15 +76,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts b/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts index 12d41e305e5724..192c403a87262f 100644 --- a/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts +++ b/target/linux/ramips/dts/rt5350_wiznet_wizfi630a.dts @@ -100,10 +100,23 @@ }; factory: partition@40000 { - #size-cells = <1>; label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -139,15 +152,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_zorlik_zl5900v2.dts b/target/linux/ramips/dts/rt5350_zorlik_zl5900v2.dts index 4ff2d57f72966d..00fbb5e927ae4e 100644 --- a/target/linux/ramips/dts/rt5350_zorlik_zl5900v2.dts +++ b/target/linux/ramips/dts/rt5350_zorlik_zl5900v2.dts @@ -69,6 +69,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; }; partition@50000 { @@ -97,15 +111,6 @@ }; &wmac { - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_4: macaddr@4 { - reg = <0x4 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_zyxel_keenetic-4g-b.dts b/target/linux/ramips/dts/rt5350_zyxel_keenetic-4g-b.dts index 9b5c45347b3d4a..9e1e47c099bd4c 100644 --- a/target/linux/ramips/dts/rt5350_zyxel_keenetic-4g-b.dts +++ b/target/linux/ramips/dts/rt5350_zyxel_keenetic-4g-b.dts @@ -92,6 +92,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -122,15 +136,6 @@ &wmac { ralink,led-polarity = <1>; - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_zyxel_keenetic-lite-b.dts b/target/linux/ramips/dts/rt5350_zyxel_keenetic-lite-b.dts index d044be395a8a0b..6effb4f075b6aa 100644 --- a/target/linux/ramips/dts/rt5350_zyxel_keenetic-lite-b.dts +++ b/target/linux/ramips/dts/rt5350_zyxel_keenetic-lite-b.dts @@ -76,6 +76,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -106,15 +120,6 @@ &wmac { ralink,led-polarity = <1>; - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts b/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts index 69a1759f36fda3..8b1e0584b6f116 100644 --- a/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts +++ b/target/linux/ramips/dts/rt5350_zyxel_keenetic-start.dts @@ -78,6 +78,20 @@ label = "factory"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; + }; }; partition@50000 { @@ -107,17 +121,7 @@ }; &wmac { - status = "okay"; ralink,led-polarity = <1>; - ralink,mtd-eeprom = <&factory 0x0>; -}; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_28: macaddr@28 { - reg = <0x28 0x6>; - }; + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; }; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 265e9fb5e0c33a..fdc15aa1efc3ce 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -31,7 +31,7 @@ KERNEL_DTB = kernel-bin | append-dtb | lzma define Build/jcg-header $(STAGING_DIR_HOST)/bin/jcgimage -v $(1) \ - $(if $(JCG_MAXSIZE), -m $$(($(subst k, * 1024,$(JCG_MAXSIZE)))),) \ + $(if $(JCG_MAXSIZE), -m $$(($(call exp_units,$(JCG_MAXSIZE)))),) \ -u $@ -o $@.new mv $@.new $@ endef @@ -142,7 +142,7 @@ endef define Build/trx $(STAGING_DIR_HOST)/bin/trx $(1) \ -o $@ \ - -m $$(($(subst k, * 1024,$(IMAGE_SIZE)))) \ + -m $$(($(call exp_units,$(IMAGE_SIZE)))) \ -f $(IMAGE_KERNEL) \ -a 4 -f $(IMAGE_ROOTFS) endef diff --git a/target/linux/ramips/image/common-sercomm.mk b/target/linux/ramips/image/common-sercomm.mk index 4060da092357ef..0987010911209a 100644 --- a/target/linux/ramips/image/common-sercomm.mk +++ b/target/linux/ramips/image/common-sercomm.mk @@ -23,6 +23,35 @@ define Build/sercomm-crypto rm -f $@.enc $@.key endef +define Build/sercomm-factory-cpj + dd bs=$$((0x1fff00)) count=1 if=$@ of=$@.kernel conv=notrunc \ + 2>/dev/null + dd bs=$$((0x1fff00)) skip=1 if=$@ of=$@.rootfs1 conv=notrunc \ + 2>/dev/null + cp $@.rootfs1 $@.rootfs2 + $(TOPDIR)/scripts/sercomm-kernel-header.py \ + --kernel-image $@.kernel \ + --kernel-offset $(SERCOMM_KERNEL_OFFSET) \ + --rootfs-image $@.rootfs1 \ + --rootfs-offset $(SERCOMM_ROOTFS_OFFSET) \ + --output-header $@.header1 + $(TOPDIR)/scripts/sercomm-kernel-header.py \ + --kernel-image $@.kernel \ + --kernel-offset $(SERCOMM_KERNEL2_OFFSET) \ + --rootfs-image $@.rootfs2 \ + --rootfs-offset $(SERCOMM_ROOTFS2_OFFSET) \ + --output-header $@.header2 + cat $@.header1 $@.kernel > $@.kernel1 + cat $@.header2 $@.kernel > $@.kernel2 + rm $@.header1 $@.header2 $@.kernel + $(call Build/sercomm-part-tag-common,kernel $@.kernel1) + $(call Build/sercomm-part-tag-common,kernel2 $@.kernel2) + $(call Build/sercomm-part-tag-common,rootfs $@.rootfs1) + $(call Build/sercomm-part-tag-common,rootfs2 $@.rootfs2) + cat $@.kernel2 $@.rootfs2 $@.kernel1 $@.rootfs1 > $@ + rm $@.kernel1 $@.rootfs1 $@.kernel2 $@.rootfs2 +endef + define Build/sercomm-factory-cqr $(TOPDIR)/scripts/sercomm-pid.py \ --hw-version $(SERCOMM_HWVER) \ @@ -38,10 +67,6 @@ define Build/sercomm-factory-cqr mv $@.fhdr $@ endef -define Build/sercomm-fix-buc-pid - printf 1 | dd seek=$$((0x13)) of=$@ bs=1 conv=notrunc 2>/dev/null -endef - define Build/sercomm-kernel $(TOPDIR)/scripts/sercomm-kernel-header.py \ --kernel-image $@ \ @@ -104,6 +129,10 @@ define Build/sercomm-payload rm $@.pid endef +define Build/sercomm-pid-setbit + printf 1 | dd seek=$$(($(1))) of=$@ bs=1 conv=notrunc 2>/dev/null +endef + define Build/sercomm-prepend-tagged-kernel $(CP) $(IMAGE_KERNEL) $(IMAGE_KERNEL).tagged $(call Build/sercomm-part-tag-common,$(word 1,$(1)) \ @@ -117,12 +146,46 @@ define Build/sercomm-reset-slot1-chksum dd of=$@ seek=$$((0x118)) bs=1 conv=notrunc 2>/dev/null endef +define Build/sercomm-sysupgrade-cpj + dd bs=$$((0x1fff00)) count=1 if=$@ of=$@.kernel conv=notrunc \ + 2>/dev/null + dd bs=$$((0x1fff00)) skip=1 if=$@ of=$@.rootfs conv=notrunc \ + 2>/dev/null + $(TOPDIR)/scripts/sercomm-kernel-header.py \ + --kernel-image $@.kernel \ + --kernel-offset $(SERCOMM_KERNEL_OFFSET) \ + --rootfs-image $@.rootfs \ + --rootfs-offset $(SERCOMM_ROOTFS_OFFSET) \ + --output-header $@.header + cat $@.header $@.kernel $@.rootfs > $@ + rm $@.header $@.kernel $@.rootfs +endef + define Device/sercomm $(Device/nand) LOADER_TYPE := bin IMAGES += factory.img endef +define Device/sercomm_cpj + SOC := mt7620a + DEVICE_VENDOR := Rostelecom + DEVICE_ALT0_VENDOR := Sercomm + IMAGE_SIZE := 7743k + SERCOMM_HWID := CPJ + SERCOMM_HWVER := 10000 + SERCOMM_SWVER := 1001 + SERCOMM_KERNEL_OFFSET := 0x70100 + SERCOMM_ROOTFS_OFFSET := 0x270000 + SERCOMM_KERNEL2_OFFSET := 0x800100 + SERCOMM_ROOTFS2_OFFSET := 0xa00000 + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \ + sercomm-sysupgrade-cpj | pad-rootfs | check-size | \ + append-metadata + ARTIFACTS := initramfs-factory.img + DEVICE_PACKAGES := kmod-mt76x2 +endef + define Device/sercomm_cxx_dxx $(Device/sercomm) KERNEL_SIZE := 6144k diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index f3f4873d769e29..883aacabe06268 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -2,6 +2,7 @@ # MT7620A Profiles # +include ./common-sercomm.mk include ./common-tp-link.mk DEVICE_VARS += DLINK_ROM_ID DLINK_FAMILY_MEMBER DLINK_FIRMWARE_SIZE DLINK_IMAGE_OFFSET @@ -578,7 +579,7 @@ define Device/hiwifi_hc5861 DEVICE_VENDOR := HiWiFi DEVICE_MODEL := HC5861 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 \ - kmod-usb-ledtrig-usbport + kmod-phy-realtek kmod-usb-ledtrig-usbport SUPPORTED_DEVICES += hc5861 endef TARGET_DEVICES += hiwifi_hc5861 @@ -1102,6 +1103,27 @@ define Device/ravpower_rp-wd03 endef TARGET_DEVICES += ravpower_rp-wd03 +define Device/rostelecom_rt-fl-1 + $(Device/sercomm_cpj) + DEVICE_MODEL := RT-FL-1 + DEVICE_ALT0_MODEL := RT-FL-1 + ARTIFACT/initramfs-factory.img := \ + append-image-stage initramfs-kernel.bin | check-size | \ + sercomm-factory-cpj | gzip | sercomm-payload | \ + sercomm-pid-setbit 0x11 | sercomm-crypto +endef +TARGET_DEVICES += rostelecom_rt-fl-1 + +define Device/rostelecom_s1010 + $(Device/sercomm_cpj) + DEVICE_MODEL := S1010 + DEVICE_ALT0_MODEL := S1010.RT + ARTIFACT/initramfs-factory.img := \ + append-image-stage initramfs-kernel.bin | check-size | \ + sercomm-factory-cpj | gzip | sercomm-payload | sercomm-crypto +endef +TARGET_DEVICES += rostelecom_s1010 + define Device/sanlinking_d240 SOC := mt7620a IMAGE_SIZE := 16064k diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 9838810af4341f..cd42712950641e 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))) @@ -607,6 +615,18 @@ define Device/cudy_wr1300-v2 endef TARGET_DEVICES += cudy_wr1300-v2 +define Device/cudy_wr1300-v3 + $(Device/dsa-migration) + IMAGE_SIZE := 15872k + DEVICE_VENDOR := Cudy + DEVICE_MODEL := WR1300 + DEVICE_VARIANT := v3 + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \ + -uboot-envtools + SUPPORTED_DEVICES += cudy,wr1300 R30 +endef +TARGET_DEVICES += cudy_wr1300-v3 + define Device/cudy_wr2100 $(Device/dsa-migration) DEVICE_VENDOR := Cudy @@ -641,16 +661,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 @@ -684,10 +727,9 @@ define Device/dlink_dir-8xx-a1 DEVICE_VENDOR := D-Link DEVICE_PACKAGES := kmod-mt7615-firmware -uboot-envtools KERNEL := $$(KERNEL) | uimage-sgehdr - IMAGES += factory.bin - IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ - check-size | append-metadata - IMAGE/factory.bin := append-kernel | append-rootfs | check-size + IMAGES += recovery.bin factory.bin + IMAGE/recovery.bin := append-kernel | append-rootfs | check-size + IMAGE/factory.bin := $$(IMAGE/recovery.bin) | dlink-sge-image $$$$(DEVICE_MODEL) endef define Device/dlink_dir-8xx-r1 @@ -707,8 +749,8 @@ define Device/dlink_dir-xx60-a1 DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 \ kmod-usb-ledtrig-usbport -uboot-envtools KERNEL := $$(KERNEL) | uimage-sgehdr - IMAGES += factory.bin - IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ + IMAGES += recovery.bin + IMAGE/recovery.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ check-size endef @@ -760,6 +802,8 @@ define Device/dlink_dir-853-a3 $(Device/dlink_dir-xx60-a1) DEVICE_MODEL := DIR-853 DEVICE_VARIANT := A3 + IMAGES += factory.bin + IMAGE/factory.bin := $$(IMAGE/recovery.bin) | dlink-sge-image $$(DEVICE_MODEL) endef TARGET_DEVICES += dlink_dir-853-a3 @@ -1616,10 +1660,21 @@ define Device/mediatek_mt7621-eval-board endef TARGET_DEVICES += mediatek_mt7621-eval-board +define Device/meig_slt866 + $(Device/dsa-migration) + IMAGE_SIZE := 15104k + DEVICE_VENDOR := MeiG + DEVICE_MODEL := SLT866 + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \ + kmod-usb-net-qmi-wwan kmod-usb-serial-option kmod-usb3 \ + kmod-usb-net-rndis +endef +TARGET_DEVICES += meig_slt866 + define Device/mercusys_mr70x-v1 $(Device/dsa-migration) $(Device/tplink-safeloader) - DEVICE_VENDOR := Mercusys + DEVICE_VENDOR := MERCUSYS DEVICE_MODEL := MR70X DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-mt7915-firmware -uboot-envtools @@ -2052,6 +2107,7 @@ TARGET_DEVICES += samknows_whitebox-v8 define Device/sercomm_na502 $(Device/nand) + $(Device/uimage-lzma-loader) IMAGE_SIZE := 20480k DEVICE_VENDOR := SERCOMM DEVICE_MODEL := NA502 @@ -2128,7 +2184,7 @@ define Device/telco-electronics_x1 IMAGE_SIZE := 16064k DEVICE_VENDOR := Telco Electronics DEVICE_MODEL := X1 - DEVICE_PACKAGES := kmod-usb3 kmod-mt76 -uboot-envtools + DEVICE_PACKAGES := kmod-usb3 kmod-mt7603 kmod-mt76x2 -uboot-envtools endef TARGET_DEVICES += telco-electronics_x1 @@ -2325,6 +2381,20 @@ define Device/tplink_er605-v2 endef TARGET_DEVICES += tplink_er605-v2 +define Device/tplink_ex220-v1 + $(Device/dsa-migration) + DEVICE_VENDOR := TP-Link + DEVICE_MODEL := EX220 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-mt7915-firmware -uboot-envtools + TPLINK_BOARD_ID := EX220-V1 + KERNEL_LOADADDR := 0x82000000 + KERNEL := kernel-bin | relocate-kernel 0x80001000 | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb + IMAGE_SIZE := 15744k +endef +TARGET_DEVICES += tplink_ex220-v1 + define Device/tplink_mr600-v2-eu $(Device/dsa-migration) $(Device/tplink-v2) @@ -2611,7 +2681,7 @@ define Device/wifire_s1500-nbn IMAGE_SIZE := 51200k IMAGE/factory.img := append-kernel | sercomm-kernel-factory | \ sercomm-reset-slot1-chksum | append-ubi | check-size | \ - sercomm-factory-cqr | sercomm-fix-buc-pid | sercomm-mkhash | \ + sercomm-factory-cqr | sercomm-pid-setbit 0x13 | sercomm-mkhash | \ sercomm-crypto SERCOMM_HWID := BUC SERCOMM_HWVER := 10000 @@ -2974,6 +3044,21 @@ define Device/zyxel_lte3301-plus endef TARGET_DEVICES += zyxel_lte3301-plus +define Device/zyxel_lte5398-m904 + $(Device/nand) + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := LTE5398-M904 + KERNEL_SIZE := 31488k + DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware kmod-usb3 uqmi \ + kmod-usb-net-qmi-wwan kmod-usb-serial-option kmod-usb-ledtrig-usbport + KERNEL := $(KERNEL_DTB) | uImage lzma | \ + zytrx-header $$(DEVICE_MODEL) $$(VERSION_DIST)-$$(REVISION) + KERNEL_INITRAMFS := $(KERNEL_DTB) | uImage lzma | \ + zytrx-header $$(DEVICE_MODEL) 9.99(ABQU.1)$$(VERSION_DIST)-recovery + KERNEL_INITRAMFS_SUFFIX := -recovery.bin +endef +TARGET_DEVICES += zyxel_lte5398-m904 + define Device/zyxel_nr7101 $(Device/nand) DEVICE_VENDOR := ZyXEL diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 816009ac182fcc..fd90c7bac96ea3 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -593,6 +593,19 @@ 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 +endef +TARGET_DEVICES += tplink_archer-c50-v6 + define Device/tplink_re200-v2 $(Device/tplink-safeloader) IMAGE_SIZE := 7808k diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds index 22e79ca7553199..c4f7fcbb8762b5 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds @@ -208,6 +208,14 @@ zbtlink,zbt-we826-e) ravpower,rp-wd03) ucidef_set_led_netdev "internet" "internet" "green:wifi" "eth0" ;; +rostelecom,rt-fl-1|\ +rostelecom,s1010) + ucidef_set_led_switch "lan-1" "lan-1" "green:lan-1" "switch0" "0x02" + ucidef_set_led_switch "lan-2" "lan-2" "green:lan-2" "switch0" "0x04" + ucidef_set_led_switch "lan-3" "lan-3" "green:lan-3" "switch0" "0x08" + ucidef_set_led_switch "lan-4" "lan-4" "green:lan-4" "switch0" "0x10" + ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01" + ;; tplink,archer-c2-v1) ucidef_set_led_switch "lan" "lan" "green:lan" "switch1" "0x1e" ucidef_set_led_switch "wan" "wan" "green:wan" "switch1" "0x01" diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index a0174d2d1ccc48..cbfb8a1d863f31 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -119,6 +119,8 @@ ramips_setup_interfaces() netgear,jwnr2010-v5|\ phicomm,k2-v22.4|\ phicomm,k2-v22.5|\ + rostelecom,rt-fl-1|\ + rostelecom,s1010|\ trendnet,tew-810dr|\ zbtlink,zbt-we2026) ucidef_add_switch "switch0" \ @@ -392,6 +394,11 @@ ramips_setup_macs() linksys,e1700) wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR) ;; + rostelecom,rt-fl-1|\ + rostelecom,s1010) + label_mac=$(mtd_get_mac_binary "SC Nvram(permanent data)" 0x0) + wan_mac=$(macaddr_add "$label_mac" 10) + ;; snr,cpe-w4n-mt) lan_mac=$(mtd_get_mac_binary Factory 0x28) wan_mac=$(mtd_get_mac_binary Factory 0x2e) @@ -412,7 +419,7 @@ ramips_setup_macs() label_mac=$(mtd_get_mac_binary factory 0x4) ;; zyxel,keenetic-lite-iii-a) - lan_mac=$(mtd_get_mac_binary RF-EEPROM 0x4) + lan_mac=$(mtd_get_mac_binary RF-EEPROM 0x4) wan_mac=$(mtd_get_mac_binary RF-EEPROM 0x28) label_mac=$wan_mac ;; diff --git a/target/linux/ramips/mt7620/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7620/base-files/lib/upgrade/platform.sh index 9f71dc918e50a2..6dd7fc7cef1af4 100755 --- a/target/linux/ramips/mt7620/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7620/base-files/lib/upgrade/platform.sh @@ -30,6 +30,14 @@ platform_do_upgrade() { } default_do_upgrade "$1" ;; + rostelecom,rt-fl-1|\ + rostelecom,s1010) + idx="$(find_mtd_index ftd_and_bootflag)" + [ -n "$idx" ] && \ + printf 0 | dd bs=1 seek=$((0x18007)) count=1 \ + of=/dev/mtdblock$idx + default_do_upgrade "$1" + ;; *) default_do_upgrade "$1" ;; diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index d4dfdf39e2e304..51afb9cf414122 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -138,6 +138,10 @@ linksys,ea8100-v2) ucidef_set_led_netdev "lan4" "lan4 link" "green:lan4" "lan4" "link" ucidef_set_led_netdev "wan" "wan link" "green:wan" "wan" "link" ;; +meig,slt866) + ucidef_set_led_netdev "lan" "eth" "blue:lanwan" "lan" "link tx rx" + ucidef_set_led_netdev "wwan0" "net" "blue:internet" "wwan0" "link tx rx" + ;; mikrotik,routerboard-760igs) ucidef_set_led_netdev "sfp" "SFP" "blue:sfp" "sfp" ;; @@ -189,7 +193,8 @@ snr,snr-cpe-me1) tplink,archer-a6-v3|\ tplink,archer-ax23-v1|\ tplink,archer-c6-v3|\ -tplink,archer-c6u-v1) +tplink,archer-c6u-v1|\ +tplink,ex220-v1) ucidef_set_led_netdev "lan" "LAN" "green:lan" "br-lan" ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan" ;; @@ -248,6 +253,9 @@ yuncore,ax820) zyxel,lte3301-plus) ucidef_set_led_netdev "internet" "internet" "white:internet" "wwan0" ;; +zyxel,lte5398-m904) + ucidef_set_led_netdev "internet" "LTE/3G Internet Activity" "green:internet" "wwan0" "rx tx" + ;; esac board_config_flush 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 67fe45f633608f..ae29da4adc3f76 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 @@ -95,9 +95,12 @@ ramips_setup_interfaces() ;; cudy,m1800|\ yuncore,ax820|\ - zyxel,nt7101) + 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" ;; @@ -148,12 +151,17 @@ ramips_setup_interfaces() ubnt,usw-flex) ucidef_set_interface_lan "lan1 lan2 lan3 lan4 lan5" ;; + zyxel,lte5398-m904) + ucidef_set_interface_lan "lan1 lan2" + ucidef_set_interface "wan" device "/dev/cdc-wdm0" protocol "qmi" + ;; zyxel,wap6805) ucidef_set_interface_lan "lan1 lan2 lan3 lan4" ucidef_set_interface "qtn" ifname "eth1" protocol "static" ipaddr "1.1.1.1" netmask "255.255.255.0" ;; comfast,cf-e390ax|\ - comfast,cf-ew72-v2) + comfast,cf-ew72-v2|\ + meig,slt866) ucidef_set_interfaces_lan_wan "lan" "wan" ;; *) @@ -214,6 +222,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/board.d/03_gpio_switches b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches index aebb4163716310..22cf272429a392 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches @@ -29,7 +29,8 @@ ubnt,edgerouter-x-sfp) ucidef_add_gpio_switch "poe_power_port3" "PoE Power Port3" "403" ucidef_add_gpio_switch "poe_power_port4" "PoE Power Port4" "404" ;; -zyxel,lte3301-plus) +zyxel,lte3301-plus|\ +zyxel,lte5398-m904) ucidef_add_gpio_switch "usb_power" "Power USB Port" "usb_power" "1" ucidef_add_gpio_switch "lte_power" "Power LTE modem" "lte_power" "1" ;; 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 96b49ff00ae8b2..8a977e68aee3ca 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" ] && \ @@ -173,6 +180,10 @@ case "$board" in hw_mac_addr="$(mtd_get_mac_binary product-info 0x8)" macaddr_add "$hw_mac_addr" "$PHYNBR" > "/sys${DEVPATH}/macaddress" ;; + tplink,ex220-v1) + hw_mac_addr="$(mtd_get_mac_binary rom_file 0xf100)" + [ "$PHYNBR" = "1" ] && macaddr_add "$hw_mac_addr" 2 > "/sys${DEVPATH}/macaddress" + ;; yuncore,ax820) [ "$PHYNBR" = "1" ] && \ macaddr_setbit_la "$(mtd_get_mac_binary Factory 0xe000)" > /sys${DEVPATH}/macaddress diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount index 9db700bff5560b..c558247341374a 100755 --- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount @@ -34,6 +34,7 @@ boot() { [ $(printf %d $(fw_printenv -n Image1Stable)) -gt 0 ] || fw_setenv Image1Stable 1 [ $(printf %d $(fw_printenv -n Image1Try)) -gt 0 ] && fw_setenv Image1Try 0 ;; + zyxel,lte5398-m904|\ zyxel,nr7101) [ $(printf %d $(fw_printenv -n DebugFlag)) -gt 0 ] || fw_setenv DebugFlag 0x1 [ $(printf %d $(fw_printenv -n Image1Stable)) -gt 0 ] || fw_setenv Image1Stable 1 diff --git a/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration new file mode 100644 index 00000000000000..b595ae6fd12eba --- /dev/null +++ b/target/linux/ramips/mt7621/base-files/etc/uci-defaults/04_led_migration @@ -0,0 +1,17 @@ +. /lib/functions.sh +. /lib/functions/migrations.sh + +board=$(board_name) + +case "$board" in +tplink,archer-a6-v3|\ +tplink,archer-c6-v3) + migrate_leds ':wifi2g$=:wlan-2' ':wifi5g$=:wlan-5' + ;; +esac + +remove_devicename_leds + +migrations_apply system + +exit 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 203872394bda33..2b789342abe056 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|\ @@ -149,6 +150,7 @@ platform_do_upgrade() { platform_upgrade_ubnt_erx "$1" ;; zyxel,lte3301-plus|\ + zyxel,lte5398-m904|\ zyxel,nr7101) fw_setenv CheckBypass 0 fw_setenv Image1Stable 0 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 792bd13ebc1ae6..0b109feb6c51c7 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 6bcdea971b2f8d..2ec41fe25492d6 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 20adfafc3dd037..427de8406fff18 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/ramips/mt76x8/config-5.15 b/target/linux/ramips/mt76x8/config-5.15 index bd1d3688b82c74..6d6759a7c585db 100644 --- a/target/linux/ramips/mt76x8/config-5.15 +++ b/target/linux/ramips/mt76x8/config-5.15 @@ -162,6 +162,7 @@ CONFIG_REGMAP_MMIO=y CONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_RESET_CONTROLLER=y +CONFIG_RTC_CLASS=y CONFIG_SERIAL_8250_NR_UARTS=3 CONFIG_SERIAL_8250_RUNTIME_UARTS=3 CONFIG_SERIAL_MCTRL_GPIO=y diff --git a/target/linux/ramips/patches-5.15/720-Revert-net-phy-simplify-phy_link_change-arguments.patch b/target/linux/ramips/patches-5.15/720-Revert-net-phy-simplify-phy_link_change-arguments.patch index b8461b0030ce16..437c7611321765 100644 --- a/target/linux/ramips/patches-5.15/720-Revert-net-phy-simplify-phy_link_change-arguments.patch +++ b/target/linux/ramips/patches-5.15/720-Revert-net-phy-simplify-phy_link_change-arguments.patch @@ -95,7 +95,7 @@ still required by target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c phydev->mii_ts->link_state(phydev->mii_ts, phydev); --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c -@@ -1369,7 +1369,8 @@ void phylink_destroy(struct phylink *pl) +@@ -1370,7 +1370,8 @@ void phylink_destroy(struct phylink *pl) } EXPORT_SYMBOL_GPL(phylink_destroy); diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index 90b45abf94baed..a8579ea275bc18 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -31,7 +31,8 @@ lan_mac_end="" label_mac="" case $board in hpe,1920-8g|\ -hpe,1920-8g-poe|\ +hpe,1920-8g-poe-65w|\ +hpe,1920-8g-poe-180w|\ hpe,1920-16g|\ hpe,1920-24g) label_mac=$(mtd_get_mac_binary factory 0x68) @@ -43,7 +44,8 @@ hpe,1920-24g) ;; tplink,sg2008p-v1|\ tplink,sg2210p-v3|\ -tplink,sg2452p-v4) +tplink,sg2452p-v4|\ +tplink,t1600g-28ts-v3) label_mac=$(get_mac_label) lan_mac="$label_mac" ;; @@ -67,7 +69,10 @@ done [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac case $board in -hpe,1920-8g-poe) +hpe,1920-8g-poe-65w) + ucidef_set_poe 65 "$lan_list_rev" "lan9 lan10" + ;; +hpe,1920-8g-poe-180w) ucidef_set_poe 180 "$lan_list_rev" "lan9 lan10" ;; netgear,gs110tpp-v1) diff --git a/target/linux/realtek/base-files/etc/board.d/03_gpio_switches b/target/linux/realtek/base-files/etc/board.d/03_gpio_switches index abfcb8e5924014..1e49d89c64a241 100644 --- a/target/linux/realtek/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/realtek/base-files/etc/board.d/03_gpio_switches @@ -6,7 +6,7 @@ board_config_update board=$(board_name) case "$board" in -hpe,1920-8g-poe) +hpe,1920-8g-poe-180w) ucidef_add_gpio_switch "fan_ctrl" "Fan control" "456" "0" ;; esac diff --git a/target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe-180w.dts b/target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe-180w.dts new file mode 100644 index 00000000000000..6398e6d034dee3 --- /dev/null +++ b/target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe-180w.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rtl8380_hpe_1920-8g.dtsi" + +/ { + compatible = "hpe,1920-8g-poe-180w", "realtek,rtl838x-soc"; + model = "HPE 1920-8G-PoE+ 180W (JG922A)"; +}; + +&uart1 { + status = "okay"; +}; diff --git a/target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe.dts b/target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe-65w.dts similarity index 55% rename from target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe.dts rename to target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe-65w.dts index 3b00c31411917e..341f535e938aae 100644 --- a/target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe.dts +++ b/target/linux/realtek/dts-5.15/rtl8380_hpe_1920-8g-poe-65w.dts @@ -3,8 +3,8 @@ #include "rtl8380_hpe_1920-8g.dtsi" / { - compatible = "hpe,1920-8g-poe", "realtek,rtl838x-soc"; - model = "HPE 1920-8G-PoE+ (JG922A)"; + compatible = "hpe,1920-8g-poe-65w", "realtek,rtl838x-soc"; + model = "HPE 1920-8G-PoE+ 65W (JG921A)"; }; &uart1 { diff --git a/target/linux/realtek/dts-5.15/rtl8380_tplink_sg2xxx.dtsi b/target/linux/realtek/dts-5.15/rtl8380_tplink_sg2xxx.dtsi index e727a9405ad75b..0706c55524bb97 100644 --- a/target/linux/realtek/dts-5.15/rtl8380_tplink_sg2xxx.dtsi +++ b/target/linux/realtek/dts-5.15/rtl8380_tplink_sg2xxx.dtsi @@ -114,15 +114,18 @@ reg = <0x1b00000 0x400000>; }; partition@1f00000 { - compatible = "nvmem-cells"; label = "para"; reg = <0x1f00000 0x100000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - factory_macaddr: macaddr@fdff4 { - reg = <0xfdff4 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + factory_macaddr: macaddr@fdff4 { + reg = <0xfdff4 0x6>; + }; }; }; }; diff --git a/target/linux/realtek/dts-5.15/rtl8382_tplink_t1600g-28ts-v3.dts b/target/linux/realtek/dts-5.15/rtl8382_tplink_t1600g-28ts-v3.dts new file mode 100644 index 00000000000000..6e9f7baed063d9 --- /dev/null +++ b/target/linux/realtek/dts-5.15/rtl8382_tplink_t1600g-28ts-v3.dts @@ -0,0 +1,175 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rtl838x.dtsi" + +#include +#include +#include + +/ { + compatible = "tplink,t1600g-28ts-v3", "realtek,rtl838x-soc"; + model = "TP-Link T1600G-28TS v3"; + + aliases { + led-boot = &led_sys; + led-failsafe = &led_sys; + led-running = &led_sys; + led-upgrade = &led_sys; + label-mac-device = ðernet0; + }; + + chosen { + stdout-path = "serial0:38400n8"; + }; + + leds { + pinctrl-names = "default"; + compatible = "gpio-leds"; + + led_sys: led-0 { + label = "green:sys"; + gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_STATUS; + }; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x10000000>; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0xe0000>; + read-only; + }; + partition@e0000 { + label = "u-boot-env"; + reg = <0xe0000 0x20000>; + }; + partition@100000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x100000 0x1a00000>; + }; + partition@1b00000 { + label = "usrappfs"; + reg = <0x1b00000 0x400000>; + }; + partition@1f00000 { + label = "para"; + reg = <0x1f00000 0x100000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + factory_macaddr: macaddr@fdff4 { + reg = <0xfdff4 0x6>; + }; + }; + }; + }; + }; +}; + +ðernet0 { + nvmem-cells = <&factory_macaddr>; + nvmem-cell-names = "mac-address"; + + mdio-bus { + compatible = "realtek,rtl838x-mdio"; + regmap = <ðernet0>; + #address-cells = <1>; + #size-cells = <0>; + + EXTERNAL_PHY(0) + EXTERNAL_PHY(1) + EXTERNAL_PHY(2) + EXTERNAL_PHY(3) + EXTERNAL_PHY(4) + EXTERNAL_PHY(5) + EXTERNAL_PHY(6) + EXTERNAL_PHY(7) + + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) + + EXTERNAL_PHY(16) + EXTERNAL_PHY(17) + EXTERNAL_PHY(18) + EXTERNAL_PHY(19) + EXTERNAL_PHY(20) + EXTERNAL_PHY(21) + EXTERNAL_PHY(22) + EXTERNAL_PHY(23) + }; +}; + +&switch0 { + ports { + #address-cells = <1>; + #size-cells = <0>; + + SWITCH_PORT(0, 1, qsgmii) + SWITCH_PORT(1, 2, qsgmii) + SWITCH_PORT(2, 3, qsgmii) + SWITCH_PORT(3, 4, qsgmii) + SWITCH_PORT(4, 5, qsgmii) + SWITCH_PORT(5, 6, qsgmii) + SWITCH_PORT(6, 7, qsgmii) + SWITCH_PORT(7, 8, qsgmii) + + SWITCH_PORT(8, 9, internal) + SWITCH_PORT(9, 10, internal) + SWITCH_PORT(10, 11, internal) + SWITCH_PORT(11, 12, internal) + SWITCH_PORT(12, 13, internal) + SWITCH_PORT(13, 14, internal) + SWITCH_PORT(14, 15, internal) + SWITCH_PORT(15, 16, internal) + + SWITCH_PORT(16, 17, qsgmii) + SWITCH_PORT(17, 18, qsgmii) + SWITCH_PORT(18, 19, qsgmii) + SWITCH_PORT(19, 20, qsgmii) + SWITCH_PORT(20, 21, qsgmii) + SWITCH_PORT(21, 22, qsgmii) + SWITCH_PORT(22, 23, qsgmii) + SWITCH_PORT(23, 24, qsgmii) + + port@28 { + ethernet = <ðernet0>; + reg = <28>; + phy-mode = "internal"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; +}; diff --git a/target/linux/realtek/dts-5.15/rtl8393_tplink_sg2452p-v4.dts b/target/linux/realtek/dts-5.15/rtl8393_tplink_sg2452p-v4.dts index d2221c1d2f0460..5ca342f970ddd3 100644 --- a/target/linux/realtek/dts-5.15/rtl8393_tplink_sg2452p-v4.dts +++ b/target/linux/realtek/dts-5.15/rtl8393_tplink_sg2452p-v4.dts @@ -262,15 +262,18 @@ reg = <0x1b00000 0x400000>; }; partition@1f00000 { - compatible = "nvmem-cells"; label = "para"; reg = <0x1f00000 0x100000>; - #address-cells = <1>; - #size-cells = <1>; read-only; - factory_macaddr: macaddr@fdff4 { - reg = <0xfdff4 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + factory_macaddr: macaddr@fdff4 { + reg = <0xfdff4 0x6>; + }; }; }; }; diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c index 5744c70ea3f0fd..063ce9b8c5d0da 100644 --- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c +++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c @@ -152,7 +152,7 @@ static void rtl83xx_vlan_setup(struct rtl838x_switch_priv *priv) static void rtl83xx_setup_bpdu_traps(struct rtl838x_switch_priv *priv) { for (int i = 0; i < priv->cpu_port; i++) - priv->r->set_receive_management_action(i, BPDU, COPY2CPU); + priv->r->set_receive_management_action(i, BPDU, TRAP2CPU); } static void rtl83xx_port_set_salrn(struct rtl838x_switch_priv *priv, @@ -429,8 +429,11 @@ static void rtl93xx_phylink_validate(struct dsa_switch *ds, int port, phylink_set(mask, 10000baseCR_Full); } - if (state->interface == PHY_INTERFACE_MODE_USXGMII) + if (state->interface == PHY_INTERFACE_MODE_USXGMII) { + phylink_set(mask, 2500baseT_Full); + phylink_set(mask, 5000baseT_Full); phylink_set(mask, 10000baseT_Full); + } phylink_set(mask, 10baseT_Half); phylink_set(mask, 10baseT_Full); @@ -559,7 +562,7 @@ static int rtl93xx_phylink_mac_link_state(struct dsa_switch *ds, int port, } if (priv->family_id == RTL9310_FAMILY_ID - && (port >= 52 || port <= 55)) { /* Internal serdes */ + && (port >= 52 && port <= 55)) { /* Internal serdes */ state->speed = SPEED_10000; state->link = 1; state->duplex = 1; diff --git a/target/linux/realtek/image/rtl838x.mk b/target/linux/realtek/image/rtl838x.mk index 73930f4d6f41a4..de98954284738a 100644 --- a/target/linux/realtek/image/rtl838x.mk +++ b/target/linux/realtek/image/rtl838x.mk @@ -99,13 +99,23 @@ define Device/hpe_1920-8g endef TARGET_DEVICES += hpe_1920-8g -define Device/hpe_1920-8g-poe +define Device/hpe_1920-8g-poe-65w $(Device/hpe_1920) SOC := rtl8380 - DEVICE_MODEL := 1920-8G-PoE+ (JG922A) + DEVICE_MODEL := 1920-8G-PoE+ 65W (JG921A) + DEVICE_PACKAGES += realtek-poe + H3C_DEVICE_ID := 0x00010024 +endef +TARGET_DEVICES += hpe_1920-8g-poe-65w + +define Device/hpe_1920-8g-poe-180w + $(Device/hpe_1920) + SOC := rtl8380 + DEVICE_MODEL := 1920-8G-PoE+ 180W (JG922A) H3C_DEVICE_ID := 0x00010025 + SUPPORTED_DEVICES += hpe_1920-8g-poe endef -TARGET_DEVICES += hpe_1920-8g-poe +TARGET_DEVICES += hpe_1920-8g-poe-180w define Device/hpe_1920-16g $(Device/hpe_1920) @@ -242,6 +252,16 @@ define Device/tplink_sg2210p-v3 endef TARGET_DEVICES += tplink_sg2210p-v3 +define Device/tplink_t1600g-28ts-v3 + SOC := rtl8382 + KERNEL_SIZE := 6m + IMAGE_SIZE := 26m + DEVICE_VENDOR := TP-Link + DEVICE_MODEL := T1600G-28TS + DEVICE_VARIANT := v3 +endef +TARGET_DEVICES += tplink_t1600g-28ts-v3 + define Device/zyxel_gs1900-10hp $(Device/zyxel_gs1900) SOC := rtl8380 diff --git a/target/linux/realtek/patches-5.15/704-drivers-net-phy-eee-support-for-rtl838x.patch b/target/linux/realtek/patches-5.15/704-drivers-net-phy-eee-support-for-rtl838x.patch index 183c9dda2fdae1..6b24df46748a69 100644 --- a/target/linux/realtek/patches-5.15/704-drivers-net-phy-eee-support-for-rtl838x.patch +++ b/target/linux/realtek/patches-5.15/704-drivers-net-phy-eee-support-for-rtl838x.patch @@ -21,7 +21,7 @@ Submitted-by: John Crispin --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c -@@ -1990,6 +1990,11 @@ int phylink_ethtool_ksettings_set(struct +@@ -1991,6 +1991,11 @@ int phylink_ethtool_ksettings_set(struct * the presence of a PHY, this should not be changed as that * should be determined from the media side advertisement. */ @@ -33,7 +33,7 @@ Submitted-by: John Crispin return phy_ethtool_ksettings_set(pl->phydev, kset); } -@@ -2293,8 +2298,11 @@ int phylink_ethtool_get_eee(struct phyli +@@ -2294,8 +2299,11 @@ int phylink_ethtool_get_eee(struct phyli ASSERT_RTNL(); @@ -46,7 +46,7 @@ Submitted-by: John Crispin return ret; } -@@ -2311,8 +2319,11 @@ int phylink_ethtool_set_eee(struct phyli +@@ -2312,8 +2320,11 @@ int phylink_ethtool_set_eee(struct phyli ASSERT_RTNL(); diff --git a/target/linux/rockchip/Makefile b/target/linux/rockchip/Makefile index f17f0bdf49085c..42d75e3b4f4257 100644 --- a/target/linux/rockchip/Makefile +++ b/target/linux/rockchip/Makefile @@ -7,8 +7,7 @@ BOARDNAME:=Rockchip FEATURES:=ext4 audio usb usbgadget display gpio fpu pci pcie rootfs-part boot-part squashfs SUBTARGETS:=armv8 -KERNEL_PATCHVER:=5.15 -KERNEL_TESTING_PATCHVER:=6.1 +KERNEL_PATCHVER:=6.1 define Target/Description Build firmware image for Rockchip SoC devices. diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds index d82e47cf538f54..fbbe2735e9e610 100644 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds @@ -16,6 +16,16 @@ xunlong,orangepi-r1-plus-lts) ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0" ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth1" ;; +friendlyarm,nanopi-r5c) + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" + ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0" + ucidef_set_led_netdev "wlan" "WLAN" "green:wlan" "phy0-ap0" + ;; +friendlyarm,nanopi-r5s) + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0" + ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "eth1" + ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "eth2" + ;; esac board_config_flush 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 7ac5148275a4d7..01e32c77406413 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 @@ -14,6 +14,12 @@ rockchip_setup_interfaces() xunlong,orangepi-r1-plus-lts) ucidef_set_interfaces_lan_wan 'eth1' 'eth0' ;; + friendlyarm,nanopi-r5c) + ucidef_set_interfaces_lan_wan 'eth0' 'eth1' + ;; + friendlyarm,nanopi-r5s) + ucidef_set_interfaces_lan_wan 'eth1 eth2' 'eth0' + ;; *) ucidef_set_interface_lan 'eth0' ;; @@ -58,6 +64,14 @@ rockchip_setup_macs() wan_mac=$(nanopi_r4s_get_mac wan) lan_mac=$(nanopi_r4s_get_mac lan) ;; + friendlyarm,nanopi-r5c) + wan_mac=$(macaddr_generate_from_mmc_cid mmcblk*) + lan_mac=$(macaddr_add "$wan_mac" 1) + ;; + friendlyarm,nanopi-r5s) + wan_mac=$(macaddr_generate_from_mmc_cid mmcblk1) + lan_mac=$(macaddr_add "$wan_mac" 1) + ;; xunlong,orangepi-r1-plus|\ xunlong,orangepi-r1-plus-lts) wan_mac=$(macaddr_add "$(cat /sys/class/net/eth1/address)" -1) diff --git a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity index bb119b9185ebab..84064d4f8bcd2c 100644 --- a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity +++ b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity @@ -40,5 +40,14 @@ friendlyarm,nanopi-r4s) set_interface_core 10 "eth0" set_interface_core 20 "eth1" ;; +friendlyarm,nanopi-r5c) + set_interface_core 2 "eth0" + set_interface_core 4 "eth1" + ;; +friendlyarm,nanopi-r5s) + set_interface_core 2 "eth0" + set_interface_core 4 "eth1" + set_interface_core 8 "eth2" + ;; esac diff --git a/target/linux/rockchip/armv8/base-files/lib/upgrade/platform.sh b/target/linux/rockchip/armv8/base-files/lib/upgrade/platform.sh index faed0667f18216..49a969f41047bf 100644 --- a/target/linux/rockchip/armv8/base-files/lib/upgrade/platform.sh +++ b/target/linux/rockchip/armv8/base-files/lib/upgrade/platform.sh @@ -1,3 +1,5 @@ +REQUIRE_IMAGE_METADATA=1 + platform_check_image() { local diskdev partdev diff diff --git a/target/linux/rockchip/armv8/config-5.15 b/target/linux/rockchip/armv8/config-5.15 deleted file mode 100644 index 08ce65d8eafb68..00000000000000 --- a/target/linux/rockchip/armv8/config-5.15 +++ /dev/null @@ -1,644 +0,0 @@ -CONFIG_64BIT=y -CONFIG_ARCH_DMA_ADDR_T_64BIT=y -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_KEEP_MEMBLOCK=y -CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y -CONFIG_ARCH_MMAP_RND_BITS=18 -CONFIG_ARCH_MMAP_RND_BITS_MAX=33 -CONFIG_ARCH_MMAP_RND_BITS_MIN=18 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS=11 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 -CONFIG_ARCH_PROC_KCORE_TEXT=y -CONFIG_ARCH_ROCKCHIP=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_ARCH_STACKWALK=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ARCH_WANTS_NO_INSTR=y -CONFIG_ARC_EMAC_CORE=y -CONFIG_ARM64=y -CONFIG_ARM64_4K_PAGES=y -CONFIG_ARM64_CNP=y -CONFIG_ARM64_CRYPTO=y -CONFIG_ARM64_EPAN=y -CONFIG_ARM64_ERRATUM_819472=y -CONFIG_ARM64_ERRATUM_824069=y -CONFIG_ARM64_ERRATUM_826319=y -CONFIG_ARM64_ERRATUM_827319=y -CONFIG_ARM64_ERRATUM_832075=y -CONFIG_ARM64_ERRATUM_843419=y -CONFIG_ARM64_ERRATUM_845719=y -CONFIG_ARM64_ERRATUM_858921=y -CONFIG_ARM64_ERRATUM_1742098=y -CONFIG_ARM64_HW_AFDBM=y -CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y -CONFIG_ARM64_PAGE_SHIFT=12 -CONFIG_ARM64_PAN=y -CONFIG_ARM64_PA_BITS=48 -CONFIG_ARM64_PA_BITS_48=y -CONFIG_ARM64_PTR_AUTH=y -CONFIG_ARM64_PTR_AUTH_KERNEL=y -CONFIG_ARM64_RAS_EXTN=y -CONFIG_ARM64_SVE=y -CONFIG_ARM64_TAGGED_ADDR_ABI=y -CONFIG_ARM64_VA_BITS=48 -# CONFIG_ARM64_VA_BITS_39 is not set -CONFIG_ARM64_VA_BITS_48=y -CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y -# CONFIG_ARMV8_DEPRECATED is not set -CONFIG_ARM_AMBA=y -CONFIG_ARM_ARCH_TIMER=y -CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y -CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND=y -CONFIG_ARM_CPUIDLE=y -CONFIG_ARM_GIC=y -CONFIG_ARM_GIC_V2M=y -CONFIG_ARM_GIC_V3=y -CONFIG_ARM_GIC_V3_ITS=y -CONFIG_ARM_GIC_V3_ITS_PCI=y -CONFIG_ARM_MHU=y -CONFIG_ARM_MHU_V2=y -CONFIG_ARM_PSCI_CPUIDLE=y -CONFIG_ARM_PSCI_CPUIDLE_DOMAIN=y -CONFIG_ARM_PSCI_FW=y -# CONFIG_ARM_RK3399_DMC_DEVFREQ is not set -CONFIG_ARM_SCPI_CPUFREQ=y -CONFIG_ARM_SCPI_POWER_DOMAIN=y -CONFIG_ARM_SCPI_PROTOCOL=y -CONFIG_ARM_SMMU=y -CONFIG_ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT=y -# CONFIG_ARM_SMMU_LEGACY_DT_BINDINGS is not set -CONFIG_ARM_SMMU_V3=y -# CONFIG_ARM_SMMU_V3_SVA is not set -CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y -CONFIG_BACKLIGHT_CLASS_DEVICE=y -CONFIG_BACKLIGHT_GPIO=y -CONFIG_BACKLIGHT_PWM=y -CONFIG_BLK_DEV_BSG=y -CONFIG_BLK_DEV_BSGLIB=y -CONFIG_BLK_DEV_BSG_COMMON=y -# CONFIG_BLK_DEV_INITRD is not set -CONFIG_BLK_DEV_INTEGRITY=y -CONFIG_BLK_DEV_INTEGRITY_T10=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_NVME=y -CONFIG_BLK_DEV_PCIESSD_MTIP32XX=y -CONFIG_BLK_DEV_SD=y -CONFIG_BLK_MQ_PCI=y -CONFIG_BLK_PM=y -CONFIG_BLOCK_COMPAT=y -CONFIG_BRCMSTB_GISB_ARB=y -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_BSD_PROCESS_ACCT_V3=y -CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y -CONFIG_CHARGER_GPIO=y -CONFIG_CLKSRC_MMIO=y -CONFIG_CLK_PX30=y -CONFIG_CLK_RK3308=y -CONFIG_CLK_RK3328=y -CONFIG_CLK_RK3368=y -CONFIG_CLK_RK3399=y -CONFIG_CLK_RK3568=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_CMA=y -CONFIG_CMA_ALIGNMENT=8 -CONFIG_CMA_AREAS=7 -# CONFIG_CMA_DEBUG is not set -# CONFIG_CMA_DEBUGFS is not set -CONFIG_CMA_SIZE_MBYTES=5 -# CONFIG_CMA_SIZE_SEL_MAX is not set -CONFIG_CMA_SIZE_SEL_MBYTES=y -# CONFIG_CMA_SIZE_SEL_MIN is not set -# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set -# CONFIG_CMA_SYSFS is not set -CONFIG_COMMON_CLK=y -CONFIG_COMMON_CLK_RK808=y -CONFIG_COMMON_CLK_ROCKCHIP=y -CONFIG_COMMON_CLK_SCPI=y -CONFIG_COMPAT_32BIT_TIME=y -CONFIG_CONFIGFS_FS=y -CONFIG_CONSOLE_TRANSLATIONS=y -CONFIG_CONTIG_ALLOC=y -CONFIG_CPUFREQ_DT=y -CONFIG_CPUFREQ_DT_PLATDEV=y -CONFIG_CPU_FREQ=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set -CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y -CONFIG_CPU_FREQ_GOV_ATTR_SET=y -# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set -# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set -CONFIG_CPU_FREQ_GOV_PERFORMANCE=y -CONFIG_CPU_FREQ_GOV_POWERSAVE=y -CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y -# CONFIG_CPU_FREQ_GOV_USERSPACE is not set -CONFIG_CPU_FREQ_STAT=y -CONFIG_CPU_IDLE=y -CONFIG_CPU_IDLE_GOV_MENU=y -CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y -CONFIG_CPU_ISOLATION=y -CONFIG_CPU_LITTLE_ENDIAN=y -CONFIG_CPU_PM=y -CONFIG_CPU_RMAP=y -CONFIG_CPU_THERMAL=y -CONFIG_CRASH_CORE=y -CONFIG_CRASH_DUMP=y -CONFIG_CRC16=y -# CONFIG_CRC32_SARWATE is not set -CONFIG_CRC32_SLICEBY8=y -CONFIG_CRC_T10DIF=y -CONFIG_CROSS_MEMORY_ATTACH=y -CONFIG_CRYPTO_AES_ARM64=y -CONFIG_CRYPTO_AES_ARM64_CE=y -CONFIG_CRYPTO_AES_ARM64_CE_BLK=y -CONFIG_CRYPTO_AES_ARM64_CE_CCM=y -CONFIG_CRYPTO_CRC32=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_CRCT10DIF=y -CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=y -CONFIG_CRYPTO_CRYPTD=y -# CONFIG_CRYPTO_DEV_ROCKCHIP is not set -CONFIG_CRYPTO_GHASH_ARM64_CE=y -CONFIG_CRYPTO_HW=y -CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_SIMD=y -CONFIG_DCACHE_WORD_ACCESS=y -CONFIG_DEBUG_BUGVERBOSE=y -# CONFIG_DEVFREQ_GOV_PASSIVE is not set -CONFIG_DEVFREQ_GOV_PERFORMANCE=y -CONFIG_DEVFREQ_GOV_POWERSAVE=y -CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y -CONFIG_DEVFREQ_GOV_USERSPACE=y -# CONFIG_DEVFREQ_THERMAL is not set -CONFIG_DEVMEM=y -# CONFIG_DEVPORT is not set -CONFIG_DMADEVICES=y -CONFIG_DMA_CMA=y -CONFIG_DMA_DIRECT_REMAP=y -CONFIG_DMA_ENGINE=y -CONFIG_DMA_OF=y -CONFIG_DMA_OPS=y -CONFIG_DMA_REMAP=y -CONFIG_DMA_SHARED_BUFFER=y -CONFIG_DNOTIFY=y -CONFIG_DTC=y -CONFIG_DT_IDLE_STATES=y -CONFIG_DUMMY_CONSOLE=y -CONFIG_DWMAC_DWC_QOS_ETH=y -CONFIG_DWMAC_GENERIC=y -CONFIG_DWMAC_ROCKCHIP=y -CONFIG_DW_WATCHDOG=y -CONFIG_EDAC_SUPPORT=y -CONFIG_EEPROM_AT24=y -CONFIG_EMAC_ROCKCHIP=y -CONFIG_ENERGY_MODEL=y -CONFIG_EXT4_FS=y -CONFIG_EXT4_FS_POSIX_ACL=y -CONFIG_EXTCON=y -CONFIG_F2FS_FS=y -CONFIG_FANOTIFY=y -CONFIG_FHANDLE=y -CONFIG_FIXED_PHY=y -CONFIG_FIX_EARLYCON_MEM=y -# CONFIG_FORTIFY_SOURCE is not set -CONFIG_FRAME_POINTER=y -CONFIG_FS_IOMAP=y -CONFIG_FS_MBCACHE=y -CONFIG_FS_POSIX_ACL=y -CONFIG_FWNODE_MDIO=y -CONFIG_FW_LOADER_PAGED_BUF=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_GENERIC_ARCH_TOPOLOGY=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y -CONFIG_GENERIC_CPU_AUTOPROBE=y -CONFIG_GENERIC_CPU_VULNERABILITIES=y -CONFIG_GENERIC_CSUM=y -CONFIG_GENERIC_EARLY_IOREMAP=y -CONFIG_GENERIC_FIND_FIRST_BIT=y -CONFIG_GENERIC_GETTIMEOFDAY=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_GENERIC_IRQ_CHIP=y -CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y -CONFIG_GENERIC_IRQ_MIGRATION=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y -CONFIG_GENERIC_MSI_IRQ=y -CONFIG_GENERIC_MSI_IRQ_DOMAIN=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_PHY=y -CONFIG_GENERIC_PINCONF=y -CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GPIOLIB_IRQCHIP=y -CONFIG_GPIO_CDEV=y -CONFIG_GPIO_DWAPB=y -CONFIG_GPIO_GENERIC=y -CONFIG_GPIO_GENERIC_PLATFORM=y -CONFIG_GPIO_ROCKCHIP=y -CONFIG_GPIO_SYSCON=y -CONFIG_HANDLE_DOMAIN_IRQ=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT_MAP=y -CONFIG_HID=y -CONFIG_HID_GENERIC=y -CONFIG_HOTPLUG_CPU=y -CONFIG_HOTPLUG_PCI=y -# CONFIG_HOTPLUG_PCI_CPCI is not set -# CONFIG_HOTPLUG_PCI_PCIE is not set -# CONFIG_HOTPLUG_PCI_SHPC is not set -CONFIG_HUGETLBFS=y -CONFIG_HUGETLB_PAGE=y -CONFIG_HWMON=y -CONFIG_HWSPINLOCK=y -CONFIG_HW_CONSOLE=y -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y -CONFIG_I2C_COMPAT=y -CONFIG_I2C_HELPER_AUTO=y -CONFIG_I2C_RK3X=y -CONFIG_IIO=y -CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 -CONFIG_INDIRECT_PIO=y -CONFIG_INPUT=y -CONFIG_INPUT_EVDEV=y -CONFIG_INPUT_FF_MEMLESS=y -CONFIG_INPUT_KEYBOARD=y -CONFIG_INPUT_LEDS=y -CONFIG_INPUT_MATRIXKMAP=y -# CONFIG_INPUT_RK805_PWRKEY is not set -CONFIG_IOMMU_API=y -# CONFIG_IOMMU_DEBUGFS is not set -CONFIG_IOMMU_DEFAULT_PASSTHROUGH=y -CONFIG_IOMMU_DMA=y -CONFIG_IOMMU_IOVA=y -CONFIG_IOMMU_IO_PGTABLE=y -# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set -CONFIG_IOMMU_IO_PGTABLE_LPAE=y -# CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set -CONFIG_IOMMU_SUPPORT=y -# CONFIG_IO_STRICT_DEVMEM is not set -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_IRQ_MSI_IOMMU=y -CONFIG_IRQ_TIME_ACCOUNTING=y -CONFIG_IRQ_WORK=y -CONFIG_JBD2=y -CONFIG_JFFS2_ZLIB=y -CONFIG_JUMP_LABEL=y -CONFIG_KALLSYMS=y -CONFIG_KCMP=y -CONFIG_KEXEC_CORE=y -CONFIG_KEXEC_FILE=y -CONFIG_KSM=y -# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set -CONFIG_LEDS_GPIO=y -CONFIG_LEDS_PWM=y -CONFIG_LEDS_SYSCON=y -CONFIG_LEDS_TRIGGER_CPU=y -CONFIG_LEDS_TRIGGER_PANIC=y -CONFIG_LIBCRC32C=y -CONFIG_LIBFDT=y -CONFIG_LOCALVERSION_AUTO=y -CONFIG_LOCK_DEBUGGING_SUPPORT=y -CONFIG_LOCK_SPIN_ON_OWNER=y -CONFIG_LOG_BUF_SHIFT=19 -CONFIG_MAGIC_SYSRQ=y -CONFIG_MAGIC_SYSRQ_SERIAL=y -CONFIG_MAILBOX=y -# CONFIG_MAILBOX_TEST is not set -CONFIG_MDIO_BUS=y -CONFIG_MDIO_BUS_MUX=y -CONFIG_MDIO_BUS_MUX_GPIO=y -CONFIG_MDIO_BUS_MUX_MMIOREG=y -CONFIG_MDIO_DEVICE=y -CONFIG_MDIO_DEVRES=y -CONFIG_MEMFD_CREATE=y -CONFIG_MEMORY_ISOLATION=y -CONFIG_MFD_CORE=y -# CONFIG_MFD_KHADAS_MCU is not set -CONFIG_MFD_RK808=y -CONFIG_MFD_SYSCON=y -CONFIG_MIGRATION=y -CONFIG_MMC=y -CONFIG_MMC_BLOCK=y -CONFIG_MMC_BLOCK_MINORS=32 -CONFIG_MMC_CQHCI=y -CONFIG_MMC_DW=y -# CONFIG_MMC_DW_BLUEFIELD is not set -# CONFIG_MMC_DW_EXYNOS is not set -# CONFIG_MMC_DW_HI3798CV200 is not set -# CONFIG_MMC_DW_K3 is not set -# CONFIG_MMC_DW_PCI is not set -CONFIG_MMC_DW_PLTFM=y -CONFIG_MMC_DW_ROCKCHIP=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_OF_ARASAN=y -CONFIG_MMC_SDHCI_OF_DWCMSHC=y -# CONFIG_MMC_SDHCI_PCI is not set -CONFIG_MMC_SDHCI_PLTFM=y -CONFIG_MODULES_USE_ELF_RELA=y -CONFIG_MOTORCOMM_PHY=y -CONFIG_MQ_IOSCHED_DEADLINE=y -# CONFIG_MTD_CFI is not set -CONFIG_MTD_CMDLINE_PARTS=y -# CONFIG_MTD_COMPLEX_MAPPINGS is not set -CONFIG_MTD_SPI_NOR=y -CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y -CONFIG_MTD_SPLIT_FIRMWARE=y -CONFIG_MUTEX_SPIN_ON_OWNER=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_NEED_SG_DMA_LENGTH=y -CONFIG_NET_FLOW_LIMIT=y -CONFIG_NET_PTP_CLASSIFY=y -CONFIG_NET_SELFTESTS=y -CONFIG_NLS=y -CONFIG_NLS_ISO8859_1=y -CONFIG_NOP_USB_XCEIV=y -CONFIG_NO_HZ_COMMON=y -CONFIG_NO_HZ_IDLE=y -CONFIG_NR_CPUS=256 -CONFIG_NVMEM=y -CONFIG_NVMEM_ROCKCHIP_EFUSE=y -# CONFIG_NVMEM_ROCKCHIP_OTP is not set -CONFIG_NVMEM_SYSFS=y -CONFIG_NVME_CORE=y -# CONFIG_NVME_HWMON is not set -# CONFIG_NVME_MULTIPATH is not set -CONFIG_OF=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_DYNAMIC=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_FLATTREE=y -CONFIG_OF_GPIO=y -CONFIG_OF_IOMMU=y -CONFIG_OF_IRQ=y -CONFIG_OF_KOBJ=y -CONFIG_OF_MDIO=y -CONFIG_OF_OVERLAY=y -CONFIG_OF_RESOLVE=y -CONFIG_OLD_SIGSUSPEND3=y -# CONFIG_OVERLAY_FS_XINO_AUTO is not set -CONFIG_PADATA=y -CONFIG_PAGE_POOL=y -# CONFIG_PANIC_ON_OOPS is not set -CONFIG_PANIC_ON_OOPS_VALUE=0 -CONFIG_PANIC_TIMEOUT=0 -# CONFIG_PARTITION_ADVANCED is not set -CONFIG_PARTITION_PERCPU=y -CONFIG_PCI=y -CONFIG_PCIEAER=y -CONFIG_PCIEASPM=y -CONFIG_PCIEASPM_DEFAULT=y -# CONFIG_PCIEASPM_PERFORMANCE is not set -# CONFIG_PCIEASPM_POWERSAVE is not set -# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set -CONFIG_PCIEPORTBUS=y -CONFIG_PCIE_DW=y -CONFIG_PCIE_DW_HOST=y -CONFIG_PCIE_PME=y -CONFIG_PCIE_ROCKCHIP=y -CONFIG_PCIE_ROCKCHIP_DW_HOST=y -CONFIG_PCIE_ROCKCHIP_HOST=y -CONFIG_PCI_DOMAINS=y -CONFIG_PCI_DOMAINS_GENERIC=y -CONFIG_PCI_MSI=y -CONFIG_PCI_MSI_IRQ_DOMAIN=y -CONFIG_PCI_STUB=y -CONFIG_PCS_XPCS=y -CONFIG_PGTABLE_LEVELS=4 -CONFIG_PHYLIB=y -CONFIG_PHYLINK=y -CONFIG_PHYS_ADDR_T_64BIT=y -CONFIG_PHY_ROCKCHIP_DP=y -# CONFIG_PHY_ROCKCHIP_DPHY_RX0 is not set -CONFIG_PHY_ROCKCHIP_EMMC=y -# CONFIG_PHY_ROCKCHIP_INNO_CSIDPHY is not set -# CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY is not set -# CONFIG_PHY_ROCKCHIP_INNO_HDMI is not set -CONFIG_PHY_ROCKCHIP_INNO_USB2=y -CONFIG_PHY_ROCKCHIP_PCIE=y -CONFIG_PHY_ROCKCHIP_TYPEC=y -CONFIG_PHY_ROCKCHIP_USB=y -CONFIG_PINCTRL=y -CONFIG_PINCTRL_RK805=y -CONFIG_PINCTRL_ROCKCHIP=y -# CONFIG_PINCTRL_SINGLE is not set -CONFIG_PL330_DMA=y -CONFIG_PLATFORM_MHU=y -CONFIG_PM=y -CONFIG_PM_CLK=y -CONFIG_PM_DEVFREQ=y -# CONFIG_PM_DEVFREQ_EVENT is not set -CONFIG_PM_GENERIC_DOMAINS=y -CONFIG_PM_GENERIC_DOMAINS_OF=y -CONFIG_PM_OPP=y -CONFIG_POWER_RESET=y -CONFIG_POWER_SUPPLY=y -CONFIG_POWER_SUPPLY_HWMON=y -CONFIG_PPS=y -CONFIG_PREEMPT=y -CONFIG_PREEMPTION=y -CONFIG_PREEMPT_COUNT=y -# CONFIG_PREEMPT_NONE is not set -CONFIG_PREEMPT_RCU=y -CONFIG_PRINTK_TIME=y -# CONFIG_PRINT_QUOTA_WARNING is not set -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_PROC_VMCORE=y -CONFIG_PTP_1588_CLOCK=y -CONFIG_PTP_1588_CLOCK_OPTIONAL=y -CONFIG_PWM=y -CONFIG_PWM_ROCKCHIP=y -CONFIG_PWM_SYSFS=y -# CONFIG_QFMT_V2 is not set -CONFIG_QUEUED_RWLOCKS=y -CONFIG_QUEUED_SPINLOCKS=y -CONFIG_QUOTA=y -CONFIG_QUOTACTL=y -CONFIG_RAID_ATTRS=y -CONFIG_RANDOMIZE_BASE=y -CONFIG_RANDOMIZE_MODULE_REGION_FULL=y -CONFIG_RAS=y -CONFIG_RATIONAL=y -# CONFIG_RAVE_SP_CORE is not set -CONFIG_RCU_TRACE=y -CONFIG_REALTEK_PHY=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_IRQ=y -CONFIG_REGMAP_MMIO=y -CONFIG_REGULATOR=y -CONFIG_REGULATOR_FAN53555=y -CONFIG_REGULATOR_FIXED_VOLTAGE=y -CONFIG_REGULATOR_GPIO=y -CONFIG_REGULATOR_PWM=y -CONFIG_REGULATOR_RK808=y -CONFIG_RELOCATABLE=y -CONFIG_RESET_CONTROLLER=y -CONFIG_RFS_ACCEL=y -CONFIG_ROCKCHIP_GRF=y -CONFIG_ROCKCHIP_IODOMAIN=y -CONFIG_ROCKCHIP_IOMMU=y -CONFIG_ROCKCHIP_MBOX=y -CONFIG_ROCKCHIP_PHY=y -CONFIG_ROCKCHIP_PM_DOMAINS=y -# CONFIG_ROCKCHIP_SARADC is not set -CONFIG_ROCKCHIP_THERMAL=y -CONFIG_ROCKCHIP_TIMER=y -CONFIG_RODATA_FULL_DEFAULT_ENABLED=y -CONFIG_RPS=y -CONFIG_RSEQ=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_DRV_RK808=y -CONFIG_RTC_I2C_AND_SPI=y -CONFIG_RTC_NVMEM=y -# CONFIG_RUNTIME_TESTING_MENU is not set -CONFIG_RWSEM_SPIN_ON_OWNER=y -CONFIG_SCHED_MC=y -CONFIG_SCSI=y -CONFIG_SCSI_COMMON=y -# CONFIG_SCSI_LOWLEVEL is not set -# CONFIG_SCSI_PROC_FS is not set -CONFIG_SCSI_SAS_ATTRS=y -CONFIG_SCSI_SAS_HOST_SMP=y -CONFIG_SCSI_SAS_LIBSAS=y -# CONFIG_SECURITY_DMESG_RESTRICT is not set -CONFIG_SENSORS_ARM_SCPI=y -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y -CONFIG_SERIAL_8250_DW=y -CONFIG_SERIAL_8250_DWLIB=y -CONFIG_SERIAL_8250_EXAR=y -CONFIG_SERIAL_8250_EXTENDED=y -CONFIG_SERIAL_8250_FSL=y -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_PCI=y -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -CONFIG_SERIAL_8250_SHARE_IRQ=y -CONFIG_SERIAL_AMBA_PL011=y -CONFIG_SERIAL_AMBA_PL011_CONSOLE=y -CONFIG_SERIAL_DEV_BUS=y -CONFIG_SERIAL_DEV_CTRL_TTYPORT=y -CONFIG_SERIAL_MCTRL_GPIO=y -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_SERIO=y -CONFIG_SERIO_AMBAKMI=y -CONFIG_SERIO_LIBPS2=y -CONFIG_SG_POOL=y -CONFIG_SLUB_DEBUG=y -CONFIG_SMP=y -CONFIG_SOCK_RX_QUEUE_MAPPING=y -CONFIG_SPARSEMEM=y -CONFIG_SPARSEMEM_EXTREME=y -CONFIG_SPARSEMEM_VMEMMAP=y -CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y -CONFIG_SPARSE_IRQ=y -CONFIG_SPI=y -CONFIG_SPI_BITBANG=y -CONFIG_SPI_DYNAMIC=y -CONFIG_SPI_MASTER=y -CONFIG_SPI_MEM=y -CONFIG_SPI_ROCKCHIP=y -# CONFIG_SPI_ROCKCHIP_SFC is not set -CONFIG_SPI_SPIDEV=y -# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set -CONFIG_SQUASHFS_DECOMP_SINGLE=y -# CONFIG_SQUASHFS_EMBEDDED is not set -CONFIG_SQUASHFS_FILE_CACHE=y -# CONFIG_SQUASHFS_FILE_DIRECT is not set -CONFIG_SRAM=y -CONFIG_SRCU=y -CONFIG_STACKPROTECTOR=y -CONFIG_STACKPROTECTOR_PER_TASK=y -CONFIG_STACKPROTECTOR_STRONG=y -CONFIG_STMMAC_ETH=y -CONFIG_STMMAC_PLATFORM=y -CONFIG_STRICT_DEVMEM=y -# CONFIG_STRIP_ASM_SYMS is not set -# CONFIG_SWAP is not set -CONFIG_SWIOTLB=y -CONFIG_SWPHY=y -CONFIG_SYNC_FILE=y -CONFIG_SYSCTL_EXCEPTION_TRACE=y -CONFIG_SYSFS_SYSCALL=y -CONFIG_SYSVIPC_COMPAT=y -# CONFIG_TEXTSEARCH is not set -CONFIG_THERMAL=y -CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 -CONFIG_THERMAL_EMULATION=y -CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y -CONFIG_THERMAL_GOV_STEP_WISE=y -CONFIG_THERMAL_HWMON=y -CONFIG_THERMAL_OF=y -CONFIG_THREAD_INFO_IN_TASK=y -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TIMER_OF=y -CONFIG_TIMER_PROBE=y -CONFIG_TRACE_CLOCK=y -CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y -CONFIG_TRANSPARENT_HUGEPAGE=y -CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y -# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set -CONFIG_TREE_RCU=y -CONFIG_TREE_SRCU=y -CONFIG_TYPEC=y -# CONFIG_TYPEC_DP_ALTMODE is not set -CONFIG_TYPEC_FUSB302=y -# CONFIG_TYPEC_HD3SS3220 is not set -# CONFIG_TYPEC_MUX_PI3USB30532 is not set -# CONFIG_TYPEC_STUSB160X is not set -# CONFIG_TYPEC_TCPCI is not set -CONFIG_TYPEC_TCPM=y -# CONFIG_TYPEC_TPS6598X is not set -# CONFIG_UACCE is not set -# CONFIG_UCLAMP_TASK is not set -# CONFIG_UEVENT_HELPER is not set -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_UNMAP_KERNEL_AT_EL0=y -CONFIG_USB=y -CONFIG_USB_COMMON=y -CONFIG_USB_DWC3=y -CONFIG_USB_DWC3_HOST=y -CONFIG_USB_DWC3_OF_SIMPLE=y -CONFIG_USB_EHCI_HCD=y -CONFIG_USB_EHCI_HCD_PLATFORM=y -# CONFIG_USB_EHCI_ROOT_HUB_TT is not set -CONFIG_USB_HID=y -CONFIG_USB_OHCI_HCD=y -CONFIG_USB_OHCI_HCD_PLATFORM=y -CONFIG_USB_PHY=y -CONFIG_USB_ROLE_SWITCH=y -CONFIG_USB_STORAGE=y -CONFIG_USB_SUPPORT=y -CONFIG_USB_ULPI=y -CONFIG_USB_ULPI_BUS=y -CONFIG_USB_ULPI_VIEWPORT=y -CONFIG_USB_XHCI_HCD=y -CONFIG_USB_XHCI_PLATFORM=y -# CONFIG_VIRTIO_MENU is not set -CONFIG_VMAP_STACK=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_VT=y -CONFIG_VT_CONSOLE=y -CONFIG_VT_HW_CONSOLE_BINDING=y -CONFIG_WATCHDOG_CORE=y -CONFIG_XARRAY_MULTI=y -CONFIG_XPS=y -CONFIG_XXHASH=y -CONFIG_XZ_DEC_ARM=y -CONFIG_XZ_DEC_ARMTHUMB=y -CONFIG_XZ_DEC_BCJ=y -CONFIG_ZLIB_DEFLATE=y -CONFIG_ZLIB_INFLATE=y -CONFIG_ZONE_DMA32=y diff --git a/target/linux/rockchip/armv8/config-6.1 b/target/linux/rockchip/armv8/config-6.1 index e21de9a348492f..1830a89c93a279 100644 --- a/target/linux/rockchip/armv8/config-6.1 +++ b/target/linux/rockchip/armv8/config-6.1 @@ -66,6 +66,15 @@ CONFIG_ARM_PSCI_CPUIDLE=y CONFIG_ARM_PSCI_CPUIDLE_DOMAIN=y CONFIG_ARM_PSCI_FW=y # CONFIG_ARM_RK3399_DMC_DEVFREQ is not set +CONFIG_ARM_SCMI_CPUFREQ=y +CONFIG_ARM_SCMI_HAVE_SHMEM=y +CONFIG_ARM_SCMI_HAVE_TRANSPORT=y +CONFIG_ARM_SCMI_POWER_CONTROL=y +CONFIG_ARM_SCMI_POWER_DOMAIN=y +CONFIG_ARM_SCMI_PROTOCOL=y +CONFIG_ARM_SCMI_TRANSPORT_MAILBOX=y +CONFIG_ARM_SCMI_TRANSPORT_SMC=y +CONFIG_ARM_SCMI_TRANSPORT_SMC_ATOMIC_ENABLE=y CONFIG_ARM_SCPI_CPUFREQ=y CONFIG_ARM_SCPI_POWER_DOMAIN=y CONFIG_ARM_SCPI_PROTOCOL=y @@ -90,7 +99,6 @@ CONFIG_BLK_DEV_PCIESSD_MTIP32XX=y CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_PM=y -# CONFIG_BOSCH_BNO055_SERIAL is not set CONFIG_BRCMSTB_GISB_ARB=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y @@ -113,7 +121,7 @@ CONFIG_CMA_ALIGNMENT=8 CONFIG_CMA_AREAS=7 # CONFIG_CMA_DEBUG is not set # CONFIG_CMA_DEBUGFS is not set -CONFIG_CMA_SIZE_MBYTES=5 +CONFIG_CMA_SIZE_MBYTES=16 # CONFIG_CMA_SIZE_SEL_MAX is not set CONFIG_CMA_SIZE_SEL_MBYTES=y # CONFIG_CMA_SIZE_SEL_MIN is not set @@ -122,6 +130,7 @@ CONFIG_CMA_SIZE_SEL_MBYTES=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_RK808=y CONFIG_COMMON_CLK_ROCKCHIP=y +CONFIG_COMMON_CLK_SCMI=y CONFIG_COMMON_CLK_SCPI=y CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 CONFIG_COMPAT_32BIT_TIME=y @@ -293,6 +302,7 @@ CONFIG_I2C_COMPAT=y CONFIG_I2C_HELPER_AUTO=y CONFIG_I2C_RK3X=y CONFIG_IIO=y +# CONFIG_IIO_SCMI is not set CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 CONFIG_INDIRECT_PIO=y CONFIG_INPUT=y @@ -301,7 +311,7 @@ CONFIG_INPUT_FF_MEMLESS=y CONFIG_INPUT_KEYBOARD=y CONFIG_INPUT_LEDS=y CONFIG_INPUT_MATRIXKMAP=y -# CONFIG_INPUT_RK805_PWRKEY is not set +CONFIG_INPUT_RK805_PWRKEY=y CONFIG_IOMMU_API=y # CONFIG_IOMMU_DEBUGFS is not set # CONFIG_IOMMU_DEFAULT_DMA_LAZY is not set @@ -334,7 +344,6 @@ CONFIG_KSM=y # CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set CONFIG_LEDS_GPIO=y CONFIG_LEDS_PWM=y -# CONFIG_LEDS_PWM_MULTICOLOR is not set CONFIG_LEDS_SYSCON=y CONFIG_LEDS_TRIGGER_CPU=y CONFIG_LEDS_TRIGGER_PANIC=y @@ -459,9 +468,9 @@ CONFIG_PHY_ROCKCHIP_EMMC=y # CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY is not set # CONFIG_PHY_ROCKCHIP_INNO_HDMI is not set CONFIG_PHY_ROCKCHIP_INNO_USB2=y -# CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY is not set +CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY=y CONFIG_PHY_ROCKCHIP_PCIE=y -# CONFIG_PHY_ROCKCHIP_SNPS_PCIE3 is not set +CONFIG_PHY_ROCKCHIP_SNPS_PCIE3=y CONFIG_PHY_ROCKCHIP_TYPEC=y CONFIG_PHY_ROCKCHIP_USB=y CONFIG_PINCTRL=y @@ -495,10 +504,8 @@ CONFIG_PROC_VMCORE=y CONFIG_PTP_1588_CLOCK=y CONFIG_PTP_1588_CLOCK_OPTIONAL=y CONFIG_PWM=y -# CONFIG_PWM_CLK is not set CONFIG_PWM_ROCKCHIP=y CONFIG_PWM_SYSFS=y -# CONFIG_PWM_XILINX is not set # CONFIG_QFMT_V2 is not set CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y @@ -518,6 +525,7 @@ CONFIG_REGMAP_I2C=y CONFIG_REGMAP_IRQ=y CONFIG_REGMAP_MMIO=y CONFIG_REGULATOR=y +CONFIG_REGULATOR_ARM_SCMI=y CONFIG_REGULATOR_FAN53555=y CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_REGULATOR_GPIO=y @@ -525,6 +533,7 @@ CONFIG_REGULATOR_PWM=y CONFIG_REGULATOR_RK808=y CONFIG_RELOCATABLE=y CONFIG_RESET_CONTROLLER=y +CONFIG_RESET_SCMI=y CONFIG_RFS_ACCEL=y CONFIG_ROCKCHIP_GRF=y CONFIG_ROCKCHIP_IODOMAIN=y @@ -553,6 +562,7 @@ CONFIG_SCSI_SAS_ATTRS=y CONFIG_SCSI_SAS_HOST_SMP=y CONFIG_SCSI_SAS_LIBSAS=y # CONFIG_SECURITY_DMESG_RESTRICT is not set +CONFIG_SENSORS_ARM_SCMI=y CONFIG_SENSORS_ARM_SCPI=y CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y CONFIG_SERIAL_8250_DW=y @@ -574,7 +584,6 @@ CONFIG_SERIO=y CONFIG_SERIO_AMBAKMI=y CONFIG_SERIO_LIBPS2=y CONFIG_SG_POOL=y -CONFIG_SLUB_DEBUG=y CONFIG_SMP=y CONFIG_SOCK_RX_QUEUE_MAPPING=y CONFIG_SOFTIRQ_ON_OWN_STACK=y @@ -589,7 +598,7 @@ CONFIG_SPI_DYNAMIC=y CONFIG_SPI_MASTER=y CONFIG_SPI_MEM=y CONFIG_SPI_ROCKCHIP=y -# CONFIG_SPI_ROCKCHIP_SFC is not set +CONFIG_SPI_ROCKCHIP_SFC=y CONFIG_SPI_SPIDEV=y # CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set CONFIG_SQUASHFS_DECOMP_SINGLE=y @@ -598,7 +607,6 @@ CONFIG_SQUASHFS_FILE_CACHE=y # CONFIG_SQUASHFS_FILE_DIRECT is not set CONFIG_SRAM=y CONFIG_SRCU=y -CONFIG_STACKDEPOT=y CONFIG_STACKPROTECTOR=y CONFIG_STACKPROTECTOR_PER_TASK=y CONFIG_STACKPROTECTOR_STRONG=y diff --git a/target/linux/rockchip/armv8/target.mk b/target/linux/rockchip/armv8/target.mk index a5e60a613e8dcd..085b475c4b3129 100644 --- a/target/linux/rockchip/armv8/target.mk +++ b/target/linux/rockchip/armv8/target.mk @@ -1,6 +1,6 @@ ARCH:=aarch64 SUBTARGET:=armv8 -BOARDNAME:=RK33xx boards (64 bit) +BOARDNAME:=RK33xx/RK356x boards (64 bit) define Target/Description Build firmware image for Rockchip RK33xx devices. diff --git a/target/linux/rockchip/image/Makefile b/target/linux/rockchip/image/Makefile index 3b118201b687da..d34948f6aed98c 100644 --- a/target/linux/rockchip/image/Makefile +++ b/target/linux/rockchip/image/Makefile @@ -48,7 +48,9 @@ endef define Device/Default PROFILES := Default KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb + BOOT_SCRIPT := IMAGES := sysupgrade.img.gz + IMAGE/sysupgrade.img.gz = boot-common | boot-script $$(BOOT_SCRIPT) | pine64-img | gzip | append-metadata DEVICE_DTS = rockchip/$$(SOC)-$(lastword $(subst _, ,$(1))) UBOOT_DEVICE_NAME = $(lastword $(subst _, ,$(1)))-$$(SOC) endef diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk index dd6a2d5bfe8de7..0bf91d15ca0c6d 100644 --- a/target/linux/rockchip/image/armv8.mk +++ b/target/linux/rockchip/image/armv8.mk @@ -11,7 +11,6 @@ define Device/firefly_roc-rk3328-cc SOC := rk3328 DEVICE_DTS := rockchip/rk3328-roc-cc UBOOT_DEVICE_NAME := roc-cc-rk3328 - IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata endef TARGET_DEVICES += firefly_roc-rk3328-cc @@ -19,7 +18,6 @@ define Device/friendlyarm_nanopc-t4 DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPC T4 SOC := rk3399 - IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata DEVICE_PACKAGES := kmod-brcmfmac brcmfmac-nvram-4356-sdio cypress-firmware-4356-sdio endef TARGET_DEVICES += friendlyarm_nanopc-t4 @@ -28,7 +26,6 @@ define Device/friendlyarm_nanopi-r2c DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R2C SOC := rk3328 - IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata DEVICE_PACKAGES := kmod-usb-net-rtl8152 endef TARGET_DEVICES += friendlyarm_nanopi-r2c @@ -37,7 +34,6 @@ define Device/friendlyarm_nanopi-r2s DEVICE_VENDOR := FriendlyARM DEVICE_MODEL := NanoPi R2S SOC := rk3328 - IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata DEVICE_PACKAGES := kmod-usb-net-rtl8152 endef TARGET_DEVICES += friendlyarm_nanopi-r2s @@ -47,17 +43,30 @@ define Device/friendlyarm_nanopi-r4s DEVICE_MODEL := NanoPi R4S DEVICE_VARIANT := 4GB LPDDR4 SOC := rk3399 - IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata DEVICE_PACKAGES := kmod-r8169 endef TARGET_DEVICES += friendlyarm_nanopi-r4s +define Device/friendlyarm_nanopi-r5c + DEVICE_VENDOR := FriendlyARM + DEVICE_MODEL := NanoPi R5C + SOC := rk3568 + DEVICE_PACKAGES := kmod-r8169 kmod-rtw88-8822ce rtl8822ce-firmware wpad-basic-mbedtls +endef +TARGET_DEVICES += friendlyarm_nanopi-r5c + +define Device/friendlyarm_nanopi-r5s + DEVICE_VENDOR := FriendlyARM + DEVICE_MODEL := NanoPi R5S + SOC := rk3568 + DEVICE_PACKAGES := kmod-r8169 +endef +TARGET_DEVICES += friendlyarm_nanopi-r5s + define Device/pine64_rock64 DEVICE_VENDOR := Pine64 DEVICE_MODEL := Rock64 SOC := rk3328 - UBOOT_DEVICE_NAME := rock64-rk3328 - IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata endef TARGET_DEVICES += pine64_rock64 @@ -65,7 +74,6 @@ define Device/pine64_rockpro64 DEVICE_VENDOR := Pine64 DEVICE_MODEL := RockPro64 SOC := rk3399 - IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata endef TARGET_DEVICES += pine64_rockpro64 @@ -75,7 +83,6 @@ define Device/radxa_rock-pi-4a SOC := rk3399 SUPPORTED_DEVICES := radxa,rockpi4a radxa,rockpi4 UBOOT_DEVICE_NAME := rock-pi-4-rk3399 - IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata endef TARGET_DEVICES += radxa_rock-pi-4a @@ -83,8 +90,6 @@ define Device/radxa_rock-pi-e DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK Pi E SOC := rk3328 - UBOOT_DEVICE_NAME := rock-pi-e-rk3328 - IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata endef TARGET_DEVICES += radxa_rock-pi-e @@ -92,7 +97,6 @@ define Device/xunlong_orangepi-r1-plus DEVICE_VENDOR := Xunlong DEVICE_MODEL := Orange Pi R1 Plus SOC := rk3328 - IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata DEVICE_PACKAGES := kmod-usb-net-rtl8152 endef TARGET_DEVICES += xunlong_orangepi-r1-plus @@ -101,7 +105,6 @@ define Device/xunlong_orangepi-r1-plus-lts DEVICE_VENDOR := Xunlong DEVICE_MODEL := Orange Pi R1 Plus LTS SOC := rk3328 - IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata DEVICE_PACKAGES := kmod-usb-net-rtl8152 endef TARGET_DEVICES += xunlong_orangepi-r1-plus-lts diff --git a/target/linux/rockchip/patches-5.15/005-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch b/target/linux/rockchip/patches-5.15/005-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch deleted file mode 100644 index 792028b29290f5..00000000000000 --- a/target/linux/rockchip/patches-5.15/005-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch +++ /dev/null @@ -1,31 +0,0 @@ -From af20b3384e8723077cc6484160b0cf4e9be321de Mon Sep 17 00:00:00 2001 -From: Tianling Shen -Date: Mon, 7 Jun 2021 15:45:37 +0800 -Subject: [PATCH] arm64: dts: rockchip: add EEPROM node for NanoPi R4S - -NanoPi R4S has a EEPROM attached to the 2nd I2C bus (U92), which -stores the MAC address. - -Signed-off-by: Tianling Shen ---- - arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts | 9 +++++++++ - 1 file changed, 9 insertions(+) - ---- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts -@@ -68,6 +68,15 @@ - status = "disabled"; - }; - -+&i2c2 { -+ eeprom@51 { -+ compatible = "microchip,24c02", "atmel,24c02"; -+ reg = <0x51>; -+ pagesize = <16>; -+ read-only; /* This holds our MAC */ -+ }; -+}; -+ - &i2c4 { - status = "disabled"; - }; diff --git a/target/linux/rockchip/patches-5.15/006-v6.4-arm64-dts-rockchip-Add-FriendlyARM-NanoPi-R2C.patch b/target/linux/rockchip/patches-5.15/006-v6.4-arm64-dts-rockchip-Add-FriendlyARM-NanoPi-R2C.patch deleted file mode 100644 index f58463b3d188b4..00000000000000 --- a/target/linux/rockchip/patches-5.15/006-v6.4-arm64-dts-rockchip-Add-FriendlyARM-NanoPi-R2C.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 004589ff9df5b75672a78b6c3c4cba93202b14c9 Mon Sep 17 00:00:00 2001 -From: Tianling Shen -Date: Sat, 25 Mar 2023 15:40:20 +0800 -Subject: [PATCH] arm64: dts: rockchip: Add FriendlyARM NanoPi R2C - -The NanoPi R2C is a minor variant of NanoPi R2S with the on-board NIC -chip changed from rtl8211e to yt8521s, and otherwise identical to R2S. - -Signed-off-by: Tianling Shen -Link: https://lore.kernel.org/r/20230325074022.9818-3-cnsztl@gmail.com -Signed-off-by: Heiko Stuebner ---- - arch/arm64/boot/dts/rockchip/Makefile | 1 + - .../boot/dts/rockchip/rk3328-nanopi-r2c.dts | 40 +++++++++++++++++++ - 2 files changed, 41 insertions(+) - create mode 100644 arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2c.dts - ---- a/arch/arm64/boot/dts/rockchip/Makefile -+++ b/arch/arm64/boot/dts/rockchip/Makefile -@@ -9,6 +9,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3318-a9 - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3326-odroid-go2.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-a1.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-evb.dtb -+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-r2c.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-r2s.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-rock64.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-rock-pi-e.dtb ---- /dev/null -+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2c.dts -@@ -0,0 +1,40 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT -+/* -+ * Copyright (c) 2021 FriendlyElec Computer Tech. Co., Ltd. -+ * (http://www.friendlyarm.com) -+ * -+ * Copyright (c) 2021-2023 Tianling Shen -+ */ -+ -+/dts-v1/; -+#include "rk3328-nanopi-r2s.dts" -+ -+/ { -+ model = "FriendlyElec NanoPi R2C"; -+ compatible = "friendlyarm,nanopi-r2c", "rockchip,rk3328"; -+}; -+ -+&gmac2io { -+ phy-handle = <&yt8521s>; -+ tx_delay = <0x22>; -+ rx_delay = <0x12>; -+ -+ mdio { -+ /delete-node/ ethernet-phy@1; -+ -+ yt8521s: ethernet-phy@3 { -+ compatible = "ethernet-phy-ieee802.3-c22"; -+ reg = <3>; -+ -+ motorcomm,clk-out-frequency-hz = <125000000>; -+ motorcomm,keep-pll-enabled; -+ motorcomm,auto-sleep-disabled; -+ -+ pinctrl-0 = <ð_phy_reset_pin>; -+ pinctrl-names = "default"; -+ reset-assert-us = <10000>; -+ reset-deassert-us = <50000>; -+ reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+}; diff --git a/target/linux/rockchip/patches-5.15/007-v6.3-arm64-dts-rockchip-rk3328-Add-Orange-Pi-R1-Plus.patch b/target/linux/rockchip/patches-5.15/007-v6.3-arm64-dts-rockchip-rk3328-Add-Orange-Pi-R1-Plus.patch deleted file mode 100644 index 053a4d0d8e27fa..00000000000000 --- a/target/linux/rockchip/patches-5.15/007-v6.3-arm64-dts-rockchip-rk3328-Add-Orange-Pi-R1-Plus.patch +++ /dev/null @@ -1,407 +0,0 @@ -From 51712e1d014aaaa4c6e1e7e84932d58b5c0f59ed Mon Sep 17 00:00:00 2001 -From: Chukun Pan -Date: Sat, 3 Dec 2022 15:41:49 +0800 -Subject: [PATCH] arm64: dts: rockchip: rk3328: Add Orange Pi R1 Plus - -Orange Pi R1 Plus is a Rockchip RK3328 based SBC by Xunlong. - -This device is similar to the NanoPi R2S, and has a 16MB -SPI NOR (mx25l12805d). The reset button is changed to -directly reset the power supply, another detail is that -both network ports have independent MAC addresses. - -Signed-off-by: Chukun Pan -Link: https://lore.kernel.org/r/20221203074149.11543-3-amadeus@jmu.edu.cn -Signed-off-by: Heiko Stuebner ---- - arch/arm64/boot/dts/rockchip/Makefile | 1 + - .../dts/rockchip/rk3328-orangepi-r1-plus.dts | 373 ++++++++++++++++++ - 2 files changed, 374 insertions(+) - create mode 100644 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts - ---- a/arch/arm64/boot/dts/rockchip/Makefile -+++ b/arch/arm64/boot/dts/rockchip/Makefile -@@ -11,6 +11,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-a1 - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-evb.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-r2c.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-r2s.dtb -+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-orangepi-r1-plus.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-rock64.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-rock-pi-e.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-roc-cc.dtb ---- /dev/null -+++ b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts -@@ -0,0 +1,373 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Based on rk3328-nanopi-r2s.dts, which is: -+ * Copyright (c) 2020 David Bauer -+ */ -+ -+/dts-v1/; -+ -+#include -+#include -+#include "rk3328.dtsi" -+ -+/ { -+ model = "Xunlong Orange Pi R1 Plus"; -+ compatible = "xunlong,orangepi-r1-plus", "rockchip,rk3328"; -+ -+ aliases { -+ ethernet1 = &rtl8153; -+ mmc0 = &sdmmc; -+ }; -+ -+ chosen { -+ stdout-path = "serial2:1500000n8"; -+ }; -+ -+ gmac_clk: gmac-clock { -+ compatible = "fixed-clock"; -+ clock-frequency = <125000000>; -+ clock-output-names = "gmac_clkin"; -+ #clock-cells = <0>; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-0 = <&lan_led_pin>, <&sys_led_pin>, <&wan_led_pin>; -+ pinctrl-names = "default"; -+ -+ led-0 { -+ function = LED_FUNCTION_LAN; -+ color = ; -+ gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>; -+ }; -+ -+ led-1 { -+ function = LED_FUNCTION_STATUS; -+ color = ; -+ gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>; -+ linux,default-trigger = "heartbeat"; -+ }; -+ -+ led-2 { -+ function = LED_FUNCTION_WAN; -+ color = ; -+ gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ vcc_sd: sdmmc-regulator { -+ compatible = "regulator-fixed"; -+ gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>; -+ pinctrl-0 = <&sdmmc0m1_pin>; -+ pinctrl-names = "default"; -+ regulator-name = "vcc_sd"; -+ regulator-boot-on; -+ vin-supply = <&vcc_io>; -+ }; -+ -+ vcc_sys: vcc-sys-regulator { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc_sys"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ }; -+ -+ vdd_5v_lan: vdd-5v-lan-regulator { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpio = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>; -+ pinctrl-0 = <&lan_vdd_pin>; -+ pinctrl-names = "default"; -+ regulator-name = "vdd_5v_lan"; -+ regulator-always-on; -+ regulator-boot-on; -+ vin-supply = <&vcc_sys>; -+ }; -+}; -+ -+&cpu0 { -+ cpu-supply = <&vdd_arm>; -+}; -+ -+&cpu1 { -+ cpu-supply = <&vdd_arm>; -+}; -+ -+&cpu2 { -+ cpu-supply = <&vdd_arm>; -+}; -+ -+&cpu3 { -+ cpu-supply = <&vdd_arm>; -+}; -+ -+&display_subsystem { -+ status = "disabled"; -+}; -+ -+&gmac2io { -+ assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>; -+ assigned-clock-parents = <&gmac_clk>, <&gmac_clk>; -+ clock_in_out = "input"; -+ phy-handle = <&rtl8211e>; -+ phy-mode = "rgmii"; -+ phy-supply = <&vcc_io>; -+ pinctrl-0 = <&rgmiim1_pins>; -+ pinctrl-names = "default"; -+ snps,aal; -+ rx_delay = <0x18>; -+ tx_delay = <0x24>; -+ status = "okay"; -+ -+ mdio { -+ compatible = "snps,dwmac-mdio"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ rtl8211e: ethernet-phy@1 { -+ reg = <1>; -+ pinctrl-0 = <ð_phy_reset_pin>; -+ pinctrl-names = "default"; -+ reset-assert-us = <10000>; -+ reset-deassert-us = <50000>; -+ reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+}; -+ -+&i2c1 { -+ status = "okay"; -+ -+ rk805: pmic@18 { -+ compatible = "rockchip,rk805"; -+ reg = <0x18>; -+ interrupt-parent = <&gpio1>; -+ interrupts = <24 IRQ_TYPE_LEVEL_LOW>; -+ #clock-cells = <1>; -+ clock-output-names = "xin32k", "rk805-clkout2"; -+ gpio-controller; -+ #gpio-cells = <2>; -+ pinctrl-0 = <&pmic_int_l>; -+ pinctrl-names = "default"; -+ rockchip,system-power-controller; -+ wakeup-source; -+ -+ vcc1-supply = <&vcc_sys>; -+ vcc2-supply = <&vcc_sys>; -+ vcc3-supply = <&vcc_sys>; -+ vcc4-supply = <&vcc_sys>; -+ vcc5-supply = <&vcc_io>; -+ vcc6-supply = <&vcc_sys>; -+ -+ regulators { -+ vdd_log: DCDC_REG1 { -+ regulator-name = "vdd_log"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <712500>; -+ regulator-max-microvolt = <1450000>; -+ regulator-ramp-delay = <12500>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1000000>; -+ }; -+ }; -+ -+ vdd_arm: DCDC_REG2 { -+ regulator-name = "vdd_arm"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <712500>; -+ regulator-max-microvolt = <1450000>; -+ regulator-ramp-delay = <12500>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <950000>; -+ }; -+ }; -+ -+ vcc_ddr: DCDC_REG3 { -+ regulator-name = "vcc_ddr"; -+ regulator-always-on; -+ regulator-boot-on; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ }; -+ }; -+ -+ vcc_io: DCDC_REG4 { -+ regulator-name = "vcc_io"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <3300000>; -+ }; -+ }; -+ -+ vcc_18: LDO_REG1 { -+ regulator-name = "vcc_18"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ vcc18_emmc: LDO_REG2 { -+ regulator-name = "vcc18_emmc"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ vdd_10: LDO_REG3 { -+ regulator-name = "vdd_10"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1000000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1000000>; -+ }; -+ }; -+ }; -+ }; -+}; -+ -+&io_domains { -+ pmuio-supply = <&vcc_io>; -+ vccio1-supply = <&vcc_io>; -+ vccio2-supply = <&vcc18_emmc>; -+ vccio3-supply = <&vcc_io>; -+ vccio4-supply = <&vcc_io>; -+ vccio5-supply = <&vcc_io>; -+ vccio6-supply = <&vcc_io>; -+ status = "okay"; -+}; -+ -+&pinctrl { -+ gmac2io { -+ eth_phy_reset_pin: eth-phy-reset-pin { -+ rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>; -+ }; -+ }; -+ -+ leds { -+ lan_led_pin: lan-led-pin { -+ rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ sys_led_pin: sys-led-pin { -+ rockchip,pins = <3 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ wan_led_pin: wan-led-pin { -+ rockchip,pins = <2 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ lan { -+ lan_vdd_pin: lan-vdd-pin { -+ rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ pmic { -+ pmic_int_l: pmic-int-l { -+ rockchip,pins = <1 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+}; -+ -+&pwm2 { -+ status = "okay"; -+}; -+ -+&sdmmc { -+ bus-width = <4>; -+ cap-sd-highspeed; -+ disable-wp; -+ pinctrl-0 = <&sdmmc0_clk>, <&sdmmc0_cmd>, <&sdmmc0_dectn>, <&sdmmc0_bus4>; -+ pinctrl-names = "default"; -+ vmmc-supply = <&vcc_sd>; -+ status = "okay"; -+}; -+ -+&spi0 { -+ status = "okay"; -+ -+ flash@0 { -+ compatible = "jedec,spi-nor"; -+ reg = <0>; -+ spi-max-frequency = <50000000>; -+ }; -+}; -+ -+&tsadc { -+ rockchip,hw-tshut-mode = <0>; -+ rockchip,hw-tshut-polarity = <0>; -+ status = "okay"; -+}; -+ -+&u2phy { -+ status = "okay"; -+}; -+ -+&u2phy_host { -+ status = "okay"; -+}; -+ -+&u2phy_otg { -+ status = "okay"; -+}; -+ -+&uart2 { -+ status = "okay"; -+}; -+ -+&usb20_otg { -+ dr_mode = "host"; -+ status = "okay"; -+}; -+ -+&usbdrd3 { -+ dr_mode = "host"; -+ status = "okay"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ /* Second port is for USB 3.0 */ -+ rtl8153: device@2 { -+ compatible = "usbbda,8153"; -+ reg = <2>; -+ }; -+}; -+ -+&usb_host0_ehci { -+ status = "okay"; -+}; -+ -+&usb_host0_ohci { -+ status = "okay"; -+}; diff --git a/target/linux/rockchip/patches-5.15/008-v6.4-arm64-dts-rockchip-Add-Xunlong-OrangePi-R1-Plus-LTS.patch b/target/linux/rockchip/patches-5.15/008-v6.4-arm64-dts-rockchip-Add-Xunlong-OrangePi-R1-Plus-LTS.patch deleted file mode 100644 index cedf28dc799f05..00000000000000 --- a/target/linux/rockchip/patches-5.15/008-v6.4-arm64-dts-rockchip-Add-Xunlong-OrangePi-R1-Plus-LTS.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 387b3bbac5ea6a0a105d685237f033ffe0f184f1 Mon Sep 17 00:00:00 2001 -From: Tianling Shen -Date: Sat, 25 Mar 2023 15:40:22 +0800 -Subject: [PATCH] arm64: dts: rockchip: Add Xunlong OrangePi R1 Plus LTS - -The OrangePi R1 Plus LTS is a minor variant of OrangePi R1 Plus with -the on-board NIC chip changed from rtl8211e to yt8531c, and otherwise -identical to OrangePi R1 Plus. - -Signed-off-by: Tianling Shen -Link: https://lore.kernel.org/r/20230325074022.9818-5-cnsztl@gmail.com -Signed-off-by: Heiko Stuebner ---- - arch/arm64/boot/dts/rockchip/Makefile | 1 + - .../rockchip/rk3328-orangepi-r1-plus-lts.dts | 40 +++++++++++++++++++ - 2 files changed, 41 insertions(+) - create mode 100644 arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts - ---- a/arch/arm64/boot/dts/rockchip/Makefile -+++ b/arch/arm64/boot/dts/rockchip/Makefile -@@ -12,6 +12,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-ev - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-r2c.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-r2s.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-orangepi-r1-plus.dtb -+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-orangepi-r1-plus-lts.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-rock64.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-rock-pi-e.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-roc-cc.dtb ---- /dev/null -+++ b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts -@@ -0,0 +1,40 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT -+/* -+ * Copyright (c) 2016 Xunlong Software. Co., Ltd. -+ * (http://www.orangepi.org) -+ * -+ * Copyright (c) 2021-2023 Tianling Shen -+ */ -+ -+/dts-v1/; -+#include "rk3328-orangepi-r1-plus.dts" -+ -+/ { -+ model = "Xunlong Orange Pi R1 Plus LTS"; -+ compatible = "xunlong,orangepi-r1-plus-lts", "rockchip,rk3328"; -+}; -+ -+&gmac2io { -+ phy-handle = <&yt8531c>; -+ tx_delay = <0x19>; -+ rx_delay = <0x05>; -+ -+ mdio { -+ /delete-node/ ethernet-phy@1; -+ -+ yt8531c: ethernet-phy@0 { -+ compatible = "ethernet-phy-ieee802.3-c22"; -+ reg = <0>; -+ -+ motorcomm,clk-out-frequency-hz = <125000000>; -+ motorcomm,keep-pll-enabled; -+ motorcomm,auto-sleep-disabled; -+ -+ pinctrl-0 = <ð_phy_reset_pin>; -+ pinctrl-names = "default"; -+ reset-assert-us = <15000>; -+ reset-deassert-us = <50000>; -+ reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+}; diff --git a/target/linux/rockchip/patches-5.15/100-rockchip-use-system-LED-for-OpenWrt.patch b/target/linux/rockchip/patches-5.15/100-rockchip-use-system-LED-for-OpenWrt.patch deleted file mode 100644 index 01009c5eb8411b..00000000000000 --- a/target/linux/rockchip/patches-5.15/100-rockchip-use-system-LED-for-OpenWrt.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 6731d2c9039fbe1ecf21915eab3acee0a999508a Mon Sep 17 00:00:00 2001 -From: David Bauer -Date: Fri, 10 Jul 2020 21:38:20 +0200 -Subject: [PATCH] rockchip: use system LED for OpenWrt - -Use the SYS LED on the casing for showing system status. - -This patch is kept separate from the NanoPi R2S support patch, as i plan -on submitting the device support upstream. - -Signed-off-by: David Bauer ---- - arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - ---- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -@@ -16,6 +16,11 @@ - aliases { - ethernet1 = &rtl8153; - mmc0 = &sdmmc; -+ -+ led-boot = &sys_led; -+ led-failsafe = &sys_led; -+ led-running = &sys_led; -+ led-upgrade = &sys_led; - }; - - chosen { -@@ -49,18 +54,18 @@ - - lan_led: led-0 { - gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>; -- label = "nanopi-r2s:green:lan"; -+ label = "green:lan"; - }; - - sys_led: led-1 { - gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>; -- label = "nanopi-r2s:red:sys"; -+ label = "red:sys"; - default-state = "on"; - }; - - wan_led: led-2 { - gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_HIGH>; -- label = "nanopi-r2s:green:wan"; -+ label = "green:wan"; - }; - }; - ---- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts -@@ -13,6 +13,11 @@ - aliases { - mmc0 = &sdmmc; - mmc1 = &emmc; -+ -+ led-boot = &power_led; -+ led-failsafe = &power_led; -+ led-running = &power_led; -+ led-upgrade = &power_led; - }; - - chosen { diff --git a/target/linux/rockchip/patches-5.15/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch b/target/linux/rockchip/patches-5.15/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch deleted file mode 100644 index 2221077c97ced8..00000000000000 --- a/target/linux/rockchip/patches-5.15/103-arm64-rockchip-add-OF-node-for-USB-eth-on-NanoPi-R2S.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 2795c8b31a686bdb8338f9404d18ef7a154f0d75 Mon Sep 17 00:00:00 2001 -From: David Bauer -Date: Sun, 26 Jul 2020 13:32:59 +0200 -Subject: [PATCH] arm64: rockchip: add OF node for USB eth on NanoPi R2S - -This adds the OF node for the USB3 ethernet adapter on the FriendlyARM -NanoPi R2S. Add the correct value for the RTL8153 LED configuration -register to match the blink behavior of the other port on the device. - -Signed-off-by: David Bauer ---- - arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts | 7 +++++++ - 1 file changed, 1 insertions(+) - ---- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts -@@ -402,6 +402,7 @@ - rtl8153: device@2 { - compatible = "usbbda,8153"; - reg = <2>; -+ realtek,led-data = <0x87>; - }; - }; - diff --git a/target/linux/rockchip/patches-5.15/105-nanopi-r4s-sd-signalling.patch b/target/linux/rockchip/patches-5.15/105-nanopi-r4s-sd-signalling.patch deleted file mode 100644 index 856970738aaacd..00000000000000 --- a/target/linux/rockchip/patches-5.15/105-nanopi-r4s-sd-signalling.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: David Bauer -Subject: arm64: dts: rockchip: disable UHS modes for NanoPi R4S - -The NanoPi R4S leaves the SD card in 1.8V signalling when rebooting -while U-Boot requires the card to be in 3.3V mode. - -Remove UHS support from the SD controller so the card remains in 3.3V -mode. This reduces transfer speeds but ensures a reboot whether from -userspace or following a kernel panic is always working. - -Signed-off-by: David Bauer - ---- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts -@@ -335,7 +335,6 @@ - sd-uhs-sdr12; - sd-uhs-sdr25; - sd-uhs-sdr50; -- sd-uhs-sdr104; - vmmc-supply = <&vcc_sd>; - vqmmc-supply = <&vcc_sdio>; - status = "okay"; ---- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts -@@ -121,6 +121,11 @@ - status = "disabled"; - }; - -+&sdmmc { -+ /delete-property/ sd-uhs-sdr104; -+ cap-sd-highspeed; -+}; -+ - &u2phy0_host { - phy-supply = <&vdd_5v>; - }; diff --git a/target/linux/rockchip/patches-5.15/106-r4s-openwrt-leds.patch b/target/linux/rockchip/patches-5.15/106-r4s-openwrt-leds.patch deleted file mode 100644 index d7579d61e90ce3..00000000000000 --- a/target/linux/rockchip/patches-5.15/106-r4s-openwrt-leds.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts -@@ -19,6 +19,13 @@ - model = "FriendlyElec NanoPi R4S"; - compatible = "friendlyarm,nanopi-r4s", "rockchip,rk3399"; - -+ aliases { -+ led-boot = &sys_led; -+ led-failsafe = &sys_led; -+ led-running = &sys_led; -+ led-upgrade = &sys_led; -+ }; -+ - /delete-node/ display-subsystem; - - gpio-leds { diff --git a/target/linux/rockchip/patches-5.15/107-arm64-dts-rockchip-Update-LED-properties-for-Orange-.patch b/target/linux/rockchip/patches-5.15/107-arm64-dts-rockchip-Update-LED-properties-for-Orange-.patch deleted file mode 100644 index b1e26d4e3e27d7..00000000000000 --- a/target/linux/rockchip/patches-5.15/107-arm64-dts-rockchip-Update-LED-properties-for-Orange-.patch +++ /dev/null @@ -1,56 +0,0 @@ -From d2166e3b3680bd2b206aebf1e1ce4c0d346f3c50 Mon Sep 17 00:00:00 2001 -From: Tianling Shen -Date: Fri, 19 May 2023 12:10:52 +0800 -Subject: [PATCH] arm64: dts: rockchip: Update LED properties for Orange Pi R1 - Plus - -Add OpenWrt's LED aliases for showing system status. -Also replace function/color with legacy label as OpenWrt relys on it -to update LED settings. - -Signed-off-by: Tianling Shen ---- - .../dts/rockchip/rk3328-orangepi-r1-plus.dts | 17 +++++++++-------- - 1 file changed, 9 insertions(+), 8 deletions(-) - ---- a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts -@@ -17,6 +17,11 @@ - aliases { - ethernet1 = &rtl8153; - mmc0 = &sdmmc; -+ -+ led-boot = &status_led; -+ led-failsafe = &status_led; -+ led-running = &status_led; -+ led-upgrade = &status_led; - }; - - chosen { -@@ -36,22 +41,18 @@ - pinctrl-names = "default"; - - led-0 { -- function = LED_FUNCTION_LAN; -- color = ; - gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>; -+ label = "green:lan"; - }; - -- led-1 { -- function = LED_FUNCTION_STATUS; -- color = ; -+ status_led: led-1 { - gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>; -- linux,default-trigger = "heartbeat"; -+ label = "red:status"; - }; - - led-2 { -- function = LED_FUNCTION_WAN; -- color = ; - gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_HIGH>; -+ label = "green:wan"; - }; - }; - diff --git a/target/linux/rockchip/patches-5.15/108-arm64-dts-rockchip-add-LED-configuration-to-Orange-P.patch b/target/linux/rockchip/patches-5.15/108-arm64-dts-rockchip-add-LED-configuration-to-Orange-P.patch deleted file mode 100644 index 37b59925fc16dc..00000000000000 --- a/target/linux/rockchip/patches-5.15/108-arm64-dts-rockchip-add-LED-configuration-to-Orange-P.patch +++ /dev/null @@ -1,24 +0,0 @@ -From b46a530d12ada422b9d5b2b97059e0d3ed950b40 Mon Sep 17 00:00:00 2001 -From: Tianling Shen -Date: Fri, 19 May 2023 12:38:04 +0800 -Subject: [PATCH] arm64: dts: rockchip: add LED configuration to Orange Pi R1 - Plus - -Add the correct value for the RTL8153 LED configuration register to -match the blink behavior of the other port on the device. - -Signed-off-by: Tianling Shen ---- - arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts -@@ -362,6 +362,7 @@ - rtl8153: device@2 { - compatible = "usbbda,8153"; - reg = <2>; -+ realtek,led-data = <0x87>; - }; - }; - diff --git a/target/linux/rockchip/patches-5.15/109-nanopc-t4-add-led-aliases.patch b/target/linux/rockchip/patches-5.15/109-nanopc-t4-add-led-aliases.patch deleted file mode 100644 index 1a80dadd48b93b..00000000000000 --- a/target/linux/rockchip/patches-5.15/109-nanopc-t4-add-led-aliases.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dts -@@ -15,6 +15,13 @@ - model = "FriendlyElec NanoPC-T4"; - compatible = "friendlyarm,nanopc-t4", "rockchip,rk3399"; - -+ aliases { -+ led-boot = &status_led; -+ led-failsafe = &status_led; -+ led-running = &status_led; -+ led-upgrade = &status_led; -+ }; -+ - vcc12v0_sys: vcc12v0-sys { - compatible = "regulator-fixed"; - regulator-always-on; diff --git a/target/linux/rockchip/patches-6.1/001-v6.3-mmc-sdhci-of-dwcmshc-Update-DLL-and-pre-change-delay-for.patch b/target/linux/rockchip/patches-6.1/001-v6.3-mmc-sdhci-of-dwcmshc-Update-DLL-and-pre-change-delay-for.patch new file mode 100644 index 00000000000000..2bb542be369d98 --- /dev/null +++ b/target/linux/rockchip/patches-6.1/001-v6.3-mmc-sdhci-of-dwcmshc-Update-DLL-and-pre-change-delay-for.patch @@ -0,0 +1,60 @@ +From b75a52b0dda353aeefb4830a320589a363f49579 Mon Sep 17 00:00:00 2001 +From: Shawn Lin +Date: Thu, 2 Feb 2023 08:35:16 +0800 +Subject: [PATCH] mmc: sdhci-of-dwcmshc: Update DLL and pre-change delay for + rockchip platform + +For Rockchip platform, DLL bypass bit and start bit need to be set if +DLL is not locked. And adjust pre-change delay to 0x3 for better signal +test result. + +Signed-off-by: Shawn Lin +Link: https://lore.kernel.org/r/1675298118-64243-2-git-send-email-shawn.lin@rock-chips.com +Signed-off-by: Ulf Hansson +--- + drivers/mmc/host/sdhci-of-dwcmshc.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +--- a/drivers/mmc/host/sdhci-of-dwcmshc.c ++++ b/drivers/mmc/host/sdhci-of-dwcmshc.c +@@ -48,6 +48,7 @@ + #define DWCMSHC_EMMC_DLL_RXCLK_SRCSEL 29 + #define DWCMSHC_EMMC_DLL_START_POINT 16 + #define DWCMSHC_EMMC_DLL_INC 8 ++#define DWCMSHC_EMMC_DLL_BYPASS BIT(24) + #define DWCMSHC_EMMC_DLL_DLYENA BIT(27) + #define DLL_TXCLK_TAPNUM_DEFAULT 0x10 + #define DLL_TXCLK_TAPNUM_90_DEGREES 0xA +@@ -60,6 +61,7 @@ + #define DLL_RXCLK_NO_INVERTER 1 + #define DLL_RXCLK_INVERTER 0 + #define DLL_CMDOUT_TAPNUM_90_DEGREES 0x8 ++#define DLL_RXCLK_ORI_GATE BIT(31) + #define DLL_CMDOUT_TAPNUM_FROM_SW BIT(24) + #define DLL_CMDOUT_SRC_CLK_NEG BIT(28) + #define DLL_CMDOUT_EN_SRC_CLK_NEG BIT(29) +@@ -234,9 +236,12 @@ static void dwcmshc_rk3568_set_clock(str + sdhci_writel(host, extra, reg); + + if (clock <= 52000000) { +- /* Disable DLL and reset both of sample and drive clock */ +- sdhci_writel(host, 0, DWCMSHC_EMMC_DLL_CTRL); +- sdhci_writel(host, 0, DWCMSHC_EMMC_DLL_RXCLK); ++ /* ++ * Disable DLL and reset both of sample and drive clock. ++ * The bypass bit and start bit need to be set if DLL is not locked. ++ */ ++ sdhci_writel(host, DWCMSHC_EMMC_DLL_BYPASS | DWCMSHC_EMMC_DLL_START, DWCMSHC_EMMC_DLL_CTRL); ++ sdhci_writel(host, DLL_RXCLK_ORI_GATE, DWCMSHC_EMMC_DLL_RXCLK); + sdhci_writel(host, 0, DWCMSHC_EMMC_DLL_TXCLK); + sdhci_writel(host, 0, DECMSHC_EMMC_DLL_CMDOUT); + /* +@@ -279,7 +284,7 @@ static void dwcmshc_rk3568_set_clock(str + } + + extra = 0x1 << 16 | /* tune clock stop en */ +- 0x2 << 17 | /* pre-change delay */ ++ 0x3 << 17 | /* pre-change delay */ + 0x3 << 19; /* post-change delay */ + sdhci_writel(host, extra, dwc_priv->vendor_specific_area1 + DWCMSHC_EMMC_ATCTRL); + diff --git a/target/linux/rockchip/patches-6.1/002-v6.4-mmc-sdhci-of-dwcmshc-properly-determine-max-clock-on.patch b/target/linux/rockchip/patches-6.1/002-v6.4-mmc-sdhci-of-dwcmshc-properly-determine-max-clock-on.patch new file mode 100644 index 00000000000000..9d9c1b5c1c2d2e --- /dev/null +++ b/target/linux/rockchip/patches-6.1/002-v6.4-mmc-sdhci-of-dwcmshc-properly-determine-max-clock-on.patch @@ -0,0 +1,52 @@ +From 49502408007b77ff290ce62e6218cefaeedcb31a Mon Sep 17 00:00:00 2001 +From: Vasily Khoruzhick +Date: Thu, 9 Mar 2023 17:03:49 -0800 +Subject: [PATCH] mmc: sdhci-of-dwcmshc: properly determine max clock on + Rockchip + +Currently .get_max_clock returns the current clock rate for cclk_emmc +on rk35xx, thus max clock gets set to whatever bootloader set it to. + +In case of u-boot, it is intentionally reset to 50 MHz if it boots +from eMMC, see mmc_deinit() in u-boot sources. As a result, HS200 and +HS400 modes are never selected by Linux, because dwcmshc_rk35xx_postinit +clears appropriate caps if host->mmc->f_max is < 52MHz + +cclk_emmc is not a fixed clock on rk35xx, so using +sdhci_pltfm_clk_get_max_clock is not appropriate here. + +Implement rk35xx_get_max_clock that returns actual max clock for cclk_emmc. + +Signed-off-by: Vasily Khoruzhick +Acked-by: Adrian Hunter +Link: https://lore.kernel.org/r/20230310010349.509132-1-anarsoul@gmail.com +Signed-off-by: Ulf Hansson +--- + drivers/mmc/host/sdhci-of-dwcmshc.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/drivers/mmc/host/sdhci-of-dwcmshc.c ++++ b/drivers/mmc/host/sdhci-of-dwcmshc.c +@@ -126,6 +126,13 @@ static unsigned int dwcmshc_get_max_cloc + return pltfm_host->clock; + } + ++static unsigned int rk35xx_get_max_clock(struct sdhci_host *host) ++{ ++ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); ++ ++ return clk_round_rate(pltfm_host->clk, ULONG_MAX); ++} ++ + static void dwcmshc_check_auto_cmd23(struct mmc_host *mmc, + struct mmc_request *mrq) + { +@@ -343,7 +350,7 @@ static const struct sdhci_ops sdhci_dwcm + .set_clock = dwcmshc_rk3568_set_clock, + .set_bus_width = sdhci_set_bus_width, + .set_uhs_signaling = dwcmshc_set_uhs_signaling, +- .get_max_clock = sdhci_pltfm_clk_get_max_clock, ++ .get_max_clock = rk35xx_get_max_clock, + .reset = rk35xx_sdhci_reset, + .adma_write_desc = dwcmshc_adma_write_desc, + }; diff --git a/target/linux/rockchip/patches-6.1/009-v6.4-arm64-dts-rockchip-Add-FriendlyElec-Nanopi-R5S.patch b/target/linux/rockchip/patches-6.1/009-v6.4-arm64-dts-rockchip-Add-FriendlyElec-Nanopi-R5S.patch new file mode 100644 index 00000000000000..3d502a65b635c2 --- /dev/null +++ b/target/linux/rockchip/patches-6.1/009-v6.4-arm64-dts-rockchip-Add-FriendlyElec-Nanopi-R5S.patch @@ -0,0 +1,754 @@ +From c6629b9a6738a64507478527da6c7b83c10a6d2c Mon Sep 17 00:00:00 2001 +From: Vasily Khoruzhick +Date: Tue, 7 Mar 2023 22:32:40 -0800 +Subject: [PATCH] arm64: dts: rockchip: Add FriendlyElec Nanopi R5S + +FriendlyElec Nanopi R5S is an open-sourced mini IoT gateway device. + +Board Specifications +- Rockchip RK3568 +- 2 or 4GB LPDDR4X +- 8GB or 16GB eMMC, SD card slot +- GbE LAN (Native) +- 2x 2.5G LAN (PCIe) +- M.2 Connector +- HDMI 2.0, MIPI DSI/CSI +- 2xUSB 3.0 Host +- USB Type C PD, 5V/9V/12V +- GPIO: 12-pin 0.5mm FPC connector + +Based on Tianling Shen's work. + +Signed-off-by: Vasily Khoruzhick +Link: https://lore.kernel.org/r/20230308063240.107178-2-anarsoul@gmail.com +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/Makefile | 1 + + .../boot/dts/rockchip/rk3568-nanopi-r5s.dts | 713 ++++++++++++++++++ + 2 files changed, 714 insertions(+) + create mode 100644 arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts + +--- a/arch/arm64/boot/dts/rockchip/Makefile ++++ b/arch/arm64/boot/dts/rockchip/Makefile +@@ -74,4 +74,5 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-ro + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-soquartz-cm4.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bpi-r2-pro.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb1-v10.dtb ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-nanopi-r5s.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-rock-3a.dtb +--- /dev/null ++++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts +@@ -0,0 +1,713 @@ ++// 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 Tianling Shen ++ */ ++ ++/dts-v1/; ++#include ++#include ++#include ++#include ++#include ++#include "rk3568.dtsi" ++ ++/ { ++ model = "FriendlyElec NanoPi R5S"; ++ compatible = "friendlyarm,nanopi-r5s", "rockchip,rk3568"; ++ ++ aliases { ++ ethernet0 = &gmac0; ++ mmc0 = &sdmmc0; ++ mmc1 = &sdhci; ++ }; ++ ++ chosen: chosen { ++ stdout-path = "serial2:1500000n8"; ++ }; ++ ++ hdmi-con { ++ compatible = "hdmi-connector"; ++ type = "a"; ++ ++ port { ++ hdmi_con_in: endpoint { ++ remote-endpoint = <&hdmi_out_con>; ++ }; ++ }; ++ }; ++ ++ gpio-leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&lan1_led_pin>, <&lan2_led_pin>, <&power_led_pin>, <&wan_led_pin>; ++ ++ led-lan1 { ++ color = ; ++ function = LED_FUNCTION_LAN; ++ function-enumerator = <1>; ++ gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led-lan2 { ++ color = ; ++ function = LED_FUNCTION_LAN; ++ function-enumerator = <2>; ++ gpios = <&gpio3 RK_PD7 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ power_led: led-power { ++ color = ; ++ function = LED_FUNCTION_POWER; ++ linux,default-trigger = "heartbeat"; ++ gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led-wan { ++ color = ; ++ function = LED_FUNCTION_WAN; ++ gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ vdd_usbc: vdd-usbc-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vdd_usbc"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ }; ++ ++ vcc3v3_sys: vcc3v3-sys-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_sys"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&vdd_usbc>; ++ }; ++ ++ 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 = <&vdd_usbc>; ++ }; ++ ++ vcc3v3_pcie: vcc3v3-pcie-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_pcie"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ enable-active-high; ++ gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; ++ startup-delay-us = <200000>; ++ vin-supply = <&vcc5v0_sys>; ++ }; ++ ++ 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 = <&vdd_usbc>; ++ }; ++ ++ vcc5v0_usb_host: vcc5v0-usb-host-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v0_usb_host_en>; ++ regulator-name = "vcc5v0_usb_host"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&vcc5v0_usb>; ++ }; ++ ++ vcc5v0_usb_otg: vcc5v0-usb-otg-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v0_usb_otg_en>; ++ regulator-name = "vcc5v0_usb_otg"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&vcc5v0_usb>; ++ }; ++ ++ pcie30_avdd0v9: pcie30-avdd0v9-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "pcie30_avdd0v9"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ vin-supply = <&vcc3v3_sys>; ++ }; ++ ++ pcie30_avdd1v8: pcie30-avdd1v8-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "pcie30_avdd1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vin-supply = <&vcc3v3_sys>; ++ }; ++}; ++ ++&combphy0 { ++ status = "okay"; ++}; ++ ++&combphy1 { ++ status = "okay"; ++}; ++ ++&combphy2 { ++ status = "okay"; ++}; ++ ++&cpu0 { ++ cpu-supply = <&vdd_cpu>; ++}; ++ ++&cpu1 { ++ cpu-supply = <&vdd_cpu>; ++}; ++ ++&cpu2 { ++ cpu-supply = <&vdd_cpu>; ++}; ++ ++&cpu3 { ++ cpu-supply = <&vdd_cpu>; ++}; ++ ++&gmac0 { ++ assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>; ++ assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>; ++ assigned-clock-rates = <0>, <125000000>; ++ clock_in_out = "output"; ++ phy-handle = <&rgmii_phy0>; ++ phy-mode = "rgmii-id"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&gmac0_miim ++ &gmac0_tx_bus2 ++ &gmac0_rx_bus2 ++ &gmac0_rgmii_clk ++ &gmac0_rgmii_bus>; ++ snps,reset-gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_LOW>; ++ snps,reset-active-low; ++ /* Reset time is 15ms, 50ms for rtl8211f */ ++ snps,reset-delays-us = <0 15000 50000>; ++ tx_delay = <0x3c>; ++ rx_delay = <0x2f>; ++ status = "okay"; ++}; ++ ++&gpu { ++ mali-supply = <&vdd_gpu>; ++ status = "okay"; ++}; ++ ++&hdmi { ++ avdd-0v9-supply = <&vdda0v9_image>; ++ avdd-1v8-supply = <&vcca1v8_image>; ++ status = "okay"; ++}; ++ ++&hdmi_in { ++ hdmi_in_vp0: endpoint { ++ remote-endpoint = <&vp0_out_hdmi>; ++ }; ++}; ++ ++&hdmi_out { ++ hdmi_out_con: endpoint { ++ remote-endpoint = <&hdmi_con_in>; ++ }; ++}; ++ ++&hdmi_sound { ++ status = "okay"; ++}; ++ ++&i2c0 { ++ status = "okay"; ++ ++ vdd_cpu: regulator@1c { ++ compatible = "tcs,tcs4525"; ++ reg = <0x1c>; ++ fcs,suspend-voltage-selector = <1>; ++ regulator-name = "vdd_cpu"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <800000>; ++ regulator-max-microvolt = <1150000>; ++ regulator-ramp-delay = <2300>; ++ vin-supply = <&vcc5v0_sys>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ rk809: pmic@20 { ++ compatible = "rockchip,rk809"; ++ reg = <0x20>; ++ interrupt-parent = <&gpio0>; ++ interrupts = ; ++ #clock-cells = <1>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pmic_int>; ++ rockchip,system-power-controller; ++ vcc1-supply = <&vcc3v3_sys>; ++ vcc2-supply = <&vcc3v3_sys>; ++ vcc3-supply = <&vcc3v3_sys>; ++ vcc4-supply = <&vcc3v3_sys>; ++ vcc5-supply = <&vcc3v3_sys>; ++ vcc6-supply = <&vcc3v3_sys>; ++ vcc7-supply = <&vcc3v3_sys>; ++ vcc8-supply = <&vcc3v3_sys>; ++ vcc9-supply = <&vcc3v3_sys>; ++ wakeup-source; ++ ++ regulators { ++ vdd_logic: DCDC_REG1 { ++ regulator-name = "vdd_logic"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-init-microvolt = <900000>; ++ regulator-initial-mode = <0x2>; ++ regulator-min-microvolt = <500000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_gpu: DCDC_REG2 { ++ regulator-name = "vdd_gpu"; ++ regulator-always-on; ++ regulator-init-microvolt = <900000>; ++ regulator-initial-mode = <0x2>; ++ regulator-min-microvolt = <500000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_ddr: DCDC_REG3 { ++ regulator-name = "vcc_ddr"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-initial-mode = <0x2>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vdd_npu: DCDC_REG4 { ++ regulator-name = "vdd_npu"; ++ regulator-init-microvolt = <900000>; ++ regulator-initial-mode = <0x2>; ++ regulator-min-microvolt = <500000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_1v8: DCDC_REG5 { ++ regulator-name = "vcc_1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdda0v9_image: LDO_REG1 { ++ regulator-name = "vdda0v9_image"; ++ regulator-min-microvolt = <950000>; ++ regulator-max-microvolt = <950000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdda_0v9: LDO_REG2 { ++ regulator-name = "vdda_0v9"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdda0v9_pmu: LDO_REG3 { ++ regulator-name = "vdda0v9_pmu"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <900000>; ++ }; ++ }; ++ ++ vccio_acodec: LDO_REG4 { ++ regulator-name = "vccio_acodec"; ++ regulator-always-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vccio_sd: LDO_REG5 { ++ regulator-name = "vccio_sd"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc3v3_pmu: LDO_REG6 { ++ regulator-name = "vcc3v3_pmu"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3300000>; ++ }; ++ }; ++ ++ vcca_1v8: LDO_REG7 { ++ regulator-name = "vcca_1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcca1v8_pmu: LDO_REG8 { ++ regulator-name = "vcca1v8_pmu"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ vcca1v8_image: LDO_REG9 { ++ regulator-name = "vcca1v8_image"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_3v3: SWITCH_REG1 { ++ regulator-name = "vcc_3v3"; ++ regulator-always-on; ++ regulator-boot-on; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc3v3_sd: SWITCH_REG2 { ++ regulator-name = "vcc3v3_sd"; ++ regulator-always-on; ++ regulator-boot-on; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ }; ++ ++ }; ++}; ++ ++&i2c5 { ++ status = "okay"; ++ ++ hym8563: rtc@51 { ++ compatible = "haoyu,hym8563"; ++ reg = <0x51>; ++ interrupt-parent = <&gpio0>; ++ interrupts = ; ++ #clock-cells = <0>; ++ clock-output-names = "rtcic_32kout"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hym8563_int>; ++ wakeup-source; ++ }; ++}; ++ ++&i2s0_8ch { ++ status = "okay"; ++}; ++ ++&i2s1_8ch { ++ rockchip,trcm-sync-tx-only; ++ status = "okay"; ++}; ++ ++&mdio0 { ++ rgmii_phy0: ethernet-phy@1 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <1>; ++ pinctrl-0 = <ð_phy0_reset_pin>; ++ pinctrl-names = "default"; ++ reset-assert-us = <10000>; ++ reset-deassert-us = <50000>; ++ reset-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_LOW>; ++ }; ++}; ++ ++&pcie2x1 { ++ num-lanes = <1>; ++ reset-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++}; ++ ++&pcie30phy { ++ data-lanes = <1 2>; ++ status = "okay"; ++}; ++ ++&pcie3x1 { ++ num-lanes = <1>; ++ reset-gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; ++ vpcie3v3-supply = <&vcc3v3_pcie>; ++ status = "okay"; ++}; ++ ++&pcie3x2 { ++ num-lanes = <1>; ++ num-ib-windows = <8>; ++ num-ob-windows = <8>; ++ reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>; ++ vpcie3v3-supply = <&vcc3v3_pcie>; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ gmac0 { ++ eth_phy0_reset_pin: eth-phy0-reset-pin { ++ rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ }; ++ ++ gpio-leds { ++ lan1_led_pin: lan1-led-pin { ++ rockchip,pins = <3 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ lan2_led_pin: lan2-led-pin { ++ rockchip,pins = <3 RK_PD7 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ power_led_pin: power-led-pin { ++ rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ wan_led_pin: wan-led-pin { ++ rockchip,pins = <2 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ hym8563 { ++ hym8563_int: hym8563-int { ++ rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ pmic { ++ pmic_int: pmic-int { ++ rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ usb { ++ vcc5v0_usb_host_en: vcc5v0-usb-host-en { ++ rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ vcc5v0_usb_otg_en: vcc5v0-usb-otg-en { ++ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++}; ++ ++&pmu_io_domains { ++ pmuio1-supply = <&vcc3v3_pmu>; ++ pmuio2-supply = <&vcc3v3_pmu>; ++ vccio1-supply = <&vccio_acodec>; ++ vccio3-supply = <&vccio_sd>; ++ vccio4-supply = <&vcc_1v8>; ++ vccio5-supply = <&vcc_3v3>; ++ vccio6-supply = <&vcc_1v8>; ++ vccio7-supply = <&vcc_3v3>; ++ status = "okay"; ++}; ++ ++&saradc { ++ vref-supply = <&vcca_1v8>; ++ status = "okay"; ++}; ++ ++&sdhci { ++ bus-width = <8>; ++ max-frequency = <200000000>; ++ non-removable; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd>; ++ status = "okay"; ++}; ++ ++&sdmmc0 { ++ max-frequency = <150000000>; ++ no-sdio; ++ no-mmc; ++ bus-width = <4>; ++ cap-mmc-highspeed; ++ cap-sd-highspeed; ++ disable-wp; ++ vmmc-supply = <&vcc3v3_sd>; ++ vqmmc-supply = <&vccio_sd>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; ++ status = "okay"; ++}; ++ ++&tsadc { ++ rockchip,hw-tshut-mode = <1>; ++ rockchip,hw-tshut-polarity = <0>; ++ status = "okay"; ++}; ++ ++&uart2 { ++ status = "okay"; ++}; ++ ++&usb_host0_ehci { ++ status = "okay"; ++}; ++ ++&usb_host0_ohci { ++ status = "okay"; ++}; ++ ++&usb_host0_xhci { ++ extcon = <&usb2phy0>; ++ dr_mode = "host"; ++ status = "okay"; ++}; ++ ++&usb_host1_ehci { ++ status = "okay"; ++}; ++ ++&usb_host1_ohci { ++ status = "okay"; ++}; ++ ++&usb_host1_xhci { ++ status = "okay"; ++}; ++ ++&usb2phy0 { ++ status = "okay"; ++}; ++ ++&usb2phy0_host { ++ phy-supply = <&vcc5v0_usb_host>; ++ status = "okay"; ++}; ++ ++&usb2phy0_otg { ++ status = "okay"; ++}; ++ ++&usb2phy1 { ++ status = "okay"; ++}; ++ ++&usb2phy1_host { ++ phy-supply = <&vcc5v0_usb_otg>; ++ status = "okay"; ++}; ++ ++&usb2phy1_otg { ++ status = "okay"; ++}; ++ ++&vop { ++ assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>; ++ assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>; ++ status = "okay"; ++}; ++ ++&vop_mmu { ++ status = "okay"; ++}; ++ ++&vp0 { ++ vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { ++ reg = ; ++ remote-endpoint = <&hdmi_in_vp0>; ++ }; ++}; diff --git a/target/linux/rockchip/patches-6.1/010-v6.4-arm64-dts-rockchip-create-common-dtsi-for-NanoPi-R5-serie.patch b/target/linux/rockchip/patches-6.1/010-v6.4-arm64-dts-rockchip-create-common-dtsi-for-NanoPi-R5-serie.patch new file mode 100644 index 00000000000000..cf9fe06ad0c21a --- /dev/null +++ b/target/linux/rockchip/patches-6.1/010-v6.4-arm64-dts-rockchip-create-common-dtsi-for-NanoPi-R5-serie.patch @@ -0,0 +1,1226 @@ +From c8ec73b05a95d9f0969ae0f28dd8799a54fcdfc7 Mon Sep 17 00:00:00 2001 +From: Tianling Shen +Date: Sat, 18 Mar 2023 16:37:41 +0800 +Subject: [PATCH] arm64: dts: rockchip: create common dtsi for NanoPi R5 series + +Create common dtsi for the FriendlyElec NanoPi R5 series. + +Signed-off-by: Tianling Shen +Link: https://lore.kernel.org/r/20230318083745.6181-2-cnsztl@gmail.com +Signed-off-by: Heiko Stuebner +--- + .../boot/dts/rockchip/rk3568-nanopi-r5s.dts | 575 +---------------- + .../boot/dts/rockchip/rk3568-nanopi-r5s.dtsi | 596 ++++++++++++++++++ + 2 files changed, 597 insertions(+), 574 deletions(-) + create mode 100644 arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi + +--- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts +@@ -7,12 +7,7 @@ + */ + + /dts-v1/; +-#include +-#include +-#include +-#include +-#include +-#include "rk3568.dtsi" ++#include "rk3568-nanopi-r5s.dtsi" + + / { + model = "FriendlyElec NanoPi R5S"; +@@ -20,23 +15,6 @@ + + aliases { + ethernet0 = &gmac0; +- mmc0 = &sdmmc0; +- mmc1 = &sdhci; +- }; +- +- chosen: chosen { +- stdout-path = "serial2:1500000n8"; +- }; +- +- hdmi-con { +- compatible = "hdmi-connector"; +- type = "a"; +- +- port { +- hdmi_con_in: endpoint { +- remote-endpoint = <&hdmi_out_con>; +- }; +- }; + }; + + gpio-leds { +@@ -71,130 +49,6 @@ + gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>; + }; + }; +- +- vdd_usbc: vdd-usbc-regulator { +- compatible = "regulator-fixed"; +- regulator-name = "vdd_usbc"; +- regulator-always-on; +- regulator-boot-on; +- regulator-min-microvolt = <5000000>; +- regulator-max-microvolt = <5000000>; +- }; +- +- vcc3v3_sys: vcc3v3-sys-regulator { +- compatible = "regulator-fixed"; +- regulator-name = "vcc3v3_sys"; +- regulator-always-on; +- regulator-boot-on; +- regulator-min-microvolt = <3300000>; +- regulator-max-microvolt = <3300000>; +- vin-supply = <&vdd_usbc>; +- }; +- +- 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 = <&vdd_usbc>; +- }; +- +- vcc3v3_pcie: vcc3v3-pcie-regulator { +- compatible = "regulator-fixed"; +- regulator-name = "vcc3v3_pcie"; +- regulator-min-microvolt = <3300000>; +- regulator-max-microvolt = <3300000>; +- enable-active-high; +- gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; +- startup-delay-us = <200000>; +- vin-supply = <&vcc5v0_sys>; +- }; +- +- 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 = <&vdd_usbc>; +- }; +- +- vcc5v0_usb_host: vcc5v0-usb-host-regulator { +- compatible = "regulator-fixed"; +- enable-active-high; +- gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>; +- pinctrl-names = "default"; +- pinctrl-0 = <&vcc5v0_usb_host_en>; +- regulator-name = "vcc5v0_usb_host"; +- regulator-always-on; +- regulator-boot-on; +- regulator-min-microvolt = <5000000>; +- regulator-max-microvolt = <5000000>; +- vin-supply = <&vcc5v0_usb>; +- }; +- +- vcc5v0_usb_otg: vcc5v0-usb-otg-regulator { +- compatible = "regulator-fixed"; +- enable-active-high; +- gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>; +- pinctrl-names = "default"; +- pinctrl-0 = <&vcc5v0_usb_otg_en>; +- regulator-name = "vcc5v0_usb_otg"; +- regulator-min-microvolt = <5000000>; +- regulator-max-microvolt = <5000000>; +- vin-supply = <&vcc5v0_usb>; +- }; +- +- pcie30_avdd0v9: pcie30-avdd0v9-regulator { +- compatible = "regulator-fixed"; +- regulator-name = "pcie30_avdd0v9"; +- regulator-always-on; +- regulator-boot-on; +- regulator-min-microvolt = <900000>; +- regulator-max-microvolt = <900000>; +- vin-supply = <&vcc3v3_sys>; +- }; +- +- pcie30_avdd1v8: pcie30-avdd1v8-regulator { +- compatible = "regulator-fixed"; +- regulator-name = "pcie30_avdd1v8"; +- regulator-always-on; +- regulator-boot-on; +- regulator-min-microvolt = <1800000>; +- regulator-max-microvolt = <1800000>; +- vin-supply = <&vcc3v3_sys>; +- }; +-}; +- +-&combphy0 { +- status = "okay"; +-}; +- +-&combphy1 { +- status = "okay"; +-}; +- +-&combphy2 { +- status = "okay"; +-}; +- +-&cpu0 { +- cpu-supply = <&vdd_cpu>; +-}; +- +-&cpu1 { +- cpu-supply = <&vdd_cpu>; +-}; +- +-&cpu2 { +- cpu-supply = <&vdd_cpu>; +-}; +- +-&cpu3 { +- cpu-supply = <&vdd_cpu>; + }; + + &gmac0 { +@@ -219,292 +73,6 @@ + status = "okay"; + }; + +-&gpu { +- mali-supply = <&vdd_gpu>; +- status = "okay"; +-}; +- +-&hdmi { +- avdd-0v9-supply = <&vdda0v9_image>; +- avdd-1v8-supply = <&vcca1v8_image>; +- status = "okay"; +-}; +- +-&hdmi_in { +- hdmi_in_vp0: endpoint { +- remote-endpoint = <&vp0_out_hdmi>; +- }; +-}; +- +-&hdmi_out { +- hdmi_out_con: endpoint { +- remote-endpoint = <&hdmi_con_in>; +- }; +-}; +- +-&hdmi_sound { +- status = "okay"; +-}; +- +-&i2c0 { +- status = "okay"; +- +- vdd_cpu: regulator@1c { +- compatible = "tcs,tcs4525"; +- reg = <0x1c>; +- fcs,suspend-voltage-selector = <1>; +- regulator-name = "vdd_cpu"; +- regulator-always-on; +- regulator-boot-on; +- regulator-min-microvolt = <800000>; +- regulator-max-microvolt = <1150000>; +- regulator-ramp-delay = <2300>; +- vin-supply = <&vcc5v0_sys>; +- +- regulator-state-mem { +- regulator-off-in-suspend; +- }; +- }; +- +- rk809: pmic@20 { +- compatible = "rockchip,rk809"; +- reg = <0x20>; +- interrupt-parent = <&gpio0>; +- interrupts = ; +- #clock-cells = <1>; +- pinctrl-names = "default"; +- pinctrl-0 = <&pmic_int>; +- rockchip,system-power-controller; +- vcc1-supply = <&vcc3v3_sys>; +- vcc2-supply = <&vcc3v3_sys>; +- vcc3-supply = <&vcc3v3_sys>; +- vcc4-supply = <&vcc3v3_sys>; +- vcc5-supply = <&vcc3v3_sys>; +- vcc6-supply = <&vcc3v3_sys>; +- vcc7-supply = <&vcc3v3_sys>; +- vcc8-supply = <&vcc3v3_sys>; +- vcc9-supply = <&vcc3v3_sys>; +- wakeup-source; +- +- regulators { +- vdd_logic: DCDC_REG1 { +- regulator-name = "vdd_logic"; +- regulator-always-on; +- regulator-boot-on; +- regulator-init-microvolt = <900000>; +- regulator-initial-mode = <0x2>; +- regulator-min-microvolt = <500000>; +- regulator-max-microvolt = <1350000>; +- regulator-ramp-delay = <6001>; +- +- regulator-state-mem { +- regulator-off-in-suspend; +- }; +- }; +- +- vdd_gpu: DCDC_REG2 { +- regulator-name = "vdd_gpu"; +- regulator-always-on; +- regulator-init-microvolt = <900000>; +- regulator-initial-mode = <0x2>; +- regulator-min-microvolt = <500000>; +- regulator-max-microvolt = <1350000>; +- regulator-ramp-delay = <6001>; +- +- regulator-state-mem { +- regulator-off-in-suspend; +- }; +- }; +- +- vcc_ddr: DCDC_REG3 { +- regulator-name = "vcc_ddr"; +- regulator-always-on; +- regulator-boot-on; +- regulator-initial-mode = <0x2>; +- +- regulator-state-mem { +- regulator-on-in-suspend; +- }; +- }; +- +- vdd_npu: DCDC_REG4 { +- regulator-name = "vdd_npu"; +- regulator-init-microvolt = <900000>; +- regulator-initial-mode = <0x2>; +- regulator-min-microvolt = <500000>; +- regulator-max-microvolt = <1350000>; +- regulator-ramp-delay = <6001>; +- +- regulator-state-mem { +- regulator-off-in-suspend; +- }; +- }; +- +- vcc_1v8: DCDC_REG5 { +- regulator-name = "vcc_1v8"; +- regulator-always-on; +- regulator-boot-on; +- regulator-min-microvolt = <1800000>; +- regulator-max-microvolt = <1800000>; +- +- regulator-state-mem { +- regulator-off-in-suspend; +- }; +- }; +- +- vdda0v9_image: LDO_REG1 { +- regulator-name = "vdda0v9_image"; +- regulator-min-microvolt = <950000>; +- regulator-max-microvolt = <950000>; +- +- regulator-state-mem { +- regulator-off-in-suspend; +- }; +- }; +- +- vdda_0v9: LDO_REG2 { +- regulator-name = "vdda_0v9"; +- regulator-always-on; +- regulator-boot-on; +- regulator-min-microvolt = <900000>; +- regulator-max-microvolt = <900000>; +- +- regulator-state-mem { +- regulator-off-in-suspend; +- }; +- }; +- +- vdda0v9_pmu: LDO_REG3 { +- regulator-name = "vdda0v9_pmu"; +- regulator-always-on; +- regulator-boot-on; +- regulator-min-microvolt = <900000>; +- regulator-max-microvolt = <900000>; +- +- regulator-state-mem { +- regulator-on-in-suspend; +- regulator-suspend-microvolt = <900000>; +- }; +- }; +- +- vccio_acodec: LDO_REG4 { +- regulator-name = "vccio_acodec"; +- regulator-always-on; +- regulator-min-microvolt = <3300000>; +- regulator-max-microvolt = <3300000>; +- +- regulator-state-mem { +- regulator-off-in-suspend; +- }; +- }; +- +- vccio_sd: LDO_REG5 { +- regulator-name = "vccio_sd"; +- regulator-min-microvolt = <1800000>; +- regulator-max-microvolt = <3300000>; +- +- regulator-state-mem { +- regulator-off-in-suspend; +- }; +- }; +- +- vcc3v3_pmu: LDO_REG6 { +- regulator-name = "vcc3v3_pmu"; +- regulator-always-on; +- regulator-boot-on; +- regulator-min-microvolt = <3300000>; +- regulator-max-microvolt = <3300000>; +- +- regulator-state-mem { +- regulator-on-in-suspend; +- regulator-suspend-microvolt = <3300000>; +- }; +- }; +- +- vcca_1v8: LDO_REG7 { +- regulator-name = "vcca_1v8"; +- regulator-always-on; +- regulator-boot-on; +- regulator-min-microvolt = <1800000>; +- regulator-max-microvolt = <1800000>; +- +- regulator-state-mem { +- regulator-off-in-suspend; +- }; +- }; +- +- vcca1v8_pmu: LDO_REG8 { +- regulator-name = "vcca1v8_pmu"; +- regulator-always-on; +- regulator-boot-on; +- regulator-min-microvolt = <1800000>; +- regulator-max-microvolt = <1800000>; +- +- regulator-state-mem { +- regulator-on-in-suspend; +- regulator-suspend-microvolt = <1800000>; +- }; +- }; +- +- vcca1v8_image: LDO_REG9 { +- regulator-name = "vcca1v8_image"; +- regulator-min-microvolt = <1800000>; +- regulator-max-microvolt = <1800000>; +- +- regulator-state-mem { +- regulator-off-in-suspend; +- }; +- }; +- +- vcc_3v3: SWITCH_REG1 { +- regulator-name = "vcc_3v3"; +- regulator-always-on; +- regulator-boot-on; +- +- regulator-state-mem { +- regulator-off-in-suspend; +- }; +- }; +- +- vcc3v3_sd: SWITCH_REG2 { +- regulator-name = "vcc3v3_sd"; +- regulator-always-on; +- regulator-boot-on; +- +- regulator-state-mem { +- regulator-off-in-suspend; +- }; +- }; +- }; +- +- }; +-}; +- +-&i2c5 { +- status = "okay"; +- +- hym8563: rtc@51 { +- compatible = "haoyu,hym8563"; +- reg = <0x51>; +- interrupt-parent = <&gpio0>; +- interrupts = ; +- #clock-cells = <0>; +- clock-output-names = "rtcic_32kout"; +- pinctrl-names = "default"; +- pinctrl-0 = <&hym8563_int>; +- wakeup-source; +- }; +-}; +- +-&i2s0_8ch { +- status = "okay"; +-}; +- +-&i2s1_8ch { +- rockchip,trcm-sync-tx-only; +- status = "okay"; +-}; +- + &mdio0 { + rgmii_phy0: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; +@@ -568,146 +136,5 @@ + rockchip,pins = <2 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; +- +- hym8563 { +- hym8563_int: hym8563-int { +- rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>; +- }; +- }; +- +- pmic { +- pmic_int: pmic-int { +- rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; +- }; +- }; +- +- usb { +- vcc5v0_usb_host_en: vcc5v0-usb-host-en { +- rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>; +- }; +- +- vcc5v0_usb_otg_en: vcc5v0-usb-otg-en { +- rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>; +- }; +- }; +-}; +- +-&pmu_io_domains { +- pmuio1-supply = <&vcc3v3_pmu>; +- pmuio2-supply = <&vcc3v3_pmu>; +- vccio1-supply = <&vccio_acodec>; +- vccio3-supply = <&vccio_sd>; +- vccio4-supply = <&vcc_1v8>; +- vccio5-supply = <&vcc_3v3>; +- vccio6-supply = <&vcc_1v8>; +- vccio7-supply = <&vcc_3v3>; +- status = "okay"; +-}; +- +-&saradc { +- vref-supply = <&vcca_1v8>; +- status = "okay"; +-}; +- +-&sdhci { +- bus-width = <8>; +- max-frequency = <200000000>; +- non-removable; +- pinctrl-names = "default"; +- pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd>; +- status = "okay"; +-}; +- +-&sdmmc0 { +- max-frequency = <150000000>; +- no-sdio; +- no-mmc; +- bus-width = <4>; +- cap-mmc-highspeed; +- cap-sd-highspeed; +- disable-wp; +- vmmc-supply = <&vcc3v3_sd>; +- vqmmc-supply = <&vccio_sd>; +- pinctrl-names = "default"; +- pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; +- status = "okay"; +-}; +- +-&tsadc { +- rockchip,hw-tshut-mode = <1>; +- rockchip,hw-tshut-polarity = <0>; +- status = "okay"; +-}; +- +-&uart2 { +- status = "okay"; +-}; +- +-&usb_host0_ehci { +- status = "okay"; +-}; +- +-&usb_host0_ohci { +- status = "okay"; +-}; +- +-&usb_host0_xhci { +- extcon = <&usb2phy0>; +- dr_mode = "host"; +- status = "okay"; +-}; +- +-&usb_host1_ehci { +- status = "okay"; +-}; +- +-&usb_host1_ohci { +- status = "okay"; + }; + +-&usb_host1_xhci { +- status = "okay"; +-}; +- +-&usb2phy0 { +- status = "okay"; +-}; +- +-&usb2phy0_host { +- phy-supply = <&vcc5v0_usb_host>; +- status = "okay"; +-}; +- +-&usb2phy0_otg { +- status = "okay"; +-}; +- +-&usb2phy1 { +- status = "okay"; +-}; +- +-&usb2phy1_host { +- phy-supply = <&vcc5v0_usb_otg>; +- status = "okay"; +-}; +- +-&usb2phy1_otg { +- status = "okay"; +-}; +- +-&vop { +- assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>; +- assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>; +- status = "okay"; +-}; +- +-&vop_mmu { +- status = "okay"; +-}; +- +-&vp0 { +- vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { +- reg = ; +- remote-endpoint = <&hdmi_in_vp0>; +- }; +-}; +--- /dev/null ++++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi +@@ -0,0 +1,596 @@ ++// 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 Tianling Shen ++ */ ++ ++/dts-v1/; ++#include ++#include ++#include ++#include ++#include ++#include "rk3568.dtsi" ++ ++/ { ++ aliases { ++ mmc0 = &sdmmc0; ++ mmc1 = &sdhci; ++ }; ++ ++ chosen: chosen { ++ stdout-path = "serial2:1500000n8"; ++ }; ++ ++ hdmi-con { ++ compatible = "hdmi-connector"; ++ type = "a"; ++ ++ port { ++ hdmi_con_in: endpoint { ++ remote-endpoint = <&hdmi_out_con>; ++ }; ++ }; ++ }; ++ ++ vdd_usbc: vdd-usbc-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vdd_usbc"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ }; ++ ++ vcc3v3_sys: vcc3v3-sys-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_sys"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&vdd_usbc>; ++ }; ++ ++ 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 = <&vdd_usbc>; ++ }; ++ ++ vcc3v3_pcie: vcc3v3-pcie-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_pcie"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ enable-active-high; ++ gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; ++ startup-delay-us = <200000>; ++ vin-supply = <&vcc5v0_sys>; ++ }; ++ ++ 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 = <&vdd_usbc>; ++ }; ++ ++ vcc5v0_usb_host: vcc5v0-usb-host-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v0_usb_host_en>; ++ regulator-name = "vcc5v0_usb_host"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&vcc5v0_usb>; ++ }; ++ ++ vcc5v0_usb_otg: vcc5v0-usb-otg-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v0_usb_otg_en>; ++ regulator-name = "vcc5v0_usb_otg"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&vcc5v0_usb>; ++ }; ++ ++ pcie30_avdd0v9: pcie30-avdd0v9-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "pcie30_avdd0v9"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ vin-supply = <&vcc3v3_sys>; ++ }; ++ ++ pcie30_avdd1v8: pcie30-avdd1v8-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "pcie30_avdd1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ vin-supply = <&vcc3v3_sys>; ++ }; ++}; ++ ++&combphy0 { ++ status = "okay"; ++}; ++ ++&combphy1 { ++ status = "okay"; ++}; ++ ++&combphy2 { ++ status = "okay"; ++}; ++ ++&cpu0 { ++ cpu-supply = <&vdd_cpu>; ++}; ++ ++&cpu1 { ++ cpu-supply = <&vdd_cpu>; ++}; ++ ++&cpu2 { ++ cpu-supply = <&vdd_cpu>; ++}; ++ ++&cpu3 { ++ cpu-supply = <&vdd_cpu>; ++}; ++ ++&gpu { ++ mali-supply = <&vdd_gpu>; ++ status = "okay"; ++}; ++ ++&hdmi { ++ avdd-0v9-supply = <&vdda0v9_image>; ++ avdd-1v8-supply = <&vcca1v8_image>; ++ status = "okay"; ++}; ++ ++&hdmi_in { ++ hdmi_in_vp0: endpoint { ++ remote-endpoint = <&vp0_out_hdmi>; ++ }; ++}; ++ ++&hdmi_out { ++ hdmi_out_con: endpoint { ++ remote-endpoint = <&hdmi_con_in>; ++ }; ++}; ++ ++&hdmi_sound { ++ status = "okay"; ++}; ++ ++&i2c0 { ++ status = "okay"; ++ ++ vdd_cpu: regulator@1c { ++ compatible = "tcs,tcs4525"; ++ reg = <0x1c>; ++ fcs,suspend-voltage-selector = <1>; ++ regulator-name = "vdd_cpu"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <800000>; ++ regulator-max-microvolt = <1150000>; ++ regulator-ramp-delay = <2300>; ++ vin-supply = <&vcc5v0_sys>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ rk809: pmic@20 { ++ compatible = "rockchip,rk809"; ++ reg = <0x20>; ++ interrupt-parent = <&gpio0>; ++ interrupts = ; ++ #clock-cells = <1>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pmic_int>; ++ rockchip,system-power-controller; ++ vcc1-supply = <&vcc3v3_sys>; ++ vcc2-supply = <&vcc3v3_sys>; ++ vcc3-supply = <&vcc3v3_sys>; ++ vcc4-supply = <&vcc3v3_sys>; ++ vcc5-supply = <&vcc3v3_sys>; ++ vcc6-supply = <&vcc3v3_sys>; ++ vcc7-supply = <&vcc3v3_sys>; ++ vcc8-supply = <&vcc3v3_sys>; ++ vcc9-supply = <&vcc3v3_sys>; ++ wakeup-source; ++ ++ regulators { ++ vdd_logic: DCDC_REG1 { ++ regulator-name = "vdd_logic"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-init-microvolt = <900000>; ++ regulator-initial-mode = <0x2>; ++ regulator-min-microvolt = <500000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_gpu: DCDC_REG2 { ++ regulator-name = "vdd_gpu"; ++ regulator-always-on; ++ regulator-init-microvolt = <900000>; ++ regulator-initial-mode = <0x2>; ++ regulator-min-microvolt = <500000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_ddr: DCDC_REG3 { ++ regulator-name = "vcc_ddr"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-initial-mode = <0x2>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vdd_npu: DCDC_REG4 { ++ regulator-name = "vdd_npu"; ++ regulator-init-microvolt = <900000>; ++ regulator-initial-mode = <0x2>; ++ regulator-min-microvolt = <500000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_1v8: DCDC_REG5 { ++ regulator-name = "vcc_1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdda0v9_image: LDO_REG1 { ++ regulator-name = "vdda0v9_image"; ++ regulator-min-microvolt = <950000>; ++ regulator-max-microvolt = <950000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdda_0v9: LDO_REG2 { ++ regulator-name = "vdda_0v9"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdda0v9_pmu: LDO_REG3 { ++ regulator-name = "vdda0v9_pmu"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <900000>; ++ }; ++ }; ++ ++ vccio_acodec: LDO_REG4 { ++ regulator-name = "vccio_acodec"; ++ regulator-always-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vccio_sd: LDO_REG5 { ++ regulator-name = "vccio_sd"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc3v3_pmu: LDO_REG6 { ++ regulator-name = "vcc3v3_pmu"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3300000>; ++ }; ++ }; ++ ++ vcca_1v8: LDO_REG7 { ++ regulator-name = "vcca_1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcca1v8_pmu: LDO_REG8 { ++ regulator-name = "vcca1v8_pmu"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ vcca1v8_image: LDO_REG9 { ++ regulator-name = "vcca1v8_image"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_3v3: SWITCH_REG1 { ++ regulator-name = "vcc_3v3"; ++ regulator-always-on; ++ regulator-boot-on; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc3v3_sd: SWITCH_REG2 { ++ regulator-name = "vcc3v3_sd"; ++ regulator-always-on; ++ regulator-boot-on; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ }; ++ ++ }; ++}; ++ ++&i2c5 { ++ status = "okay"; ++ ++ hym8563: rtc@51 { ++ compatible = "haoyu,hym8563"; ++ reg = <0x51>; ++ interrupt-parent = <&gpio0>; ++ interrupts = ; ++ #clock-cells = <0>; ++ clock-output-names = "rtcic_32kout"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hym8563_int>; ++ wakeup-source; ++ }; ++}; ++ ++&i2s0_8ch { ++ status = "okay"; ++}; ++ ++&i2s1_8ch { ++ rockchip,trcm-sync-tx-only; ++ status = "okay"; ++}; ++ ++&pcie30phy { ++ data-lanes = <1 2>; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ hym8563 { ++ hym8563_int: hym8563-int { ++ rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ pmic { ++ pmic_int: pmic-int { ++ rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ usb { ++ vcc5v0_usb_host_en: vcc5v0-usb-host-en { ++ rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ vcc5v0_usb_otg_en: vcc5v0-usb-otg-en { ++ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++}; ++ ++&pmu_io_domains { ++ pmuio1-supply = <&vcc3v3_pmu>; ++ pmuio2-supply = <&vcc3v3_pmu>; ++ vccio1-supply = <&vccio_acodec>; ++ vccio3-supply = <&vccio_sd>; ++ vccio4-supply = <&vcc_1v8>; ++ vccio5-supply = <&vcc_3v3>; ++ vccio6-supply = <&vcc_1v8>; ++ vccio7-supply = <&vcc_3v3>; ++ status = "okay"; ++}; ++ ++&saradc { ++ vref-supply = <&vcca_1v8>; ++ status = "okay"; ++}; ++ ++&sdhci { ++ bus-width = <8>; ++ max-frequency = <200000000>; ++ non-removable; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd>; ++ status = "okay"; ++}; ++ ++&sdmmc0 { ++ max-frequency = <150000000>; ++ no-sdio; ++ no-mmc; ++ bus-width = <4>; ++ cap-mmc-highspeed; ++ cap-sd-highspeed; ++ disable-wp; ++ vmmc-supply = <&vcc3v3_sd>; ++ vqmmc-supply = <&vccio_sd>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; ++ status = "okay"; ++}; ++ ++&tsadc { ++ rockchip,hw-tshut-mode = <1>; ++ rockchip,hw-tshut-polarity = <0>; ++ status = "okay"; ++}; ++ ++&uart2 { ++ status = "okay"; ++}; ++ ++&usb_host0_ehci { ++ status = "okay"; ++}; ++ ++&usb_host0_ohci { ++ status = "okay"; ++}; ++ ++&usb_host0_xhci { ++ extcon = <&usb2phy0>; ++ dr_mode = "host"; ++ status = "okay"; ++}; ++ ++&usb_host1_ehci { ++ status = "okay"; ++}; ++ ++&usb_host1_ohci { ++ status = "okay"; ++}; ++ ++&usb_host1_xhci { ++ status = "okay"; ++}; ++ ++&usb2phy0 { ++ status = "okay"; ++}; ++ ++&usb2phy0_host { ++ phy-supply = <&vcc5v0_usb_host>; ++ status = "okay"; ++}; ++ ++&usb2phy0_otg { ++ status = "okay"; ++}; ++ ++&usb2phy1 { ++ status = "okay"; ++}; ++ ++&usb2phy1_host { ++ phy-supply = <&vcc5v0_usb_otg>; ++ status = "okay"; ++}; ++ ++&usb2phy1_otg { ++ status = "okay"; ++}; ++ ++&vop { ++ assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>; ++ assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>; ++ status = "okay"; ++}; ++ ++&vop_mmu { ++ status = "okay"; ++}; ++ ++&vp0 { ++ vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { ++ reg = ; ++ remote-endpoint = <&hdmi_in_vp0>; ++ }; ++}; diff --git a/target/linux/rockchip/patches-6.1/011-v6.4-arm64-dts-rockchip-fix-gmac-support-for-NanoPi-R5S.patch b/target/linux/rockchip/patches-6.1/011-v6.4-arm64-dts-rockchip-fix-gmac-support-for-NanoPi-R5S.patch new file mode 100644 index 00000000000000..47f76d54e7a75b --- /dev/null +++ b/target/linux/rockchip/patches-6.1/011-v6.4-arm64-dts-rockchip-fix-gmac-support-for-NanoPi-R5S.patch @@ -0,0 +1,49 @@ +From 31425b1fadb2040b359e52ffc24c049a78d56c96 Mon Sep 17 00:00:00 2001 +From: Tianling Shen +Date: Sat, 18 Mar 2023 16:37:44 +0800 +Subject: [PATCH] arm64: dts: rockchip: fix gmac support for NanoPi R5S + +- Changed phy-mode to rgmii. + +- Fixed pull type in pinctrl for gmac0. + +- Removed duplicate properties in mdio node. + These properties are defined in the gmac0 node already. + +Signed-off-by: Tianling Shen +Link: https://lore.kernel.org/r/20230318083745.6181-5-cnsztl@gmail.com +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +--- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts +@@ -57,7 +57,7 @@ + assigned-clock-rates = <0>, <125000000>; + clock_in_out = "output"; + phy-handle = <&rgmii_phy0>; +- phy-mode = "rgmii-id"; ++ phy-mode = "rgmii"; + pinctrl-names = "default"; + pinctrl-0 = <&gmac0_miim + &gmac0_tx_bus2 +@@ -79,9 +79,6 @@ + reg = <1>; + pinctrl-0 = <ð_phy0_reset_pin>; + pinctrl-names = "default"; +- reset-assert-us = <10000>; +- reset-deassert-us = <50000>; +- reset-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_LOW>; + }; + }; + +@@ -115,7 +112,7 @@ + &pinctrl { + gmac0 { + eth_phy0_reset_pin: eth-phy0-reset-pin { +- rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_down>; ++ rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + diff --git a/target/linux/rockchip/patches-6.1/012-v6.4-arm64-dts-rockchip-remove-I2S1-TDM-node-for-the-NanoPi-R5.patch b/target/linux/rockchip/patches-6.1/012-v6.4-arm64-dts-rockchip-remove-I2S1-TDM-node-for-the-NanoPi-R5.patch new file mode 100644 index 00000000000000..48021b226adf05 --- /dev/null +++ b/target/linux/rockchip/patches-6.1/012-v6.4-arm64-dts-rockchip-remove-I2S1-TDM-node-for-the-NanoPi-R5.patch @@ -0,0 +1,39 @@ +From 975e9bbad11950fc8276f1fa260d8bf2c341aa41 Mon Sep 17 00:00:00 2001 +From: Tianling Shen +Date: Sat, 18 Mar 2023 16:37:45 +0800 +Subject: [PATCH] arm64: dts: rockchip: remove I2S1 TDM node for the NanoPi R5 + series + +This is for the audio output which does not exist on the boards. +Also disable regulator-always-on for vccio_acodec since it's only +used by the audio output. + +Signed-off-by: Tianling Shen +Link: https://lore.kernel.org/r/20230318083745.6181-6-cnsztl@gmail.com +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi | 6 ------ + 1 file changed, 6 deletions(-) + +--- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi +@@ -330,7 +330,6 @@ + + vccio_acodec: LDO_REG4 { + regulator-name = "vccio_acodec"; +- regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + +@@ -441,11 +440,6 @@ + status = "okay"; + }; + +-&i2s1_8ch { +- rockchip,trcm-sync-tx-only; +- status = "okay"; +-}; +- + &pcie30phy { + data-lanes = <1 2>; + status = "okay"; diff --git a/target/linux/rockchip/patches-6.1/013-v6.4-arm64-dts-rockchip-Add-FriendlyARM-NanoPi-R5C.patch b/target/linux/rockchip/patches-6.1/013-v6.4-arm64-dts-rockchip-Add-FriendlyARM-NanoPi-R5C.patch new file mode 100644 index 00000000000000..0465d80cbabacc --- /dev/null +++ b/target/linux/rockchip/patches-6.1/013-v6.4-arm64-dts-rockchip-Add-FriendlyARM-NanoPi-R5C.patch @@ -0,0 +1,152 @@ +From 05620031408ac6cfc6d5c048431827e49aa0ade1 Mon Sep 17 00:00:00 2001 +From: Tianling Shen +Date: Sat, 18 Mar 2023 16:37:43 +0800 +Subject: [PATCH] arm64: dts: rockchip: Add FriendlyARM NanoPi R5C + +FriendlyARM NanoPi R5C is an open-sourced mini IoT gateway device. + +Specification: +- Rockchip RK3568 +- 1/4GB LPDDR4X RAM +- 8/32GB eMMC +- SD card slot +- M.2 Connector +- 2x USB 3.0 Port +- 2x 2500 Base-T (PCIe, r8125) +- HDMI 2.0 +- MIPI DSI/CSI +- USB Type C 5V + +Signed-off-by: Tianling Shen +Link: https://lore.kernel.org/r/20230318083745.6181-4-cnsztl@gmail.com +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/Makefile | 1 + + .../boot/dts/rockchip/rk3568-nanopi-r5c.dts | 112 ++++++++++++++++++ + 2 files changed, 113 insertions(+) + create mode 100644 arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5c.dts + +--- a/arch/arm64/boot/dts/rockchip/Makefile ++++ b/arch/arm64/boot/dts/rockchip/Makefile +@@ -74,5 +74,6 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-ro + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-soquartz-cm4.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bpi-r2-pro.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb1-v10.dtb ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-nanopi-r5c.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-nanopi-r5s.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-rock-3a.dtb +--- /dev/null ++++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5c.dts +@@ -0,0 +1,112 @@ ++// 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 Tianling Shen ++ */ ++ ++/dts-v1/; ++#include "rk3568-nanopi-r5s.dtsi" ++ ++/ { ++ model = "FriendlyElec NanoPi R5C"; ++ compatible = "friendlyarm,nanopi-r5c", "rockchip,rk3568"; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&reset_button_pin>; ++ ++ button-reset { ++ debounce-interval = <50>; ++ gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_LOW>; ++ label = "reset"; ++ linux,code = ; ++ }; ++ }; ++ ++ gpio-leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&lan_led_pin>, <&power_led_pin>, <&wan_led_pin>, <&wlan_led_pin>; ++ ++ led-lan { ++ color = ; ++ function = LED_FUNCTION_LAN; ++ gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ power_led: led-power { ++ color = ; ++ function = LED_FUNCTION_POWER; ++ linux,default-trigger = "heartbeat"; ++ gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led-wan { ++ color = ; ++ function = LED_FUNCTION_WAN; ++ gpios = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led-wlan { ++ color = ; ++ function = LED_FUNCTION_WLAN; ++ gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++}; ++ ++&pcie2x1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pcie20_reset_pin>; ++ reset-gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++}; ++ ++&pcie3x1 { ++ num-lanes = <1>; ++ reset-gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; ++ vpcie3v3-supply = <&vcc3v3_pcie>; ++ status = "okay"; ++}; ++ ++&pcie3x2 { ++ num-lanes = <1>; ++ reset-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>; ++ vpcie3v3-supply = <&vcc3v3_pcie>; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ gpio-leds { ++ lan_led_pin: lan-led-pin { ++ rockchip,pins = <3 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ power_led_pin: power-led-pin { ++ rockchip,pins = <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ wan_led_pin: wan-led-pin { ++ rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ wlan_led_pin: wlan-led-pin { ++ rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ pcie { ++ pcie20_reset_pin: pcie20-reset-pin { ++ rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ rockchip-key { ++ reset_button_pin: reset-button-pin { ++ rockchip,pins = <4 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++}; diff --git a/target/linux/rockchip/patches-6.1/014-v6.4-arm64-dts-rockchip-fix-button-reset-pin-for-nanopi-r5c.patch b/target/linux/rockchip/patches-6.1/014-v6.4-arm64-dts-rockchip-fix-button-reset-pin-for-nanopi-r5c.patch new file mode 100644 index 00000000000000..0e59f0275be61e --- /dev/null +++ b/target/linux/rockchip/patches-6.1/014-v6.4-arm64-dts-rockchip-fix-button-reset-pin-for-nanopi-r5c.patch @@ -0,0 +1,37 @@ +From 5325593377f07de31f7e473a9677a28a04c891f3 Mon Sep 17 00:00:00 2001 +From: Tianling Shen +Date: Thu, 11 May 2023 00:18:50 +0800 +Subject: [PATCH] arm64: dts: rockchip: fix button reset pin for nanopi r5c + +The reset pin was wrongly assigned due to a copy/paste error, +fix it to match actual gpio pin. + +While at it, remove a blank line from nanopi r5s dts. + +Fixes: 05620031408a ("arm64: dts: rockchip: Add FriendlyARM NanoPi R5C") +Signed-off-by: Tianling Shen +Link: https://lore.kernel.org/r/20230510161850.4866-1-cnsztl@gmail.com +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5c.dts | 2 +- + arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +--- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5c.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5c.dts +@@ -106,7 +106,7 @@ + + rockchip-key { + reset_button_pin: reset-button-pin { +- rockchip,pins = <4 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>; ++ rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + }; +--- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts +@@ -134,4 +134,3 @@ + }; + }; + }; +- diff --git a/target/linux/rockchip/patches-6.1/110-arm64-dts-rockchip-Update-LED-properties-for-NanoPi-.patch b/target/linux/rockchip/patches-6.1/110-arm64-dts-rockchip-Update-LED-properties-for-NanoPi-.patch new file mode 100644 index 00000000000000..64dc433a30ae13 --- /dev/null +++ b/target/linux/rockchip/patches-6.1/110-arm64-dts-rockchip-Update-LED-properties-for-NanoPi-.patch @@ -0,0 +1,97 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tianling Shen +Date: Tue Jun 20 16:45:27 2023 +0800 +Subject: [PATCH] arm64: dts: rockchip: Update LED properties for NanoPi R5 + series + +Add OpenWrt's LED aliases for showing system status. +Also replace function/color with legacy label as OpenWrt relys on it +to update LED settings. + +Signed-off-by: Tianling Shen +--- + +--- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5c.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5c.dts +@@ -32,27 +32,22 @@ + pinctrl-0 = <&lan_led_pin>, <&power_led_pin>, <&wan_led_pin>, <&wlan_led_pin>; + + led-lan { +- color = ; +- function = LED_FUNCTION_LAN; ++ label = "green:lan"; + gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_HIGH>; + }; + + power_led: led-power { +- color = ; +- function = LED_FUNCTION_POWER; +- linux,default-trigger = "heartbeat"; ++ label = "red:power"; + gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_HIGH>; + }; + + led-wan { +- color = ; +- function = LED_FUNCTION_WAN; ++ label = "green:wan"; + gpios = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>; + }; + + led-wlan { +- color = ; +- function = LED_FUNCTION_WLAN; ++ label = "green:wlan"; + gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>; + }; + }; +--- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts +@@ -23,29 +23,22 @@ + pinctrl-0 = <&lan1_led_pin>, <&lan2_led_pin>, <&power_led_pin>, <&wan_led_pin>; + + led-lan1 { +- color = ; +- function = LED_FUNCTION_LAN; +- function-enumerator = <1>; ++ label = "green:lan1"; + gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_HIGH>; + }; + + led-lan2 { +- color = ; +- function = LED_FUNCTION_LAN; +- function-enumerator = <2>; ++ label = "green:lan2"; + gpios = <&gpio3 RK_PD7 GPIO_ACTIVE_HIGH>; + }; + + power_led: led-power { +- color = ; +- function = LED_FUNCTION_POWER; +- linux,default-trigger = "heartbeat"; ++ label = "red:power"; + gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; + }; + + led-wan { +- color = ; +- function = LED_FUNCTION_WAN; ++ label = "green:wan"; + gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>; + }; + }; +--- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi +@@ -18,6 +18,11 @@ + aliases { + mmc0 = &sdmmc0; + mmc1 = &sdhci; ++ ++ led-boot = &power_led; ++ led-failsafe = &power_led; ++ led-running = &power_led; ++ led-upgrade = &power_led; + }; + + chosen: chosen { diff --git a/target/linux/sifiveu/Makefile b/target/linux/sifiveu/Makefile index 43f70b5ce0dfa7..52989a9dae3bed 100644 --- a/target/linux/sifiveu/Makefile +++ b/target/linux/sifiveu/Makefile @@ -11,8 +11,7 @@ FEATURES:=ext4 KERNELNAME:=Image dtbs SUBTARGETS:=generic -KERNEL_PATCHVER:=5.15 -KERNEL_TESTING_PATCHVER:=6.1 +KERNEL_PATCHVER:=6.1 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/sifiveu/config-5.15 b/target/linux/sifiveu/config-5.15 deleted file mode 100644 index de3fe5b46f7563..00000000000000 --- a/target/linux/sifiveu/config-5.15 +++ /dev/null @@ -1,362 +0,0 @@ -CONFIG_64BIT=y -CONFIG_ARCH_CLOCKSOURCE_INIT=y -CONFIG_ARCH_DMA_ADDR_T_64BIT=y -CONFIG_ARCH_MMAP_RND_BITS=18 -CONFIG_ARCH_MMAP_RND_BITS_MAX=24 -CONFIG_ARCH_MMAP_RND_BITS_MIN=18 -CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y -CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y -# CONFIG_ARCH_RV32I is not set -CONFIG_ARCH_RV64I=y -CONFIG_ARCH_SELECT_MEMORY_MODEL=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_ARCH_STACKWALK=y -CONFIG_ASSOCIATIVE_ARRAY=y -CONFIG_ATA=y -CONFIG_ATA_VERBOSE_ERROR=y -CONFIG_BLK_DEV_SD=y -CONFIG_BLK_MQ_PCI=y -CONFIG_BLK_MQ_VIRTIO=y -CONFIG_CAVIUM_PTP=y -CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y -CONFIG_CLK_ANALOGBITS_WRPLL_CLN28HPC=y -CONFIG_CLK_SIFIVE=y -CONFIG_CLK_SIFIVE_PRCI=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_CLZ_TAB=y -CONFIG_CMODEL_MEDANY=y -# CONFIG_CMODEL_MEDLOW is not set -CONFIG_COMMON_CLK=y -# CONFIG_COMPAT_32BIT_TIME is not set -CONFIG_COMPAT_BRK=y -CONFIG_CONSOLE_TRANSLATIONS=y -CONFIG_COREDUMP=y -CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y -CONFIG_CPU_ISOLATION=y -CONFIG_CPU_RMAP=y -CONFIG_CRC16=y -# CONFIG_CRC32_SARWATE is not set -CONFIG_CRC32_SLICEBY8=y -CONFIG_CRC7=y -CONFIG_CRC_ITU_T=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_DRBG=y -CONFIG_CRYPTO_DRBG_HMAC=y -CONFIG_CRYPTO_DRBG_MENU=y -CONFIG_CRYPTO_ECHAINIV=y -CONFIG_CRYPTO_HASH_INFO=y -CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_JITTERENTROPY=y -CONFIG_CRYPTO_LIB_POLY1305_RSIZE=1 -CONFIG_CRYPTO_LIB_SHA256=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_RNG_DEFAULT=y -CONFIG_CRYPTO_RSA=y -CONFIG_CRYPTO_SHA256=y -CONFIG_CRYPTO_SHA512=y -CONFIG_DEBUG_BUGVERBOSE=y -CONFIG_DECOMPRESS_GZIP=y -CONFIG_DEVTMPFS=y -CONFIG_DEVTMPFS_MOUNT=y -CONFIG_DNOTIFY=y -CONFIG_DTC=y -CONFIG_DUMMY_CONSOLE=y -CONFIG_EDAC=y -# CONFIG_EDAC_DEBUG is not set -CONFIG_EDAC_LEGACY_SYSFS=y -CONFIG_EDAC_SIFIVE=y -CONFIG_EDAC_SUPPORT=y -CONFIG_EFI=y -CONFIG_EFIVAR_FS=m -# CONFIG_EFI_BOOTLOADER_CONTROL is not set -# CONFIG_EFI_CAPSULE_LOADER is not set -# CONFIG_EFI_DISABLE_PCI_DMA is not set -CONFIG_EFI_EARLYCON=y -CONFIG_EFI_ESRT=y -CONFIG_EFI_GENERIC_STUB=y -CONFIG_EFI_PARAMS_FROM_FDT=y -CONFIG_EFI_RUNTIME_WRAPPERS=y -CONFIG_EFI_STUB=y -# CONFIG_EFI_TEST is not set -CONFIG_ELF_CORE=y -CONFIG_ERRATA_SIFIVE=y -CONFIG_ERRATA_SIFIVE_CIP_1200=y -CONFIG_ERRATA_SIFIVE_CIP_453=y -CONFIG_EXT4_FS=y -CONFIG_FAILOVER=y -CONFIG_FHANDLE=y -CONFIG_FIXED_PHY=y -CONFIG_FIX_EARLYCON_MEM=y -CONFIG_FONT_8x16=y -CONFIG_FONT_AUTOSELECT=y -CONFIG_FONT_SUPPORT=y -CONFIG_FPU=y -CONFIG_FRAME_POINTER=y -CONFIG_FS_IOMAP=y -CONFIG_FS_MBCACHE=y -CONFIG_FWNODE_MDIO=y -CONFIG_FW_LOADER_PAGED_BUF=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_GENERIC_ARCH_TOPOLOGY=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y -CONFIG_GENERIC_CSUM=y -CONFIG_GENERIC_EARLY_IOREMAP=y -CONFIG_GENERIC_GETTIMEOFDAY=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_GENERIC_IOREMAP=y -CONFIG_GENERIC_IRQ_INJECTION=y -CONFIG_GENERIC_IRQ_MULTI_HANDLER=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y -CONFIG_GENERIC_MSI_IRQ=y -CONFIG_GENERIC_MSI_IRQ_DOMAIN=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GLOB=y -CONFIG_GPIOLIB=y -CONFIG_GPIOLIB_IRQCHIP=y -CONFIG_GPIO_CDEV=y -CONFIG_GPIO_CDEV_V1=y -CONFIG_GPIO_GENERIC=y -CONFIG_GPIO_SIFIVE=y -CONFIG_HANDLE_DOMAIN_IRQ=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT_MAP=y -CONFIG_HID=y -CONFIG_HID_GENERIC=y -CONFIG_HOTPLUG_PCI=y -# CONFIG_HOTPLUG_PCI_CPCI is not set -CONFIG_HOTPLUG_PCI_PCIE=y -CONFIG_HOTPLUG_PCI_SHPC=y -CONFIG_HVC_DRIVER=y -CONFIG_HVC_RISCV_SBI=y -CONFIG_HW_CONSOLE=y -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_COMPAT=y -CONFIG_I2C_HELPER_AUTO=y -CONFIG_I2C_OCORES=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_INPUT=y -# CONFIG_IOMMU_DEBUGFS is not set -CONFIG_IOMMU_SUPPORT=y -CONFIG_IO_URING=y -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_IRQ_WORK=y -CONFIG_JBD2=y -CONFIG_KALLSYMS=y -CONFIG_KEYS=y -CONFIG_LEDS_PWM=y -CONFIG_LEDS_TRIGGER_DISK=y -CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=256 -CONFIG_LIBFDT=y -CONFIG_LOCALVERSION_AUTO=y -CONFIG_LOCK_DEBUGGING_SUPPORT=y -CONFIG_LOCK_SPIN_ON_OWNER=y -CONFIG_MACB=y -# CONFIG_MACB_PCI is not set -CONFIG_MACB_USE_HWSTAMP=y -CONFIG_MDIO_BUS=y -CONFIG_MDIO_DEVICE=y -CONFIG_MDIO_DEVRES=y -CONFIG_MEMFD_CREATE=y -CONFIG_MFD_CORE=y -CONFIG_MFD_SYSCON=y -CONFIG_MICROSEMI_PHY=y -CONFIG_MIGRATION=y -CONFIG_MMC=y -CONFIG_MMC_BLOCK=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_CADENCE=y -# CONFIG_MMC_SDHCI_PCI is not set -CONFIG_MMC_SDHCI_PLTFM=y -CONFIG_MMC_SPI=y -CONFIG_MMIOWB=y -CONFIG_MODULES_USE_ELF_RELA=y -CONFIG_MODULE_SECTIONS=y -CONFIG_MPILIB=y -CONFIG_MQ_IOSCHED_DEADLINE=y -CONFIG_MQ_IOSCHED_KYBER=y -CONFIG_MTD_SPI_NOR=y -CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y -CONFIG_MUTEX_SPIN_ON_OWNER=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_NET_FAILOVER=y -CONFIG_NET_FLOW_LIMIT=y -CONFIG_NET_PTP_CLASSIFY=y -CONFIG_NET_SELFTESTS=y -CONFIG_NLS=y -CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_ISO8859_1=y -CONFIG_NR_CPUS=8 -CONFIG_NVMEM=y -CONFIG_NVMEM_SYSFS=y -CONFIG_OF=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_FLATTREE=y -CONFIG_OF_GPIO=y -CONFIG_OF_IRQ=y -CONFIG_OF_KOBJ=y -CONFIG_OF_MDIO=y -CONFIG_OID_REGISTRY=y -CONFIG_PADATA=y -CONFIG_PAGE_OFFSET=0xffffffe000000000 -CONFIG_PAGE_REPORTING=y -CONFIG_PA_BITS=56 -CONFIG_PCI=y -CONFIG_PCIEAER=y -CONFIG_PCIEAER_INJECT=m -CONFIG_PCIEASPM=y -CONFIG_PCIEASPM_DEFAULT=y -# CONFIG_PCIEASPM_PERFORMANCE is not set -# CONFIG_PCIEASPM_POWERSAVE is not set -# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set -CONFIG_PCIEPORTBUS=y -CONFIG_PCIE_DPC=y -CONFIG_PCIE_DW=y -CONFIG_PCIE_DW_HOST=y -CONFIG_PCIE_ECRC=y -CONFIG_PCIE_FU740=y -CONFIG_PCIE_PTM=y -CONFIG_PCIE_XILINX=y -CONFIG_PCI_DEBUG=y -CONFIG_PCI_DOMAINS=y -CONFIG_PCI_DOMAINS_GENERIC=y -CONFIG_PCI_ECAM=y -CONFIG_PCI_HOST_COMMON=y -CONFIG_PCI_HOST_GENERIC=y -CONFIG_PCI_MSI=y -CONFIG_PCI_MSI_IRQ_DOMAIN=y -CONFIG_PCI_SW_SWITCHTEC=y -CONFIG_PGTABLE_LEVELS=3 -CONFIG_PHYLIB=y -CONFIG_PHYLINK=y -CONFIG_PHYS_ADDR_T_64BIT=y -# CONFIG_PHYS_RAM_BASE_FIXED is not set -CONFIG_POWER_RESET=y -CONFIG_POWER_RESET_GPIO=y -CONFIG_POWER_RESET_GPIO_RESTART=y -CONFIG_POWER_RESET_RESTART=y -CONFIG_POWER_RESET_SYSCON=y -CONFIG_POWER_RESET_SYSCON_POWEROFF=y -CONFIG_PPS=y -CONFIG_PRINTK_TIME=y -CONFIG_PTP_1588_CLOCK=y -CONFIG_PTP_1588_CLOCK_OPTIONAL=y -CONFIG_PWM=y -CONFIG_PWM_SIFIVE=y -CONFIG_PWM_SYSFS=y -CONFIG_RATIONAL=y -CONFIG_RCU_TRACE=y -CONFIG_RD_GZIP=y -CONFIG_REALTEK_PHY=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_IRQ=y -CONFIG_REGMAP_MMIO=y -# CONFIG_RESET_ATTACK_MITIGATION is not set -CONFIG_RESET_CONTROLLER=y -CONFIG_RESET_SIMPLE=y -CONFIG_RFS_ACCEL=y -CONFIG_RISCV=y -CONFIG_RISCV_ERRATA_ALTERNATIVE=y -CONFIG_RISCV_INTC=y -CONFIG_RISCV_ISA_C=y -CONFIG_RISCV_SBI=y -CONFIG_RISCV_SBI_V01=y -CONFIG_RISCV_TIMER=y -CONFIG_RPS=y -CONFIG_RTC_CLASS=y -# CONFIG_RTC_DRV_EFI is not set -CONFIG_RTC_I2C_AND_SPI=y -CONFIG_RWSEM_SPIN_ON_OWNER=y -CONFIG_SCHED_DEBUG=y -CONFIG_SCSI=y -CONFIG_SCSI_COMMON=y -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y -CONFIG_SERIAL_8250_EXAR=y -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_PCI=y -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -CONFIG_SERIAL_EARLYCON_RISCV_SBI=y -CONFIG_SERIAL_MCTRL_GPIO=y -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_SERIAL_SIFIVE=y -CONFIG_SERIAL_SIFIVE_CONSOLE=y -CONFIG_SERIO=y -CONFIG_SERIO_SERPORT=y -CONFIG_SG_POOL=y -CONFIG_SIFIVE_L2=y -CONFIG_SIFIVE_PLIC=y -CONFIG_SLUB_DEBUG=y -CONFIG_SMP=y -CONFIG_SOCK_RX_QUEUE_MAPPING=y -# CONFIG_SOC_MICROCHIP_POLARFIRE is not set -CONFIG_SOC_SIFIVE=y -# CONFIG_SOC_VIRT is not set -CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y -CONFIG_SPARSE_IRQ=y -CONFIG_SPI=y -CONFIG_SPI_BITBANG=y -CONFIG_SPI_MASTER=y -CONFIG_SPI_MEM=y -CONFIG_SPI_SIFIVE=y -CONFIG_SRCU=y -CONFIG_STACKTRACE=y -CONFIG_SWIOTLB=y -CONFIG_SWPHY=y -CONFIG_SYSCTL_EXCEPTION_TRACE=y -CONFIG_SYSFB=y -# CONFIG_SYSFB_SIMPLEFB is not set -CONFIG_THREAD_INFO_IN_TASK=y -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TIMER_OF=y -CONFIG_TIMER_PROBE=y -CONFIG_TRACE_CLOCK=y -CONFIG_TREE_RCU=y -CONFIG_TREE_SRCU=y -CONFIG_TUNE_GENERIC=y -CONFIG_UCS2_STRING=y -CONFIG_UEVENT_HELPER_PATH="" -CONFIG_USB=y -CONFIG_USB_COMMON=y -CONFIG_USB_EHCI_HCD=y -# CONFIG_USB_EHCI_HCD_PLATFORM is not set -CONFIG_USB_EHCI_PCI=y -CONFIG_USB_HID=y -CONFIG_USB_NET_DRIVERS=y -CONFIG_USB_PCI=y -CONFIG_USB_STORAGE=y -CONFIG_USB_SUPPORT=y -# CONFIG_USB_UHCI_HCD is not set -CONFIG_USB_XHCI_HCD=y -CONFIG_USB_XHCI_PCI=y -# CONFIG_USB_XHCI_PLATFORM is not set -CONFIG_VA_BITS=39 -CONFIG_VFAT_FS=y -CONFIG_VGA_ARB=y -CONFIG_VGA_ARB_MAX_GPUS=16 -CONFIG_VMAP_STACK=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_VT=y -CONFIG_VT_CONSOLE=y -# CONFIG_VT_HW_CONSOLE_BINDING is not set -CONFIG_WATCHDOG_CORE=y -CONFIG_XPS=y -CONFIG_ZLIB_INFLATE=y -CONFIG_ZONE_DMA32=y diff --git a/target/linux/sifiveu/config-6.1 b/target/linux/sifiveu/config-6.1 index 7d865bf4c0fe5b..98283f4e0d8233 100644 --- a/target/linux/sifiveu/config-6.1 +++ b/target/linux/sifiveu/config-6.1 @@ -12,6 +12,7 @@ CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_ARCH_STACKWALK=y CONFIG_ARCH_WANTS_THP_SWAP=y +CONFIG_ASN1=y CONFIG_ASSOCIATIVE_ARRAY=y CONFIG_ATA=y CONFIG_ATA_VERBOSE_ERROR=y @@ -19,6 +20,8 @@ CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_CAVIUM_PTP=y CONFIG_CC_HAVE_STACKPROTECTOR_TLS=y +CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" +CONFIG_CC_NO_ARRAY_BOUNDS=y CONFIG_CLK_ANALOGBITS_WRPLL_CLN28HPC=y CONFIG_CLK_SIFIVE=y CONFIG_CLK_SIFIVE_PRCI=y @@ -31,6 +34,8 @@ CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 # CONFIG_COMPAT_32BIT_TIME is not set CONFIG_COMPAT_BRK=y CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_CONTEXT_TRACKING=y +CONFIG_CONTEXT_TRACKING_IDLE=y CONFIG_COREDUMP=y CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y CONFIG_CPU_ISOLATION=y @@ -47,8 +52,11 @@ CONFIG_CRYPTO_DRBG_MENU=y CONFIG_CRYPTO_ECHAINIV=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_JITTERENTROPY=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y CONFIG_CRYPTO_LIB_POLY1305_RSIZE=1 +CONFIG_CRYPTO_LIB_SHA1=y CONFIG_CRYPTO_LIB_SHA256=y +CONFIG_CRYPTO_LIB_UTILS=y CONFIG_CRYPTO_RNG=y CONFIG_CRYPTO_RNG2=y CONFIG_CRYPTO_RNG_DEFAULT=y @@ -56,9 +64,11 @@ CONFIG_CRYPTO_RSA=y CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_INFO=y CONFIG_DECOMPRESS_GZIP=y CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y +CONFIG_DMA_DIRECT_REMAP=y CONFIG_DNOTIFY=y CONFIG_DTC=y CONFIG_DUMMY_CONSOLE=y @@ -268,12 +278,16 @@ CONFIG_POWER_RESET_RESTART=y CONFIG_POWER_RESET_SYSCON=y CONFIG_POWER_RESET_SYSCON_POWEROFF=y CONFIG_PPS=y +CONFIG_PREEMPT_NONE_BUILD=y CONFIG_PRINTK_TIME=y CONFIG_PTP_1588_CLOCK=y CONFIG_PTP_1588_CLOCK_OPTIONAL=y CONFIG_PWM=y CONFIG_PWM_SIFIVE=y CONFIG_PWM_SYSFS=y +CONFIG_QUEUED_RWLOCKS=y +CONFIG_RANDSTRUCT_NONE=y +CONFIG_RAS=y CONFIG_RATIONAL=y CONFIG_RCU_TRACE=y CONFIG_RD_GZIP=y @@ -283,6 +297,7 @@ CONFIG_REGMAP_MMIO=y # CONFIG_RESET_ATTACK_MITIGATION is not set CONFIG_RESET_CONTROLLER=y CONFIG_RESET_SIMPLE=y +CONFIG_RFS_ACCEL=y CONFIG_RISCV=y CONFIG_RISCV_ALTERNATIVE=y # CONFIG_RISCV_BOOT_SPINWAIT is not set @@ -294,6 +309,7 @@ CONFIG_RISCV_ISA_ZICBOM=y CONFIG_RISCV_SBI=y CONFIG_RISCV_SBI_V01=y CONFIG_RISCV_TIMER=y +CONFIG_RPS=y CONFIG_RTC_CLASS=y # CONFIG_RTC_DRV_EFI is not set CONFIG_RTC_I2C_AND_SPI=y @@ -316,7 +332,6 @@ CONFIG_SERIO_SERPORT=y CONFIG_SG_POOL=y CONFIG_SIFIVE_CCACHE=y CONFIG_SIFIVE_PLIC=y -CONFIG_SLUB_DEBUG=y CONFIG_SMP=y CONFIG_SOCK_RX_QUEUE_MAPPING=y # CONFIG_SOC_MICROCHIP_POLARFIRE is not set diff --git a/target/linux/sifiveu/patches-5.15/0001-riscv-sifive-fu740-cpu-1-2-3-4-set-compatible-to-sif.patch b/target/linux/sifiveu/patches-5.15/0001-riscv-sifive-fu740-cpu-1-2-3-4-set-compatible-to-sif.patch deleted file mode 100644 index 9a1c96813907bf..00000000000000 --- a/target/linux/sifiveu/patches-5.15/0001-riscv-sifive-fu740-cpu-1-2-3-4-set-compatible-to-sif.patch +++ /dev/null @@ -1,49 +0,0 @@ -From ab5c8f5492cce16ff2104393e2f1fa64a3ff6e88 Mon Sep 17 00:00:00 2001 -From: David Abdurachmanov -Date: Wed, 17 Feb 2021 06:06:14 -0800 -Subject: [PATCH 1/7] riscv: sifive: fu740: cpu{1,2,3,4} set compatible to - sifive,u74-mc - -Signed-off-by: David Abdurachmanov ---- - arch/riscv/boot/dts/sifive/fu740-c000.dtsi | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - ---- a/arch/riscv/boot/dts/sifive/fu740-c000.dtsi -+++ b/arch/riscv/boot/dts/sifive/fu740-c000.dtsi -@@ -39,7 +39,7 @@ - }; - }; - cpu1: cpu@1 { -- compatible = "sifive,bullet0", "riscv"; -+ compatible = "sifive,u74-mc", "sifive,bullet0", "riscv"; - d-cache-block-size = <64>; - d-cache-sets = <64>; - d-cache-size = <32768>; -@@ -63,7 +63,7 @@ - }; - }; - cpu2: cpu@2 { -- compatible = "sifive,bullet0", "riscv"; -+ compatible = "sifive,u74-mc", "sifive,bullet0", "riscv"; - d-cache-block-size = <64>; - d-cache-sets = <64>; - d-cache-size = <32768>; -@@ -87,7 +87,7 @@ - }; - }; - cpu3: cpu@3 { -- compatible = "sifive,bullet0", "riscv"; -+ compatible = "sifive,u74-mc", "sifive,bullet0", "riscv"; - d-cache-block-size = <64>; - d-cache-sets = <64>; - d-cache-size = <32768>; -@@ -111,7 +111,7 @@ - }; - }; - cpu4: cpu@4 { -- compatible = "sifive,bullet0", "riscv"; -+ compatible = "sifive,u74-mc", "sifive,bullet0", "riscv"; - d-cache-block-size = <64>; - d-cache-sets = <64>; - d-cache-size = <32768>; diff --git a/target/linux/sifiveu/patches-5.15/0002-riscv-sifive-unmatched-update-regulators-values.patch b/target/linux/sifiveu/patches-5.15/0002-riscv-sifive-unmatched-update-regulators-values.patch deleted file mode 100644 index ac316e9d9b97d7..00000000000000 --- a/target/linux/sifiveu/patches-5.15/0002-riscv-sifive-unmatched-update-regulators-values.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 657819ff477dd73cd71075609698aa57ba098d8c Mon Sep 17 00:00:00 2001 -From: David Abdurachmanov -Date: Wed, 15 Sep 2021 07:10:02 -0700 -Subject: [PATCH 2/7] riscv: sifive: unmatched: update regulators values - -These are the regulators values from the schematics for Rev3{A,B} boards. - -Note this is not fully correct as bcore1/bcore2 and bmem/bio are merged, but -it's only supported in v5.15 kernel. See: - -541ee8f640327f951e7039278057827322231ab0 ("regulator: da9063: Add support for -full-current mode.") - -This will be changed for v5.15 kernel based on the patch above. - -Signed-off-by: David Abdurachmanov ---- - .../riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 32 +++++++++++----------- - 1 file changed, 16 insertions(+), 16 deletions(-) - ---- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts -+++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts -@@ -73,16 +73,16 @@ - - regulators { - vdd_bcore1: bcore1 { -- regulator-min-microvolt = <900000>; -- regulator-max-microvolt = <900000>; -+ regulator-min-microvolt = <1050000>; -+ regulator-max-microvolt = <1050000>; - regulator-min-microamp = <5000000>; - regulator-max-microamp = <5000000>; - regulator-always-on; - }; - - vdd_bcore2: bcore2 { -- regulator-min-microvolt = <900000>; -- regulator-max-microvolt = <900000>; -+ regulator-min-microvolt = <1050000>; -+ regulator-max-microvolt = <1050000>; - regulator-min-microamp = <5000000>; - regulator-max-microamp = <5000000>; - regulator-always-on; -@@ -137,48 +137,48 @@ - }; - - vdd_ldo3: ldo3 { -- regulator-min-microvolt = <1800000>; -- regulator-max-microvolt = <1800000>; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; - regulator-min-microamp = <200000>; - regulator-max-microamp = <200000>; - regulator-always-on; - }; - - vdd_ldo4: ldo4 { -- regulator-min-microvolt = <1800000>; -- regulator-max-microvolt = <1800000>; -+ regulator-min-microvolt = <2500000>; -+ regulator-max-microvolt = <2500000>; - regulator-min-microamp = <200000>; - regulator-max-microamp = <200000>; - regulator-always-on; - }; - - vdd_ldo5: ldo5 { -- regulator-min-microvolt = <1800000>; -- regulator-max-microvolt = <1800000>; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; - regulator-min-microamp = <100000>; - regulator-max-microamp = <100000>; - regulator-always-on; - }; - - vdd_ldo6: ldo6 { -- regulator-min-microvolt = <3300000>; -- regulator-max-microvolt = <3300000>; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; - regulator-min-microamp = <200000>; - regulator-max-microamp = <200000>; - regulator-always-on; - }; - - vdd_ldo7: ldo7 { -- regulator-min-microvolt = <1800000>; -- regulator-max-microvolt = <1800000>; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; - regulator-min-microamp = <200000>; - regulator-max-microamp = <200000>; - regulator-always-on; - }; - - vdd_ldo8: ldo8 { -- regulator-min-microvolt = <1800000>; -- regulator-max-microvolt = <1800000>; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; - regulator-min-microamp = <200000>; - regulator-max-microamp = <200000>; - regulator-always-on; diff --git a/target/linux/sifiveu/patches-5.15/0003-riscv-sifive-unmatched-define-PWM-LEDs.patch b/target/linux/sifiveu/patches-5.15/0003-riscv-sifive-unmatched-define-PWM-LEDs.patch deleted file mode 100644 index 661e15905f9d53..00000000000000 --- a/target/linux/sifiveu/patches-5.15/0003-riscv-sifive-unmatched-define-PWM-LEDs.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 2c2d8ac8c124a2938c9326c14b2dffd46d76b4a8 Mon Sep 17 00:00:00 2001 -From: David Abdurachmanov -Date: Mon, 13 Sep 2021 02:15:37 -0700 -Subject: [PATCH 3/7] riscv: sifive: unmatched: define PWM LEDs - -Add D2 (RGB) and D12 (green) LEDs for SiFive Unmatched board. - -Signed-off-by: David Abdurachmanov ---- - .../riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 41 ++++++++++++++++++++++ - 1 file changed, 41 insertions(+) - ---- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts -+++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts -@@ -4,6 +4,8 @@ - #include "fu740-c000.dtsi" - #include - #include -+#include -+#include - - /* Clock frequency (in Hz) of the PCB crystal for rtcclk */ - #define RTCCLK_FREQ 1000000 -@@ -31,6 +33,45 @@ - soc { - }; - -+ pwmleds { -+ compatible = "pwm-leds"; -+ green-d12 { -+ label = "green:d12"; -+ color = ; -+ pwms = <&pwm0 0 7812500 PWM_POLARITY_INVERTED>; -+ active-low = <1>; -+ max-brightness = <255>; -+ linux,default-trigger = "none"; -+ }; -+ -+ green-d2 { -+ label = "green:d2"; -+ color = ; -+ pwms = <&pwm0 1 7812500 PWM_POLARITY_INVERTED>; -+ active-low = <1>; -+ max-brightness = <255>; -+ linux,default-trigger = "none"; -+ }; -+ -+ red-d2 { -+ label = "red:d2"; -+ color = ; -+ pwms = <&pwm0 2 7812500 PWM_POLARITY_INVERTED>; -+ active-low = <1>; -+ max-brightness = <255>; -+ linux,default-trigger = "none"; -+ }; -+ -+ blue-d2 { -+ label = "blue:d2"; -+ color = ; -+ pwms = <&pwm0 3 7812500 PWM_POLARITY_INVERTED>; -+ active-low = <1>; -+ max-brightness = <255>; -+ linux,default-trigger = "none"; -+ }; -+ }; -+ - hfclk: hfclk { - #clock-cells = <0>; - compatible = "fixed-clock"; diff --git a/target/linux/sifiveu/patches-5.15/0004-riscv-sifive-unmatched-add-gpio-poweroff-node.patch b/target/linux/sifiveu/patches-5.15/0004-riscv-sifive-unmatched-add-gpio-poweroff-node.patch deleted file mode 100644 index 6d09628cb3bd32..00000000000000 --- a/target/linux/sifiveu/patches-5.15/0004-riscv-sifive-unmatched-add-gpio-poweroff-node.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 14ede57943bc4209755d08daf93ac7be967d7fbe Mon Sep 17 00:00:00 2001 -From: David Abdurachmanov -Date: Mon, 13 Sep 2021 02:18:30 -0700 -Subject: [PATCH 4/7] riscv: sifive: unmatched: add gpio-poweroff node - -Add gpio-poweroff node to allow powering off the system. - -Signed-off-by: David Abdurachmanov ---- - arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 6 ++++++ - 1 file changed, 6 insertions(+) - ---- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts -+++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts -@@ -85,6 +85,11 @@ - clock-frequency = ; - clock-output-names = "rtcclk"; - }; -+ -+ gpio-poweroff { -+ compatible = "gpio-poweroff"; -+ gpios = <&gpio 2 GPIO_ACTIVE_LOW>; -+ }; - }; - - &uart0 { diff --git a/target/linux/sifiveu/patches-5.15/0005-riscv-sifive-unleashed-define-opp-table-cpufreq.patch b/target/linux/sifiveu/patches-5.15/0005-riscv-sifive-unleashed-define-opp-table-cpufreq.patch deleted file mode 100644 index c6b997dbbed54e..00000000000000 --- a/target/linux/sifiveu/patches-5.15/0005-riscv-sifive-unleashed-define-opp-table-cpufreq.patch +++ /dev/null @@ -1,116 +0,0 @@ -From d3cf2859a056273400fbdf9d389b75750ff6ca5e Mon Sep 17 00:00:00 2001 -From: David Abdurachmanov -Date: Fri, 14 May 2021 05:27:51 -0700 -Subject: [PATCH 6/7] riscv: sifive: unleashed: define opp table (cpufreq) - -Source: https://github.com/sifive/riscv-linux/commits/dev/paulw/cpufreq-dt-aloe-v5.3-rc4 - -Signed-off-by: David Abdurachmanov ---- - arch/riscv/Kconfig | 8 +++++ - arch/riscv/boot/dts/sifive/fu540-c000.dtsi | 5 ++++ - .../riscv/boot/dts/sifive/hifive-unleashed-a00.dts | 34 ++++++++++++++++++++++ - 3 files changed, 47 insertions(+) - ---- a/arch/riscv/Kconfig -+++ b/arch/riscv/Kconfig -@@ -566,6 +566,14 @@ config BUILTIN_DTB - depends on OF - default y if XIP_KERNEL - -+menu "CPU Power Management" -+ -+source "drivers/cpuidle/Kconfig" -+ -+source "drivers/cpufreq/Kconfig" -+ -+endmenu -+ - menu "Power management options" - - source "kernel/power/Kconfig" ---- a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi -+++ b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi -@@ -30,6 +30,7 @@ - i-cache-size = <16384>; - reg = <0>; - riscv,isa = "rv64imac"; -+ clocks = <&prci PRCI_CLK_COREPLL>; - status = "disabled"; - cpu0_intc: interrupt-controller { - #interrupt-cells = <1>; -@@ -54,6 +55,7 @@ - reg = <1>; - riscv,isa = "rv64imafdc"; - tlb-split; -+ clocks = <&prci PRCI_CLK_COREPLL>; - next-level-cache = <&l2cache>; - cpu1_intc: interrupt-controller { - #interrupt-cells = <1>; -@@ -78,6 +80,7 @@ - reg = <2>; - riscv,isa = "rv64imafdc"; - tlb-split; -+ clocks = <&prci PRCI_CLK_COREPLL>; - next-level-cache = <&l2cache>; - cpu2_intc: interrupt-controller { - #interrupt-cells = <1>; -@@ -102,6 +105,7 @@ - reg = <3>; - riscv,isa = "rv64imafdc"; - tlb-split; -+ clocks = <&prci PRCI_CLK_COREPLL>; - next-level-cache = <&l2cache>; - cpu3_intc: interrupt-controller { - #interrupt-cells = <1>; -@@ -126,6 +130,7 @@ - reg = <4>; - riscv,isa = "rv64imafdc"; - tlb-split; -+ clocks = <&prci PRCI_CLK_COREPLL>; - next-level-cache = <&l2cache>; - cpu4_intc: interrupt-controller { - #interrupt-cells = <1>; ---- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts -+++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts -@@ -84,6 +84,40 @@ - label = "d4"; - }; - }; -+ -+ fu540_c000_opp_table: opp-table { -+ compatible = "operating-points-v2"; -+ opp-shared; -+ -+ opp-350000000 { -+ opp-hz = /bits/ 64 <350000000>; -+ }; -+ opp-700000000 { -+ opp-hz = /bits/ 64 <700000000>; -+ }; -+ opp-999999999 { -+ opp-hz = /bits/ 64 <999999999>; -+ }; -+ opp-1400000000 { -+ opp-hz = /bits/ 64 <1400000000>; -+ }; -+ }; -+}; -+ -+&cpu0 { -+ operating-points-v2 = <&fu540_c000_opp_table>; -+}; -+&cpu1 { -+ operating-points-v2 = <&fu540_c000_opp_table>; -+}; -+&cpu2 { -+ operating-points-v2 = <&fu540_c000_opp_table>; -+}; -+&cpu3 { -+ operating-points-v2 = <&fu540_c000_opp_table>; -+}; -+&cpu4 { -+ operating-points-v2 = <&fu540_c000_opp_table>; - }; - - &uart0 { diff --git a/target/linux/sifiveu/patches-5.15/0006-riscv-sbi-srst-support.patch b/target/linux/sifiveu/patches-5.15/0006-riscv-sbi-srst-support.patch deleted file mode 100644 index 409001bcfa8c6c..00000000000000 --- a/target/linux/sifiveu/patches-5.15/0006-riscv-sbi-srst-support.patch +++ /dev/null @@ -1,301 +0,0 @@ -From mboxrd@z Thu Jan 1 00:00:00 1970 -Return-Path: -X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on - aws-us-west-2-korg-lkml-1.web.codeaurora.org -X-Spam-Level: -X-Spam-Status: No, score=-21.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, - DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, - INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,MSGID_FROM_MTA_HEADER, - SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable - autolearn_force=no version=3.4.0 -Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) - by smtp.lore.kernel.org (Postfix) with ESMTP id 9A34CC48BCD - for ; Wed, 9 Jun 2021 12:50:08 +0000 (UTC) -Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) - (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) - (No client certificate requested) - by mail.kernel.org (Postfix) with ESMTPS id 69795611C9 - for ; Wed, 9 Jun 2021 12:50:08 +0000 (UTC) -DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 69795611C9 -Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com -Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=lists.infradead.org; s=bombadil.20210309; h=Sender: - Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: - List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: - Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: - Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: - List-Owner; bh=64gRxQ9bX8C6wjLq0KuJ2lv98bQdXijt0LPnNpch3NU=; b=rgeSpoSWQ+Nca2 - 9PLsgI7dOYVdTu48CyVJStiizsvIvVFN2rBAgELHF2nRCCtoSiPMxgcpCKtDcm7sh9lC8AblCoBjN - LXiPRHVYJAcRNiWiQ0qOTqHdTbezFdzSjNOs6drbaiI4B8AZtychw1hP+ubsb5czAaz6510OEVct/ - h5M4Tlljcn/WIyulBd/tnuUOZPT0XL6rb2+TvRQvjXDBFHN+bWqP8OjXKnE1FTvy5MF8OTlUgI6wr - 3f4t/eS/PPbtXRD5raJzEwEQLJ6XY6NJABs40tKpWZNuUaqTfmonNdbP9y1htWhByhsAk+fw5WK/C - /KocvM6IzPmqGIBWcTdQ==; -Received: from localhost ([::1] helo=bombadil.infradead.org) - by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) - id 1lqxeS-00Do8i-Hj; Wed, 09 Jun 2021 12:49:44 +0000 -Received: from esa4.hgst.iphmx.com ([216.71.154.42]) - by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) - id 1lqx5h-00DbCQ-K0 - for linux-riscv@lists.infradead.org; Wed, 09 Jun 2021 12:13:51 +0000 -DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; - d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; - t=1623240829; x=1654776829; - h=from:to:cc:subject:date:message-id:in-reply-to: - references:content-transfer-encoding:mime-version; - bh=s4va/Owvq7MQI8rUsD/e02RmaYfJNzYNcxlXspGRY7g=; - b=G5GD9eN+rv669E7jyRnRAt0jw83CxhIrSiDIjXuPmhWyMhKeQGD7ACRm - ii6o0zmOREhGihtwB6X/xpY/2ZvK+cxcHmJXa+Ykyn8QN+/YKFtg3svfj - eiTN7U/mEozCoGNd1wXu59RQj11Xz60DN/qEUlYFaL6SjukUgifFVgbvG - uUj8AM8+xf1jKHi3Q/6nVPpJX8uiW/NPFHrwI8hxUwYr9viQwxXvc7FNr - fR8bH2c/HiGacGYEHosgP0WT//d9Huqn4JNINvjidK4ZSJ74cXlr8KwMG - 8snmfx4UjEWMhK1lCYalJEU7nxXFfih/6DMuFRorETpWQ+424BAKUJdDH Q==; -IronPort-SDR: pYhRsIZkhfmi45K4HfnZj39kxfUGpxs1e+q+Wh8kDE+ySh35HkJaaUcpP04mb7VeIVtPRx/h6Q - imv6sn8fYo/V8ezHAq4jpd1QadqInKi1ubLnCE3Zy7GnhVBepoV6FbI14Y01V+5QIUwYdFNcGG - RsxDOTQyU5AljH0Rc6WkrpdVf5jsrXXMddmlDdi6QsfKGy7MwQ/NYojNIqyLhRSgu5w2uTIE7X - atSbjb8j2a+EJUY0WgYTGfNHKCdQLAhjcsWZgU7Iu0vSaBU6A7seCkqun24dvF/zYuzEj7wedD - TvE= -X-IronPort-AV: E=Sophos;i="5.83,260,1616428800"; d="scan'208";a="170575129" -Received: from mail-dm6nam12lp2169.outbound.protection.outlook.com (HELO - NAM12-DM6-obe.outbound.protection.outlook.com) ([104.47.59.169]) - by ob1.hgst.iphmx.com with ESMTP; 09 Jun 2021 20:13:48 +0800 -ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; - b=hrlr4Qi66FmbQW45zI7QeA9nEYSvxO+tR++vUyFHxjRqnr6WtjKgHM8hPpp8oHXaK82U0+KQUc2+WjLbe8LihexXFQs5zRwBDwuArmkKt85cL3utD3OBzTkr4A9ZhRS5mzztnn9kvTFNplPjSydXPetJQIZ9WKmihJrdeaGQ+zQ//6TdDWVpLyBbqiBVUbUwlKQbpbbfHvzQCHYQbIiUcGn4vaSXYp2Xp1Z5yYVtrfDK+TemKG/8fKQoJjg/tdmDtQ97Cgw7nX6Oc9kdmoTIxFilMy4XjPciPcNOPdLmboGCt6+TMBeftLc1VFNnr7PwuxOogv4I7eJ/P9UaK57k5A== -ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; - s=arcselector9901; - h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; - bh=Ibi36Vj2s7bu56DZaU1uSl4xNA3OB2FHlI/rBKn+8xo=; - b=CE3o+0GFLPMQuw0AK1IRf/vX00diXsjayn0MmpS7ntSVXgxXIAPT9aDtk7x0NovJBTk2LHI5Mtxvz6SwVnJzUqZmNsXUktEj5Iwdd8EPIIxgCOjugo/6WC0FqaFKNvJB4hQ0tjFxv+J5DexSJ8+mPx6Ucr4DwtUXrCWzOeXyF5YK68mU5FgttbyutW3CGsGkPgaPAdOxXOgJqyYu8X25unmzG12Jq2xC4oVKsbA+RfDiaMKm97q2Bhy+LcgJNS6/ktlFKSOVu1HQ0POYgba3mtldN3vg73wLbxrfsdoe4261aJpkM05GJFDzdTNp4t3rEGhNuLR1+8OmKfLlPeSU9w== -ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass - smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass - header.d=wdc.com; arc=none -DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; - d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; - h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; - bh=Ibi36Vj2s7bu56DZaU1uSl4xNA3OB2FHlI/rBKn+8xo=; - b=Z76YsVxTHK6/ta19C5vwaBPYmtDa2GIM/ml4myQZfIaHFNzXPzZ+PFcYy/Xf1Ixd0GZHcuSZQYgs/SPHWATh+rOWBAislGv1zmSAG/g0tiDckB8WaCwh1e3qGW4ZmUTmAU7dxB0vn0pRSLTnc1hdCUZ73buM78qo9qwsQZv41d0= -Authentication-Results: dabbelt.com; dkim=none (message not signed) - header.d=none;dabbelt.com; dmarc=none action=none header.from=wdc.com; -Received: from CO6PR04MB7812.namprd04.prod.outlook.com (2603:10b6:303:138::6) - by CO6PR04MB7794.namprd04.prod.outlook.com (2603:10b6:303:13f::7) - with Microsoft SMTP Server (version=TLS1_2, - cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21; Wed, 9 Jun - 2021 12:13:47 +0000 -Received: from CO6PR04MB7812.namprd04.prod.outlook.com - ([fe80::a153:b7f8:c87f:89f8]) by CO6PR04MB7812.namprd04.prod.outlook.com - ([fe80::a153:b7f8:c87f:89f8%9]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 - 12:13:47 +0000 -From: Anup Patel -To: Palmer Dabbelt , - Palmer Dabbelt , - Paul Walmsley , Albert Ou -Cc: Atish Patra , - Alistair Francis , - Anup Patel , linux-riscv@lists.infradead.org, - linux-kernel@vger.kernel.org, Anup Patel -Subject: [PATCH v7 1/1] RISC-V: Use SBI SRST extension when available -Date: Wed, 9 Jun 2021 17:43:22 +0530 -Message-Id: <20210609121322.3058-2-anup.patel@wdc.com> -X-Mailer: git-send-email 2.25.1 -In-Reply-To: <20210609121322.3058-1-anup.patel@wdc.com> -References: <20210609121322.3058-1-anup.patel@wdc.com> -X-Originating-IP: [122.172.176.125] -X-ClientProxiedBy: MA1PR0101CA0036.INDPRD01.PROD.OUTLOOK.COM - (2603:1096:a00:22::22) To CO6PR04MB7812.namprd04.prod.outlook.com - (2603:10b6:303:138::6) -MIME-Version: 1.0 -X-MS-Exchange-MessageSentRepresentingType: 1 -Received: from wdc.com (122.172.176.125) by - MA1PR0101CA0036.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::22) with - Microsoft SMTP Server (version=TLS1_2, - cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend - Transport; Wed, 9 Jun 2021 12:13:44 +0000 -X-MS-PublicTrafficType: Email -X-MS-Office365-Filtering-Correlation-Id: 17406ef0-e8d7-4dc3-eee9-08d92b40085b -X-MS-TrafficTypeDiagnostic: CO6PR04MB7794: -X-MS-Exchange-Transport-Forked: True -X-Microsoft-Antispam-PRVS: -WDCIPOUTBOUND: EOP-TRUE -X-MS-Oob-TLC-OOBClassifiers: OLM:2887; -X-MS-Exchange-SenderADCheck: 1 -X-Microsoft-Antispam: BCL:0; -X-Microsoft-Antispam-Message-Info: IxB9oKL9LkeXCQ7mZ1A5qIcKlICr/TPZ/8V0ErM5hbqnvfK6Mf0mQL0tqqlJAOvLpCEVIyX7FllGqSlWsNG3ik/WbbDYQb9wAFCuFSAlGAeGppnJjJf0zfDAmp4NONB7kshKqtUYfGltTHTkV4ni+VEwWf/Q3T4vA0k3Jkt34iZFi9tOsSHkSWxPTsQyviBdCp3/36ZCVhYs6bXkf8sh0sA4Ql/l8t2zpcEUwjAm14ie3hOUBEp1W9qOz6StmR4xyl+zy49U38byeHu5XDF/qFT8FI4WclwFwxbDeTm8cU7MMg4D0xeR0Ytm2wVrgAdiapgQYLmxPIjIG96TRTbCupyuaJXmYcI6/x27PtiQYFwcpbRUjXDKRVX2WW74WHm88OOlTexD/OsbGHD6PVnc+InniK38yNcx06U9fIkDGSYWrJqLysALlO0V5gfkc35Fhttum638ES0S2sldGkFufM372EZeooczK7jeLMpoOTAnaLtPdTCGsHnnEDDbOK7NiptQlrLMhrNQ/70harAMmB6Vvdl+jvJi34DsuX+57WeQU8Ya1cyVxzFkWX2DwvPRsAnp/VNHzeQLc5MAIUYpwQvkJBcqihYMKrLMNOT94HmxBYmY2bcW/K9fXrPQ/whyJ5HoQuxydeiy7+QKg6FWnhguTACaaTKGKKIDIlfYA5FXYlZOaQ2iJFtiZP1GbxQnDEwz4SfGgCgBdiwqFm1NfGG7wRhqQa/Kgp3jBTHwaysCwcWu/Xdz/yiCV4lfQD/PTiOr5hmtld29G7WVDy9m6Q== -X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; - IPV:NLI; SFV:NSPM; H:CO6PR04MB7812.namprd04.prod.outlook.com; PTR:; CAT:NONE; - SFS:(4636009)(396003)(39860400002)(136003)(346002)(366004)(376002)(8676002)(316002)(55236004)(38100700002)(38350700002)(110136005)(86362001)(54906003)(4326008)(956004)(966005)(478600001)(26005)(186003)(55016002)(8936002)(2616005)(7696005)(52116002)(16526019)(5660300002)(8886007)(6666004)(1076003)(66476007)(66556008)(36756003)(66946007)(83380400001)(2906002)(44832011); - DIR:OUT; SFP:1102; -X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 -X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?2kfiFAcyFkAMcwkoCUqJGxdVnwsuTm5WWTXA4Pq0ZNAjWsfYI4MNugTA9f8C?= - =?us-ascii?Q?WaQrYEizTkvIlgRDqeKVRS0vaMaeU9XaSzO6UAJMnd0jY3BzkJgKUU9xj1aU?= - =?us-ascii?Q?vmwXKxCS+vZ2VKgLifaU1JCeemiJqV9aW+6AJEycq722bz9yXmcaJsaHWtX3?= - =?us-ascii?Q?4sSoLeVPvfzwzDZEEoGsZZi1G7inY2imGEgY/r3m5/qYvavJQ3An4e4sjEqZ?= - =?us-ascii?Q?Z4a4FAd/6c3X8cjmNwGvgWoAIM5WaJYFQe30MQ79alCUfZyiKB4tR0+5OGFd?= - =?us-ascii?Q?P/rQ169Z644JNKKcEabikpL7qZZJ6OMPTS7XR9x/7GzWOJ7soV3/3I2tfCdi?= - =?us-ascii?Q?xVsOK1DRF4y6gi5udvnb+Uu1U5wC1NlT0U/+TrnTSeY/IuLmMgFUysw+fQ+D?= - =?us-ascii?Q?DIVN44TKrMoEZKx9SKcx4jYpUGYvaCH4sVOAx3zWQC0Oz1Nz3/a/isywpQW9?= - =?us-ascii?Q?1I1kl/2N97K0EoWIPf6qPjyLVWXg1dOHfk6SjNW64JIIPUNnM3h7k2igDX3o?= - =?us-ascii?Q?d7lWyFfzoWhNC7opS71uzta+ti8aHxo+xzvYvf2wLb+fdyEP9t+oQVrEQYIW?= - =?us-ascii?Q?rAUKPqjEfAZOYBB28SaabfVt/QF6hFfV/0yJ/JV/Ie8ivC1t6iO+QZQscV7K?= - =?us-ascii?Q?d4Pg+xVSE+m+LsgNwO36cTTe6hSLBPnWU1NMOW2cxTRKGm0Lwd2HyjyKTBMD?= - =?us-ascii?Q?BcnKo9GXAVgOAGCG5cwEBN76q6sXxbWy0pjni3O2bLYBg4CIYCB/JNzOIfE0?= - =?us-ascii?Q?Toz6Qwc4aw5NxRLqz9IygGT6ZunRVUWUsgJrIt5U20elX+lRmtX1cqrQNTON?= - =?us-ascii?Q?ZHzuAI587pB0zK4EiS25hc9C8RtwjlY67heuMsYZDww5TU+NV3+0WN1/NrCX?= - =?us-ascii?Q?3kB7O188tvm1sWVhCaC6hk9s19nKGRgMS5OHXTMxhmyw1Dn/zorMYff3r9ZE?= - =?us-ascii?Q?sNiBI7fwru/Jsxt2/jNCpFaEYUa9JkrdSse76BXo/UxLALnxO3bzpym3Dq+T?= - =?us-ascii?Q?s4uEA8UncKM0e+Mhp9hW1c3DR61Qjj8wb+LV3XB0qYK/1rHs8IDdJ97tw1fp?= - =?us-ascii?Q?Ux9SlgS9YE2bEp6wxcX6TpA5DoYjqdlK50/4/DZ3YTXWlPTaQbt/j36TbEgZ?= - =?us-ascii?Q?hhIV08WX7EDjBz1QrFRppEtBghOJikHLdvPo6GnZkHNQ9cxaa8Jrk0iypK4d?= - =?us-ascii?Q?bMj47kiugWCGY+ZW2ioGV1GgH1aZEvAukQgTiAAiyGU83td11Q5Pv2N5ytvk?= - =?us-ascii?Q?i+Ux/DUoeU4VyqYnb69asjdyKI5RzIxQPdQAQ7x/TBlyPp/Yj2/v31b6lCYT?= - =?us-ascii?Q?b1iYdeIKK+6I6A+e/EUnPOKC?= -X-OriginatorOrg: wdc.com -X-MS-Exchange-CrossTenant-Network-Message-Id: 17406ef0-e8d7-4dc3-eee9-08d92b40085b -X-MS-Exchange-CrossTenant-AuthSource: CO6PR04MB7812.namprd04.prod.outlook.com -X-MS-Exchange-CrossTenant-AuthAs: Internal -X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 12:13:47.1304 (UTC) -X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted -X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 -X-MS-Exchange-CrossTenant-MailboxType: HOSTED -X-MS-Exchange-CrossTenant-UserPrincipalName: rHld9c5jovIZF30ZL04ehEJ81O0isWetsUM3vlp/0cN1LoJ5z8guKzUTANDGVGM0Eua+2cZ1jQGTC49NwWH4hA== -X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR04MB7794 -X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20210609_051349_766689_30430D67 -X-CRM114-Status: GOOD ( 15.29 ) -X-BeenThere: linux-riscv@lists.infradead.org -X-Mailman-Version: 2.1.34 -Precedence: list -List-Id: -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Content-Type: text/plain; charset="us-ascii" -Content-Transfer-Encoding: 7bit -Sender: "linux-riscv" -Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org - -The SBI SRST extension provides a standard way to poweroff and -reboot the system irrespective to whether Linux RISC-V S-mode -is running natively (HS-mode) or inside Guest/VM (VS-mode). - -The SBI SRST extension is available in the SBI v0.3 specification. -(Refer, https://github.com/riscv/riscv-sbi-doc/releases/tag/v0.3.0-rc1) - -This patch extends Linux RISC-V SBI implementation to detect -and use SBI SRST extension. - -Signed-off-by: Anup Patel -Reviewed-by: Atish Patra ---- - arch/riscv/include/asm/sbi.h | 24 ++++++++++++++++++++++++ - arch/riscv/kernel/sbi.c | 35 +++++++++++++++++++++++++++++++++++ - 2 files changed, 59 insertions(+) - ---- a/arch/riscv/include/asm/sbi.h -+++ b/arch/riscv/include/asm/sbi.h -@@ -27,6 +27,7 @@ enum sbi_ext_id { - SBI_EXT_IPI = 0x735049, - SBI_EXT_RFENCE = 0x52464E43, - SBI_EXT_HSM = 0x48534D, -+ SBI_EXT_SRST = 0x53525354, - }; - - enum sbi_ext_base_fid { -@@ -70,6 +71,21 @@ enum sbi_hsm_hart_status { - SBI_HSM_HART_STATUS_STOP_PENDING, - }; - -+enum sbi_ext_srst_fid { -+ SBI_EXT_SRST_RESET = 0, -+}; -+ -+enum sbi_srst_reset_type { -+ SBI_SRST_RESET_TYPE_SHUTDOWN = 0, -+ SBI_SRST_RESET_TYPE_COLD_REBOOT, -+ SBI_SRST_RESET_TYPE_WARM_REBOOT, -+}; -+ -+enum sbi_srst_reset_reason { -+ SBI_SRST_RESET_REASON_NONE = 0, -+ SBI_SRST_RESET_REASON_SYS_FAILURE, -+}; -+ - #define SBI_SPEC_VERSION_DEFAULT 0x1 - #define SBI_SPEC_VERSION_MAJOR_SHIFT 24 - #define SBI_SPEC_VERSION_MAJOR_MASK 0x7f -@@ -148,6 +164,14 @@ static inline unsigned long sbi_minor_ve - return sbi_spec_version & SBI_SPEC_VERSION_MINOR_MASK; - } - -+/* Make SBI version */ -+static inline unsigned long sbi_mk_version(unsigned long major, -+ unsigned long minor) -+{ -+ return ((major & SBI_SPEC_VERSION_MAJOR_MASK) << -+ SBI_SPEC_VERSION_MAJOR_SHIFT) | minor; -+} -+ - int sbi_err_map_linux_errno(int err); - #else /* CONFIG_RISCV_SBI */ - static inline int sbi_remote_fence_i(const unsigned long *hart_mask) { return -1; } ---- a/arch/riscv/kernel/sbi.c -+++ b/arch/riscv/kernel/sbi.c -@@ -7,6 +7,7 @@ - - #include - #include -+#include - #include - #include - -@@ -501,6 +502,32 @@ int sbi_remote_hfence_vvma_asid(const un - } - EXPORT_SYMBOL(sbi_remote_hfence_vvma_asid); - -+static void sbi_srst_reset(unsigned long type, unsigned long reason) -+{ -+ sbi_ecall(SBI_EXT_SRST, SBI_EXT_SRST_RESET, type, reason, -+ 0, 0, 0, 0); -+ pr_warn("%s: type=0x%lx reason=0x%lx failed\n", -+ __func__, type, reason); -+} -+ -+static int sbi_srst_reboot(struct notifier_block *this, -+ unsigned long mode, void *cmd) -+{ -+ sbi_srst_reset((mode == REBOOT_WARM || mode == REBOOT_SOFT) ? -+ SBI_SRST_RESET_TYPE_WARM_REBOOT : -+ SBI_SRST_RESET_TYPE_COLD_REBOOT, -+ SBI_SRST_RESET_REASON_NONE); -+ return NOTIFY_DONE; -+} -+ -+static struct notifier_block sbi_srst_reboot_nb; -+ -+static void sbi_srst_power_off(void) -+{ -+ sbi_srst_reset(SBI_SRST_RESET_TYPE_SHUTDOWN, -+ SBI_SRST_RESET_REASON_NONE); -+} -+ - /** - * sbi_probe_extension() - Check if an SBI extension ID is supported or not. - * @extid: The extension ID to be probed. -@@ -608,6 +635,14 @@ void __init sbi_init(void) - } else { - __sbi_rfence = __sbi_rfence_v01; - } -+ if ((sbi_spec_version >= sbi_mk_version(0, 3)) && -+ (sbi_probe_extension(SBI_EXT_SRST) > 0)) { -+ pr_info("SBI SRST extension detected\n"); -+ pm_power_off = sbi_srst_power_off; -+ sbi_srst_reboot_nb.notifier_call = sbi_srst_reboot; -+ sbi_srst_reboot_nb.priority = 192; -+ register_restart_handler(&sbi_srst_reboot_nb); -+ } - } else { - __sbi_set_timer = __sbi_set_timer_v01; - __sbi_send_ipi = __sbi_send_ipi_v01; diff --git a/target/linux/sunxi/base-files/etc/board.d/01_leds b/target/linux/sunxi/base-files/etc/board.d/01_leds index 60783363dee98a..da94e403737c8f 100644 --- a/target/linux/sunxi/base-files/etc/board.d/01_leds +++ b/target/linux/sunxi/base-files/etc/board.d/01_leds @@ -9,8 +9,8 @@ board_config_update case $board in friendlyarm,nanopi-r1|\ friendlyarm,nanopi-r1s-h5) - ucidef_set_led_netdev "wan" "WAN" "nanopi:green:wan" "eth0" - ucidef_set_led_netdev "lan" "LAN" "nanopi:green:lan" "eth1" + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0" + ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth1" ;; esac diff --git a/target/linux/sunxi/config-5.15 b/target/linux/sunxi/config-5.15 index c33bb7ab6fd829..6a7baf7baee7e2 100644 --- a/target/linux/sunxi/config-5.15 +++ b/target/linux/sunxi/config-5.15 @@ -17,7 +17,7 @@ CONFIG_ARCH_SUNXI=y CONFIG_ARCH_SUNXI_MC_SMP=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARM=y -# CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM is not set +CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM=y CONFIG_ARM_APPENDED_DTB=y CONFIG_ARM_ARCH_TIMER=y CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y diff --git a/target/linux/sunxi/config-6.1 b/target/linux/sunxi/config-6.1 index 8f793f3c3a9235..a76834c13a9978 100644 --- a/target/linux/sunxi/config-6.1 +++ b/target/linux/sunxi/config-6.1 @@ -18,7 +18,7 @@ CONFIG_ARCH_SUNXI=y CONFIG_ARCH_SUNXI_MC_SMP=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARM=y -# CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM is not set +CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM=y CONFIG_ARM_APPENDED_DTB=y CONFIG_ARM_ARCH_TIMER=y CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y diff --git a/target/linux/x86/base-files.mk b/target/linux/x86/base-files.mk new file mode 100644 index 00000000000000..e2b7d05f57379e --- /dev/null +++ b/target/linux/x86/base-files.mk @@ -0,0 +1,8 @@ +GRUB_SERIAL:=$(call qstrip,$(CONFIG_TARGET_SERIAL)) +ifeq ($(GRUB_SERIAL),) +$(error This platform requires CONFIG_TARGET_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/board.d/01_leds b/target/linux/x86/base-files/etc/board.d/01_leds index efc5460df3ce86..47ea0929e62531 100644 --- a/target/linux/x86/base-files/etc/board.d/01_leds +++ b/target/linux/x86/base-files/etc/board.d/01_leds @@ -28,6 +28,10 @@ traverse-technologies-geos) ucidef_set_led_netdev "wlan" "WiFi" "geos:2" "phy0tpt" ucidef_set_led_default "diag" "DIAG" "geos:3" "1" ;; +silicom-80500-0214-*) + ucidef_set_led_netdev "wan" "WAN" "multicolor:fp_center" "wan0" + ucidef_set_led_netdev "lan" "LAN" "multicolor:fp_right" "br-lan" + ;; esac board_config_flush diff --git a/target/linux/x86/base-files/etc/board.d/02_network b/target/linux/x86/base-files/etc/board.d/02_network index e00e8c04dd25c2..b18ab60120eb04 100644 --- a/target/linux/x86/base-files/etc/board.d/02_network +++ b/target/linux/x86/base-files/etc/board.d/02_network @@ -31,6 +31,9 @@ cisco-mx100-hw) ucidef_set_network_device_path "eth11" "pci0000:00/0000:00:01.1/0000:02:00.2" ucidef_set_interfaces_lan_wan "mgmt eth2 eth3 eth4 eth5 eth6 eth7 eth8 eth9 eth10 eth11" "wan" ;; +mellanox-technologies-ltd-msn2100) + ucidef_set_interface_lan "eth1 eth2 eth3 eth4 eth5 eth6 eth7 eth8 eth9 eth10 eth11 eth12 eth13 eth14 eth15 eth16" + ;; pc-engines-apu1|pc-engines-apu2|pc-engines-apu3) ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0" ;; @@ -75,6 +78,17 @@ traverse-technologies-geos) macaddr="$(cat /sys/class/net/eth0/address)" 2>/dev/null [ -n "$macaddr" ] && ucidef_set_interface_macaddr "wan" "$macaddr" ;; +silicom-80500-0214-*) + ucidef_set_network_device_path "wan0" "pci0000:00/0000:00:16.0/0000:03:00.0" + ucidef_set_network_device_path "wan1" "pci0000:00/0000:00:16.0/0000:03:00.1" + ucidef_set_network_device_path "media0" "pci0000:00/0000:00:17.0/0000:02:00.1" + ucidef_set_network_device_path "media1" "pci0000:00/0000:00:17.0/0000:02:00.0" + ucidef_set_network_device_path "eth0" "pci0000:00/0000:00:0c.0/0000:04:00.0" + ucidef_set_network_device_path "eth1" "pci0000:00/0000:00:0e.0/0000:05:00.0" + ucidef_set_network_device_path "eth2" "pci0000:00/0000:00:0f.0/0000:06:00.0" + ucidef_set_network_device_path "eth3" "pci0000:00/0000:00:10.0/0000:07:00.0" + ucidef_set_interfaces_lan_wan "eth0 eth1 eth2 eth3" "wan0" + ;; esac board_config_flush diff --git a/target/linux/x86/base-files/etc/inittab b/target/linux/x86/base-files/etc/inittab index f4747f200d0b24..9daf2ce2f0f34d 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 6776d05be38901..af3676f37147a2 100644 --- a/target/linux/x86/config-6.1 +++ b/target/linux/x86/config-6.1 @@ -92,7 +92,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_DMI=y CONFIG_DMIID=y diff --git a/target/linux/x86/image/64.mk b/target/linux/x86/image/64.mk index 5ec9978b667ded..f3d795ea22506c 100644 --- a/target/linux/x86/image/64.mk +++ b/target/linux/x86/image/64.mk @@ -2,9 +2,13 @@ define Device/generic DEVICE_VENDOR := Generic DEVICE_MODEL := x86/64 DEVICE_PACKAGES += \ - kmod-amazon-ena kmod-amd-xgbe kmod-bnx2 kmod-e1000e kmod-e1000 \ + kmod-amazon-ena kmod-amd-xgbe kmod-bnx2 kmod-dwmac-intel kmod-e1000e kmod-e1000 \ kmod-forcedeth kmod-fs-vfat kmod-igb kmod-igc kmod-ixgbe kmod-r8169 \ - kmod-tg3 + kmod-tg3 kmod-mlxsw-core kmod-mlxsw-pci kmod-mlxsw-i2c \ + kmod-mlxsw-spectrum kmod-mlxsw-minimal kmod-mlxfw \ + kmod-leds-mlxcpld kmod-lib-objagg kmod-lib-parman \ + kmod-hwmon-coretemp kmod-hwmon-drivetemp kmod-hwmon-jc42 \ + kmod-i2c-i801 mlxsw_spectrum-firmware GRUB2_VARIANT := generic endef TARGET_DEVICES += generic diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile index 322131c2a48815..6e59f2e465f3cb 100644 --- a/target/linux/x86/image/Makefile +++ b/target/linux/x86/image/Makefile @@ -16,17 +16,13 @@ ifneq ($(CONFIG_GRUB_CONSOLE),) GRUB_TERMINALS += console endif -GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL)) +GRUB_SERIAL:=$(call qstrip,$(CONFIG_TARGET_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/target/linux/x86/modules.mk b/target/linux/x86/modules.mk index 511410d614bc81..cdae01bce651f7 100644 --- a/target/linux/x86/modules.mk +++ b/target/linux/x86/modules.mk @@ -18,6 +18,18 @@ endef $(eval $(call KernelPackage,amd-xgbe)) +define KernelPackage/dwmac-intel + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Intel GMAC support + DEPENDS:=@TARGET_x86_64 +kmod-stmmac-core + KCONFIG:=CONFIG_DWMAC_INTEL + FILES=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.ko + AUTOLOAD=$(call AutoLoad,45,dwmac-intel) +endef + +$(eval $(call KernelPackage,dwmac-intel)) + + define KernelPackage/f71808e-wdt SUBMENU:=$(OTHER_MENU) TITLE:=Fintek F718xx/F818xx Watchdog Timer diff --git a/target/linux/x86/patches-5.15/120-hwrng-geode-fix-accessing-registers.patch b/target/linux/x86/patches-5.15/120-hwrng-geode-fix-accessing-registers.patch deleted file mode 100644 index 4c8015013bc8a5..00000000000000 --- a/target/linux/x86/patches-5.15/120-hwrng-geode-fix-accessing-registers.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 859bd2e0c0052967536f3f902716f204d5a978b1 Mon Sep 17 00:00:00 2001 -From: Jonas Gorski -Date: Fri, 8 Sep 2023 22:48:33 +0200 -Subject: [PATCH] hwrng: geode: fix accessing registers - -When the membase and pci_dev pointer were moved to a new struct in priv, -the actual membase users were left untouched, and they started reading -out arbitrary memory behind the struct instead of registers. This -unfortunately turned the RNG into a constant number generator, depending -on the content of what was at that offset. - -To fix this, update geode_rng_data_{read,present}() to also get the -membase via amd_geode_priv, and properly read from the right addresses -again. - -Fixes: 9f6ec8dc574e ("hwrng: geode - Fix PCI device refcount leak") -Reported-by: Timur I. Davletshin -Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217882 -Tested-by: Timur I. Davletshin -Suggested-by: Jo-Philipp Wich -Signed-off-by: Jonas Gorski ---- - drivers/char/hw_random/geode-rng.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - ---- a/drivers/char/hw_random/geode-rng.c -+++ b/drivers/char/hw_random/geode-rng.c -@@ -58,7 +58,8 @@ struct amd_geode_priv { - - static int geode_rng_data_read(struct hwrng *rng, u32 *data) - { -- void __iomem *mem = (void __iomem *)rng->priv; -+ struct amd_geode_priv *priv = (struct amd_geode_priv *)rng->priv; -+ void __iomem *mem = priv->membase; - - *data = readl(mem + GEODE_RNG_DATA_REG); - -@@ -67,7 +68,8 @@ static int geode_rng_data_read(struct hw - - static int geode_rng_data_present(struct hwrng *rng, int wait) - { -- void __iomem *mem = (void __iomem *)rng->priv; -+ struct amd_geode_priv *priv = (struct amd_geode_priv *)rng->priv; -+ void __iomem *mem = priv->membase; - int data, i; - - for (i = 0; i < 20; i++) { diff --git a/toolchain/Config.in b/toolchain/Config.in index b0273acafdd7dc..24caecccb3ee73 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -150,6 +150,14 @@ menuconfig EXTERNAL_TOOLCHAIN endchoice + config EXTERNAL_GCC_VERSION + string + prompt "External Toolchain GCC Version" if DEVEL + depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN + help + Manually specify the GCC version used by the selected + external toolchain. + config TOOLCHAIN_LIBC string depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version index a7e55eb5caf1e7..a00685ffa3f295 100644 --- a/toolchain/gcc/Config.version +++ b/toolchain/gcc/Config.version @@ -8,6 +8,7 @@ config GCC_VERSION_13 config GCC_VERSION string + default EXTERNAL_GCC_VERSION if EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN default "11.3.0" if GCC_VERSION_11 default "13.2.0" if GCC_VERSION_13 default "12.3.0" diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index 474a18e95ff264..71b16139345d11 100644 --- a/toolchain/gdb/Makefile +++ b/toolchain/gdb/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb -PKG_VERSION:=12.1 +PKG_VERSION:=13.2 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb -PKG_HASH:=0e1793bf8f2b54d53f46dea84ccfd446f48f81b297b28c4f7fc017b818d69fed +PKG_HASH:=fd5bebb7be1833abdb6e023c2f498a354498281df9d05523d8915babeb893f0a PKG_CPE_ID:=cpe:/a:gnu:gdb GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION) diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index b80cb2678b8fad..18413cd271af54 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -12,8 +12,8 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=7c32cb7dd88cf100b0b412163896e30aa2ee671a -PKG_MIRROR_HASH:=92afa3672e4af0c3ba9d360e9aaac60c094a0aad9334ef78a1fd2ee49f5e1b64 +PKG_SOURCE_VERSION:=b4e23c75aea756b4bddc4abcf27a1c6dca8b6bd3 +PKG_MIRROR_HASH:=4d5b3de6ec7b47427700f74fdb529e32083b54a512f6ca86ec824a61092ecdd4 PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz PKG_CPE_ID:=cpe:/a:gnu:glibc diff --git a/tools/Makefile b/tools/Makefile index bf525d34a052cd..bc169d7a95afb8 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -39,6 +39,7 @@ tools-y += cmake tools-y += cpio tools-y += dosfstools tools-y += e2fsprogs +tools-y += elfutils tools-y += expat tools-y += fakeroot tools-y += findutils @@ -95,6 +96,7 @@ $(curdir)/cbootimage/compile += $(curdir)/automake/compile $(curdir)/cmake/compile += $(curdir)/libressl/compile $(curdir)/ninja/compile $(curdir)/expat/compile $(curdir)/xz/compile $(curdir)/zlib/compile $(curdir)/zstd/compile $(curdir)/dosfstools/compile := $(curdir)/automake/compile $(curdir)/e2fsprogs/compile := $(curdir)/libtool/compile +$(curdir)/elfutils/compile := $(curdir)/m4/compile $(curdir)/zlib/compile $(curdir)/gnulib/compile $(curdir)/libtool/compile $(curdir)/fakeroot/compile := $(curdir)/libtool/compile $(curdir)/findutils/compile := $(curdir)/bison/compile $(curdir)/firmware-utils/compile += $(curdir)/cmake/compile @@ -137,9 +139,7 @@ ifeq ($(HOST_OS),Darwin) tools-y += bash else $(curdir)/dwarves/compile += $(curdir)/elfutils/compile - $(curdir)/elfutils/compile := $(curdir)/m4/compile $(curdir)/zlib/compile tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_DWARVES),y) += dwarves - tools-y += elfutils endif ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),) diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index 7b89b441010133..f76be9f90edd4c 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ccache -PKG_VERSION:=4.8.2 +PKG_VERSION:=4.8.3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION) -PKG_HASH:=3d3fb3f888a5b16c4fa7ee5214cca76348afd6130e8443de5f6f2424f2076a49 +PKG_HASH:=e47374c810b248cfca3665ee1d86c7c763ffd68d9944bc422d9c1872611f2b11 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile index 9ed7ccb5a515d6..19c4a5b8b80e08 100644 --- a/tools/cmake/Makefile +++ b/tools/cmake/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cmake -PKG_VERSION:=3.27.4 +PKG_VERSION:=3.27.7 PKG_VERSION_MAJOR:=$(word 1,$(subst ., ,$(PKG_VERSION))).$(word 2,$(subst ., ,$(PKG_VERSION))) PKG_RELEASE:=1 PKG_CPE_ID:=cpe:/a:kitware:cmake @@ -15,7 +15,7 @@ PKG_CPE_ID:=cpe:/a:kitware:cmake PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/Kitware/CMake/releases/download/v$(PKG_VERSION)/ \ https://cmake.org/files/v$(PKG_VERSION_MAJOR)/ -PKG_HASH:=0a905ca8635ca81aa152e123bdde7e54cbe764fdd9a70d62af44cad8b92967af +PKG_HASH:=08f71a106036bf051f692760ef9558c0577c42ac39e96ba097e7662bd4158d8e HOST_BUILD_PARALLEL:=1 HOST_CONFIGURE_PARALLEL:=1 @@ -30,6 +30,7 @@ HOST_CONFIGURE_VARS += \ MAKE="$(STAGING_DIR_HOST)/bin/ninja" HOST_CONFIGURE_ARGS := \ + --no-debugger \ $(if $(MAKE_JOBSERVER),--parallel="$(MAKE_JOBSERVER)") \ --prefix="$(STAGING_DIR_HOST)" \ --system-expat \ diff --git a/tools/elfutils/Makefile b/tools/elfutils/Makefile index f9c6272719c890..a70182724857a3 100644 --- a/tools/elfutils/Makefile +++ b/tools/elfutils/Makefile @@ -19,16 +19,33 @@ PKG_INSTALL:=1 include $(INCLUDE_DIR)/host-build.mk +ifeq ($(HOST_OS),Darwin) + HOST_CFLAGS += -I/opt/homebrew/include +endif + +HOST_CFLAGS += -Wno-error -fPIC + HOST_CONFIGURE_ARGS += \ + --without-libintl-prefix \ + --without-libiconv-prefix \ --disable-debuginfod \ --disable-libdebuginfod \ --disable-nls \ --disable-shared \ + --enable-static \ --without-lzma \ + --without-bzlib \ --without-zstd -HOST_MAKE_FLAGS += \ - SUBDIRS="lib libelf libcpu backends libebl libdwelf libdwfl libdw" +ifeq ($(HOST_OS),Darwin) + HOST_CONFIGURE_ARGS += --disable-symbol-versioning +endif + +Hooks/HostConfigure/Pre := Host/Gnulib $(Hooks/HostConfigure/Pre) +define Host/Gnulib + cd $(HOST_BUILD_DIR); $(STAGING_DIR_HOST)/bin/gnulib-tool --libtool --source-base=libgnu --import argp obstack fts strchrnul progname tsearch; + ln -sf ../lib/eu-config.h $(HOST_BUILD_DIR)/libgnu/; +endef define Host/Uninstall -$(call Host/Compile/Default,uninstall) diff --git a/tools/elfutils/patches/100-portability.patch b/tools/elfutils/patches/100-portability.patch new file mode 100644 index 00000000000000..0d650549eec390 --- /dev/null +++ b/tools/elfutils/patches/100-portability.patch @@ -0,0 +1,910 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -20,6 +20,7 @@ dnl You should have received a copy of + dnl along with this program. If not, see . + AC_INIT([elfutils],[0.189],[https://sourceware.org/bugzilla],[elfutils],[http://elfutils.org/]) + ++AC_CONFIG_MACRO_DIRS([m4]) + dnl Workaround for older autoconf < 2.64 + m4_ifndef([AC_PACKAGE_URL], + [AC_DEFINE([PACKAGE_URL], ["http://elfutils.org/"], +@@ -43,16 +44,17 @@ elif test "x$program_prefix" = "x"; then + fi + + AC_CONFIG_AUX_DIR([config]) +-AC_CONFIG_FILES([config/Makefile]) ++AC_CONFIG_FILES([config/Makefile libgnu/Makefile]) + + AC_COPYRIGHT([Copyright (C) 1996-2023 The elfutils developers.]) +-AC_PREREQ(2.63) dnl Minimum Autoconf version required. ++AC_PREREQ(2.64) dnl Minimum Autoconf version required. + + dnl We use GNU make extensions; automake 1.10 defaults to -Wportability. + AM_INIT_AUTOMAKE([gnits 1.11 -Wno-portability dist-bzip2 no-dist-gzip parallel-tests]) + AM_MAINTAINER_MODE + + AM_SILENT_RULES([yes]) ++AC_USE_SYSTEM_EXTENSIONS() + + AC_CONFIG_SRCDIR([libelf/libelf.h]) + AC_CONFIG_FILES([Makefile]) +@@ -89,12 +91,14 @@ AS_IF([test "$use_locks" = yes], + AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.]) + + m4_version_prereq([2.70], [AC_PROG_CC], [AC_PROG_CC_C99]) ++gl_EARLY ++gl_INIT + AC_PROG_CXX +-AC_PROG_RANLIB + AC_PROG_YACC + AC_PROG_LEX([noyywrap]) + # Only available since automake 1.12 + m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) ++LT_INIT() + AC_CHECK_TOOL([READELF], [readelf]) + AC_CHECK_TOOL([NM], [nm]) + +@@ -195,7 +199,6 @@ AC_CACHE_CHECK([whether the compiler gen + AC_LINK_IFELSE([AC_LANG_PROGRAM()],[ac_cv_buildid=yes; $READELF -n conftest$EXEEXT | grep -q NT_GNU_BUILD_ID || ac_cv_buildid=no],AC_MSG_FAILURE([unexpected compile failure]))]) + if test "$ac_cv_buildid" = "no"; then + AC_MSG_WARN([compiler doesn't generate build-id by default]) +- LDFLAGS="$LDFLAGS -Wl,--build-id" + fi + + ZRELRO_LDFLAGS="-Wl,-z,relro" +@@ -635,36 +638,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], + CFLAGS="$old_CFLAGS"]) + AS_IF([test "x$ac_cv_fno_addrsig" = "xyes"], CFLAGS="$CFLAGS -fno-addrsig") + +-saved_LIBS="$LIBS" +-AC_SEARCH_LIBS([argp_parse], [argp]) +-LIBS="$saved_LIBS" +-case "$ac_cv_search_argp_parse" in +- no) AC_MSG_FAILURE([failed to find argp_parse]) ;; +- -l*) argp_LDADD="$ac_cv_search_argp_parse" ;; +- *) argp_LDADD= ;; +-esac +-AC_SUBST([argp_LDADD]) +- +-saved_LIBS="$LIBS" +-AC_SEARCH_LIBS([fts_close], [fts]) +-LIBS="$saved_LIBS" +-case "$ac_cv_search_fts_close" in +- no) AC_MSG_FAILURE([failed to find fts_close]) ;; +- -l*) fts_LIBS="$ac_cv_search_fts_close" ;; +- *) fts_LIBS= ;; +-esac +-AC_SUBST([fts_LIBS]) +- +-saved_LIBS="$LIBS" +-AC_SEARCH_LIBS([_obstack_free], [obstack]) +-LIBS="$saved_LIBS" +-case "$ac_cv_search__obstack_free" in +- no) AC_MSG_FAILURE([failed to find _obstack_free]) ;; +- -l*) obstack_LIBS="$ac_cv_search__obstack_free" ;; +- *) obstack_LIBS= ;; +-esac +-AC_SUBST([obstack_LIBS]) +- + dnl The directories with content. + + dnl Documentation. +--- a/Makefile.am ++++ b/Makefile.am +@@ -26,11 +26,11 @@ AM_MAKEFLAGS = --no-print-directory + + pkginclude_HEADERS = version.h + +-SUBDIRS = config lib libelf libcpu backends libebl libdwelf libdwfl libdw \ +- libasm debuginfod src po doc tests ++SUBDIRS = libgnu config lib libelf libcpu backends libebl libdwelf libdwfl libdw + + EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \ +- COPYING COPYING-GPLV2 COPYING-LGPLV3 ++ COPYING COPYING-GPLV2 COPYING-LGPLV3 \ ++ m4/gnulib-cache.m4 + + # Make sure the test install uses lib64 when $LIB will yield lib64. + # Make sure the test build uses the same compiler, which on e.g. ppc64 +--- a/libelf/elf_update.c ++++ b/libelf/elf_update.c +@@ -37,6 +37,33 @@ + + #include "libelfP.h" + ++#include "elf_fill.c" ++ ++#ifdef __APPLE__ ++static int posix_fallocate(int fd, off_t offset, off_t len) ++{ ++ off_t c_test; ++ int ret; ++ if (!__builtin_saddll_overflow(offset, len, &c_test)) { ++ fstore_t store = {F_ALLOCATECONTIG, F_PEOFPOSMODE, 0, offset + len, 0}; ++ // Try to get a continuous chunk of disk space ++ ret = fcntl(fd, F_PREALLOCATE, &store); ++ if (ret < 0) { ++ // OK, perhaps we are too fragmented, allocate non-continuous ++ store.fst_flags = F_ALLOCATEALL; ++ ret = fcntl(fd, F_PREALLOCATE, &store); ++ if (ret < 0) { ++ return ret; ++ } ++ } ++ ret = ftruncate(fd, offset + len); ++ } else { ++ // offset+len would overflow. ++ ret = -1; ++ } ++ return ret; ++} ++#endif + + static int64_t + write_file (Elf *elf, int64_t size, int change_bo, size_t shnum) +--- a/lib/eu-config.h ++++ b/lib/eu-config.h +@@ -52,14 +52,18 @@ + # define rwlock_unlock(lock) ((void) (lock)) + #endif /* USE_LOCKS */ + +-#include ++#include + /* gettext helper macros. */ + #define N_(Str) Str + #define _(Str) dgettext ("elfutils", Str) + + /* Compiler-specific definitions. */ ++#ifdef __APPLE__ ++#define strong_alias(name, aliasname) ++#else + #define strong_alias(name, aliasname) \ + extern __typeof (name) aliasname __attribute__ ((alias (#name))); ++#endif + + #ifdef __i386__ + # define internal_function __attribute__ ((regparm (3), stdcall)) +@@ -70,12 +74,7 @@ + #define internal_strong_alias(name, aliasname) \ + extern __typeof (name) aliasname __attribute__ ((alias (#name))) internal_function; + +-#ifdef HAVE_VISIBILITY +-#define attribute_hidden \ +- __attribute__ ((visibility ("hidden"))) +-#else + #define attribute_hidden /* empty */ +-#endif + + #ifdef HAVE_GCC_STRUCT + #define attribute_packed \ +@@ -159,7 +158,7 @@ asm (".section predict_data, \"aw\"; .pr + #endif + + /* Avoid PLT entries. */ +-#ifdef PIC ++#if defined(PIC) && !defined(__APPLE__) + # define INTUSE(name) _INTUSE(name) + # define _INTUSE(name) __##name##_internal + # define INTDEF(name) _INTDEF(name) +--- a/config/eu.am ++++ b/config/eu.am +@@ -31,7 +31,7 @@ + ## + + DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"' +-AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. ++AM_CPPFLAGS = -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. + + # Drop the 'u' flag that automake adds by default. It is incompatible + # with deterministic archives. +--- a/libelf/Makefile.am ++++ b/libelf/Makefile.am +@@ -34,9 +34,7 @@ endif + + VERSION = 1 + +-lib_LIBRARIES = libelf.a +-noinst_LIBRARIES = libelf_pic.a +-noinst_DATA = $(noinst_LIBRARIES:_pic.a=.so) ++lib_LTLIBRARIES = libelf.la + include_HEADERS = libelf.h gelf.h nlist.h + + noinst_HEADERS = abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \ +@@ -51,7 +49,8 @@ endif + + pkginclude_HEADERS = elf-knowledge.h + +-libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \ ++libelf_la_LIBADD = ../libgnu/libgnu.la ../lib/libeu.la -lz $(zstd_LIBS) -lpthread ++libelf_la_SOURCES = elf_version.c elf_hash.c elf_error.c \ + elf_begin.c elf_next.c elf_rand.c elf_end.c elf_kind.c \ + gelf_getclass.c elf_getbase.c elf_getident.c \ + elf32_fsize.c elf64_fsize.c gelf_fsize.c \ +@@ -102,37 +101,9 @@ libelf_a_SOURCES = elf_version.c elf_has + elf32_getchdr.c elf64_getchdr.c gelf_getchdr.c \ + elf_compress.c elf_compress_gnu.c + +-libelf_pic_a_SOURCES = +-am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os) +- +-libelf_so_DEPS = ../lib/libeu.a +-libelf_so_LDLIBS = $(libelf_so_DEPS) -lz $(zstd_LIBS) +-if USE_LOCKS +-libelf_so_LDLIBS += -lpthread +-endif +- +-libelf_so_LIBS = libelf_pic.a +-libelf.so: $(srcdir)/libelf.map $(libelf_so_LIBS) $(libelf_so_DEPS) +- $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \ +- -Wl,--soname,$@.$(VERSION) \ +- -Wl,--version-script,$< \ +- $(NO_UNDEFINED) \ +- -Wl,--whole-archive $(libelf_so_LIBS) -Wl,--no-whole-archive \ +- $(libelf_so_LDLIBS) +- @$(textrel_check) +- $(AM_V_at)ln -fs $@ $@.$(VERSION) +- +-install: install-am libelf.so ++install: install-am + $(mkinstalldirs) $(DESTDIR)$(libdir) +- $(INSTALL_PROGRAM) libelf.so $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so +- ln -fs libelf-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libelf.so.$(VERSION) +- ln -fs libelf.so.$(VERSION) $(DESTDIR)$(libdir)/libelf.so + + uninstall: uninstall-am +- rm -f $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so +- rm -f $(DESTDIR)$(libdir)/libelf.so.$(VERSION) +- rm -f $(DESTDIR)$(libdir)/libelf.so + + EXTRA_DIST = libelf.map +- +-CLEANFILES += $(am_libelf_pic_a_OBJECTS) libelf.so libelf.so.$(VERSION) +--- a/backends/i386_auxv.c ++++ b/backends/i386_auxv.c +@@ -48,5 +48,4 @@ EBLHOOK(auxv_info) (GElf_Xword a_type, c + return 1; + } + +-__typeof (i386_auxv_info) x86_64_auxv_info +- __attribute__ ((alias ("i386_auxv_info"))); ++auxv_info_alias(x86_64) +--- a/backends/ppc_regs.c ++++ b/backends/ppc_regs.c +@@ -204,5 +204,11 @@ ppc_register_info (Ebl *ebl __attribute_ + return namelen; + } + +-__typeof (ppc_register_info) +- ppc64_register_info __attribute__ ((alias ("ppc_register_info"))); ++ssize_t ++ppc64_register_info (Ebl *ebl, ++ int regno, char *name, size_t namelen, ++ const char **prefix, const char **setname, ++ int *bits, int *type) ++{ ++ return ppc_register_info(ebl, regno, name, namelen, prefix, setname, bits, type); ++} +--- a/backends/libebl_CPU.h ++++ b/backends/libebl_CPU.h +@@ -97,4 +97,10 @@ dwarf_is_pointer (int tag) + case DW_TAG_reference_type: \ + case DW_TAG_rvalue_reference_type + ++#define auxv_info_alias(arch) \ ++ int EBLHOOK_1(arch ## _, auxv_info) (GElf_Xword a_type, const char **name, const char **format) \ ++ { \ ++ return EBLHOOK(auxv_info)(a_type, name, format); \ ++ } ++ + #endif /* libebl_CPU.h */ +--- a/backends/ppc_auxv.c ++++ b/backends/ppc_auxv.c +@@ -51,5 +51,4 @@ EBLHOOK(auxv_info) (GElf_Xword a_type, c + return 1; + } + +-__typeof (ppc_auxv_info) ppc64_auxv_info +- __attribute__ ((alias ("ppc_auxv_info"))); ++auxv_info_alias(ppc64) +--- a/backends/ppc_cfi.c ++++ b/backends/ppc_cfi.c +@@ -72,6 +72,7 @@ ppc_abi_cfi (Ebl *ebl __attribute__ ((un + return 0; + } + +-__typeof (ppc_abi_cfi) +- ppc64_abi_cfi +- __attribute__ ((alias ("ppc_abi_cfi"))); ++int ppc64_abi_cfi(Ebl *ebl, Dwarf_CIE *abi_info) ++{ ++ return ppc_abi_cfi(ebl, abi_info); ++} +--- a/backends/ppc_initreg.c ++++ b/backends/ppc_initreg.c +@@ -68,9 +68,10 @@ ppc_dwarf_to_regno (Ebl *ebl __attribute + abort (); + } + +-__typeof (ppc_dwarf_to_regno) +- ppc64_dwarf_to_regno +- __attribute__ ((alias ("ppc_dwarf_to_regno"))); ++bool ppc64_dwarf_to_regno (Ebl *ebl, unsigned *regno) ++{ ++ return ppc_dwarf_to_regno(ebl, regno); ++} + + bool + ppc_set_initial_registers_tid (pid_t tid __attribute__ ((unused)), +@@ -127,6 +128,7 @@ ppc_set_initial_registers_tid (pid_t tid + #endif /* __powerpc__ */ + } + +-__typeof (ppc_set_initial_registers_tid) +- ppc64_set_initial_registers_tid +- __attribute__ ((alias ("ppc_set_initial_registers_tid"))); ++bool ppc64_set_initial_registers_tid(pid_t tid, ebl_tid_registers_t *setfunc, void *arg) ++{ ++ return ppc_set_initial_registers_tid(tid, setfunc, arg); ++} +--- a/backends/ppc_attrs.c ++++ b/backends/ppc_attrs.c +@@ -81,6 +81,9 @@ ppc_check_object_attribute (Ebl *ebl __a + return false; + } + +-__typeof (ppc_check_object_attribute) +- ppc64_check_object_attribute +- __attribute__ ((alias ("ppc_check_object_attribute"))); ++bool ppc64_check_object_attribute(Ebl *ebl, ++ const char *vendor, int tag, uint64_t value, ++ const char **tag_name, const char **value_name) ++{ ++ return ppc_check_object_attribute(ebl, vendor, tag, value, tag_name, value_name); ++} +--- a/lib/libeu.h ++++ b/lib/libeu.h +@@ -45,4 +45,11 @@ extern char *xasprintf(const char *fmt, + extern uint32_t crc32 (uint32_t crc, unsigned char *buf, size_t len); + extern int crc32_file (int fd, uint32_t *resp); + ++#ifdef __APPLE__ ++static inline void tdestroy(void *root __attribute__ ((unused)), ++ void (*freekey)(void *) __attribute__ ((unused))) ++{ ++} ++#endif ++ + #endif +--- a/libdwfl/libdwflP.h ++++ b/libdwfl/libdwflP.h +@@ -31,6 +31,8 @@ + + #include + #include ++#include ++#include + #include + #include + #include +--- /dev/null ++++ b/lib/stdio_ext.h +@@ -0,0 +1,6 @@ ++#include ++#ifndef __APPLE__ ++#include_next ++#else ++#define __fsetlocking(...) 0 ++#endif +--- a/libdw/libdwP.h ++++ b/libdw/libdwP.h +@@ -32,8 +32,10 @@ + #include + #include + ++#include + #include + #include ++#include + + + /* Known location expressions already decoded. */ +--- a/libdw/Makefile.am ++++ b/libdw/Makefile.am +@@ -34,14 +34,12 @@ endif + AM_CPPFLAGS += -I$(srcdir)/../libebl -I$(srcdir)/../libelf -I$(srcdir)/../libdwelf -pthread + VERSION = 1 + +-lib_LIBRARIES = libdw.a +-noinst_LIBRARIES = libdw_pic.a +-noinst_DATA = $(noinst_LIBRARIES:_pic.a=.so) ++lib_LTLIBRARIES = libdw.la + + include_HEADERS = dwarf.h + pkginclude_HEADERS = libdw.h known-dwarf.h + +-libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \ ++libdw_la_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \ + dwarf_getpubnames.c dwarf_getabbrev.c dwarf_tag.c \ + dwarf_error.c dwarf_nextcu.c dwarf_diename.c dwarf_offdie.c \ + dwarf_attr.c dwarf_formstring.c \ +@@ -103,50 +101,12 @@ $(srcdir)/known-dwarf.h: $(top_srcdir)/c + mv -f $@.new $@ + endif + +-libdw_pic_a_SOURCES = +-am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os) +- +-libdw_so_LIBS = ../libebl/libebl_pic.a ../backends/libebl_backends_pic.a \ +- ../libcpu/libcpu_pic.a libdw_pic.a ../libdwelf/libdwelf_pic.a \ +- ../libdwfl/libdwfl_pic.a +-libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so +-libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LIBS) $(obstack_LIBS) $(zip_LIBS) -pthread +-libdw.so: $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS) +- $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \ +- -Wl,--soname,$@.$(VERSION),--enable-new-dtags \ +- -Wl,--version-script,$< \ +- $(NO_UNDEFINED) \ +- -Wl,--whole-archive $(libdw_so_LIBS) -Wl,--no-whole-archive \ +- $(libdw_so_LDLIBS) +- @$(textrel_check) +- $(AM_V_at)ln -fs $@ $@.$(VERSION) +- +-install: install-am libdw.so +- $(mkinstalldirs) $(DESTDIR)$(libdir) +- $(INSTALL_PROGRAM) libdw.so $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so +- ln -fs libdw-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdw.so.$(VERSION) +- ln -fs libdw.so.$(VERSION) $(DESTDIR)$(libdir)/libdw.so +- +-uninstall: uninstall-am +- rm -f $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so +- rm -f $(DESTDIR)$(libdir)/libdw.so.$(VERSION) +- rm -f $(DESTDIR)$(libdir)/libdw.so +- rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils +- +-libdwfl_objects = $(shell $(AR) t ../libdwfl/libdwfl.a) +-libdw_a_LIBADD = $(addprefix ../libdwfl/,$(libdwfl_objects)) +- +-libdwelf_objects = $(shell $(AR) t ../libdwelf/libdwelf.a) +-libdw_a_LIBADD += $(addprefix ../libdwelf/,$(libdwelf_objects)) +- +-libebl_objects = $(shell $(AR) t ../libebl/libebl.a) +-libdw_a_LIBADD += $(addprefix ../libebl/,$(libebl_objects)) +- +-backends_objects = $(shell $(AR) t ../backends/libebl_backends.a) +-libdw_a_LIBADD += $(addprefix ../backends/,$(backends_objects)) +- +-libcpu_objects = $(shell $(AR) t ../libcpu/libcpu.a) +-libdw_a_LIBADD += $(addprefix ../libcpu/,$(libcpu_objects)) ++libdw_la_LIBADD = \ ++ ../libdwfl/libdwfl.la \ ++ ../libdwelf/libdwelf.la \ ++ ../libebl/libebl.la \ ++ ../backends/libebl_backends.la \ ++ ../libcpu/libcpu.la + + noinst_HEADERS = libdwP.h memory-access.h dwarf_abbrev_hash.h \ + dwarf_sig8_hash.h cfi.h encoded-value.h +--- a/libasm/Makefile.am ++++ b/libasm/Makefile.am +@@ -32,12 +32,10 @@ AM_CPPFLAGS += -I$(top_srcdir)/libelf -I + + VERSION = 1 + +-lib_LIBRARIES = libasm.a +-noinst_LIBRARIES = libasm_pic.a +-noinst_DATA = $(noinst_LIBRARIES:_pic.a=.so) ++lib_LTLIBRARIES = libasm.la + pkginclude_HEADERS = libasm.h + +-libasm_a_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \ ++libasm_la_SOURCES = asm_begin.c asm_abort.c asm_end.c asm_error.c \ + asm_getelf.c asm_newscn.c asm_newscn_ingrp.c \ + asm_newsubscn.c asm_newsym.c asm_newcomsym.c \ + asm_newabssym.c \ +@@ -51,38 +49,6 @@ libasm_a_SOURCES = asm_begin.c asm_abort + disasm_begin.c disasm_cb.c disasm_end.c disasm_str.c \ + symbolhash.c + +-libasm_pic_a_SOURCES = +-am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os) +- +-libasm_so_DEPS = ../lib/libeu.a ../libebl/libebl_pic.a ../libelf/libelf.so ../libdw/libdw.so +-libasm_so_LDLIBS = $(libasm_so_DEPS) +-if USE_LOCKS +-libasm_so_LDLIBS += -lpthread +-endif +- +-libasm_so_LIBS = libasm_pic.a +-libasm.so: $(srcdir)/libasm.map $(libasm_so_LIBS) $(libasm_so_DEPS) +- $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \ +- -Wl,--soname,$@.$(VERSION) \ +- -Wl,--version-script,$< \ +- $(NO_UNDEFINED) \ +- -Wl,--whole-archive $(libasm_so_LIBS) -Wl,--no-whole-archive \ +- $(libasm_so_LDLIBS) +- @$(textrel_check) +- $(AM_V_at)ln -fs $@ $@.$(VERSION) +- +-install: install-am libasm.so +- $(mkinstalldirs) $(DESTDIR)$(libdir) +- $(INSTALL_PROGRAM) libasm.so $(DESTDIR)$(libdir)/libasm-$(PACKAGE_VERSION).so +- ln -fs libasm-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libasm.so.$(VERSION) +- ln -fs libasm.so.$(VERSION) $(DESTDIR)$(libdir)/libasm.so +- +-uninstall: uninstall-am +- rm -f $(DESTDIR)$(libdir)/libasm-$(PACKAGE_VERSION).so +- rm -f $(DESTDIR)$(libdir)/libasm.so.$(VERSION) +- rm -f $(DESTDIR)$(libdir)/libasm.so +- rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils +- + noinst_HEADERS = libasmP.h symbolhash.h + EXTRA_DIST = libasm.map + +--- a/libdwfl/Makefile.am ++++ b/libdwfl/Makefile.am +@@ -34,13 +34,11 @@ AM_CPPFLAGS += -I$(srcdir) -I$(srcdir)/. + -I$(srcdir)/../libdw -I$(srcdir)/../libdwelf -I$(builddir)/../debuginfod + VERSION = 1 + +-noinst_LIBRARIES = libdwfl.a +-noinst_LIBRARIES += libdwfl_pic.a ++noinst_LTLIBRARIES = libdwfl.la + + pkginclude_HEADERS = libdwfl.h + +- +-libdwfl_a_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c dwfl_version.c \ ++libdwfl_la_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c dwfl_version.c \ + dwfl_module.c dwfl_report_elf.c relocate.c \ + dwfl_module_build_id.c dwfl_module_report_build_id.c \ + derelocate.c offline.c segment.c \ +@@ -73,24 +71,14 @@ libdwfl_a_SOURCES = dwfl_begin.c dwfl_en + gzip.c debuginfod-client.c + + if BZLIB +-libdwfl_a_SOURCES += bzip2.c ++libdwfl_la_SOURCES += bzip2.c + endif + if LZMA +-libdwfl_a_SOURCES += lzma.c ++libdwfl_la_SOURCES += lzma.c + endif + if ZSTD +-libdwfl_a_SOURCES += zstd.c ++libdwfl_la_SOURCES += zstd.c + endif + +-libdwfl = $(libdw) +-libdw = ../libdw/libdw.so +-libelf = ../libelf/libelf.so +-libebl = ../libebl/libebl.a +-libeu = ../lib/libeu.a +- +-libdwfl_pic_a_SOURCES = +-am_libdwfl_pic_a_OBJECTS = $(libdwfl_a_SOURCES:.c=.os) +- + noinst_HEADERS = libdwflP.h + +-CLEANFILES += $(am_libdwfl_pic_a_OBJECTS) +--- a/backends/Makefile.am ++++ b/backends/Makefile.am +@@ -34,7 +34,7 @@ endif + AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \ + -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw + +-noinst_LIBRARIES = libebl_backends.a libebl_backends_pic.a ++noinst_LTLIBRARIES = libebl_backends.la + + modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \ + m68k bpf riscv csky loongarch arc +@@ -100,17 +100,13 @@ loongarch_SRCS = loongarch_init.c loonga + + arc_SRCS = arc_init.c arc_symbol.c + +-libebl_backends_a_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \ ++libebl_backends_la_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \ + $(ia64_SRCS) $(alpha_SRCS) $(arm_SRCS) \ + $(aarch64_SRCS) $(sparc_SRCS) $(ppc_SRCS) \ + $(ppc64_SRCS) $(s390_SRCS) \ + $(m68k_SRCS) $(bpf_SRCS) $(riscv_SRCS) $(csky_SRCS) \ + $(loongarch_SRCS) $(arc_SRCS) + +-libebl_backends_pic_a_SOURCES = +-am_libebl_backends_pic_a_OBJECTS = $(libebl_backends_a_SOURCES:.c=.os) + + noinst_HEADERS = libebl_CPU.h common-reloc.c linux-core-note.c x86_corenote.c + EXTRA_DIST = $(modules:=_reloc.def) +- +-MOSTLYCLEANFILES = $(am_libebl_backends_pic_a_OBJECTS) +--- a/libdwelf/Makefile.am ++++ b/libdwelf/Makefile.am +@@ -34,24 +34,12 @@ AM_CPPFLAGS += -I$(srcdir)/../libelf -I$ + -I$(srcdir)/../libdwfl -I$(srcdir)/../libebl + VERSION = 1 + +-noinst_LIBRARIES = libdwelf.a libdwelf_pic.a ++noinst_LTLIBRARIES = libdwelf.la + + pkginclude_HEADERS = libdwelf.h + noinst_HEADERS = libdwelfP.h + +-libdwelf_a_SOURCES = dwelf_elf_gnu_debuglink.c dwelf_dwarf_gnu_debugaltlink.c \ ++libdwelf_la_SOURCES = dwelf_elf_gnu_debuglink.c dwelf_dwarf_gnu_debugaltlink.c \ + dwelf_elf_gnu_build_id.c dwelf_scn_gnu_compressed_size.c \ + dwelf_strtab.c dwelf_elf_begin.c \ + dwelf_elf_e_machine_string.c +- +-libdwelf = $(libdw) +- +-libdw = ../libdw/libdw.so +-libelf = ../libelf/libelf.so +-libebl = ../libebl/libebl.a +-libeu = ../lib/libeu.a +- +-libdwelf_pic_a_SOURCES = +-am_libdwelf_pic_a_OBJECTS = $(libdwelf_a_SOURCES:.c=.os) +- +-CLEANFILES += $(am_libdwelf_pic_a_OBJECTS) +--- a/libebl/Makefile.am ++++ b/libebl/Makefile.am +@@ -34,9 +34,9 @@ endif + AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libdw -I$(srcdir)/../libasm + VERSION = 1 + +-noinst_LIBRARIES = libebl.a libebl_pic.a ++noinst_LTLIBRARIES = libebl.la + +-libebl_a_SOURCES = eblopenbackend.c eblclosebackend.c eblreloctypename.c \ ++libebl_la_SOURCES = eblopenbackend.c eblclosebackend.c eblreloctypename.c \ + eblsegmenttypename.c eblsectiontypename.c \ + eblmachineflagname.c eblsymboltypename.c \ + ebldynamictagname.c eblsectionname.c \ +@@ -56,9 +56,4 @@ libebl_a_SOURCES = eblopenbackend.c eblc + eblresolvesym.c eblcheckreloctargettype.c \ + ebl_data_marker_symbol.c + +-libebl_pic_a_SOURCES = +-am_libebl_pic_a_OBJECTS = $(libebl_a_SOURCES:.c=.os) +- + noinst_HEADERS = libebl.h libeblP.h ebl-hooks.h +- +-MOSTLYCLEANFILES = $(am_libebl_pic_a_OBJECTS) +--- a/debuginfod/Makefile.am ++++ b/debuginfod/Makefile.am +@@ -40,23 +40,12 @@ AM_CPPFLAGS += -I$(srcdir) -I$(srcdir)/. + program_prefix= + program_transform_name = s,x,x, + +-if BUILD_STATIC +-libasm = ../libasm/libasm.a +-libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread +-libelf = ../libelf/libelf.a -lz +-if DUMMY_LIBDEBUGINFOD +-libdebuginfod = ./libdebuginfod.a +-else +-libdebuginfod = ./libdebuginfod.a -lpthread $(libcurl_LIBS) +-endif +-else +-libasm = ../libasm/libasm.so +-libdw = ../libdw/libdw.so +-libelf = ../libelf/libelf.so +-libdebuginfod = ./libdebuginfod.so +-endif +-libebl = ../libebl/libebl.a +-libeu = ../lib/libeu.a ++libasm = ../libasm/libasm.la ++libdw = ../libdw/libdw.la -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread ++libelf = ../libelf/libelf.la ++libdebuginfod = ./libdebuginfod.la ++libebl = ../libebl/libebl.la ++libeu = ../lib/libeu.la + + AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw:. + +@@ -76,14 +65,10 @@ debuginfod_find_SOURCES = debuginfod-fin + debuginfod_find_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(argp_LDADD) $(fts_LIBS) + + if LIBDEBUGINFOD +-noinst_LIBRARIES = libdebuginfod.a +-noinst_LIBRARIES += libdebuginfod_pic.a ++libdebuginfod_la_SOURCES = debuginfod-client.c ++noinst_LTLIBRARIES = libdebuginfod.la + endif + +-libdebuginfod_a_SOURCES = debuginfod-client.c +-libdebuginfod_pic_a_SOURCES = debuginfod-client.c +-am_libdebuginfod_pic_a_OBJECTS = $(libdebuginfod_a_SOURCES:.c=.os) +- + if DUMMY_LIBDEBUGINFOD + AM_CPPFLAGS += -Wno-unused-parameter + endif +@@ -92,42 +77,7 @@ if LIBDEBUGINFOD + pkginclude_HEADERS = debuginfod.h + endif + +-if LIBDEBUGINFOD +-libdebuginfod_so_LIBS = libdebuginfod_pic.a +-if DUMMY_LIBDEBUGINFOD +-libdebuginfod_so_LDLIBS = +-else +-libdebuginfod_so_LDLIBS = -lpthread $(libcurl_LIBS) $(fts_LIBS) $(libelf) +-endif +-$(LIBDEBUGINFOD_SONAME): $(srcdir)/libdebuginfod.map $(libdebuginfod_so_LIBS) +- $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \ +- -Wl,--soname,$(LIBDEBUGINFOD_SONAME) \ +- -Wl,--version-script,$< \ +- $(NO_UNDEFINED) \ +- -Wl,--whole-archive $(libdebuginfod_so_LIBS) -Wl,--no-whole-archive \ +- $(libdebuginfod_so_LDLIBS) +- @$(textrel_check) +- +-libdebuginfod.so: $(LIBDEBUGINFOD_SONAME) +- ln -fs $< $@ +- +-install: install-am libdebuginfod.so +- $(mkinstalldirs) $(DESTDIR)$(libdir) +- $(INSTALL_PROGRAM) $(LIBDEBUGINFOD_SONAME) \ +- $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so +- ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/$(LIBDEBUGINFOD_SONAME) +- ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdebuginfod.so +- +-uninstall: uninstall-am +- rm -f $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so +- rm -f $(DESTDIR)$(libdir)/$(LIBDEBUGINFOD_SONAME) +- rm -f $(DESTDIR)$(libdir)/libdebuginfod.so +- rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils +-endif +- + EXTRA_DIST = libdebuginfod.map +-MOSTLYCLEANFILES = $(am_libdebuginfod_pic_a_OBJECTS) $(LIBDEBUGINFOD_SONAME) +-CLEANFILES += $(am_libdebuginfod_pic_a_OBJECTS) libdebuginfod.so + + # automake std-options override: arrange to pass LD_LIBRARY_PATH + installcheck-binPROGRAMS: $(bin_PROGRAMS) +--- a/lib/Makefile.am ++++ b/lib/Makefile.am +@@ -31,9 +31,9 @@ include $(top_srcdir)/config/eu.am + AM_CFLAGS += $(fpic_CFLAGS) + AM_CPPFLAGS += -I$(srcdir)/../libelf + +-noinst_LIBRARIES = libeu.a ++noinst_LTLIBRARIES = libeu.la + +-libeu_a_SOURCES = xasprintf.c xstrdup.c xstrndup.c xmalloc.c next_prime.c \ ++libeu_la_SOURCES = xasprintf.c xstrdup.c xstrndup.c xmalloc.c next_prime.c \ + crc32.c crc32_file.c \ + color.c error.c printversion.c + +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -29,9 +29,9 @@ bin_PROGRAMS = readelf nm size strip elf + elfcmp objdump ranlib strings ar unstrip stack elfcompress \ + elfclassify + +-noinst_LIBRARIES = libar.a ++noinst_LTLIBRARIES = libar.la + +-libar_a_SOURCES = arlib.c arlib2.c arlib-argp.c ++libar_la_SOURCES = arlib.c arlib2.c arlib-argp.c + + EXTRA_DIST = arlib.h debugpred.h + +@@ -39,17 +39,11 @@ bin_SCRIPTS = make-debug-archive + EXTRA_DIST += make-debug-archive.in + CLEANFILES += make-debug-archive + +-if BUILD_STATIC +-libasm = ../libasm/libasm.a +-libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread +-libelf = ../libelf/libelf.a -lz +-else +-libasm = ../libasm/libasm.so +-libdw = ../libdw/libdw.so +-libelf = ../libelf/libelf.so +-endif +-libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a +-libeu = ../lib/libeu.a ++libasm = ../libasm/libasm.la ++libdw = ../libdw/libdw.la -lz $(zip_LIBS) $(libelf) -ldl -lpthread ++libelf = ../libelf/libelf.la ++libebl = ../libebl/libebl.la ../backends/libebl_backends.la ../libcpu/libcpu.la ++libeu = ../lib/libeu.la + + if DEMANGLE + demanglelib = -lstdc++ +@@ -77,9 +71,9 @@ findtextrel_LDADD = $(libdw) $(libelf) $ + addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib) + elfcmp_LDADD = $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD) + objdump_LDADD = $(libasm) $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD) +-ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS) ++ranlib_LDADD = libar.la $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS) + strings_LDADD = $(libelf) $(libeu) $(argp_LDADD) +-ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS) ++ar_LDADD = libar.la $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS) + unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) + stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(demanglelib) + elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -662,17 +662,11 @@ installcheck-local: + TESTS_ENVIRONMENT="$(installed_TESTS_ENVIRONMENT)" \ + LOG_COMPILER="$(installed_LOG_COMPILER)" check-TESTS + +-if BUILD_STATIC +-libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread +-libelf = ../libelf/libelf.a -lz +-libasm = ../libasm/libasm.a +-else +-libdw = ../libdw/libdw.so +-libelf = ../libelf/libelf.so +-libasm = ../libasm/libasm.so +-endif +-libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a +-libeu = ../lib/libeu.a ++libdw = ../libdw/libdw.la -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread ++libelf = ../libelf/libelf.la ++libasm = ../libasm/libasm.la ++libebl = ../libebl/libebl.la ../backends/libebl_backends.la ../libcpu/libcpu.la ++libeu = ../lib/libeu.la + + arextract_LDADD = $(libelf) + arsymtest_LDADD = $(libelf) +--- a/libcpu/Makefile.am ++++ b/libcpu/Makefile.am +@@ -38,19 +38,16 @@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAG + LEX_OUTPUT_ROOT = lex.$( $@T +@@ -87,20 +84,15 @@ endif + + i386_lex_no_Werror = yes + +-libeu = ../lib/libeu.a ++libeu = ../lib/libeu.la + + i386_lex_CFLAGS = -Wno-unused-label -Wno-unused-function -Wno-sign-compare \ + -Wno-implicit-fallthrough +-i386_parse.o: i386_parse.c i386.mnemonics +-i386_lex.o: i386_parse.h + i386_gendis_LDADD = $(libeu) -lm $(obstack_LIBS) + +-i386_parse.h: i386_parse.c ; +- + bpf_disasm_CFLAGS = -Wno-format-nonliteral + + EXTRA_DIST = defs/i386 + +-MOSTLYCLEANFILES = $(am_libcpu_pic_a_OBJECTS) + CLEANFILES += $(foreach P,i386 x86_64,$P_defs $P.mnemonics) + MAINTAINERCLEANFILES = $(foreach P,i386 x86_64, $P_dis.h) +--- a/config/libelf.pc.in ++++ b/config/libelf.pc.in +@@ -8,7 +8,7 @@ Description: elfutils libelf library to + Version: @VERSION@ + URL: http://elfutils.org/ + +-Libs: -L${libdir} -lelf ++Libs: -L${libdir} -lelf -lz + Cflags: -I${includedir} + + Requires.private: zlib @LIBZSTD@ diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 72103411677531..6dc77621ea3ee6 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-06-29 -PKG_SOURCE_VERSION:=9e2de8515be15e2b61ae518ce592e5b446ef2d48 -PKG_MIRROR_HASH:=e43d1796dd482ec364e5196f224bb1563dbb0494f0f28fb4e206ef7ef31260fb +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 diff --git a/tools/firmware-utils/patches/001-add-sifiveu-guid-types.patch b/tools/firmware-utils/patches/001-add-sifiveu-guid-types.patch deleted file mode 100644 index 45900e982c9c4c..00000000000000 --- a/tools/firmware-utils/patches/001-add-sifiveu-guid-types.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -ruN firmware-utils-2022-02-28-002cfaf0.old/src/ptgen.c firmware-utils-2022-02-28-002cfaf0/src/ptgen.c ---- firmware-utils-2022-02-28-002cfaf0.old/src/ptgen.c 2022-04-23 19:02:07.307896842 +0200 -+++ firmware-utils-2022-02-28-002cfaf0/src/ptgen.c 2022-04-22 18:48:54.477970950 +0200 -@@ -82,6 +82,14 @@ - GUID_INIT( 0x0fc63daf, 0x8483, 0x4772, \ - 0x8e, 0x79, 0x3d, 0x69, 0xd8, 0x47, 0x7d, 0xe4) - -+#define GUID_PARTITION_SIFIVE_SPL \ -+ GUID_INIT( 0x5b193300, 0xfc78, 0x40cd, \ -+ 0x80, 0x02, 0xe8, 0x6c, 0x45, 0x58, 0x0b, 0x47) -+ -+#define GUID_PARTITION_SIFIVE_UBOOT \ -+ GUID_INIT( 0x2e54b353, 0x1271, 0x4842, \ -+ 0x80, 0x6f, 0xe4, 0x36, 0xd6, 0xaf, 0x69, 0x85) -+ - #define GPT_HEADER_SIZE 92 - #define GPT_ENTRY_SIZE 128 - #define GPT_ENTRY_MAX 128 -@@ -276,6 +284,19 @@ - (1ULL << 56); /* success=1 */ - return true; - } -+ -+ if (!strcmp(type, "sifiveu_spl")) { -+ part->has_guid = true; -+ part->guid = GUID_PARTITION_SIFIVE_SPL; -+ return true; -+ } -+ -+ if (!strcmp(type, "sifiveu_uboot")) { -+ part->has_guid = true; -+ part->guid = GUID_PARTITION_SIFIVE_UBOOT; -+ return true; -+ } -+ - return false; - } - diff --git a/tools/gmp/Makefile b/tools/gmp/Makefile index c48069dd7bc616..7f0a7a7a6a1eb1 100644 --- a/tools/gmp/Makefile +++ b/tools/gmp/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gmp -PKG_VERSION:=6.2.1 +PKG_VERSION:=6.3.0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gmp/ -PKG_HASH:=fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2 +PKG_HASH:=a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898 PKG_CPE_ID:=cpe:/a:gmplib:gmp HOST_FIXUP:=autoreconf diff --git a/tools/gnulib/Makefile b/tools/gnulib/Makefile index 43d86c213c7083..2ce763f6ab7948 100644 --- a/tools/gnulib/Makefile +++ b/tools/gnulib/Makefile @@ -18,10 +18,11 @@ define Host/Install $(INSTALL_DATA) $(HOST_BUILD_DIR)/m4/*.m4 $(1)/share/aclocal/ $(INSTALL_DIR) $(1)/share/gnulib $(CP) $(HOST_BUILD_DIR)/* $(1)/share/gnulib/ + ln -sf ../share/gnulib/gnulib-tool $(STAGING_DIR_HOST)/bin/gnulib-tool endef define Host/Clean - rm -rf $(STAGING_DIR_HOST)/share/gnulib + rm -rf $(STAGING_DIR_HOST)/bin/gnulib-tool $(STAGING_DIR_HOST)/share/gnulib endef $(eval $(call HostBuild)) diff --git a/tools/include/asm/types.h b/tools/include/asm/types.h index 2c912326195208..5a12bbe91b604d 100644 --- a/tools/include/asm/types.h +++ b/tools/include/asm/types.h @@ -10,15 +10,20 @@ #define _ASM_GENERIC_INT_LL64_H typedef __signed__ char __s8; +typedef unsigned char __u8; typedef __signed__ short __s16; +typedef unsigned short __u16; typedef __signed__ int __s32; +typedef unsigned int __u32; #ifdef __GNUC__ __extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; #else typedef __signed__ long long __s64; +typedef unsigned long long __u64; #endif #endif /* _ASM_GENERIC_INT_LL64_H */ diff --git a/tools/include/endian.h b/tools/include/endian.h index e2ac7556672ef8..f625689f3dfa4d 100644 --- a/tools/include/endian.h +++ b/tools/include/endian.h @@ -37,4 +37,52 @@ #define __LITTLE_ENDIAN LITTLE_ENDIAN #endif +#ifndef __linux__ +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define htobe16(x) bswap_16(x) +#define be16toh(x) bswap_16(x) +#define htobe32(x) bswap_32(x) +#define be32toh(x) bswap_32(x) +#define htobe64(x) bswap_64(x) +#define be64toh(x) bswap_64(x) +#define htole16(x) (uint16_t)(x) +#define le16toh(x) (uint16_t)(x) +#define htole32(x) (uint32_t)(x) +#define le32toh(x) (uint32_t)(x) +#define htole64(x) (uint64_t)(x) +#define le64toh(x) (uint64_t)(x) +#else +#define htobe16(x) (uint16_t)(x) +#define be16toh(x) (uint16_t)(x) +#define htobe32(x) (uint32_t)(x) +#define be32toh(x) (uint32_t)(x) +#define htobe64(x) (uint64_t)(x) +#define be64toh(x) (uint64_t)(x) +#define htole16(x) bswap_16(x) +#define le16toh(x) bswap_16(x) +#define htole32(x) bswap_32(x) +#define le32toh(x) bswap_32(x) +#define htole64(x) bswap_64(x) +#define le64toh(x) bswap_64(x) +#endif + +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define betoh16(x) bswap_16(x) +#define betoh32(x) bswap_32(x) +#define betoh64(x) bswap_64(x) +#define letoh16(x) (uint16_t)(x) +#define letoh32(x) (uint32_t)(x) +#define letoh64(x) (uint64_t)(x) +#else +#define betoh16(x) (uint16_t)(x) +#define betoh32(x) (uint32_t)(x) +#define betoh64(x) (uint64_t)(x) +#define letoh16(x) bswap_16(x) +#define letoh32(x) bswap_32(x) +#define letoh64(x) bswap_64(x) +#endif +#endif +#endif + #endif diff --git a/tools/libdeflate/Makefile b/tools/libdeflate/Makefile index e0f348196dc37f..5da6c693eacbeb 100644 --- a/tools/libdeflate/Makefile +++ b/tools/libdeflate/Makefile @@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libdeflate -PKG_VERSION:=1.18 +PKG_VERSION:=1.19 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://github.com/ebiggers/libdeflate.git PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=v$(PKG_VERSION) -PKG_MIRROR_HASH:=015cbd33b1382b812f7c035640709186bc5d3d6a0ab177bffa7948f26f64edf9 +PKG_MIRROR_HASH:=5aac9801815384a5e417c8345d25d07547648e28403566ef73a46295ec26b6c4 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/mkimage/Makefile b/tools/mkimage/Makefile index a6d54f5eff2ae4..5dceb9a471778a 100644 --- a/tools/mkimage/Makefile +++ b/tools/mkimage/Makefile @@ -7,14 +7,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mkimage -PKG_VERSION:=2023.04 +PKG_VERSION:=2023.10 PKG_SOURCE:=u-boot-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ https://mirror.cyberbits.eu/u-boot \ https://ftp.denx.de/pub/u-boot \ ftp://ftp.denx.de/pub/u-boot -PKG_HASH:=e31cac91545ff41b71cec5d8c22afd695645cd6e2a442ccdacacd60534069341 +PKG_HASH:=e00e6c6f014e046101739d08d06f328811cebcf5ae101348f409cbbd55ce6900 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/u-boot-$(PKG_VERSION) diff --git a/tools/mkimage/patches/030-allow-to-use-different-magic.patch b/tools/mkimage/patches/030-allow-to-use-different-magic.patch index c33b0f4327ad71..3689fcb531538d 100644 --- a/tools/mkimage/patches/030-allow-to-use-different-magic.patch +++ b/tools/mkimage/patches/030-allow-to-use-different-magic.patch @@ -50,7 +50,7 @@ This patch makes it possible to set a custom image magic. break; --- a/tools/default_image.c +++ b/tools/default_image.c -@@ -63,7 +63,7 @@ static int image_verify_header(unsigned +@@ -68,7 +68,7 @@ static int image_verify_header(unsigned */ memcpy(hdr, ptr, sizeof(struct legacy_img_hdr)); @@ -59,7 +59,7 @@ This patch makes it possible to set a custom image magic. debug("%s: Bad Magic Number: \"%s\" is no valid image\n", params->cmdname, params->imagefile); return -FDT_ERR_BADMAGIC; -@@ -142,7 +142,7 @@ static void image_set_header(void *ptr, +@@ -147,7 +147,7 @@ static void image_set_header(void *ptr, } /* Build new header */ diff --git a/tools/mkimage/patches/100-increase-tmpfile-name-length-limit.patch b/tools/mkimage/patches/100-increase-tmpfile-name-length-limit.patch deleted file mode 100644 index aae89356012f07..00000000000000 --- a/tools/mkimage/patches/100-increase-tmpfile-name-length-limit.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/tools/mkimage.h -+++ b/tools/mkimage.h -@@ -44,7 +44,7 @@ static inline ulong map_to_sysmem(void * - #define ALLOC_CACHE_ALIGN_BUFFER(type, name, size) type name[size] - - #define MKIMAGE_TMPFILE_SUFFIX ".tmp" --#define MKIMAGE_MAX_TMPFILE_LEN 256 -+#define MKIMAGE_MAX_TMPFILE_LEN 1024 - #define MKIMAGE_DEFAULT_DTC_OPTIONS "-I dts -O dtb -p 500" - #define MKIMAGE_MAX_DTC_CMDLINE_LEN 2 * MKIMAGE_MAX_TMPFILE_LEN + 35 - diff --git a/tools/mold/Makefile b/tools/mold/Makefile index b266cea77dc33f..418f04fb6b7844 100644 --- a/tools/mold/Makefile +++ b/tools/mold/Makefile @@ -3,12 +3,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mold -PKG_VERSION:=2.1.0 +PKG_VERSION:=2.3.2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL_FILE:=v$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/rui314/mold/archive/refs/tags -PKG_HASH:=a32bec1282671b18ea4691855aed925ea2f348dfef89cb7689cd81273ea0c5df +PKG_HASH:=db172c0e97606565a81e37995bf5c911606d3f3b9f3829e92cd26985c9b0ed3b include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/tools/mtd-utils/Makefile b/tools/mtd-utils/Makefile index 90108019769b69..59b1716072c1a7 100644 --- a/tools/mtd-utils/Makefile +++ b/tools/mtd-utils/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mtd-utils -PKG_VERSION:=2.1.5 +PKG_VERSION:=2.1.6 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://infraroot.at/pub/mtd/ -PKG_HASH:=386e27fd121699b6b729bc2e8e04dda987b31cca6b16e12fb6cc6dcf26449f46 +PKG_HASH:=c1d853bc4adf83bcabd2792fc95af33bdd8643c97e8f7b3f0180af36af76f0e5 PKG_CPE_ID:=cpe:/a:mtd-utils_project:mtd-utils PKG_FIXUP:=autoreconf diff --git a/tools/mtd-utils/patches/110-portability.patch b/tools/mtd-utils/patches/110-portability.patch index 73b97796a2f4f4..e25fd82bb3c296 100644 --- a/tools/mtd-utils/patches/110-portability.patch +++ b/tools/mtd-utils/patches/110-portability.patch @@ -70,7 +70,7 @@ #include --- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c +++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c -@@ -1541,6 +1541,7 @@ static int add_inode(struct stat *st, in +@@ -1542,6 +1542,7 @@ static int add_inode(struct stat *st, in if (c->default_compr != UBIFS_COMPR_NONE) use_flags |= UBIFS_COMPR_FL; @@ -78,7 +78,7 @@ if (flags & FS_COMPR_FL) use_flags |= UBIFS_COMPR_FL; if (flags & FS_SYNC_FL) -@@ -1553,6 +1554,7 @@ static int add_inode(struct stat *st, in +@@ -1554,6 +1555,7 @@ static int add_inode(struct stat *st, in use_flags |= UBIFS_DIRSYNC_FL; if (fctx) use_flags |= UBIFS_CRYPT_FL; @@ -86,7 +86,7 @@ memset(ino, 0, UBIFS_INO_NODE_SZ); ino_key_init(&key, inum); -@@ -1638,7 +1640,9 @@ static int add_dir_inode(const char *pat +@@ -1639,7 +1641,9 @@ static int add_dir_inode(const char *pat fd = dirfd(dir); if (fd == -1) return sys_err_msg("dirfd failed"); @@ -96,7 +96,7 @@ flags = 0; } -@@ -1849,6 +1853,7 @@ static int add_file(const char *path_nam +@@ -1850,6 +1854,7 @@ static int add_file(const char *path_nam dn->ch.node_type = UBIFS_DATA_NODE; key_write(&key, &dn->key); out_len = NODE_BUFFER_SIZE - UBIFS_DATA_NODE_SZ; @@ -104,7 +104,7 @@ if (c->default_compr == UBIFS_COMPR_NONE && !c->encrypted && (flags & FS_COMPR_FL)) #ifdef WITHOUT_LZO -@@ -1857,6 +1862,7 @@ static int add_file(const char *path_nam +@@ -1858,6 +1863,7 @@ static int add_file(const char *path_nam use_compr = UBIFS_COMPR_LZO; #endif else @@ -112,7 +112,7 @@ use_compr = c->default_compr; compr_type = compress_data(buf, bytes_read, &dn->data, &out_len, use_compr); -@@ -1916,7 +1922,9 @@ static int add_non_dir(const char *path_ +@@ -1917,7 +1923,9 @@ static int add_non_dir(const char *path_ if (fd == -1) return sys_err_msg("failed to open file '%s'", path_name); diff --git a/tools/pkgconf/Makefile b/tools/pkgconf/Makefile index da1f005be63c2e..0b460a9891ade0 100644 --- a/tools/pkgconf/Makefile +++ b/tools/pkgconf/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pkgconf -PKG_VERSION:=2.0.1 +PKG_VERSION:=2.0.3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://distfiles.dereferenced.org/pkgconf -PKG_HASH:=3238af7473740844e5159dd8fb6540603e3fbcebf60beb3c8a426cdca2e29c51 +PKG_HASH:=cabdf3c474529854f7ccce8573c5ac68ad34a7e621037535cbc3981f6b23836c PKG_CPE_ID:=cpe:/a:pkgconf:pkgconf diff --git a/tools/xz/Makefile b/tools/xz/Makefile index 757d5ae0e1e116..e020f5a54752d7 100644 --- a/tools/xz/Makefile +++ b/tools/xz/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xz -PKG_VERSION:=5.4.4 +PKG_VERSION:=5.4.5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/lzmautils \ http://tukaani.org/xz -PKG_HASH:=0b6fcde1ac38e90433a2556f500c065950b9bcd2d602006efc334782bdfe6296 +PKG_HASH:=8ccf5fff868c006f29522e386fb4c6a1b66463fbca65a4cfc3c4bd596e895e79 PKG_CPE_ID:=cpe:/a:tukaani:xz HOST_BUILD_PARALLEL:=1 diff --git a/tools/zlib/Makefile b/tools/zlib/Makefile index 17fe9fa233d128..e802a0272e4b57 100644 --- a/tools/zlib/Makefile +++ b/tools/zlib/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zlib -PKG_VERSION:=1.2.13 +PKG_VERSION:=1.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/madler/zlib/releases/download/v$(PKG_VERSION) -PKG_HASH:=d14c38e313afc35a9a8760dadf26042f51ea0f5d154b0630a31da0540107fb98 +PKG_HASH:=8a9ba2898e1d0d774eca6ba5b4627a11e5588ba85c8851336eb38de4683050a7 PKG_LICENSE:=Zlib PKG_LICENSE_FILES:=README