Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2023-01-09 15:25:06 +08:00
commit 861f5abe83
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
67 changed files with 3058 additions and 490 deletions

View File

@ -171,7 +171,7 @@ endef
define KernelPackage/mt7615-firmware define KernelPackage/mt7615-firmware
$(KernelPackage/mt76-default) $(KernelPackage/mt76-default)
TITLE:=MediaTek MT7615e firmware TITLE:=MediaTek MT7615e firmware
DEFAULT:=PACKAGE_kmod-mt7615e DEPENDS+=+kmod-mt7615e
endef endef
define KernelPackage/mt7615e define KernelPackage/mt7615e
@ -182,6 +182,12 @@ define KernelPackage/mt7615e
AUTOLOAD:=$(call AutoProbe,mt7615e) AUTOLOAD:=$(call AutoProbe,mt7615e)
endef endef
define KernelPackage/mt7622-firmware
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7622 firmware
DEPENDS+=+kmod-mt7615e
endef
define KernelPackage/mt7663-firmware-ap define KernelPackage/mt7663-firmware-ap
$(KernelPackage/mt76-default) $(KernelPackage/mt76-default)
TITLE:=MediaTek MT7663e firmware (optimized for AP) TITLE:=MediaTek MT7663e firmware (optimized for AP)
@ -218,10 +224,16 @@ define KernelPackage/mt7663u
AUTOLOAD:=$(call AutoProbe,mt7663u) AUTOLOAD:=$(call AutoProbe,mt7663u)
endef endef
define KernelPackage/mt7915-firmware
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7915 firmware
DEPENDS+=+kmod-mt7915e
endef
define KernelPackage/mt7915e define KernelPackage/mt7915e
$(KernelPackage/mt76-default) $(KernelPackage/mt76-default)
TITLE:=MediaTek MT7915e wireless driver TITLE:=MediaTek MT7915e wireless driver
DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT +@KERNEL_RELAY DEPENDS+=@PCI_SUPPORT +kmod-mt76-connac +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT +@KERNEL_RELAY
FILES:= $(PKG_BUILD_DIR)/mt7915/mt7915e.ko FILES:= $(PKG_BUILD_DIR)/mt7915/mt7915e.ko
AUTOLOAD:=$(call AutoProbe,mt7915e) AUTOLOAD:=$(call AutoProbe,mt7915e)
endef endef
@ -439,9 +451,14 @@ define KernelPackage/mt7615-firmware/install
$(PKG_BUILD_DIR)/firmware/mt7615_cr4.bin \ $(PKG_BUILD_DIR)/firmware/mt7615_cr4.bin \
$(PKG_BUILD_DIR)/firmware/mt7615_n9.bin \ $(PKG_BUILD_DIR)/firmware/mt7615_n9.bin \
$(PKG_BUILD_DIR)/firmware/mt7615_rom_patch.bin \ $(PKG_BUILD_DIR)/firmware/mt7615_rom_patch.bin \
$(if $(CONFIG_TARGET_mediatek_mt7622), \ $(1)/lib/firmware/mediatek
endef
define KernelPackage/mt7622-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/mediatek
cp \
$(PKG_BUILD_DIR)/firmware/mt7622_n9.bin \ $(PKG_BUILD_DIR)/firmware/mt7622_n9.bin \
$(PKG_BUILD_DIR)/firmware/mt7622_rom_patch.bin) \ $(PKG_BUILD_DIR)/firmware/mt7622_rom_patch.bin \
$(1)/lib/firmware/mediatek $(1)/lib/firmware/mediatek
endef endef
@ -461,7 +478,7 @@ define KernelPackage/mt7663-firmware-sta/install
$(1)/lib/firmware/mediatek $(1)/lib/firmware/mediatek
endef endef
define KernelPackage/mt7915e/install define KernelPackage/mt7915-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/mediatek $(INSTALL_DIR) $(1)/lib/firmware/mediatek
cp \ cp \
$(PKG_BUILD_DIR)/firmware/mt7915_wa.bin \ $(PKG_BUILD_DIR)/firmware/mt7915_wa.bin \
@ -520,12 +537,14 @@ $(eval $(call KernelPackage,mt76-connac))
$(eval $(call KernelPackage,mt76-sdio)) $(eval $(call KernelPackage,mt76-sdio))
$(eval $(call KernelPackage,mt7615-common)) $(eval $(call KernelPackage,mt7615-common))
$(eval $(call KernelPackage,mt7615-firmware)) $(eval $(call KernelPackage,mt7615-firmware))
$(eval $(call KernelPackage,mt7622-firmware))
$(eval $(call KernelPackage,mt7615e)) $(eval $(call KernelPackage,mt7615e))
$(eval $(call KernelPackage,mt7663-firmware-ap)) $(eval $(call KernelPackage,mt7663-firmware-ap))
$(eval $(call KernelPackage,mt7663-firmware-sta)) $(eval $(call KernelPackage,mt7663-firmware-sta))
$(eval $(call KernelPackage,mt7663-usb-sdio)) $(eval $(call KernelPackage,mt7663-usb-sdio))
$(eval $(call KernelPackage,mt7663u)) $(eval $(call KernelPackage,mt7663u))
$(eval $(call KernelPackage,mt7663s)) $(eval $(call KernelPackage,mt7663s))
$(eval $(call KernelPackage,mt7915-firmware))
$(eval $(call KernelPackage,mt7915e)) $(eval $(call KernelPackage,mt7915e))
$(eval $(call KernelPackage,mt7916-firmware)) $(eval $(call KernelPackage,mt7916-firmware))
$(eval $(call KernelPackage,mt7986-firmware)) $(eval $(call KernelPackage,mt7986-firmware))

View File

@ -39,7 +39,9 @@ NOSTDINC_FLAGS := \
-I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \ -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
-I$(STAGING_DIR)/usr/include/mac80211 \ -I$(STAGING_DIR)/usr/include/mac80211 \
-I$(STAGING_DIR)/usr/include/mac80211/uapi \ -I$(STAGING_DIR)/usr/include/mac80211/uapi \
-include backport/backport.h -include backport/backport.h \
-Wno-error=address \
-Wno-error=stringop-overread
NOSTDINC_FLAGS+=-DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DBUILD_OPENWRT NOSTDINC_FLAGS+=-DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DBUILD_OPENWRT

View File

@ -81,7 +81,7 @@ HOST_CONFIGURE_VARS += \
CONFIGURE_VARS += \ CONFIGURE_VARS += \
ac_cv_search__obstack_free=yes ac_cv_search__obstack_free=yes
TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result -Wno-format-nonliteral TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result -Wno-format-nonliteral -Wno-error=use-after-free
define Build/InstallDev define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include $(INSTALL_DIR) $(1)/usr/include

View File

@ -32,7 +32,11 @@ define Package/uqmi/description
endef endef
TARGET_CFLAGS += \ TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include -ffunction-sections -fdata-sections -I$(STAGING_DIR)/usr/include \
-ffunction-sections \
-fdata-sections \
-Wno-error=dangling-pointer \
-Wno-error=maybe-uninitialized
TARGET_LDFLAGS += -Wl,--gc-sections TARGET_LDFLAGS += -Wl,--gc-sections

View File

@ -208,6 +208,15 @@ config BUSYBOX_DEFAULT_PASSWORD_MINLEN
config BUSYBOX_DEFAULT_MD5_SMALL config BUSYBOX_DEFAULT_MD5_SMALL
int int
default 1 default 1
config BUSYBOX_DEFAULT_SHA1_SMALL
int
default 3
config BUSYBOX_DEFAULT_SHA1_HWACCEL
bool
default y
config BUSYBOX_DEFAULT_SHA256_HWACCEL
bool
default y
config BUSYBOX_DEFAULT_SHA3_SMALL config BUSYBOX_DEFAULT_SHA3_SMALL
int int
default 1 default 1
@ -298,6 +307,15 @@ config BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE
config BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN config BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN
bool bool
default n default n
config BUSYBOX_DEFAULT_LOOP_CONFIGURE
bool
default n
config BUSYBOX_DEFAULT_NO_LOOP_CONFIGURE
bool
default n
config BUSYBOX_DEFAULT_TRY_LOOP_CONFIGURE
bool
default y
config BUSYBOX_DEFAULT_FEATURE_SEAMLESS_XZ config BUSYBOX_DEFAULT_FEATURE_SEAMLESS_XZ
bool bool
default n default n
@ -860,6 +878,9 @@ config BUSYBOX_DEFAULT_TRUNCATE
bool bool
default y if TARGET_bcm53xx default y if TARGET_bcm53xx
default n default n
config BUSYBOX_DEFAULT_TSORT
bool
default n
config BUSYBOX_DEFAULT_TTY config BUSYBOX_DEFAULT_TTY
bool bool
default n default n
@ -2162,6 +2183,9 @@ config BUSYBOX_DEFAULT_RUNLEVEL
config BUSYBOX_DEFAULT_RX config BUSYBOX_DEFAULT_RX
bool bool
default n default n
config BUSYBOX_DEFAULT_SEEDRNG
bool
default n
config BUSYBOX_DEFAULT_SETFATTR config BUSYBOX_DEFAULT_SETFATTR
bool bool
default n default n
@ -2174,6 +2198,9 @@ config BUSYBOX_DEFAULT_STRINGS
config BUSYBOX_DEFAULT_TIME config BUSYBOX_DEFAULT_TIME
bool bool
default y default y
config BUSYBOX_DEFAULT_TREE
bool
default n
config BUSYBOX_DEFAULT_TS config BUSYBOX_DEFAULT_TS
bool bool
default n default n
@ -2682,6 +2709,9 @@ config BUSYBOX_DEFAULT_FEATURE_UDHCPC_SANITIZEOPT
config BUSYBOX_DEFAULT_UDHCPC_DEFAULT_SCRIPT config BUSYBOX_DEFAULT_UDHCPC_DEFAULT_SCRIPT
string string
default "/usr/share/udhcpc/default.script" default "/usr/share/udhcpc/default.script"
config BUSYBOX_DEFAULT_UDHCPC6_DEFAULT_SCRIPT
string
default ""
config BUSYBOX_DEFAULT_UDHCPC6 config BUSYBOX_DEFAULT_UDHCPC6
bool bool
default n default n
@ -3012,6 +3042,9 @@ config BUSYBOX_DEFAULT_ASH_PRINTF
config BUSYBOX_DEFAULT_ASH_TEST config BUSYBOX_DEFAULT_ASH_TEST
bool bool
default y default y
config BUSYBOX_DEFAULT_ASH_SLEEP
bool
default n
config BUSYBOX_DEFAULT_ASH_HELP config BUSYBOX_DEFAULT_ASH_HELP
bool bool
default n default n

View File

@ -5,14 +5,14 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=busybox PKG_NAME:=busybox
PKG_VERSION:=1.35.0 PKG_VERSION:=1.36.0
PKG_RELEASE:=$(AUTORELEASE) PKG_RELEASE:=1
PKG_FLAGS:=essential PKG_FLAGS:=essential
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://www.busybox.net/downloads \ PKG_SOURCE_URL:=https://www.busybox.net/downloads \
http://sources.buildroot.net http://sources.buildroot.net
PKG_HASH:=faeeb244c35a348a334f4a59e44626ee870fb07b6884d68c10ae8bc19f83a694 PKG_HASH:=542750c8af7cb2630e201780b4f99f3dcceeb06f505b479ec68241c1e6af61a5
PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_PAM:libpam PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_PAM:libpam
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1

View File

@ -653,7 +653,7 @@ config BUSYBOX_CONFIG_SORT
sort is used to sort lines of text in specified files. sort is used to sort lines of text in specified files.
config BUSYBOX_CONFIG_FEATURE_SORT_BIG config BUSYBOX_CONFIG_FEATURE_SORT_BIG
bool "Full SuSv3 compliant sort (support -ktcbdfiogM)" bool "Full SuSv3 compliant sort (support -ktcbdfioghM)"
default BUSYBOX_DEFAULT_FEATURE_SORT_BIG default BUSYBOX_DEFAULT_FEATURE_SORT_BIG
depends on BUSYBOX_CONFIG_SORT depends on BUSYBOX_CONFIG_SORT
help help
@ -851,6 +851,11 @@ config BUSYBOX_CONFIG_TRUNCATE
help help
truncate truncates files to a given size. If a file does truncate truncates files to a given size. If a file does
not exist, it is created unless told otherwise. not exist, it is created unless told otherwise.
config BUSYBOX_CONFIG_TSORT
bool "tsort (0.7 kb)"
default BUSYBOX_DEFAULT_TSORT
help
tsort performs a topological sort.
config BUSYBOX_CONFIG_TTY config BUSYBOX_CONFIG_TTY
bool "tty (3.6 kb)" bool "tty (3.6 kb)"
default BUSYBOX_DEFAULT_TTY default BUSYBOX_DEFAULT_TTY

View File

@ -98,7 +98,7 @@ config BUSYBOX_CONFIG_MD5_SMALL
default BUSYBOX_DEFAULT_MD5_SMALL # all "fast or small" options default to small default BUSYBOX_DEFAULT_MD5_SMALL # all "fast or small" options default to small
range 0 3 range 0 3
help help
Trade binary size versus speed for the md5sum algorithm. Trade binary size versus speed for the md5 algorithm.
Approximate values running uClibc and hashing Approximate values running uClibc and hashing
linux-2.4.4.tar.bz2 were: linux-2.4.4.tar.bz2 were:
value user times (sec) text size (386) value user times (sec) text size (386)
@ -107,12 +107,38 @@ config BUSYBOX_CONFIG_MD5_SMALL
2 3.0 5088 2 3.0 5088
3 (smallest) 5.1 4912 3 (smallest) 5.1 4912
config BUSYBOX_CONFIG_SHA1_SMALL
int "SHA1: Trade bytes for speed (0:fast, 3:slow)"
default BUSYBOX_DEFAULT_SHA1_SMALL # all "fast or small" options default to small
range 0 3
help
Trade binary size versus speed for the sha1 algorithm.
With FEATURE_COPYBUF_KB=64:
throughput MB/s size of sha1_process_block64
value 486 x86-64 486 x86-64
0 440 485 3481 3502
1 265 265 641 696
2,3 220 210 342 364
config BUSYBOX_CONFIG_SHA1_HWACCEL
bool "SHA1: Use hardware accelerated instructions if possible"
default BUSYBOX_DEFAULT_SHA1_HWACCEL
help
On x86, this adds ~590 bytes of code. Throughput
is about twice as fast as fully-unrolled generic code.
config BUSYBOX_CONFIG_SHA256_HWACCEL
bool "SHA256: Use hardware accelerated instructions if possible"
default BUSYBOX_DEFAULT_SHA256_HWACCEL
help
On x86, this adds ~1k bytes of code.
config BUSYBOX_CONFIG_SHA3_SMALL config BUSYBOX_CONFIG_SHA3_SMALL
int "SHA3: Trade bytes for speed (0:fast, 1:slow)" int "SHA3: Trade bytes for speed (0:fast, 1:slow)"
default BUSYBOX_DEFAULT_SHA3_SMALL # all "fast or small" options default to small default BUSYBOX_DEFAULT_SHA3_SMALL # all "fast or small" options default to small
range 0 1 range 0 1
help help
Trade binary size versus speed for the sha3sum algorithm. Trade binary size versus speed for the sha3 algorithm.
SHA3_SMALL=0 compared to SHA3_SMALL=1 (approximate): SHA3_SMALL=0 compared to SHA3_SMALL=1 (approximate):
64-bit x86: +270 bytes of code, 45% faster 64-bit x86: +270 bytes of code, 45% faster
32-bit x86: +450 bytes of code, 75% faster 32-bit x86: +450 bytes of code, 75% faster
@ -399,3 +425,25 @@ config BUSYBOX_CONFIG_UNICODE_PRESERVE_BROKEN
For example, this means that entering 'l', 's', ' ', 0xff, [Enter] For example, this means that entering 'l', 's', ' ', 0xff, [Enter]
at shell prompt will list file named 0xff (single char name at shell prompt will list file named 0xff (single char name
with char value 255), not file named '?'. with char value 255), not file named '?'.
choice
prompt "Use LOOP_CONFIGURE for losetup and loop mounts"
default BUSYBOX_CONFIG_TRY_LOOP_CONFIGURE
help
LOOP_CONFIGURE is added to Linux 5.8
https://lwn.net/Articles/820408/
This allows userspace to completely setup a loop device with a single
ioctl, removing the in-between state where the device can be partially
configured - eg the loop device has a backing file associated with it,
but is reading from the wrong offset.
config BUSYBOX_CONFIG_LOOP_CONFIGURE
bool "use LOOP_CONFIGURE, needs kernel >= 5.8"
config BUSYBOX_CONFIG_NO_LOOP_CONFIGURE
bool "use LOOP_SET_FD + LOOP_SET_STATUS"
config BUSYBOX_CONFIG_TRY_LOOP_CONFIGURE
bool "try LOOP_CONFIGURE, fall back to LOOP_SET_FD + LOOP_SET_STATUS"
endchoice

View File

@ -704,6 +704,13 @@ config BUSYBOX_CONFIG_RX
default BUSYBOX_DEFAULT_RX default BUSYBOX_DEFAULT_RX
help help
Receive files using the Xmodem protocol. Receive files using the Xmodem protocol.
config BUSYBOX_CONFIG_SEEDRNG
bool "seedrng (1.3 kb)"
default BUSYBOX_DEFAULT_SEEDRNG
help
Seed the kernel RNG from seed files, meant to be called
once during startup, once during shutdown, and optionally
at some periodic interval in between.
config BUSYBOX_CONFIG_SETFATTR config BUSYBOX_CONFIG_SETFATTR
bool "setfattr (3.7 kb)" bool "setfattr (3.7 kb)"
default BUSYBOX_DEFAULT_SETFATTR default BUSYBOX_DEFAULT_SETFATTR
@ -727,6 +734,11 @@ config BUSYBOX_CONFIG_TIME
The time command runs the specified program with the given arguments. The time command runs the specified program with the given arguments.
When the command finishes, time writes a message to standard output When the command finishes, time writes a message to standard output
giving timing statistics about this program run. giving timing statistics about this program run.
config BUSYBOX_CONFIG_TREE
bool "tree (0.6 kb)"
default BUSYBOX_DEFAULT_TREE
help
List files and directories in a tree structure.
config BUSYBOX_CONFIG_TS config BUSYBOX_CONFIG_TS
bool "ts (450 bytes)" bool "ts (450 bytes)"
default BUSYBOX_DEFAULT_TS default BUSYBOX_DEFAULT_TS

View File

@ -93,12 +93,17 @@ config BUSYBOX_CONFIG_FEATURE_UDHCPC_SANITIZEOPT
config BUSYBOX_CONFIG_UDHCPC_DEFAULT_SCRIPT config BUSYBOX_CONFIG_UDHCPC_DEFAULT_SCRIPT
string "Absolute path to config script" string "Absolute path to config script"
default BUSYBOX_DEFAULT_UDHCPC_DEFAULT_SCRIPT default BUSYBOX_DEFAULT_UDHCPC_DEFAULT_SCRIPT
depends on BUSYBOX_CONFIG_UDHCPC || BUSYBOX_CONFIG_UDHCPC6 depends on BUSYBOX_CONFIG_UDHCPC
help help
This script is called after udhcpc receives an answer. See This script is called after udhcpc receives an answer. See
examples/udhcp for a working example. Normally it is safe examples/udhcp for a working example. Normally it is safe
to leave this untouched. to leave this untouched.
config BUSYBOX_CONFIG_UDHCPC6_DEFAULT_SCRIPT
string "Absolute path to config script for IPv6"
default BUSYBOX_DEFAULT_UDHCPC6_DEFAULT_SCRIPT
depends on BUSYBOX_CONFIG_UDHCPC6
# udhcpc6 config is inserted here: # udhcpc6 config is inserted here:
config BUSYBOX_CONFIG_UDHCPC6 config BUSYBOX_CONFIG_UDHCPC6
bool "udhcpc6 (21 kb)" bool "udhcpc6 (21 kb)"

View File

@ -201,6 +201,11 @@ config BUSYBOX_CONFIG_ASH_TEST
default BUSYBOX_DEFAULT_ASH_TEST default BUSYBOX_DEFAULT_ASH_TEST
depends on BUSYBOX_CONFIG_SHELL_ASH depends on BUSYBOX_CONFIG_SHELL_ASH
config BUSYBOX_CONFIG_ASH_SLEEP
bool "sleep builtin"
default BUSYBOX_DEFAULT_ASH_SLEEP
depends on BUSYBOX_CONFIG_SHELL_ASH
config BUSYBOX_CONFIG_ASH_HELP config BUSYBOX_CONFIG_ASH_HELP
bool "help builtin" bool "help builtin"
default BUSYBOX_DEFAULT_ASH_HELP default BUSYBOX_DEFAULT_ASH_HELP

View File

@ -1,42 +0,0 @@
From e63d7cdfdac78c6fd27e9e63150335767592b85e Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Fri, 17 Jun 2022 17:45:34 +0200
Subject: awk: fix use after free (CVE-2022-30065)
fixes https://bugs.busybox.net/show_bug.cgi?id=14781
function old new delta
evaluate 3343 3357 +14
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
editors/awk.c | 3 +++
testsuite/awk.tests | 6 ++++++
2 files changed, 9 insertions(+)
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -3114,6 +3114,9 @@ static var *evaluate(node *op, var *res)
case XC( OC_MOVE ):
debug_printf_eval("MOVE\n");
+ /* make sure that we never return a temp var */
+ if (L.v == TMPVAR0)
+ L.v = res;
/* if source is a temporary string, jusk relink it to dest */
if (R.v == TMPVAR1
&& !(R.v->type & VF_NUMBER)
--- a/testsuite/awk.tests
+++ b/testsuite/awk.tests
@@ -469,4 +469,10 @@ testing 'awk printf %% prints one %' \
"%\n" \
'' ''
+testing 'awk assign while test' \
+ "awk '\$1==\$1=\"foo\" {print \$1}'" \
+ "foo\n" \
+ "" \
+ "foo"
+
exit $FAILCOUNT

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=util-linux PKG_NAME:=util-linux
PKG_VERSION:=2.38 PKG_VERSION:=2.38.1
PKG_RELEASE:=$(AUTORELEASE) PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.38 PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.38
PKG_HASH:=6d111cbe4d55b336db2f1fbeffbc65b89908704c01136371d32aa9bec373eb64 PKG_HASH:=60492a19b44e6cf9a3ddff68325b333b8b52b6c59ce3ebd6a0ecaa4c5117e84f
PKG_CPE_ID:=cpe:/a:kernel:util-linux PKG_CPE_ID:=cpe:/a:kernel:util-linux
PKG_LICENSE:=GPL-2.0-only PKG_LICENSE:=GPL-2.0-only

View File

@ -1,20 +0,0 @@
From c387d4fe7a1435a762a5b7d8b75feb13ad613315 Mon Sep 17 00:00:00 2001
From: Anatoly Pugachev <matorola@gmail.com>
Date: Fri, 8 Apr 2022 15:34:16 +0300
Subject: [PATCH] libfdisk: meson.build fix typo
---
libfdisk/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/libfdisk/meson.build
+++ b/libfdisk/meson.build
@@ -11,7 +11,7 @@ libfdisk_h = configure_file(
output : 'libfdisk.h',
configuration : defs,
install : build_libfdisk,
- install_dir : join_paths(get_option('includedir'), 'libfisk'),
+ install_dir : join_paths(get_option('includedir'), 'libfdisk'),
)
lib_fdisk_sources = '''

View File

@ -1,22 +0,0 @@
From 38b15ca2dc4ca32bbe4a2449e1c7b645e4577840 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Fri, 29 Apr 2022 16:53:43 -0700
Subject: [PATCH 1/7] meson: fix compilation without systemd
systemdsystemunitdir is used elsewhere.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
meson.build | 1 +
1 file changed, 1 insertion(+)
--- a/meson.build
+++ b/meson.build
@@ -720,6 +720,7 @@ if fs_search_path_extra != ''
endif
conf.set_quoted('FS_SEARCH_PATH', fs_search_path)
+systemdsystemunitdir = ''
if systemd.found()
systemdsystemunitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
endif

View File

@ -1,21 +0,0 @@
From e51565b653cf09985df57cb7254b16d5af5df223 Mon Sep 17 00:00:00 2001
From: Nicolas Caramelli <caramelli.devel@gmail.com>
Date: Fri, 29 Apr 2022 18:16:36 +0200
Subject: [PATCH] meson: fix when HAVE_CLOCK_GETTIME is set
Signed-off-by: Nicolas Caramelli <caramelli.devel@gmail.com>
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/meson.build
+++ b/meson.build
@@ -602,7 +602,7 @@ if not have
have = cc.has_function('clock_gettime',
dependencies : realtime_libs)
endif
-conf.set('HAVE_CLOCK_GETTIME', have_dirfd ? 1 : false)
+conf.set('HAVE_CLOCK_GETTIME', have ? 1 : false)
thread_libs = dependency('threads')

View File

@ -200,6 +200,7 @@ CONFIG_NET_PTP_CLASSIFY=y
CONFIG_NET_SELFTESTS=y CONFIG_NET_SELFTESTS=y
CONFIG_NLS=y CONFIG_NLS=y
CONFIG_NVMEM=y CONFIG_NVMEM=y
# CONFIG_NVMEM_MICROCHIP_OTPC is not set
CONFIG_NVMEM_SYSFS=y CONFIG_NVMEM_SYSFS=y
CONFIG_OF=y CONFIG_OF=y
CONFIG_OF_ADDRESS=y CONFIG_OF_ADDRESS=y

View File

@ -305,6 +305,7 @@ CONFIG_NLS_UTF8=y
CONFIG_NO_HZ_COMMON=y CONFIG_NO_HZ_COMMON=y
CONFIG_NO_HZ_IDLE=y CONFIG_NO_HZ_IDLE=y
CONFIG_NVMEM=y CONFIG_NVMEM=y
# CONFIG_NVMEM_MICROCHIP_OTPC is not set
CONFIG_NVMEM_SYSFS=y CONFIG_NVMEM_SYSFS=y
CONFIG_OF=y CONFIG_OF=y
CONFIG_OF_ADDRESS=y CONFIG_OF_ADDRESS=y

View File

@ -269,6 +269,7 @@ CONFIG_NLS_UTF8=y
CONFIG_NO_HZ_COMMON=y CONFIG_NO_HZ_COMMON=y
CONFIG_NO_HZ_IDLE=y CONFIG_NO_HZ_IDLE=y
CONFIG_NVMEM=y CONFIG_NVMEM=y
# CONFIG_NVMEM_MICROCHIP_OTPC is not set
CONFIG_NVMEM_SYSFS=y CONFIG_NVMEM_SYSFS=y
CONFIG_OF=y CONFIG_OF=y
CONFIG_OF_ADDRESS=y CONFIG_OF_ADDRESS=y

View File

@ -25,7 +25,7 @@ Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
--- a/MAINTAINERS --- a/MAINTAINERS
+++ b/MAINTAINERS +++ b/MAINTAINERS
@@ -17521,6 +17521,14 @@ T: git git://linuxtv.org/media_tree.git @@ -17529,6 +17529,14 @@ T: git git://linuxtv.org/media_tree.git
F: Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml F: Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml
F: drivers/media/i2c/imx412.c F: drivers/media/i2c/imx412.c

View File

@ -132,7 +132,7 @@ Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
+... +...
--- a/MAINTAINERS --- a/MAINTAINERS
+++ b/MAINTAINERS +++ b/MAINTAINERS
@@ -17535,6 +17535,7 @@ M: Raspberry Pi Kernel Maintenance <kern @@ -17543,6 +17543,7 @@ M: Raspberry Pi Kernel Maintenance <kern
L: linux-media@vger.kernel.org L: linux-media@vger.kernel.org
S: Maintained S: Maintained
T: git git://linuxtv.org/media_tree.git T: git git://linuxtv.org/media_tree.git

View File

@ -132,7 +132,7 @@ Signed-off-by: Lee Jackson <info@arducam.com>
+... +...
--- a/MAINTAINERS --- a/MAINTAINERS
+++ b/MAINTAINERS +++ b/MAINTAINERS
@@ -17539,6 +17539,14 @@ F: Documentation/devicetree/bindings/med @@ -17547,6 +17547,14 @@ F: Documentation/devicetree/bindings/med
F: Documentation/devicetree/bindings/media/i2c/imx477.yaml F: Documentation/devicetree/bindings/media/i2c/imx477.yaml
F: drivers/media/i2c/imx477.c F: drivers/media/i2c/imx477.c

View File

@ -0,0 +1,95 @@
From 3637d49e11219512920aca8b8ccd0994be33fa8b Mon Sep 17 00:00:00 2001
From: Lee Jones <lee.jones@linaro.org>
Date: Thu, 18 Mar 2021 10:40:30 +0000
Subject: [PATCH] of: base: Fix some formatting issues and provide missing
descriptions
Fixes the following W=1 kernel build warning(s):
drivers/of/base.c:315: warning: Function parameter or member 'cpun' not described in '__of_find_n_match_cpu_property'
drivers/of/base.c:315: warning: Function parameter or member 'prop_name' not described in '__of_find_n_match_cpu_property'
drivers/of/base.c:315: warning: Function parameter or member 'cpu' not described in '__of_find_n_match_cpu_property'
drivers/of/base.c:315: warning: Function parameter or member 'thread' not described in '__of_find_n_match_cpu_property'
drivers/of/base.c:315: warning: expecting prototype for property holds the physical id of the(). Prototype was for __of_find_n_match_cpu_property() instead
drivers/of/base.c:1139: warning: Function parameter or member 'match' not described in 'of_find_matching_node_and_match'
drivers/of/base.c:1779: warning: Function parameter or member 'np' not described in '__of_add_property'
drivers/of/base.c:1779: warning: Function parameter or member 'prop' not described in '__of_add_property'
drivers/of/base.c:1800: warning: Function parameter or member 'np' not described in 'of_add_property'
drivers/of/base.c:1800: warning: Function parameter or member 'prop' not described in 'of_add_property'
drivers/of/base.c:1849: warning: Function parameter or member 'np' not described in 'of_remove_property'
drivers/of/base.c:1849: warning: Function parameter or member 'prop' not described in 'of_remove_property'
drivers/of/base.c:2137: warning: Function parameter or member 'dn' not described in 'of_console_check'
drivers/of/base.c:2137: warning: Function parameter or member 'name' not described in 'of_console_check'
drivers/of/base.c:2137: warning: Function parameter or member 'index' not described in 'of_console_check'
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: devicetree@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210318104036.3175910-5-lee.jones@linaro.org
---
drivers/of/base.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -305,7 +305,7 @@ bool __weak arch_match_cpu_phys_id(int c
return (u32)phys_id == cpu;
}
-/**
+/*
* Checks if the given "prop_name" property holds the physical id of the
* core/thread corresponding to the logical cpu 'cpu'. If 'thread' is not
* NULL, local thread number within the core is returned in it.
@@ -1128,7 +1128,7 @@ EXPORT_SYMBOL(of_match_node);
* will; typically, you pass what the previous call
* returned. of_node_put() will be called on it
* @matches: array of of device match structures to search in
- * @match Updated to point at the matches entry which matched
+ * @match: Updated to point at the matches entry which matched
*
* Returns a node pointer with refcount incremented, use
* of_node_put() on it when done.
@@ -1779,6 +1779,8 @@ EXPORT_SYMBOL(of_count_phandle_with_args
/**
* __of_add_property - Add a property to a node without lock operations
+ * @np: Caller's Device Node
+ * @prob: Property to add
*/
int __of_add_property(struct device_node *np, struct property *prop)
{
@@ -1800,6 +1802,8 @@ int __of_add_property(struct device_node
/**
* of_add_property - Add a property to a node
+ * @np: Caller's Device Node
+ * @prob: Property to add
*/
int of_add_property(struct device_node *np, struct property *prop)
{
@@ -1844,6 +1848,8 @@ int __of_remove_property(struct device_n
/**
* of_remove_property - Remove a property from a node.
+ * @np: Caller's Device Node
+ * @prob: Property to remove
*
* Note that we don't actually remove it, since we have given out
* who-knows-how-many pointers to the data using get-property.
@@ -2130,9 +2136,9 @@ EXPORT_SYMBOL_GPL(of_alias_get_highest_i
/**
* of_console_check() - Test and setup console for DT setup
- * @dn - Pointer to device node
- * @name - Name to use for preferred console without index. ex. "ttyS"
- * @index - Index to use for preferred console.
+ * @dn: Pointer to device node
+ * @name: Name to use for preferred console without index. ex. "ttyS"
+ * @index: Index to use for preferred console.
*
* Check if the given device node matches the stdout-path property in the
* /chosen node. If it does then register it as the preferred console and return

View File

@ -0,0 +1,489 @@
From 62f026f082e4d762a47b43ea693b38f025122332 Mon Sep 17 00:00:00 2001
From: Rob Herring <robh@kernel.org>
Date: Fri, 26 Mar 2021 13:26:06 -0600
Subject: [PATCH] of: Fix kerneldoc output formatting
The indentation of the kerneldoc comments affects the output formatting.
Leading tabs in particular don't work, sections need to be indented
under the section header, and several code blocks are reformatted.
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/20210326192606.3702739-1-robh@kernel.org
---
drivers/of/base.c | 275 +++++++++++++++++++++++-----------------------
drivers/of/fdt.c | 9 +-
2 files changed, 141 insertions(+), 143 deletions(-)
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -651,11 +651,11 @@ bool of_device_is_big_endian(const struc
EXPORT_SYMBOL(of_device_is_big_endian);
/**
- * of_get_parent - Get a node's parent if any
- * @node: Node to get parent
+ * of_get_parent - Get a node's parent if any
+ * @node: Node to get parent
*
- * Returns a node pointer with refcount incremented, use
- * of_node_put() on it when done.
+ * Return: A node pointer with refcount incremented, use
+ * of_node_put() on it when done.
*/
struct device_node *of_get_parent(const struct device_node *node)
{
@@ -673,15 +673,15 @@ struct device_node *of_get_parent(const
EXPORT_SYMBOL(of_get_parent);
/**
- * of_get_next_parent - Iterate to a node's parent
- * @node: Node to get parent of
+ * of_get_next_parent - Iterate to a node's parent
+ * @node: Node to get parent of
*
- * This is like of_get_parent() except that it drops the
- * refcount on the passed node, making it suitable for iterating
- * through a node's parents.
+ * This is like of_get_parent() except that it drops the
+ * refcount on the passed node, making it suitable for iterating
+ * through a node's parents.
*
- * Returns a node pointer with refcount incremented, use
- * of_node_put() on it when done.
+ * Return: A node pointer with refcount incremented, use
+ * of_node_put() on it when done.
*/
struct device_node *of_get_next_parent(struct device_node *node)
{
@@ -719,13 +719,13 @@ static struct device_node *__of_get_next
child = __of_get_next_child(parent, child))
/**
- * of_get_next_child - Iterate a node childs
- * @node: parent node
- * @prev: previous child of the parent node, or NULL to get first
- *
- * Returns a node pointer with refcount incremented, use of_node_put() on
- * it when done. Returns NULL when prev is the last child. Decrements the
- * refcount of prev.
+ * of_get_next_child - Iterate a node childs
+ * @node: parent node
+ * @prev: previous child of the parent node, or NULL to get first
+ *
+ * Return: A node pointer with refcount incremented, use of_node_put() on
+ * it when done. Returns NULL when prev is the last child. Decrements the
+ * refcount of prev.
*/
struct device_node *of_get_next_child(const struct device_node *node,
struct device_node *prev)
@@ -741,12 +741,12 @@ struct device_node *of_get_next_child(co
EXPORT_SYMBOL(of_get_next_child);
/**
- * of_get_next_available_child - Find the next available child node
- * @node: parent node
- * @prev: previous child of the parent node, or NULL to get first
+ * of_get_next_available_child - Find the next available child node
+ * @node: parent node
+ * @prev: previous child of the parent node, or NULL to get first
*
- * This function is like of_get_next_child(), except that it
- * automatically skips any disabled nodes (i.e. status = "disabled").
+ * This function is like of_get_next_child(), except that it
+ * automatically skips any disabled nodes (i.e. status = "disabled").
*/
struct device_node *of_get_next_available_child(const struct device_node *node,
struct device_node *prev)
@@ -772,12 +772,12 @@ struct device_node *of_get_next_availabl
EXPORT_SYMBOL(of_get_next_available_child);
/**
- * of_get_next_cpu_node - Iterate on cpu nodes
- * @prev: previous child of the /cpus node, or NULL to get first
+ * of_get_next_cpu_node - Iterate on cpu nodes
+ * @prev: previous child of the /cpus node, or NULL to get first
*
- * Returns a cpu node pointer with refcount incremented, use of_node_put()
- * on it when done. Returns NULL when prev is the last child. Decrements
- * the refcount of prev.
+ * Return: A cpu node pointer with refcount incremented, use of_node_put()
+ * on it when done. Returns NULL when prev is the last child. Decrements
+ * the refcount of prev.
*/
struct device_node *of_get_next_cpu_node(struct device_node *prev)
{
@@ -834,15 +834,15 @@ struct device_node *of_get_compatible_ch
EXPORT_SYMBOL(of_get_compatible_child);
/**
- * of_get_child_by_name - Find the child node by name for a given parent
- * @node: parent node
- * @name: child name to look for.
- *
- * This function looks for child node for given matching name
- *
- * Returns a node pointer if found, with refcount incremented, use
- * of_node_put() on it when done.
- * Returns NULL if node is not found.
+ * of_get_child_by_name - Find the child node by name for a given parent
+ * @node: parent node
+ * @name: child name to look for.
+ *
+ * This function looks for child node for given matching name
+ *
+ * Return: A node pointer if found, with refcount incremented, use
+ * of_node_put() on it when done.
+ * Returns NULL if node is not found.
*/
struct device_node *of_get_child_by_name(const struct device_node *node,
const char *name)
@@ -893,22 +893,22 @@ struct device_node *__of_find_node_by_fu
}
/**
- * of_find_node_opts_by_path - Find a node matching a full OF path
- * @path: Either the full path to match, or if the path does not
- * start with '/', the name of a property of the /aliases
- * node (an alias). In the case of an alias, the node
- * matching the alias' value will be returned.
- * @opts: Address of a pointer into which to store the start of
- * an options string appended to the end of the path with
- * a ':' separator.
- *
- * Valid paths:
- * /foo/bar Full path
- * foo Valid alias
- * foo/bar Valid alias + relative path
+ * of_find_node_opts_by_path - Find a node matching a full OF path
+ * @path: Either the full path to match, or if the path does not
+ * start with '/', the name of a property of the /aliases
+ * node (an alias). In the case of an alias, the node
+ * matching the alias' value will be returned.
+ * @opts: Address of a pointer into which to store the start of
+ * an options string appended to the end of the path with
+ * a ':' separator.
+ *
+ * Valid paths:
+ * * /foo/bar Full path
+ * * foo Valid alias
+ * * foo/bar Valid alias + relative path
*
- * Returns a node pointer with refcount incremented, use
- * of_node_put() on it when done.
+ * Return: A node pointer with refcount incremented, use
+ * of_node_put() on it when done.
*/
struct device_node *of_find_node_opts_by_path(const char *path, const char **opts)
{
@@ -958,15 +958,15 @@ struct device_node *of_find_node_opts_by
EXPORT_SYMBOL(of_find_node_opts_by_path);
/**
- * of_find_node_by_name - Find a node by its "name" property
- * @from: The node to start searching from or NULL; the node
+ * of_find_node_by_name - Find a node by its "name" property
+ * @from: The node to start searching from or NULL; the node
* you pass will not be searched, only the next one
* will. Typically, you pass what the previous call
* returned. of_node_put() will be called on @from.
- * @name: The name string to match against
+ * @name: The name string to match against
*
- * Returns a node pointer with refcount incremented, use
- * of_node_put() on it when done.
+ * Return: A node pointer with refcount incremented, use
+ * of_node_put() on it when done.
*/
struct device_node *of_find_node_by_name(struct device_node *from,
const char *name)
@@ -985,16 +985,16 @@ struct device_node *of_find_node_by_name
EXPORT_SYMBOL(of_find_node_by_name);
/**
- * of_find_node_by_type - Find a node by its "device_type" property
- * @from: The node to start searching from, or NULL to start searching
+ * of_find_node_by_type - Find a node by its "device_type" property
+ * @from: The node to start searching from, or NULL to start searching
* the entire device tree. The node you pass will not be
* searched, only the next one will; typically, you pass
* what the previous call returned. of_node_put() will be
* called on from for you.
- * @type: The type string to match against
+ * @type: The type string to match against
*
- * Returns a node pointer with refcount incremented, use
- * of_node_put() on it when done.
+ * Return: A node pointer with refcount incremented, use
+ * of_node_put() on it when done.
*/
struct device_node *of_find_node_by_type(struct device_node *from,
const char *type)
@@ -1013,18 +1013,18 @@ struct device_node *of_find_node_by_type
EXPORT_SYMBOL(of_find_node_by_type);
/**
- * of_find_compatible_node - Find a node based on type and one of the
+ * of_find_compatible_node - Find a node based on type and one of the
* tokens in its "compatible" property
- * @from: The node to start searching from or NULL, the node
- * you pass will not be searched, only the next one
- * will; typically, you pass what the previous call
- * returned. of_node_put() will be called on it
- * @type: The type string to match "device_type" or NULL to ignore
- * @compatible: The string to match to one of the tokens in the device
- * "compatible" list.
+ * @from: The node to start searching from or NULL, the node
+ * you pass will not be searched, only the next one
+ * will; typically, you pass what the previous call
+ * returned. of_node_put() will be called on it
+ * @type: The type string to match "device_type" or NULL to ignore
+ * @compatible: The string to match to one of the tokens in the device
+ * "compatible" list.
*
- * Returns a node pointer with refcount incremented, use
- * of_node_put() on it when done.
+ * Return: A node pointer with refcount incremented, use
+ * of_node_put() on it when done.
*/
struct device_node *of_find_compatible_node(struct device_node *from,
const char *type, const char *compatible)
@@ -1044,16 +1044,16 @@ struct device_node *of_find_compatible_n
EXPORT_SYMBOL(of_find_compatible_node);
/**
- * of_find_node_with_property - Find a node which has a property with
- * the given name.
- * @from: The node to start searching from or NULL, the node
- * you pass will not be searched, only the next one
- * will; typically, you pass what the previous call
- * returned. of_node_put() will be called on it
- * @prop_name: The name of the property to look for.
+ * of_find_node_with_property - Find a node which has a property with
+ * the given name.
+ * @from: The node to start searching from or NULL, the node
+ * you pass will not be searched, only the next one
+ * will; typically, you pass what the previous call
+ * returned. of_node_put() will be called on it
+ * @prop_name: The name of the property to look for.
*
- * Returns a node pointer with refcount incremented, use
- * of_node_put() on it when done.
+ * Return: A node pointer with refcount incremented, use
+ * of_node_put() on it when done.
*/
struct device_node *of_find_node_with_property(struct device_node *from,
const char *prop_name)
@@ -1102,10 +1102,10 @@ const struct of_device_id *__of_match_no
/**
* of_match_node - Tell if a device_node has a matching of_match structure
- * @matches: array of of device match structures to search in
- * @node: the of device structure to match against
+ * @matches: array of of device match structures to search in
+ * @node: the of device structure to match against
*
- * Low level utility function used by device matching.
+ * Low level utility function used by device matching.
*/
const struct of_device_id *of_match_node(const struct of_device_id *matches,
const struct device_node *node)
@@ -1121,17 +1121,17 @@ const struct of_device_id *of_match_node
EXPORT_SYMBOL(of_match_node);
/**
- * of_find_matching_node_and_match - Find a node based on an of_device_id
- * match table.
- * @from: The node to start searching from or NULL, the node
- * you pass will not be searched, only the next one
- * will; typically, you pass what the previous call
- * returned. of_node_put() will be called on it
- * @matches: array of of device match structures to search in
- * @match: Updated to point at the matches entry which matched
+ * of_find_matching_node_and_match - Find a node based on an of_device_id
+ * match table.
+ * @from: The node to start searching from or NULL, the node
+ * you pass will not be searched, only the next one
+ * will; typically, you pass what the previous call
+ * returned. of_node_put() will be called on it
+ * @matches: array of of device match structures to search in
+ * @match: Updated to point at the matches entry which matched
*
- * Returns a node pointer with refcount incremented, use
- * of_node_put() on it when done.
+ * Return: A node pointer with refcount incremented, use
+ * of_node_put() on it when done.
*/
struct device_node *of_find_matching_node_and_match(struct device_node *from,
const struct of_device_id *matches,
@@ -1465,21 +1465,21 @@ EXPORT_SYMBOL(of_parse_phandle);
* Caller is responsible to call of_node_put() on the returned out_args->np
* pointer.
*
- * Example:
+ * Example::
*
- * phandle1: node1 {
+ * phandle1: node1 {
* #list-cells = <2>;
- * }
+ * };
*
- * phandle2: node2 {
+ * phandle2: node2 {
* #list-cells = <1>;
- * }
+ * };
*
- * node3 {
+ * node3 {
* list = <&phandle1 1 2 &phandle2 3>;
- * }
+ * };
*
- * To get a device_node of the `node2' node you may call this:
+ * To get a device_node of the ``node2`` node you may call this:
* of_parse_phandle_with_args(node3, "list", "#list-cells", 1, &args);
*/
int of_parse_phandle_with_args(const struct device_node *np, const char *list_name,
@@ -1517,29 +1517,29 @@ EXPORT_SYMBOL(of_parse_phandle_with_args
* Caller is responsible to call of_node_put() on the returned out_args->np
* pointer.
*
- * Example:
- *
- * phandle1: node1 {
- * #list-cells = <2>;
- * }
- *
- * phandle2: node2 {
- * #list-cells = <1>;
- * }
+ * Example::
*
- * phandle3: node3 {
- * #list-cells = <1>;
- * list-map = <0 &phandle2 3>,
- * <1 &phandle2 2>,
- * <2 &phandle1 5 1>;
- * list-map-mask = <0x3>;
- * };
- *
- * node4 {
- * list = <&phandle1 1 2 &phandle3 0>;
- * }
+ * phandle1: node1 {
+ * #list-cells = <2>;
+ * };
+ *
+ * phandle2: node2 {
+ * #list-cells = <1>;
+ * };
+ *
+ * phandle3: node3 {
+ * #list-cells = <1>;
+ * list-map = <0 &phandle2 3>,
+ * <1 &phandle2 2>,
+ * <2 &phandle1 5 1>;
+ * list-map-mask = <0x3>;
+ * };
+ *
+ * node4 {
+ * list = <&phandle1 1 2 &phandle3 0>;
+ * };
*
- * To get a device_node of the `node2' node you may call this:
+ * To get a device_node of the ``node2`` node you may call this:
* of_parse_phandle_with_args(node4, "list", "list", 1, &args);
*/
int of_parse_phandle_with_args_map(const struct device_node *np,
@@ -1699,19 +1699,19 @@ EXPORT_SYMBOL(of_parse_phandle_with_args
* Caller is responsible to call of_node_put() on the returned out_args->np
* pointer.
*
- * Example:
+ * Example::
*
- * phandle1: node1 {
- * }
+ * phandle1: node1 {
+ * };
*
- * phandle2: node2 {
- * }
+ * phandle2: node2 {
+ * };
*
- * node3 {
- * list = <&phandle1 0 2 &phandle2 2 3>;
- * }
+ * node3 {
+ * list = <&phandle1 0 2 &phandle2 2 3>;
+ * };
*
- * To get a device_node of the `node2' node you may call this:
+ * To get a device_node of the ``node2`` node you may call this:
* of_parse_phandle_with_fixed_args(node3, "list", 2, 1, &args);
*/
int of_parse_phandle_with_fixed_args(const struct device_node *np,
@@ -1957,13 +1957,12 @@ static void of_alias_add(struct alias_pr
/**
* of_alias_scan - Scan all properties of the 'aliases' node
+ * @dt_alloc: An allocator that provides a virtual address to memory
+ * for storing the resulting tree
*
* The function scans all the properties of the 'aliases' node and populates
* the global lookup table with the properties. It returns the
* number of alias properties found, or an error code in case of failure.
- *
- * @dt_alloc: An allocator that provides a virtual address to memory
- * for storing the resulting tree
*/
void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
{
@@ -2158,12 +2157,12 @@ bool of_console_check(struct device_node
EXPORT_SYMBOL_GPL(of_console_check);
/**
- * of_find_next_cache_node - Find a node's subsidiary cache
- * @np: node of type "cpu" or "cache"
+ * of_find_next_cache_node - Find a node's subsidiary cache
+ * @np: node of type "cpu" or "cache"
*
- * Returns a node pointer with refcount incremented, use
- * of_node_put() on it when done. Caller should hold a reference
- * to np.
+ * Return: A node pointer with refcount incremented, use
+ * of_node_put() on it when done. Caller should hold a reference
+ * to np.
*/
struct device_node *of_find_next_cache_node(const struct device_node *np)
{
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -349,11 +349,6 @@ static int unflatten_dt_nodes(const void
/**
* __unflatten_device_tree - create tree of device_nodes from flat blob
- *
- * unflattens a device-tree, creating the
- * tree of struct device_node. It also fills the "name" and "type"
- * pointers of the nodes so the normal device-tree walking functions
- * can be used.
* @blob: The blob to expand
* @dad: Parent device node
* @mynodes: The device_node tree created by the call
@@ -361,6 +356,10 @@ static int unflatten_dt_nodes(const void
* for the resulting tree
* @detached: if true set OF_DETACHED on @mynodes
*
+ * unflattens a device-tree, creating the tree of struct device_node. It also
+ * fills the "name" and "type" pointers of the nodes so the normal device-tree
+ * walking functions can be used.
+ *
* Returns NULL on failure or the memory chunk containing the unflattened
* device tree on success.
*/

View File

@ -0,0 +1,787 @@
From 8c8239c2c1fb82f171cb22a707f3bb88a2f22109 Mon Sep 17 00:00:00 2001
From: Rob Herring <robh@kernel.org>
Date: Thu, 25 Mar 2021 10:47:12 -0600
Subject: [PATCH] of: Add missing 'Return' section in kerneldoc comments
Many of the DT kerneldoc comments are lacking a 'Return' section. Let's
add the section in cases we have a description of return values. There's
still some cases where the return values are not documented.
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/20210325164713.1296407-8-robh@kernel.org
---
drivers/of/base.c | 39 +++++++++++++------------
drivers/of/dynamic.c | 19 ++++++++-----
drivers/of/fdt.c | 8 +++---
drivers/of/irq.c | 14 ++++-----
drivers/of/overlay.c | 16 +++++------
drivers/of/platform.c | 10 +++----
drivers/of/property.c | 66 +++++++++++++++++++++++++++----------------
include/linux/of.h | 63 ++++++++++++++++++++++++++---------------
8 files changed, 140 insertions(+), 95 deletions(-)
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -244,7 +244,7 @@ struct device_node *__of_find_all_nodes(
* @prev: Previous node or NULL to start iteration
* of_node_put() will be called on it
*
- * Returns a node pointer with refcount incremented, use
+ * Return: A node pointer with refcount incremented, use
* of_node_put() on it when done.
*/
struct device_node *of_find_all_nodes(struct device_node *prev)
@@ -374,7 +374,7 @@ bool __weak arch_find_n_match_cpu_physic
* before booting secondary cores. This function uses arch_match_cpu_phys_id
* which can be overridden by architecture specific implementation.
*
- * Returns a node pointer for the logical cpu with refcount incremented, use
+ * Return: A node pointer for the logical cpu with refcount incremented, use
* of_node_put() on it when done. Returns NULL if not found.
*/
struct device_node *of_get_cpu_node(int cpu, unsigned int *thread)
@@ -394,8 +394,8 @@ EXPORT_SYMBOL(of_get_cpu_node);
*
* @cpu_node: Pointer to the device_node for CPU.
*
- * Returns the logical CPU number of the given CPU device_node.
- * Returns -ENODEV if the CPU is not found.
+ * Return: The logical CPU number of the given CPU device_node or -ENODEV if the
+ * CPU is not found.
*/
int of_cpu_node_to_id(struct device_node *cpu_node)
{
@@ -427,7 +427,7 @@ EXPORT_SYMBOL(of_cpu_node_to_id);
* bindings. This function check for both and returns the idle state node for
* the requested index.
*
- * In case an idle state node is found at @index, the refcount is incremented
+ * Return: An idle state node if found at @index. The refcount is incremented
* for it, so call of_node_put() on it when done. Returns NULL if not found.
*/
struct device_node *of_get_cpu_state_node(struct device_node *cpu_node,
@@ -561,7 +561,7 @@ int of_device_compatible_match(struct de
* of_machine_is_compatible - Test root of device tree for a given compatible value
* @compat: compatible string to look for in root node's compatible property.
*
- * Returns a positive integer if the root node has the given value in its
+ * Return: A positive integer if the root node has the given value in its
* compatible property.
*/
int of_machine_is_compatible(const char *compat)
@@ -583,7 +583,7 @@ EXPORT_SYMBOL(of_machine_is_compatible);
*
* @device: Node to check for availability, with locks already held
*
- * Returns true if the status property is absent or set to "okay" or "ok",
+ * Return: True if the status property is absent or set to "okay" or "ok",
* false otherwise
*/
static bool __of_device_is_available(const struct device_node *device)
@@ -611,7 +611,7 @@ static bool __of_device_is_available(con
*
* @device: Node to check for availability
*
- * Returns true if the status property is absent or set to "okay" or "ok",
+ * Return: True if the status property is absent or set to "okay" or "ok",
* false otherwise
*/
bool of_device_is_available(const struct device_node *device)
@@ -632,7 +632,7 @@ EXPORT_SYMBOL(of_device_is_available);
*
* @device: Node to check for endianness
*
- * Returns true if the device has a "big-endian" property, or if the kernel
+ * Return: True if the device has a "big-endian" property, or if the kernel
* was compiled for BE *and* the device has a "native-endian" property.
* Returns false otherwise.
*
@@ -816,7 +816,7 @@ EXPORT_SYMBOL(of_get_next_cpu_node);
* Lookup child node whose compatible property contains the given compatible
* string.
*
- * Returns a node pointer with refcount incremented, use of_node_put() on it
+ * Return: a node pointer with refcount incremented, use of_node_put() on it
* when done; or NULL if not found.
*/
struct device_node *of_get_compatible_child(const struct device_node *parent,
@@ -1170,7 +1170,7 @@ EXPORT_SYMBOL(of_find_matching_node_and_
* It does this by stripping the manufacturer prefix (as delimited by a ',')
* from the first entry in the compatible list property.
*
- * This routine returns 0 on success, <0 on failure.
+ * Return: This routine returns 0 on success, <0 on failure.
*/
int of_modalias_node(struct device_node *node, char *modalias, int len)
{
@@ -1190,7 +1190,7 @@ EXPORT_SYMBOL_GPL(of_modalias_node);
* of_find_node_by_phandle - Find a node given a phandle
* @handle: phandle of the node to find
*
- * Returns a node pointer with refcount incremented, use
+ * Return: A node pointer with refcount incremented, use
* of_node_put() on it when done.
*/
struct device_node *of_find_node_by_phandle(phandle handle)
@@ -1431,7 +1431,7 @@ static int __of_parse_phandle_with_args(
* @index: For properties holding a table of phandles, this is the index into
* the table
*
- * Returns the device_node pointer with refcount incremented. Use
+ * Return: The device_node pointer with refcount incremented. Use
* of_node_put() on it when done.
*/
struct device_node *of_parse_phandle(const struct device_node *np,
@@ -1731,7 +1731,7 @@ EXPORT_SYMBOL(of_parse_phandle_with_fixe
* @list_name: property name that contains a list
* @cells_name: property name that specifies phandles' arguments count
*
- * Returns the number of phandle + argument tuples within a property. It
+ * Return: The number of phandle + argument tuples within a property. It
* is a typical pattern to encode a list of phandle and variable
* arguments into a single property. The number of arguments is encoded
* by a property in the phandle-target node. For example, a gpios
@@ -2031,7 +2031,9 @@ void of_alias_scan(void * (*dt_alloc)(u6
* @stem: Alias stem of the given device_node
*
* The function travels the lookup table to get the alias id for the given
- * device_node and alias stem. It returns the alias id if found.
+ * device_node and alias stem.
+ *
+ * Return: The alias id if found.
*/
int of_alias_get_id(struct device_node *np, const char *stem)
{
@@ -2140,8 +2142,9 @@ EXPORT_SYMBOL_GPL(of_alias_get_highest_i
* @index: Index to use for preferred console.
*
* Check if the given device node matches the stdout-path property in the
- * /chosen node. If it does then register it as the preferred console and return
- * TRUE. Otherwise return FALSE.
+ * /chosen node. If it does then register it as the preferred console.
+ *
+ * Return: TRUE if console successfully setup. Otherwise return FALSE.
*/
bool of_console_check(struct device_node *dn, char *name, int index)
{
@@ -2192,7 +2195,7 @@ struct device_node *of_find_next_cache_n
*
* @cpu: cpu number(logical index) for which the last cache level is needed
*
- * Returns the the level at which the last cache is present. It is exactly
+ * Return: The the level at which the last cache is present. It is exactly
* same as the total number of cache levels for the given logical cpu.
*/
int of_find_last_cache_level(unsigned int cpu)
--- a/drivers/of/dynamic.c
+++ b/drivers/of/dynamic.c
@@ -27,7 +27,7 @@ static struct device_node *kobj_to_devic
* @node: Node to inc refcount, NULL is supported to simplify writing of
* callers
*
- * Returns node.
+ * Return: The node with refcount incremented.
*/
struct device_node *of_node_get(struct device_node *node)
{
@@ -104,7 +104,8 @@ int of_reconfig_notify(unsigned long act
* @arg - argument of the of notifier
*
* Returns the new state of a device based on the notifier used.
- * Returns 0 on device going from enabled to disabled, 1 on device
+ *
+ * Return: 0 on device going from enabled to disabled, 1 on device
* going from disabled to enabled and -1 on no change.
*/
int of_reconfig_get_state_change(unsigned long action, struct of_reconfig_data *pr)
@@ -371,7 +372,8 @@ void of_node_release(struct kobject *kob
* property structure and the property name & contents. The property's
* flags have the OF_DYNAMIC bit set so that we can differentiate between
* dynamically allocated properties and not.
- * Returns the newly allocated property or NULL on out of memory error.
+ *
+ * Return: The newly allocated property or NULL on out of memory error.
*/
struct property *__of_prop_dup(const struct property *prop, gfp_t allocflags)
{
@@ -414,7 +416,7 @@ struct property *__of_prop_dup(const str
* another node. The node data are dynamically allocated and all the node
* flags have the OF_DYNAMIC & OF_DETACHED bits set.
*
- * Returns the newly allocated node or NULL on out of memory error.
+ * Return: The newly allocated node or NULL on out of memory error.
*/
struct device_node *__of_node_dup(const struct device_node *np,
const char *full_name)
@@ -780,7 +782,8 @@ static int __of_changeset_apply(struct o
* Any side-effects of live tree state changes are applied here on
* success, like creation/destruction of devices and side-effects
* like creation of sysfs properties and directories.
- * Returns 0 on success, a negative error value in case of an error.
+ *
+ * Return: 0 on success, a negative error value in case of an error.
* On error the partially applied effects are reverted.
*/
int of_changeset_apply(struct of_changeset *ocs)
@@ -874,7 +877,8 @@ static int __of_changeset_revert(struct
* was before the application.
* Any side-effects like creation/destruction of devices and
* removal of sysfs properties and directories are applied.
- * Returns 0 on success, a negative error value in case of an error.
+ *
+ * Return: 0 on success, a negative error value in case of an error.
*/
int of_changeset_revert(struct of_changeset *ocs)
{
@@ -902,7 +906,8 @@ EXPORT_SYMBOL_GPL(of_changeset_revert);
* + OF_RECONFIG_ADD_PROPERTY
* + OF_RECONFIG_REMOVE_PROPERTY,
* + OF_RECONFIG_UPDATE_PROPERTY
- * Returns 0 on success, a negative error value in case of an error.
+ *
+ * Return: 0 on success, a negative error value in case of an error.
*/
int of_changeset_action(struct of_changeset *ocs, unsigned long action,
struct device_node *np, struct property *prop)
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -282,7 +282,7 @@ static void reverse_nodes(struct device_
* @dad: Parent struct device_node
* @nodepp: The device_node tree created by the call
*
- * It returns the size of unflattened device tree or error code
+ * Return: The size of unflattened device tree or error code
*/
static int unflatten_dt_nodes(const void *blob,
void *mem,
@@ -360,7 +360,7 @@ static int unflatten_dt_nodes(const void
* fills the "name" and "type" pointers of the nodes so the normal device-tree
* walking functions can be used.
*
- * Returns NULL on failure or the memory chunk containing the unflattened
+ * Return: NULL on failure or the memory chunk containing the unflattened
* device tree on success.
*/
void *__unflatten_device_tree(const void *blob,
@@ -441,7 +441,7 @@ static DEFINE_MUTEX(of_fdt_unflatten_mut
* pointers of the nodes so the normal device-tree walking functions
* can be used.
*
- * Returns NULL on failure or the memory chunk containing the unflattened
+ * Return: NULL on failure or the memory chunk containing the unflattened
* device tree on success.
*/
void *of_fdt_unflatten_tree(const unsigned long *blob,
@@ -715,7 +715,7 @@ const void *__init of_get_flat_dt_prop(u
* @node: node to test
* @compat: compatible string to compare with compatible list.
*
- * On match, returns a non-zero value with smaller values returned for more
+ * Return: a non-zero value on match with smaller values returned for more
* specific compatible values.
*/
static int of_fdt_is_compatible(const void *blob,
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -48,7 +48,7 @@ EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
* of_irq_find_parent - Given a device node, find its interrupt parent node
* @child: pointer to device node
*
- * Returns a pointer to the interrupt parent node, or NULL if the interrupt
+ * Return: A pointer to the interrupt parent node, or NULL if the interrupt
* parent could not be determined.
*/
struct device_node *of_irq_find_parent(struct device_node *child)
@@ -81,14 +81,14 @@ EXPORT_SYMBOL_GPL(of_irq_find_parent);
* @addr: address specifier (start of "reg" property of the device) in be32 format
* @out_irq: structure of_phandle_args updated by this function
*
- * Returns 0 on success and a negative number on error
- *
* This function is a low-level interrupt tree walking function. It
* can be used to do a partial walk with synthetized reg and interrupts
* properties, for example when resolving PCI interrupts when no device
* node exist for the parent. It takes an interrupt specifier structure as
* input, walks the tree looking for any interrupt-map properties, translates
* the specifier for each map, and then returns the translated map.
+ *
+ * Return: 0 on success and a negative number on error
*/
int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
{
@@ -380,7 +380,7 @@ EXPORT_SYMBOL_GPL(of_irq_to_resource);
* @dev: pointer to device tree node
* @index: zero-based index of the IRQ
*
- * Returns Linux IRQ number on success, or 0 on the IRQ mapping failure, or
+ * Return: Linux IRQ number on success, or 0 on the IRQ mapping failure, or
* -EPROBE_DEFER if the IRQ domain is not yet created, or error code in case
* of any other failure.
*/
@@ -407,7 +407,7 @@ EXPORT_SYMBOL_GPL(of_irq_get);
* @dev: pointer to device tree node
* @name: IRQ name
*
- * Returns Linux IRQ number on success, or 0 on the IRQ mapping failure, or
+ * Return: Linux IRQ number on success, or 0 on the IRQ mapping failure, or
* -EPROBE_DEFER if the IRQ domain is not yet created, or error code in case
* of any other failure.
*/
@@ -447,7 +447,7 @@ int of_irq_count(struct device_node *dev
* @res: array of resources to fill in
* @nr_irqs: the number of IRQs (and upper bound for num of @res elements)
*
- * Returns the size of the filled in table (up to @nr_irqs).
+ * Return: The size of the filled in table (up to @nr_irqs).
*/
int of_irq_to_resource_table(struct device_node *dev, struct resource *res,
int nr_irqs)
@@ -602,7 +602,7 @@ static u32 __of_msi_map_id(struct device
* Walk up the device hierarchy looking for devices with a "msi-map"
* property. If found, apply the mapping to @id_in.
*
- * Returns the mapped MSI ID.
+ * Return: The mapped MSI ID.
*/
u32 of_msi_map_id(struct device *dev, struct device_node *msi_np, u32 id_in)
{
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -296,7 +296,7 @@ err_free_target_path:
*
* Update of property in symbols node is not allowed.
*
- * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
+ * Return: 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
* invalid @overlay.
*/
static int add_changeset_property(struct overlay_changeset *ovcs,
@@ -401,7 +401,7 @@ static int add_changeset_property(struct
*
* NOTE_2: Multiple mods of created nodes not supported.
*
- * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
+ * Return: 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
* invalid @overlay.
*/
static int add_changeset_node(struct overlay_changeset *ovcs,
@@ -473,7 +473,7 @@ static int add_changeset_node(struct ove
*
* Do not allow symbols node to have any children.
*
- * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
+ * Return: 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
* invalid @overlay_node.
*/
static int build_changeset_next_level(struct overlay_changeset *ovcs,
@@ -604,7 +604,7 @@ static int find_dup_cset_prop(struct ove
* the same node or duplicate {add, delete, or update} properties entries
* for the same property.
*
- * Returns 0 on success, or -EINVAL if duplicate changeset entry found.
+ * Return: 0 on success, or -EINVAL if duplicate changeset entry found.
*/
static int changeset_dup_entry_check(struct overlay_changeset *ovcs)
{
@@ -628,7 +628,7 @@ static int changeset_dup_entry_check(str
* any portions of the changeset that were successfully created will remain
* in @ovcs->cset.
*
- * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
+ * Return: 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if
* invalid overlay in @ovcs->fragments[].
*/
static int build_changeset(struct overlay_changeset *ovcs)
@@ -724,7 +724,7 @@ static struct device_node *find_target(s
* the top level of @tree. The relevant top level nodes are the fragment
* nodes and the __symbols__ node. Any other top level node will be ignored.
*
- * Returns 0 on success, -ENOMEM if memory allocation failure, -EINVAL if error
+ * Return: 0 on success, -ENOMEM if memory allocation failure, -EINVAL if error
* detected in @tree, or -ENOSPC if idr_alloc() error.
*/
static int init_overlay_changeset(struct overlay_changeset *ovcs,
@@ -1179,7 +1179,7 @@ static int overlay_removal_is_ok(struct
* If an error is returned by an overlay changeset post-remove notifier
* then no further overlay changeset post-remove notifier will be called.
*
- * Returns 0 on success, or a negative error number. *ovcs_id is set to
+ * Return: 0 on success, or a negative error number. *ovcs_id is set to
* zero after reverting the changeset, even if a subsequent error occurs.
*/
int of_overlay_remove(int *ovcs_id)
@@ -1257,7 +1257,7 @@ EXPORT_SYMBOL_GPL(of_overlay_remove);
*
* Removes all overlays from the system in the correct order.
*
- * Returns 0 on success, or a negative error number
+ * Return: 0 on success, or a negative error number
*/
int of_overlay_remove_all(void)
{
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -44,7 +44,7 @@ static const struct of_device_id of_skip
* Takes a reference to the embedded struct device which needs to be dropped
* after use.
*
- * Returns platform_device pointer, or NULL if not found
+ * Return: platform_device pointer, or NULL if not found
*/
struct platform_device *of_find_device_by_node(struct device_node *np)
{
@@ -160,7 +160,7 @@ EXPORT_SYMBOL(of_device_alloc);
* @platform_data: pointer to populate platform_data pointer with
* @parent: Linux device model parent device.
*
- * Returns pointer to created platform device, or NULL if a device was not
+ * Return: Pointer to created platform device, or NULL if a device was not
* registered. Unavailable devices will not get registered.
*/
static struct platform_device *of_platform_device_create_pdata(
@@ -204,7 +204,7 @@ err_clear_flag:
* @bus_id: name to assign device
* @parent: Linux device model parent device.
*
- * Returns pointer to created platform device, or NULL if a device was not
+ * Return: Pointer to created platform device, or NULL if a device was not
* registered. Unavailable devices will not get registered.
*/
struct platform_device *of_platform_device_create(struct device_node *np,
@@ -463,7 +463,7 @@ EXPORT_SYMBOL(of_platform_bus_probe);
* New board support should be using this function instead of
* of_platform_bus_probe().
*
- * Returns 0 on success, < 0 on failure.
+ * Return: 0 on success, < 0 on failure.
*/
int of_platform_populate(struct device_node *root,
const struct of_device_id *matches,
@@ -608,7 +608,7 @@ static void devm_of_platform_populate_re
* Similar to of_platform_populate(), but will automatically call
* of_platform_depopulate() when the device is unbound from the bus.
*
- * Returns 0 on success, < 0 on failure.
+ * Return: 0 on success, < 0 on failure.
*/
int devm_of_platform_populate(struct device *dev)
{
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -60,9 +60,11 @@ EXPORT_SYMBOL(of_graph_is_present);
* @elem_size: size of the individual element
*
* Search for a property in a device node and count the number of elements of
- * size elem_size in it. Returns number of elements on sucess, -EINVAL if the
- * property does not exist or its length does not match a multiple of elem_size
- * and -ENODATA if the property does not have a value.
+ * size elem_size in it.
+ *
+ * Return: The number of elements on sucess, -EINVAL if the property does not
+ * exist or its length does not match a multiple of elem_size and -ENODATA if
+ * the property does not have a value.
*/
int of_property_count_elems_of_size(const struct device_node *np,
const char *propname, int elem_size)
@@ -94,8 +96,9 @@ EXPORT_SYMBOL_GPL(of_property_count_elem
* @len: if !=NULL, actual length is written to here
*
* Search for a property in a device node and valid the requested size.
- * Returns the property value on success, -EINVAL if the property does not
- * exist, -ENODATA if property does not have a value, and -EOVERFLOW if the
+ *
+ * Return: The property value on success, -EINVAL if the property does not
+ * exist, -ENODATA if property does not have a value, and -EOVERFLOW if the
* property data is too small or too large.
*
*/
@@ -128,7 +131,9 @@ static void *of_find_property_value_of_s
* @out_value: pointer to return value, modified only if no error.
*
* Search for a property in a device node and read nth 32-bit value from
- * it. Returns 0 on success, -EINVAL if the property does not exist,
+ * it.
+ *
+ * Return: 0 on success, -EINVAL if the property does not exist,
* -ENODATA if property does not have a value, and -EOVERFLOW if the
* property data isn't large enough.
*
@@ -160,7 +165,9 @@ EXPORT_SYMBOL_GPL(of_property_read_u32_i
* @out_value: pointer to return value, modified only if no error.
*
* Search for a property in a device node and read nth 64-bit value from
- * it. Returns 0 on success, -EINVAL if the property does not exist,
+ * it.
+ *
+ * Return: 0 on success, -EINVAL if the property does not exist,
* -ENODATA if property does not have a value, and -EOVERFLOW if the
* property data isn't large enough.
*
@@ -195,12 +202,14 @@ EXPORT_SYMBOL_GPL(of_property_read_u64_i
* sz_min will be read.
*
* Search for a property in a device node and read 8-bit value(s) from
- * it. Returns number of elements read on success, -EINVAL if the property
- * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
- * if the property data is smaller than sz_min or longer than sz_max.
+ * it.
*
* dts entry of array should be like:
- * property = /bits/ 8 <0x50 0x60 0x70>;
+ * ``property = /bits/ 8 <0x50 0x60 0x70>;``
+ *
+ * Return: The number of elements read on success, -EINVAL if the property
+ * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
+ * if the property data is smaller than sz_min or longer than sz_max.
*
* The out_values is modified only if a valid u8 value can be decoded.
*/
@@ -243,12 +252,14 @@ EXPORT_SYMBOL_GPL(of_property_read_varia
* sz_min will be read.
*
* Search for a property in a device node and read 16-bit value(s) from
- * it. Returns number of elements read on success, -EINVAL if the property
- * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
- * if the property data is smaller than sz_min or longer than sz_max.
+ * it.
*
* dts entry of array should be like:
- * property = /bits/ 16 <0x5000 0x6000 0x7000>;
+ * ``property = /bits/ 16 <0x5000 0x6000 0x7000>;``
+ *
+ * Return: The number of elements read on success, -EINVAL if the property
+ * does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
+ * if the property data is smaller than sz_min or longer than sz_max.
*
* The out_values is modified only if a valid u16 value can be decoded.
*/
@@ -291,7 +302,9 @@ EXPORT_SYMBOL_GPL(of_property_read_varia
* sz_min will be read.
*
* Search for a property in a device node and read 32-bit value(s) from
- * it. Returns number of elements read on success, -EINVAL if the property
+ * it.
+ *
+ * Return: The number of elements read on success, -EINVAL if the property
* does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
* if the property data is smaller than sz_min or longer than sz_max.
*
@@ -330,7 +343,9 @@ EXPORT_SYMBOL_GPL(of_property_read_varia
* @out_value: pointer to return value, modified only if return value is 0.
*
* Search for a property in a device node and read a 64-bit value from
- * it. Returns 0 on success, -EINVAL if the property does not exist,
+ * it.
+ *
+ * Return: 0 on success, -EINVAL if the property does not exist,
* -ENODATA if property does not have a value, and -EOVERFLOW if the
* property data isn't large enough.
*
@@ -365,7 +380,9 @@ EXPORT_SYMBOL_GPL(of_property_read_u64);
* sz_min will be read.
*
* Search for a property in a device node and read 64-bit value(s) from
- * it. Returns number of elements read on success, -EINVAL if the property
+ * it.
+ *
+ * Return: The number of elements read on success, -EINVAL if the property
* does not exist, -ENODATA if property does not have a value, and -EOVERFLOW
* if the property data is smaller than sz_min or longer than sz_max.
*
@@ -407,10 +424,11 @@ EXPORT_SYMBOL_GPL(of_property_read_varia
* return value is 0.
*
* Search for a property in a device tree node and retrieve a null
- * terminated string value (pointer to data, not a copy). Returns 0 on
- * success, -EINVAL if the property does not exist, -ENODATA if property
- * does not have a value, and -EILSEQ if the string is not null-terminated
- * within the length of the property data.
+ * terminated string value (pointer to data, not a copy).
+ *
+ * Return: 0 on success, -EINVAL if the property does not exist, -ENODATA if
+ * property does not have a value, and -EILSEQ if the string is not
+ * null-terminated within the length of the property data.
*
* The out_string pointer is modified only if a valid string can be decoded.
*/
@@ -774,7 +792,7 @@ EXPORT_SYMBOL(of_graph_get_remote_port_p
* @node: pointer to a local endpoint device_node
*
* Return: Remote port node associated with remote endpoint node linked
- * to @node. Use of_node_put() on it when done.
+ * to @node. Use of_node_put() on it when done.
*/
struct device_node *of_graph_get_remote_port(const struct device_node *node)
{
@@ -807,7 +825,7 @@ EXPORT_SYMBOL(of_graph_get_endpoint_coun
* @endpoint: identifier (value of reg property) of the endpoint node
*
* Return: Remote device node associated with remote endpoint node linked
- * to @node. Use of_node_put() on it when done.
+ * to @node. Use of_node_put() on it when done.
*/
struct device_node *of_graph_get_remote_node(const struct device_node *node,
u32 port, u32 endpoint)
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -424,12 +424,14 @@ extern int of_detach_node(struct device_
* @sz: number of array elements to read
*
* Search for a property in a device node and read 8-bit value(s) from
- * it. Returns 0 on success, -EINVAL if the property does not exist,
- * -ENODATA if property does not have a value, and -EOVERFLOW if the
- * property data isn't large enough.
+ * it.
*
* dts entry of array should be like:
- * property = /bits/ 8 <0x50 0x60 0x70>;
+ * ``property = /bits/ 8 <0x50 0x60 0x70>;``
+ *
+ * Return: 0 on success, -EINVAL if the property does not exist,
+ * -ENODATA if property does not have a value, and -EOVERFLOW if the
+ * property data isn't large enough.
*
* The out_values is modified only if a valid u8 value can be decoded.
*/
@@ -454,12 +456,14 @@ static inline int of_property_read_u8_ar
* @sz: number of array elements to read
*
* Search for a property in a device node and read 16-bit value(s) from
- * it. Returns 0 on success, -EINVAL if the property does not exist,
- * -ENODATA if property does not have a value, and -EOVERFLOW if the
- * property data isn't large enough.
+ * it.
*
* dts entry of array should be like:
- * property = /bits/ 16 <0x5000 0x6000 0x7000>;
+ * ``property = /bits/ 16 <0x5000 0x6000 0x7000>;``
+ *
+ * Return: 0 on success, -EINVAL if the property does not exist,
+ * -ENODATA if property does not have a value, and -EOVERFLOW if the
+ * property data isn't large enough.
*
* The out_values is modified only if a valid u16 value can be decoded.
*/
@@ -485,7 +489,9 @@ static inline int of_property_read_u16_a
* @sz: number of array elements to read
*
* Search for a property in a device node and read 32-bit value(s) from
- * it. Returns 0 on success, -EINVAL if the property does not exist,
+ * it.
+ *
+ * Return: 0 on success, -EINVAL if the property does not exist,
* -ENODATA if property does not have a value, and -EOVERFLOW if the
* property data isn't large enough.
*
@@ -513,7 +519,9 @@ static inline int of_property_read_u32_a
* @sz: number of array elements to read
*
* Search for a property in a device node and read 64-bit value(s) from
- * it. Returns 0 on success, -EINVAL if the property does not exist,
+ * it.
+ *
+ * Return: 0 on success, -EINVAL if the property does not exist,
* -ENODATA if property does not have a value, and -EOVERFLOW if the
* property data isn't large enough.
*
@@ -1063,7 +1071,9 @@ static inline bool of_node_is_type(const
* @propname: name of the property to be searched.
*
* Search for a property in a device node and count the number of u8 elements
- * in it. Returns number of elements on sucess, -EINVAL if the property does
+ * in it.
+ *
+ * Return: The number of elements on sucess, -EINVAL if the property does
* not exist or its length does not match a multiple of u8 and -ENODATA if the
* property does not have a value.
*/
@@ -1080,7 +1090,9 @@ static inline int of_property_count_u8_e
* @propname: name of the property to be searched.
*
* Search for a property in a device node and count the number of u16 elements
- * in it. Returns number of elements on sucess, -EINVAL if the property does
+ * in it.
+ *
+ * Return: The number of elements on sucess, -EINVAL if the property does
* not exist or its length does not match a multiple of u16 and -ENODATA if the
* property does not have a value.
*/
@@ -1097,7 +1109,9 @@ static inline int of_property_count_u16_
* @propname: name of the property to be searched.
*
* Search for a property in a device node and count the number of u32 elements
- * in it. Returns number of elements on sucess, -EINVAL if the property does
+ * in it.
+ *
+ * Return: The number of elements on sucess, -EINVAL if the property does
* not exist or its length does not match a multiple of u32 and -ENODATA if the
* property does not have a value.
*/
@@ -1114,7 +1128,9 @@ static inline int of_property_count_u32_
* @propname: name of the property to be searched.
*
* Search for a property in a device node and count the number of u64 elements
- * in it. Returns number of elements on sucess, -EINVAL if the property does
+ * in it.
+ *
+ * Return: The number of elements on sucess, -EINVAL if the property does
* not exist or its length does not match a multiple of u64 and -ENODATA if the
* property does not have a value.
*/
@@ -1135,7 +1151,7 @@ static inline int of_property_count_u64_
* Search for a property in a device tree node and retrieve a list of
* terminated string values (pointer to data, not a copy) in that property.
*
- * If @out_strs is NULL, the number of strings in the property is returned.
+ * Return: If @out_strs is NULL, the number of strings in the property is returned.
*/
static inline int of_property_read_string_array(const struct device_node *np,
const char *propname, const char **out_strs,
@@ -1151,10 +1167,11 @@ static inline int of_property_read_strin
* @propname: name of the property to be searched.
*
* Search for a property in a device tree node and retrieve the number of null
- * terminated string contain in it. Returns the number of strings on
- * success, -EINVAL if the property does not exist, -ENODATA if property
- * does not have a value, and -EILSEQ if the string is not null-terminated
- * within the length of the property data.
+ * terminated string contain in it.
+ *
+ * Return: The number of strings on success, -EINVAL if the property does not
+ * exist, -ENODATA if property does not have a value, and -EILSEQ if the string
+ * is not null-terminated within the length of the property data.
*/
static inline int of_property_count_strings(const struct device_node *np,
const char *propname)
@@ -1174,7 +1191,8 @@ static inline int of_property_count_stri
* Search for a property in a device tree node and retrieve a null
* terminated string value (pointer to data, not a copy) in the list of strings
* contained in that property.
- * Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if
+ *
+ * Return: 0 on success, -EINVAL if the property does not exist, -ENODATA if
* property does not have a value, and -EILSEQ if the string is not
* null-terminated within the length of the property data.
*
@@ -1194,7 +1212,8 @@ static inline int of_property_read_strin
* @propname: name of the property to be searched.
*
* Search for a property in a device node.
- * Returns true if the property exists false otherwise.
+ *
+ * Return: true if the property exists false otherwise.
*/
static inline bool of_property_read_bool(const struct device_node *np,
const char *propname)
@@ -1440,7 +1459,7 @@ static inline int of_reconfig_get_state_
* of_device_is_system_power_controller - Tells if system-power-controller is found for device_node
* @np: Pointer to the given device_node
*
- * return true if present false otherwise
+ * Return: true if present false otherwise
*/
static inline bool of_device_is_system_power_controller(const struct device_node *np)
{

View File

@ -0,0 +1,54 @@
From 31e46db02ac1351c84e56a18606d17fc1b8390dd Mon Sep 17 00:00:00 2001
From: Lee Jones <lee.jones@linaro.org>
Date: Mon, 29 Mar 2021 16:24:35 +0100
Subject: [PATCH] of: base: Fix spelling issue with function param 'prop'
Fixes the following W=1 kernel build warning(s):
drivers/of/base.c:1781: warning: Function parameter or member 'prop' not described in '__of_add_property'
drivers/of/base.c:1781: warning: Excess function parameter 'prob' description in '__of_add_property'
drivers/of/base.c:1804: warning: Function parameter or member 'prop' not described in 'of_add_property'
drivers/of/base.c:1804: warning: Excess function parameter 'prob' description in 'of_add_property'
drivers/of/base.c:1855: warning: Function parameter or member 'prop' not described in 'of_remove_property'
drivers/of/base.c:1855: warning: Excess function parameter 'prob' description in 'of_remove_property'
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: devicetree@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210329152435.900225-1-lee.jones@linaro.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
drivers/of/base.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1780,7 +1780,7 @@ EXPORT_SYMBOL(of_count_phandle_with_args
/**
* __of_add_property - Add a property to a node without lock operations
* @np: Caller's Device Node
- * @prob: Property to add
+ * @prop: Property to add
*/
int __of_add_property(struct device_node *np, struct property *prop)
{
@@ -1803,7 +1803,7 @@ int __of_add_property(struct device_node
/**
* of_add_property - Add a property to a node
* @np: Caller's Device Node
- * @prob: Property to add
+ * @prop: Property to add
*/
int of_add_property(struct device_node *np, struct property *prop)
{
@@ -1849,7 +1849,7 @@ int __of_remove_property(struct device_n
/**
* of_remove_property - Remove a property from a node.
* @np: Caller's Device Node
- * @prob: Property to remove
+ * @prop: Property to remove
*
* Note that we don't actually remove it, since we have given out
* who-knows-how-many pointers to the data using get-property.

View File

@ -1,7 +1,7 @@
From 83216e3988cd196183542937c9bd58b279f946af Mon Sep 17 00:00:00 2001 From 83216e3988cd196183542937c9bd58b279f946af Mon Sep 17 00:00:00 2001
From: Michael Walle <michael@walle.cc> From: Michael Walle <michael@walle.cc>
Date: Mon, 12 Apr 2021 19:47:17 +0200 Date: Mon, 12 Apr 2021 19:47:17 +0200
Subject: of: net: pass the dst buffer to of_get_mac_address() Subject: [PATCH] of: net: pass the dst buffer to of_get_mac_address()
of_get_mac_address() returns a "const void*" pointer to a MAC address. of_get_mac_address() returns a "const void*" pointer to a MAC address.
Lately, support to fetch the MAC address by an NVMEM provider was added. Lately, support to fetch the MAC address by an NVMEM provider was added.

View File

@ -1,7 +1,7 @@
From f10843e04a075202dbb39dfcee047e3a2fdf5a8d Mon Sep 17 00:00:00 2001 From f10843e04a075202dbb39dfcee047e3a2fdf5a8d Mon Sep 17 00:00:00 2001
From: Michael Walle <michael@walle.cc> From: Michael Walle <michael@walle.cc>
Date: Mon, 12 Apr 2021 19:47:18 +0200 Date: Mon, 12 Apr 2021 19:47:18 +0200
Subject: of: net: fix of_get_mac_addr_nvmem() for non-platform devices Subject: [PATCH] of: net: fix of_get_mac_addr_nvmem() for non-platform devices
of_get_mac_address() already supports fetching the MAC address by an of_get_mac_address() already supports fetching the MAC address by an
nvmem provider. But until now, it was just working for platform devices. nvmem provider. But until now, it was just working for platform devices.

View File

@ -0,0 +1,27 @@
From a065d5615fc83908ef21ed8159ffb63d816ff5de Mon Sep 17 00:00:00 2001
From: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Date: Wed, 28 Jul 2021 16:42:27 +0200
Subject: [PATCH] of: unify of_count_phandle_with_args() arguments with
!CONFIG_OF
Unify the declaration of of_count_phandle_with_args() between enabled
and disabled OF by making constifying pointed device_node.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
include/linux/of.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -889,7 +889,7 @@ static inline int of_parse_phandle_with_
return -ENOSYS;
}
-static inline int of_count_phandle_with_args(struct device_node *np,
+static inline int of_count_phandle_with_args(const struct device_node *np,
const char *list_name,
const char *cells_name)
{

View File

@ -0,0 +1,359 @@
From 66a8f7f04979f4ad739085f01d99c8caf620b4f5 Mon Sep 17 00:00:00 2001
From: Michael Walle <michael@walle.cc>
Date: Tue, 18 Jan 2022 18:35:02 +0100
Subject: [PATCH] of: base: make small of_parse_phandle() variants static
inline
Make all the smaller variants of the of_parse_phandle() static inline.
This also let us remove the empty function stubs if CONFIG_OF is not
defined.
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Michael Walle <michael@walle.cc>
[robh: move index < 0 check into __of_parse_phandle_with_args]
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220118173504.2867523-2-michael@walle.cc
---
drivers/of/base.c | 131 +++------------------------------------
include/linux/of.h | 148 ++++++++++++++++++++++++++++++++++++---------
2 files changed, 129 insertions(+), 150 deletions(-)
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1372,15 +1372,18 @@ int of_phandle_iterator_args(struct of_p
return count;
}
-static int __of_parse_phandle_with_args(const struct device_node *np,
- const char *list_name,
- const char *cells_name,
- int cell_count, int index,
- struct of_phandle_args *out_args)
+int __of_parse_phandle_with_args(const struct device_node *np,
+ const char *list_name,
+ const char *cells_name,
+ int cell_count, int index,
+ struct of_phandle_args *out_args)
{
struct of_phandle_iterator it;
int rc, cur_index = 0;
+ if (index < 0)
+ return -EINVAL;
+
/* Loop over the phandles until all the requested entry is found */
of_for_each_phandle(&it, rc, np, list_name, cells_name, cell_count) {
/*
@@ -1423,82 +1426,7 @@ static int __of_parse_phandle_with_args(
of_node_put(it.node);
return rc;
}
-
-/**
- * of_parse_phandle - Resolve a phandle property to a device_node pointer
- * @np: Pointer to device node holding phandle property
- * @phandle_name: Name of property holding a phandle value
- * @index: For properties holding a table of phandles, this is the index into
- * the table
- *
- * Return: The device_node pointer with refcount incremented. Use
- * of_node_put() on it when done.
- */
-struct device_node *of_parse_phandle(const struct device_node *np,
- const char *phandle_name, int index)
-{
- struct of_phandle_args args;
-
- if (index < 0)
- return NULL;
-
- if (__of_parse_phandle_with_args(np, phandle_name, NULL, 0,
- index, &args))
- return NULL;
-
- return args.np;
-}
-EXPORT_SYMBOL(of_parse_phandle);
-
-/**
- * of_parse_phandle_with_args() - Find a node pointed by phandle in a list
- * @np: pointer to a device tree node containing a list
- * @list_name: property name that contains a list
- * @cells_name: property name that specifies phandles' arguments count
- * @index: index of a phandle to parse out
- * @out_args: optional pointer to output arguments structure (will be filled)
- *
- * This function is useful to parse lists of phandles and their arguments.
- * Returns 0 on success and fills out_args, on error returns appropriate
- * errno value.
- *
- * Caller is responsible to call of_node_put() on the returned out_args->np
- * pointer.
- *
- * Example::
- *
- * phandle1: node1 {
- * #list-cells = <2>;
- * };
- *
- * phandle2: node2 {
- * #list-cells = <1>;
- * };
- *
- * node3 {
- * list = <&phandle1 1 2 &phandle2 3>;
- * };
- *
- * To get a device_node of the ``node2`` node you may call this:
- * of_parse_phandle_with_args(node3, "list", "#list-cells", 1, &args);
- */
-int of_parse_phandle_with_args(const struct device_node *np, const char *list_name,
- const char *cells_name, int index,
- struct of_phandle_args *out_args)
-{
- int cell_count = -1;
-
- if (index < 0)
- return -EINVAL;
-
- /* If cells_name is NULL we assume a cell count of 0 */
- if (!cells_name)
- cell_count = 0;
-
- return __of_parse_phandle_with_args(np, list_name, cells_name,
- cell_count, index, out_args);
-}
-EXPORT_SYMBOL(of_parse_phandle_with_args);
+EXPORT_SYMBOL(__of_parse_phandle_with_args);
/**
* of_parse_phandle_with_args_map() - Find a node pointed by phandle in a list and remap it
@@ -1685,47 +1613,6 @@ free:
EXPORT_SYMBOL(of_parse_phandle_with_args_map);
/**
- * of_parse_phandle_with_fixed_args() - Find a node pointed by phandle in a list
- * @np: pointer to a device tree node containing a list
- * @list_name: property name that contains a list
- * @cell_count: number of argument cells following the phandle
- * @index: index of a phandle to parse out
- * @out_args: optional pointer to output arguments structure (will be filled)
- *
- * This function is useful to parse lists of phandles and their arguments.
- * Returns 0 on success and fills out_args, on error returns appropriate
- * errno value.
- *
- * Caller is responsible to call of_node_put() on the returned out_args->np
- * pointer.
- *
- * Example::
- *
- * phandle1: node1 {
- * };
- *
- * phandle2: node2 {
- * };
- *
- * node3 {
- * list = <&phandle1 0 2 &phandle2 2 3>;
- * };
- *
- * To get a device_node of the ``node2`` node you may call this:
- * of_parse_phandle_with_fixed_args(node3, "list", 2, 1, &args);
- */
-int of_parse_phandle_with_fixed_args(const struct device_node *np,
- const char *list_name, int cell_count,
- int index, struct of_phandle_args *out_args)
-{
- if (index < 0)
- return -EINVAL;
- return __of_parse_phandle_with_args(np, list_name, NULL, cell_count,
- index, out_args);
-}
-EXPORT_SYMBOL(of_parse_phandle_with_fixed_args);
-
-/**
* of_count_phandle_with_args() - Find the number of phandles references in a property
* @np: pointer to a device tree node containing a list
* @list_name: property name that contains a list
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -363,18 +363,12 @@ extern const struct of_device_id *of_mat
const struct of_device_id *matches, const struct device_node *node);
extern int of_modalias_node(struct device_node *node, char *modalias, int len);
extern void of_print_phandle_args(const char *msg, const struct of_phandle_args *args);
-extern struct device_node *of_parse_phandle(const struct device_node *np,
- const char *phandle_name,
- int index);
-extern int of_parse_phandle_with_args(const struct device_node *np,
- const char *list_name, const char *cells_name, int index,
- struct of_phandle_args *out_args);
+extern int __of_parse_phandle_with_args(const struct device_node *np,
+ const char *list_name, const char *cells_name, int cell_count,
+ int index, struct of_phandle_args *out_args);
extern int of_parse_phandle_with_args_map(const struct device_node *np,
const char *list_name, const char *stem_name, int index,
struct of_phandle_args *out_args);
-extern int of_parse_phandle_with_fixed_args(const struct device_node *np,
- const char *list_name, int cells_count, int index,
- struct of_phandle_args *out_args);
extern int of_count_phandle_with_args(const struct device_node *np,
const char *list_name, const char *cells_name);
@@ -857,18 +851,12 @@ static inline int of_property_read_strin
return -ENOSYS;
}
-static inline struct device_node *of_parse_phandle(const struct device_node *np,
- const char *phandle_name,
- int index)
-{
- return NULL;
-}
-
-static inline int of_parse_phandle_with_args(const struct device_node *np,
- const char *list_name,
- const char *cells_name,
- int index,
- struct of_phandle_args *out_args)
+static inline int __of_parse_phandle_with_args(const struct device_node *np,
+ const char *list_name,
+ const char *cells_name,
+ int cell_count,
+ int index,
+ struct of_phandle_args *out_args)
{
return -ENOSYS;
}
@@ -882,13 +870,6 @@ static inline int of_parse_phandle_with_
return -ENOSYS;
}
-static inline int of_parse_phandle_with_fixed_args(const struct device_node *np,
- const char *list_name, int cells_count, int index,
- struct of_phandle_args *out_args)
-{
- return -ENOSYS;
-}
-
static inline int of_count_phandle_with_args(const struct device_node *np,
const char *list_name,
const char *cells_name)
@@ -1065,6 +1046,117 @@ static inline bool of_node_is_type(const
}
/**
+ * of_parse_phandle - Resolve a phandle property to a device_node pointer
+ * @np: Pointer to device node holding phandle property
+ * @phandle_name: Name of property holding a phandle value
+ * @index: For properties holding a table of phandles, this is the index into
+ * the table
+ *
+ * Return: The device_node pointer with refcount incremented. Use
+ * of_node_put() on it when done.
+ */
+static inline struct device_node *of_parse_phandle(const struct device_node *np,
+ const char *phandle_name,
+ int index)
+{
+ struct of_phandle_args args;
+
+ if (__of_parse_phandle_with_args(np, phandle_name, NULL, 0,
+ index, &args))
+ return NULL;
+
+ return args.np;
+}
+
+/**
+ * of_parse_phandle_with_args() - Find a node pointed by phandle in a list
+ * @np: pointer to a device tree node containing a list
+ * @list_name: property name that contains a list
+ * @cells_name: property name that specifies phandles' arguments count
+ * @index: index of a phandle to parse out
+ * @out_args: optional pointer to output arguments structure (will be filled)
+ *
+ * This function is useful to parse lists of phandles and their arguments.
+ * Returns 0 on success and fills out_args, on error returns appropriate
+ * errno value.
+ *
+ * Caller is responsible to call of_node_put() on the returned out_args->np
+ * pointer.
+ *
+ * Example::
+ *
+ * phandle1: node1 {
+ * #list-cells = <2>;
+ * };
+ *
+ * phandle2: node2 {
+ * #list-cells = <1>;
+ * };
+ *
+ * node3 {
+ * list = <&phandle1 1 2 &phandle2 3>;
+ * };
+ *
+ * To get a device_node of the ``node2`` node you may call this:
+ * of_parse_phandle_with_args(node3, "list", "#list-cells", 1, &args);
+ */
+static inline int of_parse_phandle_with_args(const struct device_node *np,
+ const char *list_name,
+ const char *cells_name,
+ int index,
+ struct of_phandle_args *out_args)
+{
+ int cell_count = -1;
+
+ /* If cells_name is NULL we assume a cell count of 0 */
+ if (!cells_name)
+ cell_count = 0;
+
+ return __of_parse_phandle_with_args(np, list_name, cells_name,
+ cell_count, index, out_args);
+}
+
+/**
+ * of_parse_phandle_with_fixed_args() - Find a node pointed by phandle in a list
+ * @np: pointer to a device tree node containing a list
+ * @list_name: property name that contains a list
+ * @cell_count: number of argument cells following the phandle
+ * @index: index of a phandle to parse out
+ * @out_args: optional pointer to output arguments structure (will be filled)
+ *
+ * This function is useful to parse lists of phandles and their arguments.
+ * Returns 0 on success and fills out_args, on error returns appropriate
+ * errno value.
+ *
+ * Caller is responsible to call of_node_put() on the returned out_args->np
+ * pointer.
+ *
+ * Example::
+ *
+ * phandle1: node1 {
+ * };
+ *
+ * phandle2: node2 {
+ * };
+ *
+ * node3 {
+ * list = <&phandle1 0 2 &phandle2 2 3>;
+ * };
+ *
+ * To get a device_node of the ``node2`` node you may call this:
+ * of_parse_phandle_with_fixed_args(node3, "list", 2, 1, &args);
+ */
+static inline int of_parse_phandle_with_fixed_args(const struct device_node *np,
+ const char *list_name,
+ int cell_count,
+ int index,
+ struct of_phandle_args *out_args)
+{
+ return __of_parse_phandle_with_args(np, list_name, NULL, cell_count,
+ index, out_args);
+}
+
+/**
* of_property_count_u8_elems - Count the number of u8 elements in a property
*
* @np: device node from which the property value is to be read.

View File

@ -0,0 +1,56 @@
From 8eddceb280f5deb8046fcb660de9f9f683b408b9 Mon Sep 17 00:00:00 2001
From: Michael Walle <michael@walle.cc>
Date: Tue, 6 Dec 2022 21:07:21 +0100
Subject: [PATCH] of: base: add of_parse_phandle_with_optional_args()
Add a new variant of the of_parse_phandle_with_args() which treats the
cells name as optional. If it's missing, it is assumed that the phandle
has no arguments.
Up until now, a nvmem node didn't have any arguments, so all the device
trees haven't any '#*-cells' property. But there is a need for an
additional argument for the phandle, for which we need a '#*-cells'
property. Therefore, we need to support nvmem nodes with and without
this property.
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
include/linux/of.h | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -1157,6 +1157,31 @@ static inline int of_parse_phandle_with_
}
/**
+ * of_parse_phandle_with_optional_args() - Find a node pointed by phandle in a list
+ * @np: pointer to a device tree node containing a list
+ * @list_name: property name that contains a list
+ * @cells_name: property name that specifies phandles' arguments count
+ * @index: index of a phandle to parse out
+ * @out_args: optional pointer to output arguments structure (will be filled)
+ *
+ * Same as of_parse_phandle_with_args() except that if the cells_name property
+ * is not found, cell_count of 0 is assumed.
+ *
+ * This is used to useful, if you have a phandle which didn't have arguments
+ * before and thus doesn't have a '#*-cells' property but is now migrated to
+ * having arguments while retaining backwards compatibility.
+ */
+static inline int of_parse_phandle_with_optional_args(const struct device_node *np,
+ const char *list_name,
+ const char *cells_name,
+ int index,
+ struct of_phandle_args *out_args)
+{
+ return __of_parse_phandle_with_args(np, list_name, cells_name,
+ 0, index, out_args);
+}
+
+/**
* of_property_count_u8_elems - Count the number of u8 elements in a property
*
* @np: device node from which the property value is to be read.

View File

@ -0,0 +1,32 @@
From 4f4145c9fee8c7a445dbbbadceccce5391e6b287 Mon Sep 17 00:00:00 2001
From: Michael Walle <michael@walle.cc>
Date: Tue, 6 Dec 2022 21:07:22 +0100
Subject: [PATCH] of: property: make #.*-cells optional for simple props
Sometimes, future bindings for phandles will get additional arguments.
Thus the target node of the phandle will need a new #.*-cells property.
To be backwards compatible, this needs to be optional.
Prepare the DEFINE_SIMPLE_PROPS() to handle the cells name as optional.
Signed-off-by: Michael Walle <michael@walle.cc>
Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/of/property.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1267,8 +1267,8 @@ static struct device_node *parse_suffix_
if (strcmp_suffix(prop_name, suffix))
return NULL;
- if (of_parse_phandle_with_args(np, prop_name, cells_name, index,
- &sup_args))
+ if (__of_parse_phandle_with_args(np, prop_name, cells_name, 0, index,
+ &sup_args))
return NULL;
return sup_args.np;

View File

@ -0,0 +1,28 @@
From 9cf9486a6a7e8a3d76154d0c506051ba3740e8b6 Mon Sep 17 00:00:00 2001
From: Michael Walle <michael@walle.cc>
Date: Tue, 6 Dec 2022 21:07:23 +0100
Subject: [PATCH] of: property: add #nvmem-cell-cells property
Bindings describe the new '#nvmem-cell-cells' property. Now that the
arguments count property is optional, we just add this property to the
nvmem-cells.
Signed-off-by: Michael Walle <michael@walle.cc>
Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/of/property.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1314,7 +1314,7 @@ DEFINE_SIMPLE_PROP(hwlocks, "hwlocks", "
DEFINE_SIMPLE_PROP(extcon, "extcon", NULL)
DEFINE_SIMPLE_PROP(interrupts_extended, "interrupts-extended",
"#interrupt-cells")
-DEFINE_SIMPLE_PROP(nvmem_cells, "nvmem-cells", NULL)
+DEFINE_SIMPLE_PROP(nvmem_cells, "nvmem-cells", "#nvmem-cell-cells")
DEFINE_SIMPLE_PROP(phys, "phys", "#phy-cells")
DEFINE_SIMPLE_PROP(wakeup_parent, "wakeup-parent", NULL)
DEFINE_SIMPLE_PROP(pinctrl0, "pinctrl-0", NULL)

View File

@ -0,0 +1,359 @@
From 66a8f7f04979f4ad739085f01d99c8caf620b4f5 Mon Sep 17 00:00:00 2001
From: Michael Walle <michael@walle.cc>
Date: Tue, 18 Jan 2022 18:35:02 +0100
Subject: [PATCH] of: base: make small of_parse_phandle() variants static
inline
Make all the smaller variants of the of_parse_phandle() static inline.
This also let us remove the empty function stubs if CONFIG_OF is not
defined.
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Michael Walle <michael@walle.cc>
[robh: move index < 0 check into __of_parse_phandle_with_args]
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220118173504.2867523-2-michael@walle.cc
---
drivers/of/base.c | 131 +++------------------------------------
include/linux/of.h | 148 ++++++++++++++++++++++++++++++++++++---------
2 files changed, 129 insertions(+), 150 deletions(-)
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1371,15 +1371,18 @@ int of_phandle_iterator_args(struct of_p
return count;
}
-static int __of_parse_phandle_with_args(const struct device_node *np,
- const char *list_name,
- const char *cells_name,
- int cell_count, int index,
- struct of_phandle_args *out_args)
+int __of_parse_phandle_with_args(const struct device_node *np,
+ const char *list_name,
+ const char *cells_name,
+ int cell_count, int index,
+ struct of_phandle_args *out_args)
{
struct of_phandle_iterator it;
int rc, cur_index = 0;
+ if (index < 0)
+ return -EINVAL;
+
/* Loop over the phandles until all the requested entry is found */
of_for_each_phandle(&it, rc, np, list_name, cells_name, cell_count) {
/*
@@ -1422,82 +1425,7 @@ static int __of_parse_phandle_with_args(
of_node_put(it.node);
return rc;
}
-
-/**
- * of_parse_phandle - Resolve a phandle property to a device_node pointer
- * @np: Pointer to device node holding phandle property
- * @phandle_name: Name of property holding a phandle value
- * @index: For properties holding a table of phandles, this is the index into
- * the table
- *
- * Return: The device_node pointer with refcount incremented. Use
- * of_node_put() on it when done.
- */
-struct device_node *of_parse_phandle(const struct device_node *np,
- const char *phandle_name, int index)
-{
- struct of_phandle_args args;
-
- if (index < 0)
- return NULL;
-
- if (__of_parse_phandle_with_args(np, phandle_name, NULL, 0,
- index, &args))
- return NULL;
-
- return args.np;
-}
-EXPORT_SYMBOL(of_parse_phandle);
-
-/**
- * of_parse_phandle_with_args() - Find a node pointed by phandle in a list
- * @np: pointer to a device tree node containing a list
- * @list_name: property name that contains a list
- * @cells_name: property name that specifies phandles' arguments count
- * @index: index of a phandle to parse out
- * @out_args: optional pointer to output arguments structure (will be filled)
- *
- * This function is useful to parse lists of phandles and their arguments.
- * Returns 0 on success and fills out_args, on error returns appropriate
- * errno value.
- *
- * Caller is responsible to call of_node_put() on the returned out_args->np
- * pointer.
- *
- * Example::
- *
- * phandle1: node1 {
- * #list-cells = <2>;
- * };
- *
- * phandle2: node2 {
- * #list-cells = <1>;
- * };
- *
- * node3 {
- * list = <&phandle1 1 2 &phandle2 3>;
- * };
- *
- * To get a device_node of the ``node2`` node you may call this:
- * of_parse_phandle_with_args(node3, "list", "#list-cells", 1, &args);
- */
-int of_parse_phandle_with_args(const struct device_node *np, const char *list_name,
- const char *cells_name, int index,
- struct of_phandle_args *out_args)
-{
- int cell_count = -1;
-
- if (index < 0)
- return -EINVAL;
-
- /* If cells_name is NULL we assume a cell count of 0 */
- if (!cells_name)
- cell_count = 0;
-
- return __of_parse_phandle_with_args(np, list_name, cells_name,
- cell_count, index, out_args);
-}
-EXPORT_SYMBOL(of_parse_phandle_with_args);
+EXPORT_SYMBOL(__of_parse_phandle_with_args);
/**
* of_parse_phandle_with_args_map() - Find a node pointed by phandle in a list and remap it
@@ -1684,47 +1612,6 @@ free:
EXPORT_SYMBOL(of_parse_phandle_with_args_map);
/**
- * of_parse_phandle_with_fixed_args() - Find a node pointed by phandle in a list
- * @np: pointer to a device tree node containing a list
- * @list_name: property name that contains a list
- * @cell_count: number of argument cells following the phandle
- * @index: index of a phandle to parse out
- * @out_args: optional pointer to output arguments structure (will be filled)
- *
- * This function is useful to parse lists of phandles and their arguments.
- * Returns 0 on success and fills out_args, on error returns appropriate
- * errno value.
- *
- * Caller is responsible to call of_node_put() on the returned out_args->np
- * pointer.
- *
- * Example::
- *
- * phandle1: node1 {
- * };
- *
- * phandle2: node2 {
- * };
- *
- * node3 {
- * list = <&phandle1 0 2 &phandle2 2 3>;
- * };
- *
- * To get a device_node of the ``node2`` node you may call this:
- * of_parse_phandle_with_fixed_args(node3, "list", 2, 1, &args);
- */
-int of_parse_phandle_with_fixed_args(const struct device_node *np,
- const char *list_name, int cell_count,
- int index, struct of_phandle_args *out_args)
-{
- if (index < 0)
- return -EINVAL;
- return __of_parse_phandle_with_args(np, list_name, NULL, cell_count,
- index, out_args);
-}
-EXPORT_SYMBOL(of_parse_phandle_with_fixed_args);
-
-/**
* of_count_phandle_with_args() - Find the number of phandles references in a property
* @np: pointer to a device tree node containing a list
* @list_name: property name that contains a list
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -363,18 +363,12 @@ extern const struct of_device_id *of_mat
const struct of_device_id *matches, const struct device_node *node);
extern int of_modalias_node(struct device_node *node, char *modalias, int len);
extern void of_print_phandle_args(const char *msg, const struct of_phandle_args *args);
-extern struct device_node *of_parse_phandle(const struct device_node *np,
- const char *phandle_name,
- int index);
-extern int of_parse_phandle_with_args(const struct device_node *np,
- const char *list_name, const char *cells_name, int index,
- struct of_phandle_args *out_args);
+extern int __of_parse_phandle_with_args(const struct device_node *np,
+ const char *list_name, const char *cells_name, int cell_count,
+ int index, struct of_phandle_args *out_args);
extern int of_parse_phandle_with_args_map(const struct device_node *np,
const char *list_name, const char *stem_name, int index,
struct of_phandle_args *out_args);
-extern int of_parse_phandle_with_fixed_args(const struct device_node *np,
- const char *list_name, int cells_count, int index,
- struct of_phandle_args *out_args);
extern int of_count_phandle_with_args(const struct device_node *np,
const char *list_name, const char *cells_name);
@@ -864,18 +858,12 @@ static inline int of_property_read_strin
return -ENOSYS;
}
-static inline struct device_node *of_parse_phandle(const struct device_node *np,
- const char *phandle_name,
- int index)
-{
- return NULL;
-}
-
-static inline int of_parse_phandle_with_args(const struct device_node *np,
- const char *list_name,
- const char *cells_name,
- int index,
- struct of_phandle_args *out_args)
+static inline int __of_parse_phandle_with_args(const struct device_node *np,
+ const char *list_name,
+ const char *cells_name,
+ int cell_count,
+ int index,
+ struct of_phandle_args *out_args)
{
return -ENOSYS;
}
@@ -889,13 +877,6 @@ static inline int of_parse_phandle_with_
return -ENOSYS;
}
-static inline int of_parse_phandle_with_fixed_args(const struct device_node *np,
- const char *list_name, int cells_count, int index,
- struct of_phandle_args *out_args)
-{
- return -ENOSYS;
-}
-
static inline int of_count_phandle_with_args(const struct device_node *np,
const char *list_name,
const char *cells_name)
@@ -1077,6 +1058,117 @@ static inline bool of_node_is_type(const
}
/**
+ * of_parse_phandle - Resolve a phandle property to a device_node pointer
+ * @np: Pointer to device node holding phandle property
+ * @phandle_name: Name of property holding a phandle value
+ * @index: For properties holding a table of phandles, this is the index into
+ * the table
+ *
+ * Return: The device_node pointer with refcount incremented. Use
+ * of_node_put() on it when done.
+ */
+static inline struct device_node *of_parse_phandle(const struct device_node *np,
+ const char *phandle_name,
+ int index)
+{
+ struct of_phandle_args args;
+
+ if (__of_parse_phandle_with_args(np, phandle_name, NULL, 0,
+ index, &args))
+ return NULL;
+
+ return args.np;
+}
+
+/**
+ * of_parse_phandle_with_args() - Find a node pointed by phandle in a list
+ * @np: pointer to a device tree node containing a list
+ * @list_name: property name that contains a list
+ * @cells_name: property name that specifies phandles' arguments count
+ * @index: index of a phandle to parse out
+ * @out_args: optional pointer to output arguments structure (will be filled)
+ *
+ * This function is useful to parse lists of phandles and their arguments.
+ * Returns 0 on success and fills out_args, on error returns appropriate
+ * errno value.
+ *
+ * Caller is responsible to call of_node_put() on the returned out_args->np
+ * pointer.
+ *
+ * Example::
+ *
+ * phandle1: node1 {
+ * #list-cells = <2>;
+ * };
+ *
+ * phandle2: node2 {
+ * #list-cells = <1>;
+ * };
+ *
+ * node3 {
+ * list = <&phandle1 1 2 &phandle2 3>;
+ * };
+ *
+ * To get a device_node of the ``node2`` node you may call this:
+ * of_parse_phandle_with_args(node3, "list", "#list-cells", 1, &args);
+ */
+static inline int of_parse_phandle_with_args(const struct device_node *np,
+ const char *list_name,
+ const char *cells_name,
+ int index,
+ struct of_phandle_args *out_args)
+{
+ int cell_count = -1;
+
+ /* If cells_name is NULL we assume a cell count of 0 */
+ if (!cells_name)
+ cell_count = 0;
+
+ return __of_parse_phandle_with_args(np, list_name, cells_name,
+ cell_count, index, out_args);
+}
+
+/**
+ * of_parse_phandle_with_fixed_args() - Find a node pointed by phandle in a list
+ * @np: pointer to a device tree node containing a list
+ * @list_name: property name that contains a list
+ * @cell_count: number of argument cells following the phandle
+ * @index: index of a phandle to parse out
+ * @out_args: optional pointer to output arguments structure (will be filled)
+ *
+ * This function is useful to parse lists of phandles and their arguments.
+ * Returns 0 on success and fills out_args, on error returns appropriate
+ * errno value.
+ *
+ * Caller is responsible to call of_node_put() on the returned out_args->np
+ * pointer.
+ *
+ * Example::
+ *
+ * phandle1: node1 {
+ * };
+ *
+ * phandle2: node2 {
+ * };
+ *
+ * node3 {
+ * list = <&phandle1 0 2 &phandle2 2 3>;
+ * };
+ *
+ * To get a device_node of the ``node2`` node you may call this:
+ * of_parse_phandle_with_fixed_args(node3, "list", 2, 1, &args);
+ */
+static inline int of_parse_phandle_with_fixed_args(const struct device_node *np,
+ const char *list_name,
+ int cell_count,
+ int index,
+ struct of_phandle_args *out_args)
+{
+ return __of_parse_phandle_with_args(np, list_name, NULL, cell_count,
+ index, out_args);
+}
+
+/**
* of_property_count_u8_elems - Count the number of u8 elements in a property
*
* @np: device node from which the property value is to be read.

View File

@ -0,0 +1,56 @@
From 8eddceb280f5deb8046fcb660de9f9f683b408b9 Mon Sep 17 00:00:00 2001
From: Michael Walle <michael@walle.cc>
Date: Tue, 6 Dec 2022 21:07:21 +0100
Subject: [PATCH] of: base: add of_parse_phandle_with_optional_args()
Add a new variant of the of_parse_phandle_with_args() which treats the
cells name as optional. If it's missing, it is assumed that the phandle
has no arguments.
Up until now, a nvmem node didn't have any arguments, so all the device
trees haven't any '#*-cells' property. But there is a need for an
additional argument for the phandle, for which we need a '#*-cells'
property. Therefore, we need to support nvmem nodes with and without
this property.
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
include/linux/of.h | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -1169,6 +1169,31 @@ static inline int of_parse_phandle_with_
}
/**
+ * of_parse_phandle_with_optional_args() - Find a node pointed by phandle in a list
+ * @np: pointer to a device tree node containing a list
+ * @list_name: property name that contains a list
+ * @cells_name: property name that specifies phandles' arguments count
+ * @index: index of a phandle to parse out
+ * @out_args: optional pointer to output arguments structure (will be filled)
+ *
+ * Same as of_parse_phandle_with_args() except that if the cells_name property
+ * is not found, cell_count of 0 is assumed.
+ *
+ * This is used to useful, if you have a phandle which didn't have arguments
+ * before and thus doesn't have a '#*-cells' property but is now migrated to
+ * having arguments while retaining backwards compatibility.
+ */
+static inline int of_parse_phandle_with_optional_args(const struct device_node *np,
+ const char *list_name,
+ const char *cells_name,
+ int index,
+ struct of_phandle_args *out_args)
+{
+ return __of_parse_phandle_with_args(np, list_name, cells_name,
+ 0, index, out_args);
+}
+
+/**
* of_property_count_u8_elems - Count the number of u8 elements in a property
*
* @np: device node from which the property value is to be read.

View File

@ -0,0 +1,32 @@
From 4f4145c9fee8c7a445dbbbadceccce5391e6b287 Mon Sep 17 00:00:00 2001
From: Michael Walle <michael@walle.cc>
Date: Tue, 6 Dec 2022 21:07:22 +0100
Subject: [PATCH] of: property: make #.*-cells optional for simple props
Sometimes, future bindings for phandles will get additional arguments.
Thus the target node of the phandle will need a new #.*-cells property.
To be backwards compatible, this needs to be optional.
Prepare the DEFINE_SIMPLE_PROPS() to handle the cells name as optional.
Signed-off-by: Michael Walle <michael@walle.cc>
Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/of/property.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1227,8 +1227,8 @@ static struct device_node *parse_suffix_
if (strcmp_suffix(prop_name, suffix))
return NULL;
- if (of_parse_phandle_with_args(np, prop_name, cells_name, index,
- &sup_args))
+ if (__of_parse_phandle_with_args(np, prop_name, cells_name, 0, index,
+ &sup_args))
return NULL;
return sup_args.np;

View File

@ -0,0 +1,28 @@
From 9cf9486a6a7e8a3d76154d0c506051ba3740e8b6 Mon Sep 17 00:00:00 2001
From: Michael Walle <michael@walle.cc>
Date: Tue, 6 Dec 2022 21:07:23 +0100
Subject: [PATCH] of: property: add #nvmem-cell-cells property
Bindings describe the new '#nvmem-cell-cells' property. Now that the
arguments count property is optional, we just add this property to the
nvmem-cells.
Signed-off-by: Michael Walle <michael@walle.cc>
Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/of/property.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1276,7 +1276,7 @@ DEFINE_SIMPLE_PROP(dmas, "dmas", "#dma-c
DEFINE_SIMPLE_PROP(power_domains, "power-domains", "#power-domain-cells")
DEFINE_SIMPLE_PROP(hwlocks, "hwlocks", "#hwlock-cells")
DEFINE_SIMPLE_PROP(extcon, "extcon", NULL)
-DEFINE_SIMPLE_PROP(nvmem_cells, "nvmem-cells", NULL)
+DEFINE_SIMPLE_PROP(nvmem_cells, "nvmem-cells", "#nvmem-cell-cells")
DEFINE_SIMPLE_PROP(phys, "phys", "#phy-cells")
DEFINE_SIMPLE_PROP(wakeup_parent, "wakeup-parent", NULL)
DEFINE_SIMPLE_PROP(pinctrl0, "pinctrl-0", NULL)

View File

@ -75,36 +75,35 @@ Submitted-by: Yousong Zhou <yszhou4tech@gmail.com>
/** /**
* Obtain the MAC address from an nvmem cell named 'mac-address' associated * Obtain the MAC address from an nvmem cell named 'mac-address' associated
* with given device. * with given device.
@@ -552,19 +609,23 @@ int nvmem_get_mac_address(struct device @@ -550,21 +607,28 @@ EXPORT_SYMBOL(eth_platform_get_mac_addre
*/
int nvmem_get_mac_address(struct device *dev, void *addrbuf)
{ {
+ struct nvmem_cell_mac_address_property *property;
struct nvmem_cell *cell; struct nvmem_cell *cell;
const void *mac; const void *mac;
- size_t len; - size_t len;
+ struct nvmem_cell_mac_address_property *property;
+ int i; + int i;
+
- cell = nvmem_cell_get(dev, "mac-address");
- if (IS_ERR(cell))
- return PTR_ERR(cell);
-
- mac = nvmem_cell_read(cell, &len);
- nvmem_cell_put(cell);
-
- if (IS_ERR(mac))
- return PTR_ERR(mac);
+ for (i = 0; i < ARRAY_SIZE(nvmem_cell_mac_address_properties); i++) { + for (i = 0; i < ARRAY_SIZE(nvmem_cell_mac_address_properties); i++) {
+ property = &nvmem_cell_mac_address_properties[i]; + property = &nvmem_cell_mac_address_properties[i];
+ cell = nvmem_cell_get(dev, property->name); + cell = nvmem_cell_get(dev, property->name);
+ if (IS_ERR(cell)) { + /* For -EPROBE_DEFER don't try other properties. We'll get back to this one. */
+ if (i == ARRAY_SIZE(nvmem_cell_mac_address_properties) - 1) + if (!IS_ERR(cell) || PTR_ERR(cell) == -EPROBE_DEFER)
+ return PTR_ERR(cell);
+ continue;
+ }
+ mac = property->read(cell);
+ nvmem_cell_put(cell);
+ break; + break;
+ } + }
- cell = nvmem_cell_get(dev, "mac-address");
if (IS_ERR(cell))
return PTR_ERR(cell);
- mac = nvmem_cell_read(cell, &len);
+ mac = property->read(cell);
nvmem_cell_put(cell);
-
if (IS_ERR(mac))
return PTR_ERR(mac);
- if (len != ETH_ALEN || !is_valid_ether_addr(mac)) { - if (len != ETH_ALEN || !is_valid_ether_addr(mac)) {
+ if (!is_valid_ether_addr(mac)) { + if (!is_valid_ether_addr(mac)) {
kfree(mac); kfree(mac);

View File

@ -16,7 +16,7 @@ SVN-Revision: 36780
--- a/drivers/of/fdt.c --- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c +++ b/drivers/of/fdt.c
@@ -1055,6 +1055,9 @@ int __init early_init_dt_scan_chosen(uns @@ -1054,6 +1054,9 @@ int __init early_init_dt_scan_chosen(uns
p = of_get_flat_dt_prop(node, "bootargs", &l); p = of_get_flat_dt_prop(node, "bootargs", &l);
if (p != NULL && l > 0) if (p != NULL && l > 0)
strlcpy(data, p, min(l, COMMAND_LINE_SIZE)); strlcpy(data, p, min(l, COMMAND_LINE_SIZE));

View File

@ -75,36 +75,35 @@ Submitted-by: Yousong Zhou <yszhou4tech@gmail.com>
/** /**
* nvmem_get_mac_address - Obtain the MAC address from an nvmem cell named * nvmem_get_mac_address - Obtain the MAC address from an nvmem cell named
* 'mac-address' associated with given device. * 'mac-address' associated with given device.
@@ -551,19 +608,23 @@ int nvmem_get_mac_address(struct device @@ -549,21 +606,28 @@ EXPORT_SYMBOL(eth_platform_get_mac_addre
*/
int nvmem_get_mac_address(struct device *dev, void *addrbuf)
{ {
+ struct nvmem_cell_mac_address_property *property;
struct nvmem_cell *cell; struct nvmem_cell *cell;
const void *mac; const void *mac;
- size_t len; - size_t len;
+ struct nvmem_cell_mac_address_property *property;
+ int i; + int i;
+
- cell = nvmem_cell_get(dev, "mac-address");
- if (IS_ERR(cell))
- return PTR_ERR(cell);
-
- mac = nvmem_cell_read(cell, &len);
- nvmem_cell_put(cell);
-
- if (IS_ERR(mac))
- return PTR_ERR(mac);
+ for (i = 0; i < ARRAY_SIZE(nvmem_cell_mac_address_properties); i++) { + for (i = 0; i < ARRAY_SIZE(nvmem_cell_mac_address_properties); i++) {
+ property = &nvmem_cell_mac_address_properties[i]; + property = &nvmem_cell_mac_address_properties[i];
+ cell = nvmem_cell_get(dev, property->name); + cell = nvmem_cell_get(dev, property->name);
+ if (IS_ERR(cell)) { + /* For -EPROBE_DEFER don't try other properties. We'll get back to this one. */
+ if (i == ARRAY_SIZE(nvmem_cell_mac_address_properties) - 1) + if (!IS_ERR(cell) || PTR_ERR(cell) == -EPROBE_DEFER)
+ return PTR_ERR(cell);
+ continue;
+ }
+ mac = property->read(cell);
+ nvmem_cell_put(cell);
+ break; + break;
+ } + }
- cell = nvmem_cell_get(dev, "mac-address");
if (IS_ERR(cell))
return PTR_ERR(cell);
- mac = nvmem_cell_read(cell, &len);
+ mac = property->read(cell);
nvmem_cell_put(cell);
-
if (IS_ERR(mac))
return PTR_ERR(mac);
- if (len != ETH_ALEN || !is_valid_ether_addr(mac)) { - if (len != ETH_ALEN || !is_valid_ether_addr(mac)) {
+ if (!is_valid_ether_addr(mac)) { + if (!is_valid_ether_addr(mac)) {
kfree(mac); kfree(mac);

View File

@ -17,7 +17,7 @@
default "" default ""
--- a/drivers/of/fdt.c --- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c +++ b/drivers/of/fdt.c
@@ -1059,6 +1059,17 @@ int __init early_init_dt_scan_chosen(uns @@ -1058,6 +1058,17 @@ int __init early_init_dt_scan_chosen(uns
if (p != NULL && l > 0) if (p != NULL && l > 0)
strlcat(data, p, min_t(int, strlen(data) + (int)l, COMMAND_LINE_SIZE)); strlcat(data, p, min_t(int, strlen(data) + (int)l, COMMAND_LINE_SIZE));

View File

@ -544,6 +544,7 @@ CONFIG_NUMA=y
CONFIG_NUMA_BALANCING=y CONFIG_NUMA_BALANCING=y
CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y
CONFIG_NVMEM=y CONFIG_NVMEM=y
# CONFIG_NVMEM_LAYERSCAPE_SFP is not set
# CONFIG_NVMEM_SPMI_SDAM is not set # CONFIG_NVMEM_SPMI_SDAM is not set
CONFIG_NVMEM_SYSFS=y CONFIG_NVMEM_SYSFS=y
CONFIG_OF=y CONFIG_OF=y

View File

@ -129,7 +129,7 @@ define Device/buffalo_wsr-2533dhp2
IMAGE/sysupgrade.bin := append-kernel | \ IMAGE/sysupgrade.bin := append-kernel | \
buffalo-kernel-trx 0x32504844 $(KDIR)/tmp/$$(DEVICE_NAME).null | \ buffalo-kernel-trx 0x32504844 $(KDIR)/tmp/$$(DEVICE_NAME).null | \
sysupgrade-tar kernel=$$$$@ | append-metadata sysupgrade-tar kernel=$$$$@ | append-metadata
DEVICE_PACKAGES := swconfig DEVICE_PACKAGES := kmod-mt7615-firmware swconfig
endef endef
TARGET_DEVICES += buffalo_wsr-2533dhp2 TARGET_DEVICES += buffalo_wsr-2533dhp2
@ -138,7 +138,7 @@ define Device/elecom_wrc-2533gent
DEVICE_MODEL := WRC-2533GENT DEVICE_MODEL := WRC-2533GENT
DEVICE_DTS := mt7622-elecom-wrc-2533gent DEVICE_DTS := mt7622-elecom-wrc-2533gent
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-btmtkuart kmod-usb3 swconfig DEVICE_PACKAGES := kmod-btmtkuart kmod-mt7615-firmware kmod-usb3 swconfig
endef endef
TARGET_DEVICES += elecom_wrc-2533gent TARGET_DEVICES += elecom_wrc-2533gent
@ -158,7 +158,7 @@ define Device/elecom_wrc-x3200gst3
elecom-wrc-gs-factory WRC-X3200GST3 0.00 -N | \ elecom-wrc-gs-factory WRC-X3200GST3 0.00 -N | \
append-string MT7622_ELECOM_WRC-X3200GST3 append-string MT7622_ELECOM_WRC-X3200GST3
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
endef endef
TARGET_DEVICES += elecom_wrc-x3200gst3 TARGET_DEVICES += elecom_wrc-x3200gst3
@ -169,7 +169,7 @@ define Device/linksys_e8450
DEVICE_ALT0_MODEL := RT3200 DEVICE_ALT0_MODEL := RT3200
DEVICE_DTS := mt7622-linksys-e8450 DEVICE_DTS := mt7622-linksys-e8450
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e kmod-usb3 DEVICE_PACKAGES := kmod-mt7915-firmware kmod-usb3
endef endef
TARGET_DEVICES += linksys_e8450 TARGET_DEVICES += linksys_e8450
@ -182,7 +182,7 @@ define Device/linksys_e8450-ubi
DEVICE_ALT0_VARIANT := UBI DEVICE_ALT0_VARIANT := UBI
DEVICE_DTS := mt7622-linksys-e8450-ubi DEVICE_DTS := mt7622-linksys-e8450-ubi
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e kmod-usb3 DEVICE_PACKAGES := kmod-mt7915-firmware kmod-usb3
UBINIZE_OPTS := -E 5 UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k BLOCKSIZE := 128k
PAGESIZE := 2048 PAGESIZE := 2048
@ -233,7 +233,7 @@ define Device/ruijie_rg-ew3200gx-pro
DEVICE_MODEL := RG-EW3200GX PRO DEVICE_MODEL := RG-EW3200GX PRO
DEVICE_DTS := mt7622-ruijie-rg-ew3200gx-pro DEVICE_DTS := mt7622-ruijie-rg-ew3200gx-pro
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
endef endef
TARGET_DEVICES += ruijie_rg-ew3200gx-pro TARGET_DEVICES += ruijie_rg-ew3200gx-pro
@ -242,7 +242,7 @@ define Device/reyee_ax3200-e5
DEVICE_MODEL := AX3200 E5 DEVICE_MODEL := AX3200 E5
DEVICE_DTS := mt7622-reyee-ax3200-e5 DEVICE_DTS := mt7622-reyee-ax3200-e5
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
endef endef
TARGET_DEVICES += reyee_ax3200-e5 TARGET_DEVICES += reyee_ax3200-e5
@ -251,7 +251,7 @@ define Device/totolink_a8000ru
DEVICE_MODEL := A8000RU DEVICE_MODEL := A8000RU
DEVICE_DTS := mt7622-totolink-a8000ru DEVICE_DTS := mt7622-totolink-a8000ru
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := swconfig DEVICE_PACKAGES := kmod-mt7615-firmware swconfig
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef endef
TARGET_DEVICES += totolink_a8000ru TARGET_DEVICES += totolink_a8000ru
@ -263,7 +263,7 @@ define Device/ubnt_unifi-6-lr-v1
DEVICE_DTS_CONFIG := config@1 DEVICE_DTS_CONFIG := config@1
DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v1 DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v1
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e kmod-leds-ubnt-ledbar DEVICE_PACKAGES := kmod-mt7915-firmware kmod-leds-ubnt-ledbar
SUPPORTED_DEVICES += ubnt,unifi-6-lr SUPPORTED_DEVICES += ubnt,unifi-6-lr
endef endef
TARGET_DEVICES += ubnt_unifi-6-lr-v1 TARGET_DEVICES += ubnt_unifi-6-lr-v1
@ -274,7 +274,7 @@ define Device/ubnt_unifi-6-lr-v1-ubootmod
DEVICE_VARIANT := v1 U-Boot mod DEVICE_VARIANT := v1 U-Boot mod
DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v1-ubootmod DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v1-ubootmod
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e kmod-leds-ubnt-ledbar DEVICE_PACKAGES := kmod-mt7915-firmware kmod-leds-ubnt-ledbar
KERNEL := kernel-bin | lzma KERNEL := kernel-bin | lzma
KERNEL_INITRAMFS_SUFFIX := -recovery.itb KERNEL_INITRAMFS_SUFFIX := -recovery.itb
KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
@ -294,7 +294,7 @@ define Device/ubnt_unifi-6-lr-v2
DEVICE_DTS_CONFIG := config@1 DEVICE_DTS_CONFIG := config@1
DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v2 DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v2
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
endef endef
TARGET_DEVICES += ubnt_unifi-6-lr-v2 TARGET_DEVICES += ubnt_unifi-6-lr-v2
@ -304,7 +304,7 @@ define Device/ubnt_unifi-6-lr-v2-ubootmod
DEVICE_VARIANT := v2 U-Boot mod DEVICE_VARIANT := v2 U-Boot mod
DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v2-ubootmod DEVICE_DTS := mt7622-ubnt-unifi-6-lr-v2-ubootmod
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
KERNEL := kernel-bin | lzma KERNEL := kernel-bin | lzma
KERNEL_INITRAMFS_SUFFIX := -recovery.itb KERNEL_INITRAMFS_SUFFIX := -recovery.itb
KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
@ -324,7 +324,7 @@ define Device/xiaomi_redmi-router-ax6s
DEVICE_DTS := mt7622-xiaomi-redmi-router-ax6s DEVICE_DTS := mt7622-xiaomi-redmi-router-ax6s
DEVICE_DTS_DIR := ../dts DEVICE_DTS_DIR := ../dts
BOARD_NAME := xiaomi,redmi-router-ax6s BOARD_NAME := xiaomi,redmi-router-ax6s
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
UBINIZE_OPTS := -E 5 UBINIZE_OPTS := -E 5
IMAGES += factory.bin IMAGES += factory.bin
BLOCKSIZE := 128k BLOCKSIZE := 128k

View File

@ -2,7 +2,7 @@ ARCH:=aarch64
SUBTARGET:=mt7622 SUBTARGET:=mt7622
BOARDNAME:=MT7622 BOARDNAME:=MT7622
CPU_TYPE:=cortex-a53 CPU_TYPE:=cortex-a53
DEFAULT_PACKAGES += kmod-mt7615e kmod-mt7615-firmware wpad-basic-openssl uboot-envtools DEFAULT_PACKAGES += kmod-mt7622-firmware wpad-basic-openssl uboot-envtools
KERNELNAME:=Image dtbs KERNELNAME:=Image dtbs
define Target/Description define Target/Description

View File

@ -17,7 +17,7 @@
help help
--- a/drivers/of/fdt.c --- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c +++ b/drivers/of/fdt.c
@@ -1059,6 +1059,17 @@ int __init early_init_dt_scan_chosen(uns @@ -1058,6 +1058,17 @@ int __init early_init_dt_scan_chosen(uns
if (p != NULL && l > 0) if (p != NULL && l > 0)
strlcat(data, p, min_t(int, strlen(data) + (int)l, COMMAND_LINE_SIZE)); strlcat(data, p, min_t(int, strlen(data) + (int)l, COMMAND_LINE_SIZE));

View File

@ -0,0 +1,197 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "dlink,dap-x1860-a1", "mediatek,mt7621-soc";
model = "D-Link DAP-X1860 A1";
chosen {
bootargs = "console=ttyS0,115200";
};
aliases {
label-mac-device = &gmac0;
led-boot = &led_power_orange;
led-failsafe = &led_power_red;
led-running = &led_power_orange;
led-upgrade = &led_power_red;
};
keys {
compatible = "gpio-keys";
wps {
label = "wps";
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
reset {
label = "reset";
gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
leds {
compatible = "gpio-leds";
led_power_red: power_red {
label = "red:power";
gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
};
led_power_orange: power_orange {
label = "orange:power";
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
default-state = "on";
};
rssihigh {
label = "green:rssihigh";
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
};
rssimedium {
label = "green:rssimedium";
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
};
rssilow_orange {
label = "orange:rssilow";
gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
};
rssilow_green {
label = "green:rssilow";
gpios = <&gpio 27 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";
mediatek,nmbm;
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;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_factory_4: macaddr@4 {
reg = <0x4 0x6>;
};
};
partition@180000 {
label = "kernel";
reg = <0x180000 0x0800000>;
};
fwconcat0: partition@980000 {
label = "fwconcat0";
reg = <0x980000 0x2c00000>;
};
partition@3580000 {
label = "manufacture";
reg = <0x3580000 0x400000>;
read-only;
};
partition@3980000 {
label = "storage";
reg = <0x3980000 0x680000>;
read-only;
};
fwconcat1: partition@4000000 {
label = "fwconcat1";
reg = <0x4000000 0x3800000>;
};
};
};
&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;
};
};
&ethernet {
pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
};
&gmac0 {
nvmem-cells = <&macaddr_factory_4>;
nvmem-cell-names = "mac-address";
};
&switch0 {
gpio-controller;
#gpio-cells = <2>;
ports {
port@0 {
status = "okay";
label = "lan";
};
};
};
&state_default {
gpio {
groups = "uart2";
function = "gpio";
};
};

View File

@ -57,40 +57,6 @@
function = LED_FUNCTION_WAN; function = LED_FUNCTION_WAN;
gpios = <&gpio 15 GPIO_ACTIVE_LOW>; gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
}; };
led-wan2 {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_WAN;
gpios = <&switch0 0 GPIO_ACTIVE_LOW>;
};
led-lan4 {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_LAN;
function-enumerator = <4>;
gpios = <&switch0 3 GPIO_ACTIVE_LOW>;
};
led-lan3 {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_LAN;
function-enumerator = <3>;
gpios = <&switch0 6 GPIO_ACTIVE_LOW>;
};
led-lan2 {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_LAN;
function-enumerator = <2>;
gpios = <&switch0 9 GPIO_ACTIVE_HIGH>;
};
led-lan1 {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_LAN;
function-enumerator = <1>;
gpios = <&switch0 12 GPIO_ACTIVE_LOW>;
};
}; };
}; };
@ -185,9 +151,6 @@
}; };
&switch0 { &switch0 {
gpio-controller;
#gpio-cells = <2>;
ports { ports {
port@1 { port@1 {
status = "okay"; status = "okay";

View File

@ -53,31 +53,16 @@
gpios = <&gpio 16 GPIO_ACTIVE_LOW>; gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
}; };
led_lan1_green: lan1_green {
label = "green:lan1";
gpios = <&switch0 3 GPIO_ACTIVE_LOW>;
};
led_lan1_orange: lan1_orange { led_lan1_orange: lan1_orange {
label = "orange:lan1"; label = "orange:lan1";
gpios = <&gpio 15 GPIO_ACTIVE_LOW>; gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
}; };
led_lan2_green: lan2_green {
label = "green:lan2";
gpios = <&switch0 6 GPIO_ACTIVE_LOW>;
};
led_lan2_orange: lan2_orange { led_lan2_orange: lan2_orange {
label = "orange:lan2"; label = "orange:lan2";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>; gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
}; };
led_lan3_green: lan3_green {
label = "green:lan3";
gpios = <&switch0 12 GPIO_ACTIVE_LOW>;
};
led_lan3_orange: lan3_orange { led_lan3_orange: lan3_orange {
label = "orange:lan3"; label = "orange:lan3";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>; gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
@ -256,9 +241,6 @@
}; };
&switch0 { &switch0 {
gpio-controller;
#gpio-cells = <2>;
ports { ports {
port@1 { port@1 {
status = "okay"; status = "okay";

View File

@ -51,40 +51,6 @@
gpios = <&gpio 14 GPIO_ACTIVE_LOW>; gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt"; linux,default-trigger = "phy1tpt";
}; };
lan1 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <1>;
gpios = <&switch0 0 GPIO_ACTIVE_LOW>;
};
lan2 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <2>;
gpios = <&switch0 3 GPIO_ACTIVE_LOW>;
};
lan3 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <3>;
gpios = <&switch0 6 GPIO_ACTIVE_LOW>;
};
lan4 {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_LAN;
function-enumerator = <4>;
gpios = <&switch0 9 GPIO_ACTIVE_HIGH>;
};
wan {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WAN;
gpios = <&switch0 12 GPIO_ACTIVE_LOW>;
};
}; };
}; };
@ -186,9 +152,6 @@
}; };
&switch0 { &switch0 {
gpio-controller;
#gpio-cells = <2>;
ports { ports {
port@0 { port@0 {
status = "okay"; status = "okay";

View File

@ -7,7 +7,6 @@ include ./common-tp-link.mk
DEFAULT_SOC := mt7621 DEFAULT_SOC := mt7621
KERNEL_DTB += -d21
DEVICE_VARS += ELECOM_HWNAME LINKSYS_HWNAME DEVICE_VARS += ELECOM_HWNAME LINKSYS_HWNAME
ifdef CONFIG_LINUX_5_10 ifdef CONFIG_LINUX_5_10
@ -135,7 +134,7 @@ define Device/adslr_g7
IMAGE_SIZE := 16064k IMAGE_SIZE := 16064k
DEVICE_VENDOR := ADSLR DEVICE_VENDOR := ADSLR
DEVICE_MODEL := G7 DEVICE_MODEL := G7
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
endef endef
TARGET_DEVICES += adslr_g7 TARGET_DEVICES += adslr_g7
@ -164,7 +163,7 @@ TARGET_DEVICES += alfa-network_quad-e4g
define Device/ampedwireless_ally_common define Device/ampedwireless_ally_common
$(Device/dsa-migration) $(Device/dsa-migration)
DEVICE_VENDOR := Amped Wireless DEVICE_VENDOR := Amped Wireless
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware uboot-envtools DEVICE_PACKAGES := kmod-mt7615-firmware uboot-envtools
IMAGE_SIZE := 32768k IMAGE_SIZE := 32768k
KERNEL_SIZE := 4096k KERNEL_SIZE := 4096k
BLOCKSIZE := 128k BLOCKSIZE := 128k
@ -232,7 +231,7 @@ define Device/asus_rp-ac87
IMAGE/factory.bin := append-kernel | append-rootfs | pad-rootfs | check-size IMAGE/factory.bin := append-kernel | append-rootfs | pad-rootfs | check-size
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \
check-size | append-metadata check-size | append-metadata
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware rssileds DEVICE_PACKAGES := kmod-mt7615-firmware rssileds
endef endef
TARGET_DEVICES += asus_rp-ac87 TARGET_DEVICES += asus_rp-ac87
@ -261,7 +260,7 @@ define Device/asus_rt-ac65p
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
check-size check-size
DEVICE_PACKAGES := kmod-usb3 kmod-mt7615e kmod-mt7615-firmware uboot-envtools DEVICE_PACKAGES := kmod-usb3 kmod-mt7615-firmware uboot-envtools
endef endef
TARGET_DEVICES += asus_rt-ac65p TARGET_DEVICES += asus_rt-ac65p
@ -278,7 +277,7 @@ define Device/asus_rt-ac85p
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
check-size check-size
DEVICE_PACKAGES := kmod-usb3 kmod-mt7615e kmod-mt7615-firmware uboot-envtools DEVICE_PACKAGES := kmod-usb3 kmod-mt7615-firmware uboot-envtools
endef endef
TARGET_DEVICES += asus_rt-ac85p TARGET_DEVICES += asus_rt-ac85p
@ -307,7 +306,7 @@ define Device/asus_rt-ax53u
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
check-size check-size
DEVICE_PACKAGES := kmod-mt7915e kmod-usb3 uboot-envtools \ DEVICE_PACKAGES := kmod-mt7915-firmware kmod-usb3 uboot-envtools \
kmod-usb-ledtrig-usbport kmod-usb-ledtrig-usbport
endef endef
TARGET_DEVICES += asus_rt-ax53u TARGET_DEVICES += asus_rt-ax53u
@ -329,7 +328,7 @@ define Device/beeline_smartbox-flash
IMAGES += factory.trx IMAGES += factory.trx
IMAGE/factory.trx := append-kernel | append-ubi | check-size IMAGE/factory.trx := append-kernel | append-ubi | check-size
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
DEVICE_PACKAGES := kmod-usb3 kmod-mt7615e kmod-mt7615-firmware \ DEVICE_PACKAGES := kmod-usb3 kmod-mt7615-firmware \
uboot-envtools uencrypt uboot-envtools uencrypt
endef endef
TARGET_DEVICES += beeline_smartbox-flash TARGET_DEVICES += beeline_smartbox-flash
@ -355,7 +354,7 @@ define Device/beeline_smartbox-turbo
SERCOMM_SWVER := 1004 SERCOMM_SWVER := 1004
DEVICE_VENDOR := Beeline DEVICE_VENDOR := Beeline
DEVICE_MODEL := SmartBox TURBO DEVICE_MODEL := SmartBox TURBO
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware \ DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware \
kmod-usb3 uboot-envtools kmod-usb3 uboot-envtools
endef endef
TARGET_DEVICES += beeline_smartbox-turbo TARGET_DEVICES += beeline_smartbox-turbo
@ -368,7 +367,7 @@ define Device/belkin_rt1800
IMAGE_SIZE := 49152k IMAGE_SIZE := 49152k
DEVICE_VENDOR := Belkin DEVICE_VENDOR := Belkin
DEVICE_MODEL := RT1800 DEVICE_MODEL := RT1800
DEVICE_PACKAGES := kmod-mt7915e kmod-usb3 uboot-envtools DEVICE_PACKAGES := kmod-mt7915-firmware kmod-usb3 uboot-envtools
UBINIZE_OPTS := -E 5 UBINIZE_OPTS := -E 5
KERNEL_LOADADDR := 0x82000000 KERNEL_LOADADDR := 0x82000000
KERNEL := kernel-bin | relocate-kernel 0x80001000 | lzma | \ KERNEL := kernel-bin | relocate-kernel 0x80001000 | lzma | \
@ -402,7 +401,7 @@ define Device/buffalo_wsr-2533dhpl
DEVICE_ALT0_VENDOR := Buffalo DEVICE_ALT0_VENDOR := Buffalo
DEVICE_ALT0_MODEL := WSR-2533DHP DEVICE_ALT0_MODEL := WSR-2533DHP
IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
DEFAULT := n DEFAULT := n
endef endef
TARGET_DEVICES += buffalo_wsr-2533dhpl TARGET_DEVICES += buffalo_wsr-2533dhpl
@ -433,7 +432,7 @@ define Device/cudy_m1800
DEVICE_MODEL := M1800 DEVICE_MODEL := M1800
IMAGE_SIZE := 16064k IMAGE_SIZE := 16064k
UIMAGE_NAME := R17 UIMAGE_NAME := R17
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
endef endef
TARGET_DEVICES += cudy_m1800 TARGET_DEVICES += cudy_m1800
@ -466,7 +465,7 @@ define Device/cudy_wr2100
DEVICE_MODEL := WR2100 DEVICE_MODEL := WR2100
IMAGE_SIZE := 15872k IMAGE_SIZE := 15872k
UIMAGE_NAME := R11 UIMAGE_NAME := R11
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware
endef endef
TARGET_DEVICES += cudy_wr2100 TARGET_DEVICES += cudy_wr2100
@ -476,15 +475,36 @@ define Device/cudy_x6
DEVICE_VENDOR := Cudy DEVICE_VENDOR := Cudy
DEVICE_MODEL := X6 DEVICE_MODEL := X6
UIMAGE_NAME := R13 UIMAGE_NAME := R13
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
endef endef
TARGET_DEVICES += cudy_x6 TARGET_DEVICES += cudy_x6
define Device/dlink_dap-x1860-a1
$(Device/dsa-migration)
IMAGE_SIZE := 53248k
DEVICE_VENDOR := D-Link
DEVICE_MODEL := DAP-X1860
DEVICE_VARIANT := A1
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_SIZE := 8192k
KERNEL_LOADADDR := 0x82000000
KERNEL := kernel-bin | relocate-kernel 0x80001000 | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
IMAGES += factory.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
check-size | elx-header 011b0060 8844A2D168B45A2D
DEVICE_PACKAGES := kmod-mt7915-firmware rssileds
endef
TARGET_DEVICES += dlink_dap-x1860-a1
define Device/dlink_dir-8xx-a1 define Device/dlink_dir-8xx-a1
$(Device/dsa-migration) $(Device/dsa-migration)
IMAGE_SIZE := 16000k IMAGE_SIZE := 16000k
DEVICE_VENDOR := D-Link DEVICE_VENDOR := D-Link
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
KERNEL := $$(KERNEL) | uimage-sgehdr KERNEL := $$(KERNEL) | uimage-sgehdr
IMAGES += factory.bin IMAGES += factory.bin
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \
@ -496,7 +516,7 @@ define Device/dlink_dir-8xx-r1
$(Device/dsa-migration) $(Device/dsa-migration)
IMAGE_SIZE := 16064k IMAGE_SIZE := 16064k
DEVICE_VENDOR := D-Link DEVICE_VENDOR := D-Link
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
KERNEL_INITRAMFS := $$(KERNEL) KERNEL_INITRAMFS := $$(KERNEL)
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \
check-size | append-metadata check-size | append-metadata
@ -510,7 +530,7 @@ define Device/dlink_dir-xx60-a1
IMAGE_SIZE := 40960k IMAGE_SIZE := 40960k
UBINIZE_OPTS := -E 5 UBINIZE_OPTS := -E 5
DEVICE_VENDOR := D-Link DEVICE_VENDOR := D-Link
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 \ DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 \
kmod-usb-ledtrig-usbport kmod-usb-ledtrig-usbport
KERNEL := $$(KERNEL) | uimage-sgehdr KERNEL := $$(KERNEL) | uimage-sgehdr
IMAGES += factory.bin IMAGES += factory.bin
@ -663,7 +683,7 @@ define Device/edimax_ra21s
IMAGES += factory.bin IMAGES += factory.bin
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
elx-header 02020040 8844A2D168B45A2D elx-header 02020040 8844A2D168B45A2D
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
endef endef
TARGET_DEVICES += edimax_ra21s TARGET_DEVICES += edimax_ra21s
@ -682,7 +702,7 @@ define Device/edimax_re23s
IMAGE/factory.bin := append-kernel | append-rootfs | \ IMAGE/factory.bin := append-kernel | append-rootfs | \
edimax-header -s CSYS -m RN76 -f 0x70000 -S 0x01100000 | pad-rootfs | \ edimax-header -s CSYS -m RN76 -f 0x70000 -S 0x01100000 | pad-rootfs | \
check-size check-size
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
endef endef
TARGET_DEVICES += edimax_re23s TARGET_DEVICES += edimax_re23s
@ -695,7 +715,7 @@ define Device/edimax_rg21s
IMAGES += factory.bin IMAGES += factory.bin
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
elx-header 02020038 8844A2D168B45A2D elx-header 02020038 8844A2D168B45A2D
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
endef endef
TARGET_DEVICES += edimax_rg21s TARGET_DEVICES += edimax_rg21s
@ -707,7 +727,7 @@ define Device/elecom_wrc-1167ghbk2-s
IMAGES += factory.bin IMAGES += factory.bin
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
elecom-wrc-gs-factory WRC-1167GHBK2-S 0.00 elecom-wrc-gs-factory WRC-1167GHBK2-S 0.00
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
endef endef
TARGET_DEVICES += elecom_wrc-1167ghbk2-s TARGET_DEVICES += elecom_wrc-1167ghbk2-s
@ -719,7 +739,7 @@ define Device/elecom_wrc-gs
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
elecom-wrc-gs-factory $$$$(ELECOM_HWNAME) 0.00 -N | \ elecom-wrc-gs-factory $$$$(ELECOM_HWNAME) 0.00 -N | \
append-string MT7621_ELECOM_$$$$(ELECOM_HWNAME) append-string MT7621_ELECOM_$$$$(ELECOM_HWNAME)
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
endef endef
define Device/elecom_wrc-1167gs2-b define Device/elecom_wrc-1167gs2-b
@ -780,7 +800,7 @@ define Device/elecom_wrc-2533ghbk-i
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
elx-header 0107002d 8844A2D168B45A2D | \ elx-header 0107002d 8844A2D168B45A2D | \
elecom-product-header WRC-2533GHBK-I elecom-product-header WRC-2533GHBK-I
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
endef endef
TARGET_DEVICES += elecom_wrc-2533ghbk-i TARGET_DEVICES += elecom_wrc-2533ghbk-i
@ -816,7 +836,7 @@ define Device/etisalat_s3
SERCOMM_SWVER := 4009 SERCOMM_SWVER := 4009
DEVICE_VENDOR := Etisalat DEVICE_VENDOR := Etisalat
DEVICE_MODEL := S3 DEVICE_MODEL := S3
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware \ DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware \
kmod-usb3 uboot-envtools kmod-usb3 uboot-envtools
endef endef
TARGET_DEVICES += etisalat_s3 TARGET_DEVICES += etisalat_s3
@ -846,7 +866,7 @@ define Device/glinet_gl-mt1300
IMAGE_SIZE := 32448k IMAGE_SIZE := 32448k
DEVICE_VENDOR := GL.iNet DEVICE_VENDOR := GL.iNet
DEVICE_MODEL := GL-MT1300 DEVICE_MODEL := GL-MT1300
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3
endef endef
TARGET_DEVICES += glinet_gl-mt1300 TARGET_DEVICES += glinet_gl-mt1300
@ -883,7 +903,7 @@ define Device/h3c_tx180x
KERNEL := $$(KERNEL_INITRAMFS) | h3c-blank-header KERNEL := $$(KERNEL_INITRAMFS) | h3c-blank-header
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
DEVICE_VENDOR := H3C DEVICE_VENDOR := H3C
DEVICE_PACKAGES := kmod-mt7915e uboot-envtools DEVICE_PACKAGES := kmod-mt7915-firmware uboot-envtools
endef endef
define Device/h3c_tx1800-plus define Device/h3c_tx1800-plus
@ -920,7 +940,7 @@ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
haier-sim_wr1800k-factory haier-sim_wr1800k-factory
endif endif
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
DEVICE_PACKAGES := kmod-mt7915e uboot-envtools DEVICE_PACKAGES := kmod-mt7915-firmware uboot-envtools
endef endef
define Device/haier_har-20s2u1 define Device/haier_har-20s2u1
@ -973,7 +993,7 @@ define Device/humax_e10
IMAGE/factory.bin := append-kernel | append-rootfs | pad-rootfs | \ IMAGE/factory.bin := append-kernel | append-rootfs | pad-rootfs | \
edimax-header -s CSYS -m EA03 -f 0x70000 -S 0x01100000 | \ edimax-header -s CSYS -m EA03 -f 0x70000 -S 0x01100000 | \
check-size | zip upg -P f013c26cf0a320fb71d03356dcb6bb63 check-size | zip upg -P f013c26cf0a320fb71d03356dcb6bb63
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3
endef endef
TARGET_DEVICES += humax_e10 TARGET_DEVICES += humax_e10
@ -1014,7 +1034,7 @@ define Device/iodata_wn-ax1167gr2
DEVICE_MODEL := WN-AX1167GR2 DEVICE_MODEL := WN-AX1167GR2
KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \ KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \
uImage lzma -M 0x434f4d42 -n '3.10(XBC.1)b10' | iodata-mstc-header uImage lzma -M 0x434f4d42 -n '3.10(XBC.1)b10' | iodata-mstc-header
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
endef endef
TARGET_DEVICES += iodata_wn-ax1167gr2 TARGET_DEVICES += iodata_wn-ax1167gr2
@ -1023,7 +1043,7 @@ define Device/iodata_wn-ax2033gr
DEVICE_MODEL := WN-AX2033GR DEVICE_MODEL := WN-AX2033GR
KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \ KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \
uImage lzma -M 0x434f4d42 -n '3.10(VST.1)C10' | iodata-mstc-header uImage lzma -M 0x434f4d42 -n '3.10(VST.1)C10' | iodata-mstc-header
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware
endef endef
TARGET_DEVICES += iodata_wn-ax2033gr TARGET_DEVICES += iodata_wn-ax2033gr
@ -1032,7 +1052,7 @@ define Device/iodata_wn-dx1167r
DEVICE_MODEL := WN-DX1167R DEVICE_MODEL := WN-DX1167R
KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \ KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \
uImage lzma -M 0x434f4d43 -n '3.10(XIK.1)b10' | iodata-mstc-header uImage lzma -M 0x434f4d43 -n '3.10(XIK.1)b10' | iodata-mstc-header
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
endef endef
TARGET_DEVICES += iodata_wn-dx1167r TARGET_DEVICES += iodata_wn-dx1167r
@ -1050,7 +1070,7 @@ define Device/iodata_wn-dx2033gr
DEVICE_MODEL := WN-DX2033GR DEVICE_MODEL := WN-DX2033GR
KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \ KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \
uImage lzma -M 0x434f4d42 -n '3.10(XID.0)b30' | iodata-mstc-header uImage lzma -M 0x434f4d42 -n '3.10(XID.0)b30' | iodata-mstc-header
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware
endef endef
TARGET_DEVICES += iodata_wn-dx2033gr TARGET_DEVICES += iodata_wn-dx2033gr
@ -1073,7 +1093,7 @@ define Device/iodata_wnpr2600g
IMAGES += factory.bin IMAGES += factory.bin
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \ IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
elx-header 0104003a 8844A2D168B45A2D elx-header 0104003a 8844A2D168B45A2D
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
endef endef
TARGET_DEVICES += iodata_wnpr2600g TARGET_DEVICES += iodata_wnpr2600g
@ -1083,7 +1103,7 @@ define Device/iptime_a3002mesh
UIMAGE_NAME := a3002me UIMAGE_NAME := a3002me
DEVICE_VENDOR := ipTIME DEVICE_VENDOR := ipTIME
DEVICE_MODEL := A3002MESH DEVICE_MODEL := A3002MESH
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
endef endef
TARGET_DEVICES += iptime_a3002mesh TARGET_DEVICES += iptime_a3002mesh
@ -1111,7 +1131,7 @@ define Device/iptime_a3004t
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
DEVICE_VENDOR := ipTIME DEVICE_VENDOR := ipTIME
DEVICE_MODEL := A3004T DEVICE_MODEL := A3004T
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3
endef endef
TARGET_DEVICES += iptime_a3004t TARGET_DEVICES += iptime_a3004t
@ -1121,7 +1141,7 @@ define Device/iptime_a6004ns-m
UIMAGE_NAME := a6004nm UIMAGE_NAME := a6004nm
DEVICE_VENDOR := ipTIME DEVICE_VENDOR := ipTIME
DEVICE_MODEL := A6004NS-M DEVICE_MODEL := A6004NS-M
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 \ DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 \
kmod-usb-ledtrig-usbport kmod-usb-ledtrig-usbport
endef endef
TARGET_DEVICES += iptime_a6004ns-m TARGET_DEVICES += iptime_a6004ns-m
@ -1132,7 +1152,7 @@ define Device/iptime_a6ns-m
UIMAGE_NAME := a6nm UIMAGE_NAME := a6nm
DEVICE_VENDOR := ipTIME DEVICE_VENDOR := ipTIME
DEVICE_MODEL := A6ns-M DEVICE_MODEL := A6ns-M
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 \ DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 \
kmod-usb-ledtrig-usbport kmod-usb-ledtrig-usbport
endef endef
TARGET_DEVICES += iptime_a6ns-m TARGET_DEVICES += iptime_a6ns-m
@ -1143,7 +1163,7 @@ define Device/iptime_a8004t
UIMAGE_NAME := a8004t UIMAGE_NAME := a8004t
DEVICE_VENDOR := ipTIME DEVICE_VENDOR := ipTIME
DEVICE_MODEL := A8004T DEVICE_MODEL := A8004T
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3
endef endef
TARGET_DEVICES += iptime_a8004t TARGET_DEVICES += iptime_a8004t
@ -1163,7 +1183,7 @@ define Device/iptime_ax2004m
check-size | iptime-crc32 ax2004m check-size | iptime-crc32 ax2004m
DEVICE_VENDOR := ipTIME DEVICE_VENDOR := ipTIME
DEVICE_MODEL := AX2004M DEVICE_MODEL := AX2004M
DEVICE_PACKAGES := kmod-mt7915e kmod-usb3 DEVICE_PACKAGES := kmod-mt7915-firmware kmod-usb3
endef endef
TARGET_DEVICES += iptime_ax2004m TARGET_DEVICES += iptime_ax2004m
@ -1190,7 +1210,7 @@ define Device/jcg_jhr-ac876m
JCG_MAXSIZE := 16064k JCG_MAXSIZE := 16064k
DEVICE_VENDOR := JCG DEVICE_VENDOR := JCG
DEVICE_MODEL := JHR-AC876M DEVICE_MODEL := JHR-AC876M
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 \ DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 \
kmod-usb-ledtrig-usbport kmod-usb-ledtrig-usbport
endef endef
TARGET_DEVICES += jcg_jhr-ac876m TARGET_DEVICES += jcg_jhr-ac876m
@ -1209,7 +1229,7 @@ define Device/jcg_q20
check-size check-size
DEVICE_VENDOR := JCG DEVICE_VENDOR := JCG
DEVICE_MODEL := Q20 DEVICE_MODEL := Q20
DEVICE_PACKAGES := kmod-mt7915e uboot-envtools DEVICE_PACKAGES := kmod-mt7915-firmware uboot-envtools
endef endef
TARGET_DEVICES += jcg_q20 TARGET_DEVICES += jcg_q20
@ -1222,7 +1242,7 @@ define Device/jcg_y2
JCG_MAXSIZE := 16064k JCG_MAXSIZE := 16064k
DEVICE_VENDOR := JCG DEVICE_VENDOR := JCG
DEVICE_MODEL := Y2 DEVICE_MODEL := Y2
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3
endef endef
TARGET_DEVICES += jcg_y2 TARGET_DEVICES += jcg_y2
@ -1288,7 +1308,7 @@ define Device/linksys_ea7xxx
KERNEL_SIZE := 4096k KERNEL_SIZE := 4096k
IMAGE_SIZE := 36864k IMAGE_SIZE := 36864k
DEVICE_VENDOR := Linksys DEVICE_VENDOR := Linksys
DEVICE_PACKAGES := kmod-usb3 kmod-mt7615e kmod-mt7615-firmware \ DEVICE_PACKAGES := kmod-usb3 kmod-mt7615-firmware \
uboot-envtools uboot-envtools
UBINIZE_OPTS := -E 5 UBINIZE_OPTS := -E 5
IMAGES := sysupgrade.bin factory.bin IMAGES := sysupgrade.bin factory.bin
@ -1470,7 +1490,7 @@ define Device/mts_wg430223
IMAGES += factory.trx IMAGES += factory.trx
IMAGE/factory.trx := append-kernel | append-ubi | check-size IMAGE/factory.trx := append-kernel | append-ubi | check-size
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware uboot-envtools uencrypt DEVICE_PACKAGES := kmod-mt7615-firmware uboot-envtools uencrypt
endef endef
TARGET_DEVICES += mts_wg430223 TARGET_DEVICES += mts_wg430223
@ -1527,7 +1547,7 @@ define Device/netgear_r6260
SERCOMM_HWVER := A001 SERCOMM_HWVER := A001
SERCOMM_SWVER := 0x0052 SERCOMM_SWVER := 0x0052
IMAGE_SIZE := 40960k IMAGE_SIZE := 40960k
DEVICE_PACKAGES += kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES += kmod-mt7615-firmware
endef endef
TARGET_DEVICES += netgear_r6260 TARGET_DEVICES += netgear_r6260
@ -1539,7 +1559,7 @@ define Device/netgear_r6350
SERCOMM_HWVER := A001 SERCOMM_HWVER := A001
SERCOMM_SWVER := 0x0052 SERCOMM_SWVER := 0x0052
IMAGE_SIZE := 40960k IMAGE_SIZE := 40960k
DEVICE_PACKAGES += kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES += kmod-mt7615-firmware
endef endef
TARGET_DEVICES += netgear_r6350 TARGET_DEVICES += netgear_r6350
@ -1558,7 +1578,7 @@ define Device/netgear_r6700-v2
SERCOMM_HWVER := A001 SERCOMM_HWVER := A001
SERCOMM_SWVER := 0x1032 SERCOMM_SWVER := 0x1032
IMAGE_SIZE := 40960k IMAGE_SIZE := 40960k
DEVICE_PACKAGES += kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES += kmod-mt7615-firmware
endef endef
TARGET_DEVICES += netgear_r6700-v2 TARGET_DEVICES += netgear_r6700-v2
@ -1570,7 +1590,7 @@ define Device/netgear_r6800
SERCOMM_HWVER := A001 SERCOMM_HWVER := A001
SERCOMM_SWVER := 0x0062 SERCOMM_SWVER := 0x0062
IMAGE_SIZE := 40960k IMAGE_SIZE := 40960k
DEVICE_PACKAGES += kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES += kmod-mt7615-firmware
endef endef
TARGET_DEVICES += netgear_r6800 TARGET_DEVICES += netgear_r6800
@ -1582,7 +1602,7 @@ define Device/netgear_r6850
SERCOMM_HWVER := A001 SERCOMM_HWVER := A001
SERCOMM_SWVER := 0x0052 SERCOMM_SWVER := 0x0052
IMAGE_SIZE := 40960k IMAGE_SIZE := 40960k
DEVICE_PACKAGES += kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES += kmod-mt7615-firmware
endef endef
TARGET_DEVICES += netgear_r6850 TARGET_DEVICES += netgear_r6850
@ -1595,7 +1615,7 @@ define Device/netgear_r6900-v2
SERCOMM_HWVER := A001 SERCOMM_HWVER := A001
SERCOMM_SWVER := 0x1032 SERCOMM_SWVER := 0x1032
IMAGE_SIZE := 40960k IMAGE_SIZE := 40960k
DEVICE_PACKAGES += kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES += kmod-mt7615-firmware
endef endef
TARGET_DEVICES += netgear_r6900-v2 TARGET_DEVICES += netgear_r6900-v2
@ -1607,7 +1627,7 @@ define Device/netgear_r7200
SERCOMM_HWVER := A001 SERCOMM_HWVER := A001
SERCOMM_SWVER := 0x1032 SERCOMM_SWVER := 0x1032
IMAGE_SIZE := 40960k IMAGE_SIZE := 40960k
DEVICE_PACKAGES += kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES += kmod-mt7615-firmware
endef endef
TARGET_DEVICES += netgear_r7200 TARGET_DEVICES += netgear_r7200
@ -1619,7 +1639,7 @@ define Device/netgear_r7450
SERCOMM_HWVER := A001 SERCOMM_HWVER := A001
SERCOMM_SWVER := 0x1032 SERCOMM_SWVER := 0x1032
IMAGE_SIZE := 40960k IMAGE_SIZE := 40960k
DEVICE_PACKAGES += kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES += kmod-mt7615-firmware
endef endef
TARGET_DEVICES += netgear_r7450 TARGET_DEVICES += netgear_r7450
@ -1643,7 +1663,7 @@ define Device/netgear_wac124
SERCOMM_HWVER := A003 SERCOMM_HWVER := A003
SERCOMM_SWVER := 0x0402 SERCOMM_SWVER := 0x0402
IMAGE_SIZE := 40960k IMAGE_SIZE := 40960k
DEVICE_PACKAGES += kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES += kmod-mt7615-firmware
endef endef
TARGET_DEVICES += netgear_wac124 TARGET_DEVICES += netgear_wac124
@ -1651,7 +1671,7 @@ define Device/netgear_wax202
$(Device/dsa-migration) $(Device/dsa-migration)
DEVICE_VENDOR := NETGEAR DEVICE_VENDOR := NETGEAR
DEVICE_MODEL := WAX202 DEVICE_MODEL := WAX202
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
NETGEAR_ENC_MODEL := WAX202 NETGEAR_ENC_MODEL := WAX202
NETGEAR_ENC_REGION := US NETGEAR_ENC_REGION := US
BLOCKSIZE := 128k BLOCKSIZE := 128k
@ -1715,7 +1735,7 @@ define Device/oraybox_x3a
IMAGE_SIZE := 15360k IMAGE_SIZE := 15360k
DEVICE_VENDOR := OrayBox DEVICE_VENDOR := OrayBox
DEVICE_MODEL := X3A DEVICE_MODEL := X3A
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
endef endef
TARGET_DEVICES += oraybox_x3a TARGET_DEVICES += oraybox_x3a
@ -1727,7 +1747,7 @@ define Device/phicomm_k2p
DEVICE_ALT0_VENDOR := Phicomm DEVICE_ALT0_VENDOR := Phicomm
DEVICE_ALT0_MODEL := KE 2P DEVICE_ALT0_MODEL := KE 2P
SUPPORTED_DEVICES += k2p SUPPORTED_DEVICES += k2p
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
endef endef
TARGET_DEVICES += phicomm_k2p TARGET_DEVICES += phicomm_k2p
@ -1756,7 +1776,7 @@ define Device/raisecom_msg1500-x-00
DEVICE_VARIANT := X.00 DEVICE_VARIANT := X.00
DEVICE_ALT0_VENDOR := Nokia DEVICE_ALT0_VENDOR := Nokia
DEVICE_ALT0_MODEL := A-040W-Q DEVICE_ALT0_MODEL := A-040W-Q
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 \ DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 \
kmod-usb-ledtrig-usbport uboot-envtools kmod-usb-ledtrig-usbport uboot-envtools
endef endef
TARGET_DEVICES += raisecom_msg1500-x-00 TARGET_DEVICES += raisecom_msg1500-x-00
@ -1780,7 +1800,7 @@ define Device/rostelecom_rt-sf-1
SERCOMM_SWVER := 1026 SERCOMM_SWVER := 1026
DEVICE_VENDOR := Rostelecom DEVICE_VENDOR := Rostelecom
DEVICE_MODEL := RT-SF-1 DEVICE_MODEL := RT-SF-1
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware \ DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware \
kmod-usb3 uboot-envtools kmod-usb3 uboot-envtools
endef endef
TARGET_DEVICES += rostelecom_rt-sf-1 TARGET_DEVICES += rostelecom_rt-sf-1
@ -1868,7 +1888,7 @@ define Device/tenbay_t-mb5eu-v01
DEVICE_VENDOR := Tenbay DEVICE_VENDOR := Tenbay
DEVICE_MODEL := T-MB5EU-V01 DEVICE_MODEL := T-MB5EU-V01
DEVICE_DTS_CONFIG := config@1 DEVICE_DTS_CONFIG := config@1
DEVICE_PACKAGES += kmod-mt7915e kmod-usb3 DEVICE_PACKAGES += kmod-mt7915-firmware kmod-usb3
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
IMAGE_SIZE := 15808k IMAGE_SIZE := 15808k
SUPPORTED_DEVICES += mt7621-dm2-t-mb5eu-v01-nor SUPPORTED_DEVICES += mt7621-dm2-t-mb5eu-v01-nor
@ -1892,7 +1912,7 @@ define Device/totolink_a7000r
UIMAGE_NAME := C8340R1C-9999 UIMAGE_NAME := C8340R1C-9999
DEVICE_VENDOR := TOTOLINK DEVICE_VENDOR := TOTOLINK
DEVICE_MODEL := A7000R DEVICE_MODEL := A7000R
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
endef endef
TARGET_DEVICES += totolink_a7000r TARGET_DEVICES += totolink_a7000r
@ -1902,7 +1922,7 @@ define Device/totolink_x5000r
UIMAGE_NAME := C8343R-9999 UIMAGE_NAME := C8343R-9999
DEVICE_VENDOR := TOTOLINK DEVICE_VENDOR := TOTOLINK
DEVICE_MODEL := X5000R DEVICE_MODEL := X5000R
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
endef endef
TARGET_DEVICES += totolink_x5000r TARGET_DEVICES += totolink_x5000r
@ -1964,7 +1984,7 @@ define Device/tplink_eap615-wall-v1
$(Device/tplink-safeloader) $(Device/tplink-safeloader)
DEVICE_MODEL := EAP615-Wall DEVICE_MODEL := EAP615-Wall
DEVICE_VARIANT := v1 DEVICE_VARIANT := v1
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
TPLINK_BOARD_ID := EAP615-WALL-V1 TPLINK_BOARD_ID := EAP615-WALL-V1
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | pad-to 64k KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | pad-to 64k
KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
@ -2022,7 +2042,7 @@ define Device/tplink_re500-v1
$(Device/tplink-safeloader) $(Device/tplink-safeloader)
DEVICE_MODEL := RE500 DEVICE_MODEL := RE500
DEVICE_VARIANT := v1 DEVICE_VARIANT := v1
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
TPLINK_BOARD_ID := RE500-V1 TPLINK_BOARD_ID := RE500-V1
IMAGE_SIZE := 14208k IMAGE_SIZE := 14208k
endef endef
@ -2033,7 +2053,7 @@ define Device/tplink_re650-v1
$(Device/tplink-safeloader) $(Device/tplink-safeloader)
DEVICE_MODEL := RE650 DEVICE_MODEL := RE650
DEVICE_VARIANT := v1 DEVICE_VARIANT := v1
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
TPLINK_BOARD_ID := RE650-V1 TPLINK_BOARD_ID := RE650-V1
IMAGE_SIZE := 14208k IMAGE_SIZE := 14208k
endef endef
@ -2044,7 +2064,7 @@ define Device/tplink_re650-v2
$(Device/tplink-safeloader) $(Device/tplink-safeloader)
DEVICE_MODEL := RE650 DEVICE_MODEL := RE650
DEVICE_VARIANT := v2 DEVICE_VARIANT := v2
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7615-firmware
TPLINK_BOARD_ID := RE650-V2 TPLINK_BOARD_ID := RE650-V2
IMAGE_SIZE := 7994k IMAGE_SIZE := 7994k
endef endef
@ -2097,7 +2117,7 @@ define Device/ubnt_unifi-6-lite
DEVICE_MODEL := UniFi 6 Lite DEVICE_MODEL := UniFi 6 Lite
DEVICE_DTS_CONFIG := config@1 DEVICE_DTS_CONFIG := config@1
DEVICE_DTS_LOADADDR := 0x87000000 DEVICE_DTS_LOADADDR := 0x87000000
DEVICE_PACKAGES += kmod-mt7603 kmod-mt7915e DEVICE_PACKAGES += kmod-mt7603 kmod-mt7915-firmware
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
IMAGE_SIZE := 15424k IMAGE_SIZE := 15424k
endef endef
@ -2110,7 +2130,7 @@ define Device/ubnt_unifi-flexhd
DEVICE_DTS_CONFIG := config@2 DEVICE_DTS_CONFIG := config@2
DEVICE_DTS_LOADADDR := 0x87000000 DEVICE_DTS_LOADADDR := 0x87000000
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
DEVICE_PACKAGES += kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware kmod-leds-ubnt-ledbar DEVICE_PACKAGES += kmod-mt7603 kmod-mt7615-firmware kmod-leds-ubnt-ledbar
IMAGE_SIZE := 15552k IMAGE_SIZE := 15552k
endef endef
TARGET_DEVICES += ubnt_unifi-flexhd TARGET_DEVICES += ubnt_unifi-flexhd
@ -2119,7 +2139,7 @@ define Device/ubnt_unifi-nanohd
$(Device/dsa-migration) $(Device/dsa-migration)
DEVICE_VENDOR := Ubiquiti DEVICE_VENDOR := Ubiquiti
DEVICE_MODEL := UniFi nanoHD DEVICE_MODEL := UniFi nanoHD
DEVICE_PACKAGES += kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES += kmod-mt7603 kmod-mt7615-firmware
IMAGE_SIZE := 15552k IMAGE_SIZE := 15552k
endef endef
TARGET_DEVICES += ubnt_unifi-nanohd TARGET_DEVICES += ubnt_unifi-nanohd
@ -2186,7 +2206,7 @@ define Device/wavlink_wl-wn531a6
$(Device/dsa-migration) $(Device/dsa-migration)
DEVICE_VENDOR := Wavlink DEVICE_VENDOR := Wavlink
DEVICE_MODEL := WL-WN531A6 DEVICE_MODEL := WL-WN531A6
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware kmod-usb3 DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware kmod-usb3
IMAGE_SIZE := 15040k IMAGE_SIZE := 15040k
endef endef
TARGET_DEVICES += wavlink_wl-wn531a6 TARGET_DEVICES += wavlink_wl-wn531a6
@ -2196,7 +2216,7 @@ define Device/wavlink_wl-wn533a8
DEVICE_VENDOR := Wavlink DEVICE_VENDOR := Wavlink
DEVICE_MODEL := WL-WN533A8 DEVICE_MODEL := WL-WN533A8
KERNEL_INITRAMFS_SUFFIX := -WN533A8$$(KERNEL_SUFFIX) KERNEL_INITRAMFS_SUFFIX := -WN533A8$$(KERNEL_SUFFIX)
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3
IMAGE_SIZE := 15040k IMAGE_SIZE := 15040k
endef endef
TARGET_DEVICES += wavlink_wl-wn533a8 TARGET_DEVICES += wavlink_wl-wn533a8
@ -2254,7 +2274,7 @@ define Device/winstars_ws-wn583a6
DEVICE_ALT0_VENDOR := Gemeita DEVICE_ALT0_VENDOR := Gemeita
DEVICE_ALT0_MODEL := AC2100 DEVICE_ALT0_MODEL := AC2100
KERNEL_INITRAMFS_SUFFIX := -WN583A6$$(KERNEL_SUFFIX) KERNEL_INITRAMFS_SUFFIX := -WN583A6$$(KERNEL_SUFFIX)
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware
endef endef
TARGET_DEVICES += winstars_ws-wn583a6 TARGET_DEVICES += winstars_ws-wn583a6
@ -2309,7 +2329,7 @@ define Device/xiaomi_mi-router-3-pro
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
check-size check-size
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 \ DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 \
kmod-usb-ledtrig-usbport uboot-envtools kmod-usb-ledtrig-usbport uboot-envtools
SUPPORTED_DEVICES += xiaomi,mir3p SUPPORTED_DEVICES += xiaomi,mir3p
endef endef
@ -2338,7 +2358,7 @@ define Device/xiaomi_mi-router-ac2100
$(Device/xiaomi_nand_separate) $(Device/xiaomi_nand_separate)
DEVICE_MODEL := Mi Router AC2100 DEVICE_MODEL := Mi Router AC2100
IMAGE_SIZE := 120320k IMAGE_SIZE := 120320k
DEVICE_PACKAGES += kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES += kmod-mt7603 kmod-mt7615-firmware
endef endef
TARGET_DEVICES += xiaomi_mi-router-ac2100 TARGET_DEVICES += xiaomi_mi-router-ac2100
@ -2355,7 +2375,7 @@ define Device/xiaomi_mi-router-cr660x
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/firmware.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ IMAGE/firmware.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
check-size check-size
DEVICE_PACKAGES += kmod-mt7915e uboot-envtools DEVICE_PACKAGES += kmod-mt7915-firmware uboot-envtools
endef endef
define Device/xiaomi_mi-router-cr6606 define Device/xiaomi_mi-router-cr6606
@ -2380,7 +2400,7 @@ define Device/xiaomi_redmi-router-ac2100
$(Device/xiaomi_nand_separate) $(Device/xiaomi_nand_separate)
DEVICE_MODEL := Redmi Router AC2100 DEVICE_MODEL := Redmi Router AC2100
IMAGE_SIZE := 120320k IMAGE_SIZE := 120320k
DEVICE_PACKAGES += kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware DEVICE_PACKAGES += kmod-mt7603 kmod-mt7615-firmware
endef endef
TARGET_DEVICES += xiaomi_redmi-router-ac2100 TARGET_DEVICES += xiaomi_redmi-router-ac2100
@ -2430,7 +2450,7 @@ define Device/yuncore_ax820
IMAGE_SIZE := 15808k IMAGE_SIZE := 15808k
DEVICE_VENDOR := YunCore DEVICE_VENDOR := YunCore
DEVICE_MODEL := AX820 DEVICE_MODEL := AX820
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
endef endef
TARGET_DEVICES += yuncore_ax820 TARGET_DEVICES += yuncore_ax820
@ -2440,7 +2460,7 @@ define Device/yuncore_fap640
IMAGE_SIZE := 15808k IMAGE_SIZE := 15808k
DEVICE_VENDOR := YunCore DEVICE_VENDOR := YunCore
DEVICE_MODEL := FAP640 DEVICE_MODEL := FAP640
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
endef endef
TARGET_DEVICES += yuncore_fap640 TARGET_DEVICES += yuncore_fap640
@ -2450,7 +2470,7 @@ define Device/yuncore_fap690
IMAGE_SIZE := 15808k IMAGE_SIZE := 15808k
DEVICE_VENDOR := YunCore DEVICE_VENDOR := YunCore
DEVICE_MODEL := FAP690 DEVICE_MODEL := FAP690
DEVICE_PACKAGES := kmod-mt7915e DEVICE_PACKAGES := kmod-mt7915-firmware
endef endef
TARGET_DEVICES += yuncore_fap690 TARGET_DEVICES += yuncore_fap690
@ -2579,7 +2599,7 @@ define Device/zyxel_lte3301-plus
UBINIZE_OPTS := -E 5 UBINIZE_OPTS := -E 5
DEVICE_VENDOR := ZyXEL DEVICE_VENDOR := ZyXEL
DEVICE_MODEL := LTE3301-PLUS DEVICE_MODEL := LTE3301-PLUS
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 \ DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 \
uboot-envtools kmod-usb-ledtrig-usbport kmod-usb-net-qmi-wwan \ uboot-envtools kmod-usb-ledtrig-usbport kmod-usb-net-qmi-wwan \
kmod-usb-serial-option uqmi kmod-usb-serial-option uqmi
KERNEL := $(KERNEL_DTB) | uImage lzma | \ KERNEL := $(KERNEL_DTB) | uImage lzma | \
@ -2613,7 +2633,7 @@ define Device/zyxel_nwa-ax
PAGESIZE := 2048 PAGESIZE := 2048
KERNEL_SIZE := 8192k KERNEL_SIZE := 8192k
UBINIZE_OPTS := -E 5 UBINIZE_OPTS := -E 5
DEVICE_PACKAGES := kmod-mt7915e uboot-envtools zyxel-bootconfig DEVICE_PACKAGES := kmod-mt7915-firmware uboot-envtools zyxel-bootconfig
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
IMAGES += factory.bin ramboot-factory.bin IMAGES += factory.bin ramboot-factory.bin
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | zyxel-nwa-fit IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | zyxel-nwa-fit

View File

@ -56,6 +56,13 @@ jcg,y2|\
xzwifi,creativebox-v1) xzwifi,creativebox-v1)
ucidef_set_led_netdev "internet" "internet" "blue:internet" "wan" ucidef_set_led_netdev "internet" "internet" "blue:internet" "wan"
;; ;;
dlink,dap-x1860-a1)
ucidef_set_rssimon "wlan1" "200000" "1"
ucidef_set_led_rssi "rssilow" "RSSILOW" "orange:rssilow" "wlan1" "1" "25"
ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "green:rssilow" "wlan1" "26" "100"
ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "green:rssimedium" "wlan1" "51" "100"
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "green:rssihigh" "wlan1" "76" "100"
;;
dlink,dir-1960-a1|\ dlink,dir-1960-a1|\
dlink,dir-2640-a1|\ dlink,dir-2640-a1|\
dlink,dir-2660-a1) dlink,dir-2660-a1)
@ -87,13 +94,6 @@ keenetic,kn-3010)
linksys,e5600) linksys,e5600)
ucidef_set_led_netdev "wan" "wan link" "blue:wan" "wan" "link" ucidef_set_led_netdev "wan" "wan link" "blue:wan" "wan" "link"
;; ;;
linksys,e7350)
ucidef_set_led_netdev "lan1" "lan1" "blue:lan-1" "lan1"
ucidef_set_led_netdev "lan2" "lan2" "blue:lan-2" "lan2"
ucidef_set_led_netdev "lan3" "lan4" "blue:lan-3" "lan3"
ucidef_set_led_netdev "lan4" "lan4" "blue:lan-4" "lan4"
ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan"
;;
linksys,ea6350-v4|\ linksys,ea6350-v4|\
linksys,ea7300-v1|\ linksys,ea7300-v1|\
linksys,ea7300-v2|\ linksys,ea7300-v2|\
@ -142,9 +142,6 @@ netgear,r7450)
;; ;;
netgear,wax202) netgear,wax202)
ucidef_set_led_netdev "internet" "Internet" "green:net" "wan" ucidef_set_led_netdev "internet" "Internet" "green:net" "wan"
ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "lan1"
ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "lan2"
ucidef_set_led_netdev "lan3" "LAN3" "green:lan3" "lan3"
;; ;;
oraybox,x3a) oraybox,x3a)
ucidef_set_led_netdev "wan" "wan link" "red:status" "wan" ucidef_set_led_netdev "wan" "wan link" "red:status" "wan"
@ -197,13 +194,6 @@ yuncore,ax820)
ucidef_set_led_netdev "lan" "LAN" "green:lan" "lan" ucidef_set_led_netdev "lan" "LAN" "green:lan" "lan"
ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan" ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
;; ;;
zbtlink,zbt-wg1608-16m)
ucidef_set_led_netdev "lan1" "LAN1" "green:lan-1" "lan1"
ucidef_set_led_netdev "lan2" "LAN2" "green:lan-2" "lan2"
ucidef_set_led_netdev "lan3" "LAN3" "green:lan-3" "lan3"
ucidef_set_led_netdev "lan4" "LAN4" "green:lan-4" "lan4"
ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
;;
zyxel,lte3301-plus) zyxel,lte3301-plus)
ucidef_set_led_netdev "internet" "internet" "white:internet" "wwan0" ucidef_set_led_netdev "internet" "internet" "white:internet" "wwan0"
;; ;;

View File

@ -11,6 +11,7 @@ ramips_setup_interfaces()
ampedwireless,ally-00x19k|\ ampedwireless,ally-00x19k|\
asus,rp-ac56|\ asus,rp-ac56|\
asus,rp-ac87|\ asus,rp-ac87|\
dlink,dap-x1860-a1|\
edimax,re23s|\ edimax,re23s|\
mikrotik,ltap-2hnd|\ mikrotik,ltap-2hnd|\
mikrotik,routerboard-m11g|\ mikrotik,routerboard-m11g|\

View File

@ -22,6 +22,13 @@ case "$board" in
hw_mac_addr="$(mtd_get_mac_binary factory 0x4)" hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
macaddr_add $hw_mac_addr "$PHYNBR" > /sys${DEVPATH}/macaddress macaddr_add $hw_mac_addr "$PHYNBR" > /sys${DEVPATH}/macaddress
;; ;;
dlink,dap-x1860-a1)
hw_mac_addr="$(mtd_get_mac_binary factory 0x4)"
[ "$PHYNBR" = "0" ] && \
macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && \
macaddr_add $hw_mac_addr 4 > /sys${DEVPATH}/macaddress
;;
dlink,dir-853-a3) dlink,dir-853-a3)
[ "$PHYNBR" = "0" ] && \ [ "$PHYNBR" = "0" ] && \
macaddr_setbit_la "$(mtd_get_mac_binary factory 0xe000)" \ macaddr_setbit_la "$(mtd_get_mac_binary factory 0xe000)" \

View File

@ -59,6 +59,7 @@ platform_do_upgrade() {
beeline,smartbox-giga|\ beeline,smartbox-giga|\
beeline,smartbox-turbo|\ beeline,smartbox-turbo|\
belkin,rt1800|\ belkin,rt1800|\
dlink,dap-x1860-a1|\
dlink,dir-1960-a1|\ dlink,dir-1960-a1|\
dlink,dir-2640-a1|\ dlink,dir-2640-a1|\
dlink,dir-2660-a1|\ dlink,dir-2660-a1|\

View File

@ -8,6 +8,42 @@
compatible = "d-link,dgs-1210-10mp-f", "realtek,rtl8382-soc", "realtek,rtl838x-soc"; compatible = "d-link,dgs-1210-10mp-f", "realtek,rtl8382-soc", "realtek,rtl838x-soc";
model = "D-Link DGS-1210-10MP F"; model = "D-Link DGS-1210-10MP F";
/* i2c for sfp port9 */
i2c0: i2c-gpio-0 {
compatible = "i2c-gpio";
sda-gpios = <&gpio1 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
scl-gpios = <&gpio1 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
i2c-gpio,delay-us = <2>;
#address-cells = <1>;
#size-cells = <0>;
};
sfp0: sfp-p9 {
compatible = "sff,sfp";
i2c-bus = <&i2c0>;
los-gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>;
mod-def0-gpio = <&gpio1 8 GPIO_ACTIVE_LOW>;
tx-disable-gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;
};
/* i2c for sfp port10 */
i2c1: i2c-gpio-1 {
compatible = "i2c-gpio";
sda-gpios = <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
scl-gpios = <&gpio1 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
i2c-gpio,delay-us = <2>;
#address-cells = <1>;
#size-cells = <0>;
};
sfp1: sfp-p10 {
compatible = "sff,sfp";
i2c-bus = <&i2c1>;
los-gpio = <&gpio1 4 GPIO_ACTIVE_HIGH>;
mod-def0-gpio = <&gpio1 3 GPIO_ACTIVE_LOW>;
tx-disable-gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
};
}; };
&leds { &leds {
@ -72,8 +108,24 @@
SWITCH_PORT(13, 6, internal) SWITCH_PORT(13, 6, internal)
SWITCH_PORT(14, 7, internal) SWITCH_PORT(14, 7, internal)
SWITCH_PORT(15, 8, internal) SWITCH_PORT(15, 8, internal)
SWITCH_SFP_PORT(24, 9, rgmii-id)
SWITCH_SFP_PORT(26, 10, rgmii-id) port@24 {
reg = <24>;
label = "lan9";
phy-handle = <14>;
phy-mode = "1000base-x";
managed = "in-band-status";
sfp = <&sfp0>;
};
port@26 {
reg = <26>;
label = "lan10";
phy-handle = <15>;
phy-mode = "1000base-x";
managed = "in-band-status";
sfp = <&sfp1>;
};
port@28 { port@28 {
ethernet = <&ethernet0>; ethernet = <&ethernet0>;

View File

@ -8,6 +8,42 @@
compatible = "d-link,dgs-1210-10mp-f", "realtek,rtl8382-soc", "realtek,rtl838x-soc"; compatible = "d-link,dgs-1210-10mp-f", "realtek,rtl8382-soc", "realtek,rtl838x-soc";
model = "D-Link DGS-1210-10MP F"; model = "D-Link DGS-1210-10MP F";
/* i2c for sfp port9 */
i2c0: i2c-gpio-0 {
compatible = "i2c-gpio";
sda-gpios = <&gpio1 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
scl-gpios = <&gpio1 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
i2c-gpio,delay-us = <2>;
#address-cells = <1>;
#size-cells = <0>;
};
sfp0: sfp-p9 {
compatible = "sff,sfp";
i2c-bus = <&i2c0>;
los-gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>;
mod-def0-gpio = <&gpio1 8 GPIO_ACTIVE_LOW>;
tx-disable-gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;
};
/* i2c for sfp port10 */
i2c1: i2c-gpio-1 {
compatible = "i2c-gpio";
sda-gpios = <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
scl-gpios = <&gpio1 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
i2c-gpio,delay-us = <2>;
#address-cells = <1>;
#size-cells = <0>;
};
sfp1: sfp-p10 {
compatible = "sff,sfp";
i2c-bus = <&i2c1>;
los-gpio = <&gpio1 4 GPIO_ACTIVE_HIGH>;
mod-def0-gpio = <&gpio1 3 GPIO_ACTIVE_LOW>;
tx-disable-gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
};
}; };
&leds { &leds {
@ -72,8 +108,24 @@
SWITCH_PORT(13, 6, internal) SWITCH_PORT(13, 6, internal)
SWITCH_PORT(14, 7, internal) SWITCH_PORT(14, 7, internal)
SWITCH_PORT(15, 8, internal) SWITCH_PORT(15, 8, internal)
SWITCH_SFP_PORT(24, 9, rgmii-id)
SWITCH_SFP_PORT(26, 10, rgmii-id) port@24 {
reg = <24>;
label = "lan9";
phy-handle = <14>;
phy-mode = "1000base-x";
managed = "in-band-status";
sfp = <&sfp0>;
};
port@26 {
reg = <26>;
label = "lan10";
phy-handle = <15>;
phy-mode = "1000base-x";
managed = "in-band-status";
sfp = <&sfp1>;
};
port@28 { port@28 {
ethernet = <&ethernet0>; ethernet = <&ethernet0>;

View File

@ -71,20 +71,6 @@ define Build/h3c-vfs
mv $@.new $@ mv $@.new $@
endef endef
define Build/relocate-kernel
rm -rf $@.relocate
$(CP) ../../generic/image/relocate $@.relocate
$(MAKE) -j1 -C $@.relocate KERNEL_ADDR=$(KERNEL_LOADADDR) LZMA_TEXT_START=0x82000000 \
CROSS_COMPILE=$(TARGET_CROSS)
( \
dd if=$@.relocate/loader.bin bs=32 conv=sync && \
perl -e '@s = stat("$@"); print pack("N", @s[7])' && \
cat "$@" \
) > "$@.new"
mv "$@.new" "$@"
rm -rf $@.relocate
endef
define Device/Default define Device/Default
PROFILES = Default PROFILES = Default
KERNEL := \ KERNEL := \

View File

@ -34,14 +34,12 @@ define Device/hpe_1920
KERNEL := \ KERNEL := \
kernel-bin | \ kernel-bin | \
append-dtb | \ append-dtb | \
relocate-kernel | \
7z | \ 7z | \
h3c-image | \ h3c-image | \
h3c-vfs h3c-vfs
KERNEL_INITRAMFS := \ KERNEL_INITRAMFS := \
kernel-bin | \ kernel-bin | \
append-dtb | \ append-dtb | \
relocate-kernel | \
7z | \ 7z | \
h3c-image h3c-image
IMAGE/sysupgrade.bin := \ IMAGE/sysupgrade.bin := \

View File

@ -32,7 +32,7 @@ Signed-off-by: Guenter Roeck <linux@roeck-us.net>
--- a/MAINTAINERS --- a/MAINTAINERS
+++ b/MAINTAINERS +++ b/MAINTAINERS
@@ -14816,6 +14816,13 @@ S: Maintained @@ -14824,6 +14824,13 @@ S: Maintained
F: include/sound/rt*.h F: include/sound/rt*.h
F: sound/soc/codecs/rt* F: sound/soc/codecs/rt*

View File

@ -32,7 +32,7 @@ Signed-off-by: Guenter Roeck <linux@roeck-us.net>
--- a/MAINTAINERS --- a/MAINTAINERS
+++ b/MAINTAINERS +++ b/MAINTAINERS
@@ -15882,6 +15882,13 @@ S: Maintained @@ -15890,6 +15890,13 @@ S: Maintained
F: include/sound/rt*.h F: include/sound/rt*.h
F: sound/soc/codecs/rt* F: sound/soc/codecs/rt*

View File

@ -2,7 +2,7 @@
choice choice
prompt "GCC compiler Version" if TOOLCHAINOPTS prompt "GCC compiler Version" if TOOLCHAINOPTS
default GCC_USE_VERSION_11 default GCC_USE_VERSION_12
help help
Select the version of gcc you wish to use. Select the version of gcc you wish to use.

View File

@ -1,8 +1,8 @@
config GCC_VERSION_12 config GCC_VERSION_11
default y if GCC_USE_VERSION_12 default y if GCC_USE_VERSION_11
bool bool
config GCC_VERSION config GCC_VERSION
string string
default "12.2.0" if GCC_VERSION_12 default "12.2.0"
default "11.3.0" default "11.3.0" if GCC_VERSION_11

View File

@ -178,7 +178,7 @@ define Host/SetToolchainInfo
endef endef
ifdef CONFIG_GCC_USE_VERSION_12 ifeq ($(GCC_MAJOR_VERSION),12)
GCC_VERSION_FILE:=gcc/genversion.cc GCC_VERSION_FILE:=gcc/genversion.cc
else else
GCC_VERSION_FILE:=gcc/version.c GCC_VERSION_FILE:=gcc/version.c

View File

@ -7,12 +7,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=mpfr PKG_NAME:=mpfr
PKG_VERSION:=4.1.1 PKG_VERSION:=4.2.0
PKG_CPE_ID:=cpe:/a:mpfr:gnu_mpfr PKG_CPE_ID:=cpe:/a:mpfr:gnu_mpfr
PKG_SOURCE_URL:=@GNU/mpfr http://www.mpfr.org/mpfr-$(PKG_VERSION) PKG_SOURCE_URL:=@GNU/mpfr http://www.mpfr.org/mpfr-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=ffd195bd567dbaffc3b98b23fd00aad0537680c9896171e44fe3ff79e28ac33d PKG_HASH:=06a378df13501248c1b2db5aa977a2c8126ae849a9d9b7be2546fb4a9c26d993
HOST_BUILD_PARALLEL:=1 HOST_BUILD_PARALLEL:=1
HOST_FIXUP:=autoreconf HOST_FIXUP:=autoreconf

View File

@ -1,6 +1,6 @@
--- a/Makefile.am --- a/Makefile.am
+++ b/Makefile.am +++ b/Makefile.am
@@ -34,7 +34,7 @@ AUTOMAKE_OPTIONS = gnu @@ -38,7 +38,7 @@ AUTOMAKE_OPTIONS = gnu
# old Automake version. # old Automake version.
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
@ -11,7 +11,7 @@
pkgconfig_DATA = mpfr.pc pkgconfig_DATA = mpfr.pc
--- a/Makefile.in --- a/Makefile.in
+++ b/Makefile.in +++ b/Makefile.in
@@ -397,7 +397,7 @@ AUTOMAKE_OPTIONS = gnu @@ -401,7 +401,7 @@ AUTOMAKE_OPTIONS = gnu
# libtoolize and in case some developer needs to switch back to an # libtoolize and in case some developer needs to switch back to an
# old Automake version. # old Automake version.
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4

View File

@ -1,76 +0,0 @@
From 0ce17bae34a6c54de31b126f969d3ddd72c6bc37 Mon Sep 17 00:00:00 2001
From: Vincent Lefevre <vincent@vinc17.net>
Date: Tue, 22 Nov 2022 16:33:00 +0100
Subject: [PATCH] Fix mpfr_custom_get_kind() macro bug.
* src/mpfr.h: in the mpfr_custom_get_kind() macro, changed mpfr_ptr to
mpfr_srcptr for _x to agree with the function prototype, in order to
avoid a compilation failure of user code in some cases. This bug was
introduced by commit 9f94e0311ed53d0c64d4fbca249d19cc4888027e, which
introduced the temporary variable _x to avoid an incorrect number of
evaluations of the x argument.
* tests/tstckintc.c: improved the tests to detect this bug.
This should fix mpfr bug #1.
Bug initially reported by FX Coudert:
https://github.com/CGAL/cgal/issues/7064
It affects Fedora Linux:
https://bugzilla.redhat.com/show_bug.cgi?id=2144197
---
src/mpfr.h | 2 +-
tests/tstckintc.c | 10 +++++++---
2 files changed, 8 insertions(+), 4 deletions(-)
--- a/src/mpfr.h
+++ b/src/mpfr.h
@@ -1027,7 +1027,7 @@ __MPFR_DECLSPEC int mpfr_total_order_p (
#if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
#define mpfr_custom_get_kind(x) \
__extension__ ({ \
- mpfr_ptr _x = (x); \
+ mpfr_srcptr _x = (x); \
_x->_mpfr_exp > __MPFR_EXP_INF ? \
(mpfr_int) MPFR_REGULAR_KIND * MPFR_SIGN (_x) \
: _x->_mpfr_exp == __MPFR_EXP_INF ? \
--- a/tests/tstckintc.c
+++ b/tests/tstckintc.c
@@ -295,14 +295,16 @@ static void
test_nan_inf_zero (void)
{
mpfr_ptr val;
+ mpfr_srcptr sval; /* for compilation error checking */
int sign;
int kind;
reset_stack ();
val = new_mpfr (MPFR_PREC_MIN);
+ sval = val;
mpfr_set_nan (val);
- kind = (mpfr_custom_get_kind) (val);
+ kind = (mpfr_custom_get_kind) (sval);
if (kind != MPFR_NAN_KIND)
{
printf ("mpfr_custom_get_kind error: ");
@@ -380,7 +382,8 @@ static long *
dummy_set_si (long si)
{
mpfr_t x;
- long * r = dummy_new ();
+ mpfr_srcptr px; /* for compilation error checking */
+ long *r = dummy_new ();
int i1, i2, i3, i4, i5;
/* Check that the type "void *" can be used, like with the function.
@@ -405,7 +408,8 @@ dummy_set_si (long si)
MPFR_ASSERTN (i5 == 1);
mpfr_set_si (x, si, MPFR_RNDN);
- r[0] = mpfr_custom_get_kind (x);
+ px = x;
+ r[0] = mpfr_custom_get_kind (px);
/* Check that the type "void *" can be used in C, like with the function
(forbidden in C++). Also check side effects. */

View File

@ -7,12 +7,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=xz PKG_NAME:=xz
PKG_VERSION:=5.2.10 PKG_VERSION:=5.4.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/lzmautils \ PKG_SOURCE_URL:=@SF/lzmautils \
http://tukaani.org/xz http://tukaani.org/xz
PKG_HASH:=01b71df61521d9da698ce3c33148bff06a131628ff037398c09482f3a26e5408 PKG_HASH:=795ea0494c66d509b052ddc36dc63bd634e59ff2a0f39c16a3b5644dd01d87e6
PKG_CPE_ID:=cpe:/a:tukaani:xz PKG_CPE_ID:=cpe:/a:tukaani:xz
HOST_BUILD_PARALLEL:=1 HOST_BUILD_PARALLEL:=1