From db639238f202ef7a71ad7f85693463fd8a3810cd Mon Sep 17 00:00:00 2001 From: Michael Peleshenko Date: Mon, 25 Oct 2021 20:12:57 -0400 Subject: [PATCH 01/65] umdns: add missing syscall to seccomp filter The 'madvise', syscall is missing. Found with 'utrace /usr/sbin/umdns' on an R7800 and RT3200. Signed-off-by: Michael Peleshenko --- package/network/services/umdns/files/umdns.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package/network/services/umdns/files/umdns.json b/package/network/services/umdns/files/umdns.json index e941b223a8..92f1a17b52 100644 --- a/package/network/services/umdns/files/umdns.json +++ b/package/network/services/umdns/files/umdns.json @@ -21,6 +21,7 @@ "fstat", "getsockname", "ioctl", + "madvise", "mmap", "mmap2", "munmap", From b2aca61360c33ad3161f8ef35a1c28ebb2507600 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 26 Oct 2021 13:02:37 +0100 Subject: [PATCH 02/65] base-files, metadata: support additional group membership Some packages may require additional group membership for the system user added by that package. Allow defining additional groups as third member of the ':'-separated tuple, allowing to specify multiple ','-separated groups with optional GID. Example: USERID:=foouser=1000:foogroup=1000:addg1=1001,addg2=1002,addg3 Signed-off-by: Daniel Golle --- package/base-files/files/lib/functions.sh | 23 ++++++++++++++++++++--- scripts/metadata.pm | 8 +++++++- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index d8604415cc..a5b23eb135 100644 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -209,10 +209,10 @@ add_group_and_user() { if [ -n "$rusers" ]; then local tuple oIFS="$IFS" for tuple in $rusers; do - local uid gid uname gname + local uid gid uname gname addngroups addngroup addngname addngid IFS=":" - set -- $tuple; uname="$1"; gname="$2" + set -- $tuple; uname="$1"; gname="$2"; addngroups="$3" IFS="=" set -- $uname; uname="$1"; uid="$2" set -- $gname; gname="$1"; gid="$2" @@ -232,7 +232,24 @@ add_group_and_user() { group_add_user "$gname" "$uname" fi - unset uid gid uname gname + if [ -n "$uname" ] && [ -n "$addngroups" ]; then + oIFS="$IFS" + IFS="," + for addngroup in $addngroups ; do + IFS="=" + set -- $addngroup; addngname="$1"; addngid="$2" + if [ -n "$addngid" ]; then + group_exists "$addngname" || group_add "$addngname" "$addngid" + else + group_add_next "$addngname" + fi + + group_add_user "$addngname" "$uname" + done + IFS="$oIFS" + fi + + unset uid gid uname gname addngroups addngroup addngname addngid done fi } diff --git a/scripts/metadata.pm b/scripts/metadata.pm index f252c5309c..ee5a2945ca 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -295,13 +295,19 @@ sub parse_package_metadata($) { my @ugspecs = split /\s+/, $1; for my $ugspec (@ugspecs) { - my @ugspec = split /:/, $ugspec, 2; + my @ugspec = split /:/, $ugspec, 3; if ($ugspec[0]) { parse_package_metadata_usergroup($src->{makefile}, "user", \%usernames, \%userids, $ugspec[0]) or return 0; } if ($ugspec[1]) { parse_package_metadata_usergroup($src->{makefile}, "group", \%groupnames, \%groupids, $ugspec[1]) or return 0; } + if ($ugspec[2]) { + my @addngroups = split /,/, $ugspec[2]; + for my $addngroup (@addngroups) { + parse_package_metadata_usergroup($src->{makefile}, "group", \%groupnames, \%groupids, $addngroup) or return 0; + } + } } }; } From 4ae4035e6012c19a5f2931025c09f29d1c1939ae Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Wed, 27 Oct 2021 15:30:39 +0100 Subject: [PATCH 03/65] mediatek: make sure MMC is not busy before commencing sysupgrade In case of the block device still being in use, re-reading the partition table fails. In that case, abort sysupgrade to avoid corrupting the just-written image because of wrong offsets caused by failure to re-read the partition table. Signed-off-by: Daniel Golle --- target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh | 1 + target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh index 0cdd8df8f9..513741d667 100755 --- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh @@ -12,6 +12,7 @@ platform_do_upgrade() { export_partdevice rootdev 0 case "$rootdev" in mmc*) + blockdev --rereadpt /dev/$rootdev || return 1 local fitpart=$(get_partition_by_name $rootdev "production") [ "$fitpart" ] || return 1 dd if=/dev/zero of=/dev/$fitpart bs=4096 count=1 2>/dev/null diff --git a/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh index 4564bc61dd..11da6314dc 100755 --- a/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh @@ -86,6 +86,7 @@ platform_do_upgrade() { bananapi,bpi-r2) export_bootdevice export_partdevice rootdev 0 + blockdev --rereadpt /dev/$rootdev || return 1 export_partdevice fitpart 3 [ "$fitpart" ] || return 1 dd if=/dev/zero of=/dev/$fitpart bs=4096 count=1 2>/dev/null From de8a800ca9bda1171bfe17ee7653532465a8b596 Mon Sep 17 00:00:00 2001 From: Dominick Grift Date: Fri, 22 Oct 2021 13:51:11 +0200 Subject: [PATCH 04/65] libsepol: update to version 3.3 Update VERSIONs to 3.3 for release. libsepol/cil: Fix potential undefined shifts libsepol: Fix potential undefined shifts Update VERSIONs to 3.3-rc3 for release. libsepol/cil: Do not skip macros when resolving until later passes libsepol/cil: Limit the amount of reporting for bounds failures libsepol/cil: silence clang void-pointer-to-enum-cast warning libsepol: resolve GCC warning about null-dereference libsepol: use correct cast libsepol: ebitmap: mark nodes of const ebitmaps const Update VERSIONs to 3.3-rc2 for release. libsepol/cil: Handle operations in a class mapping when verifying libsepol/cil: Do not use original type and typeattribute datums libsepol: free memory after policy validation libsepol: avoid implicit conversions libsepol: fix typo libsepol/cil: Free duplicate datums in original calling function libsepol/cil: Fix detected RESOURCE_LEAK (CWE-772) Update VERSIONs and Python bindings version to 3.3-rc1 for release libsepol/cil: Limit the number of active line marks libsepol/cil: Add function to get number of items in a stack libsepol: Fix detected RESOURCE_LEAKs libsepol/cil: Fix syntax checking in __cil_verify_syntax() libsepol/cil: Use size_t for len in __cil_verify_syntax() libsepol/cil: Remove redundant syntax checking libsepol/cil: Improve in-statement to allow use after inheritance libsepol/cil: Simplify cil_tree_children_destroy() libsepol/cil: Refactor the function __cil_build_ast_node_helper() libsepol/cil: Don't destroy optionals whose parent will be destroyed libsepol/cil: Properly check for parameter when inserting name libsepol/cil: Reset expandtypeattribute rules when resetting AST libsepol/cil: Properly check parse tree when printing error messages libsepol/cil: Allow some duplicate macro and block declarations libsepol/cil: When writing AST use line marks for src_info nodes libsepol/cil: Report correct high-level language line numbers libsepol/cil: Add line mark kind and line number to src info libsepol/cil: Create common string-to-unsigned-integer functions libsepol/cil: Push line mark state first when processing a line mark libsepol/cil: Check for valid line mark type immediately libsepol/cil: Check the token type after getting the next token libsepol/cil: Check syntax of src_info statement libsepol/cil: move the fuzz target and build script to the selinux repository libsepol: replace strerror by %m libsepol/cil: remove obsolete comment libsepol/cil: do not allow \0 in quoted strings libsepol/cil: Fix handling category sets in an expression libsepol: assure string NUL-termination of ibdev_name libsepol: avoid implicit conversions libsepol: ignore UBSAN false-positives libsepol: avoid unsigned integer overflow libsepol/cil: Improve checking for bad inheritance patterns libsepol: silence -Wextra-semi-stmt warning libsepol/cil: do not override previous results of __cil_verify_classperms libsepol/cil: Provide option to allow qualified names in declarations libsepol/cil: make array cil_sym_sizes const libsepol/cil: Only reset AST if optional has a declaration libsepol/cil: Add function to determine if a subtree has a declaration libsepol/cil: Improve degenerate inheritance check libsepol/cil: Reduce the initial symtab sizes for blocks libsepol/cil: Check for empty list when marking neverallow attributes libsepol/cil: Fix syntax checking of defaultrange rule libsepol/cil: Properly check for loops in sets libsepol/cil: Allow duplicate optional blocks in most cases libsepol: declare read-only arrays const libsepol: declare file local variable static libsepol: drop unnecessary casts libsepol: drop repeated semicolons libsepol/cil: avoid using maybe uninitialized variables libsepol/cil: drop unnecessary casts libsepol/cil: drop dead store libsepol/cil: drop extra semicolon libsepol/cil: silence cast warning libsepol: remove dead stores libsepol: do not allocate memory of size 0 libsepol: mark read-only parameters of type_set_ interfaces const libsepol: mark read-only parameters of ebitmap interfaces const libsepol: remove dead stores libsepol/cil: follow declaration-after-statement libsepol: follow declaration-after-statement libsepol: avoid unsigned integer overflow libsepol: remove unused functions libsepol: resolve missing prototypes libsepol: fix typos libsepol: Quote paths when generating policy.conf from binary policy libsepol/cil: Account for anonymous category sets in an expression libsepol/cil: Fix anonymous IP address call arguments libsepol: quote paths in CIL conversion libsepol/cil: Resolve anonymous levels only once libsepol/cil: Pointers to datums should be set to NULL when resetting libsepol/cil: Resolve anonymous class permission sets only once libsepol/cil: Limit the number of open parenthesis allowed libsepol/cil: Destroy the permission nodes when exiting with an error libsepol/cil: Handle disabled optional blocks in earlier passes libsepol/cil: Do not resolve arguments to declarations in the call libsepo/cil: Refactor macro call resolution libsepol/cil: Do not add NULL node when inserting key into symtab libsepol/cil: Make name resolution in macros work as documented libsepol/cil: Fix name resolution involving inherited blocks libsepol/cil: Check for self-referential loops in sets libsepol/cil: Return an error if a call argument fails to resolve libsepol/cil: Check datum in ordered list for expected flavor libsepol/cil: Detect degenerate inheritance and exit with an error libsepol/cil: Fix instances where an error returns SEPOL_OK libsepol/cil: Properly reset an anonymous classperm set libsepol: use checked arithmetic builtin to perform safe addition libsepol/cil: Add functions to make use of cil_write_ast() libsepol/cil: Create functions to write the CIL AST libsepol/cil: Use CIL_ERR for error messages in cil_compile() libsepol/cil: Make invalid statement error messages consistent libsepol/cil: Do not allow tunable declarations in in-statements libsepol/cil: Sync checks for invalid rules in macros libsepol/cil: Check for statements not allowed in optional blocks libsepol/cil: Sync checks for invalid rules in booleanifs libsepol/cil: Reorder checks for invalid rules when resolving AST libsepol/cil: Use AST to track blocks and optionals when resolving libsepol/cil: Create new first child helper function for building AST libsepol/cil: Cleanup build AST helper functions libsepol/cil: Reorder checks for invalid rules when building AST libsepol/cil: Move check for the shadowing of macro parameters libsepol/cil: Create function cil_add_decl_to_symtab() and refactor libsepol/cil: Refactor helper function for cil_gen_node() libsepol/cil: Allow permission expressions when using map classes libsepol/cil: Exit with an error if declaration name is a reserved word libsepol/cil: More strict verification of constraint leaf expressions libsepol/cil: Set class field to NULL when resetting struct cil_classperms libsepol/cil: cil_reset_classperms_set() should not reset classpermission libsepol/cil: Destroy classperm list when resetting map perms libsepol/cil: Destroy classperms list when resetting classpermission libsepol/cil: Fix out-of-bound read of file context pattern ending with "\" libsepol/cil: Check for duplicate blocks, optionals, and macros libsepol: Write "NO_IDENTIFIER" for empty CIL constraint expression libsepol: Enclose identifier lists in CIL constraint expressions libsepol/cil: Allow lists in constraint expressions libsepol: Enclose identifier lists in constraint expressions libsepol: Write "NO_IDENTIFIER" for empty constraint expression libsepol: make num_* unsigned int in module_to_cil libsepol/cil: do not leak avrulex_ioctl_table memory when an error occurs libsepol/cil: fix NULL pointer dereference in __cil_insert_name libsepol/cil: replace printf with proper cil_tree_log libsepol/cil: remove stray printf libsepol/cil: make cil_post_fc_fill_data static libsepol: Check kernel to CIL and Conf functions for supported versions libsepol: Remove unnecessary copying of declarations from link.c libsepol: Properly handle types associated to role attributes libsepol: Expand role attributes in constraint expressions Signed-off-by: Dominick Grift --- package/libs/libsepol/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/libsepol/Makefile b/package/libs/libsepol/Makefile index c7950a9ba0..87f1ccd917 100644 --- a/package/libs/libsepol/Makefile +++ b/package/libs/libsepol/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libsepol -PKG_VERSION:=3.2 +PKG_VERSION:=3.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 -PKG_HASH:=dfc7f662af8000116e56a01de6a0394ed79be1b34b999e551346233c5dd19508 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) +PKG_HASH:=2d97df3eb8466169b389c3660acbb90c54200ac96e452eca9f41a9639f4f238b PKG_MAINTAINER:=Thomas Petazzoni From 6925c7580d28f407bdffa47aa13b1f535b40cd41 Mon Sep 17 00:00:00 2001 From: Dominick Grift Date: Fri, 22 Oct 2021 13:51:12 +0200 Subject: [PATCH 05/65] libselinux: update to version 3.3 Update VERSIONs to 3.3 for release. libselinux: Fix potential undefined shifts Update VERSIONs to 3.3-rc3 for release. Update VERSIONs to 3.3-rc2 for release. libselinux/utils: drop requirement to combine compiling and linking Update VERSIONs and Python bindings version to 3.3-rc1 for release Improve error message for label file validation libselinux: replace strerror by %m libselinux: silence -Wextra-semi-stmt warning libselinux/utils/getseuser.c: fix build with gcc 4.8 selinux.8: document how mount flag nosuid affects SELinux libselinux: fix typo libselinux: improve getcon(3) man page libselinux: selinux_status_open: return 1 in fallback mode libselinux: do not use status page fallback mode internally libselinux: make selinux_status_open(3) reentrant libselinux: avc_destroy(3) closes status page libselinux: label_file.c: fix indent libselinux: regex: unify parameter names libselinux: sidtab_sid_stats(): unify parameter name libselinux: drop redundant casts to the same type libselinux: label_db::db_init(): open file with CLOEXEC mode libselinux: matchpathcon: free memory on realloc failure libselinux: label_file::init(): do not pass NULL to strdup libselinux: init_selinux_config(): free resources on error libselinux: matchmediacon(): close file on error libselinux: store_stem(): do not free possible non-heap object libselinux: getdefaultcon: free memory on multiple same arguments libselinux: setexecfilecon(): drop dead assignment libselinux: label_media::init(): drop dead assignment libselinux: label_x::init(): drop dead assignment libselinux: context_new(): drop dead assignment libselinux: exclude_non_seclabel_mounts(): drop unused variable libselinux: getconlist: free memory on multiple level arguments libselinux: selabel_get_digests_all_partial_matches: free memory after FTS_D block libselinux: selinux_restorecon: mark local variable static libselinux: avcstat: use standard length modifier for unsigned long long libselinux: sefcontext_compile: mark local variable static libselinux: Sha1Finalise(): do not discard const qualifier libselinux: label_common(): do not discard const qualifier libselinux: selinux_file_context_cmp(): do not discard const qualifier libselinux: sidtab_hash(): do not discard const qualifier libselinux: silence -Wstringop-overflow warning from gcc 10.3.1 libselinux: selinux_check_passwd_access_internal(): respect deny_unknown libselinux: do not duplicate make target when going into subdirectory Signed-off-by: Dominick Grift --- package/libs/libselinux/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/libselinux/Makefile b/package/libs/libselinux/Makefile index 0c5f9baceb..3969ef38d9 100644 --- a/package/libs/libselinux/Makefile +++ b/package/libs/libselinux/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libselinux -PKG_VERSION:=3.2 +PKG_VERSION:=3.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 -PKG_HASH:=df758ef1d9d4811051dd901ea6b029ae334ffd7c671c128beb16bce1e25ac161 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) +PKG_HASH:=acfdee27633d2496508c28727c3d41d3748076f66d42fccde2e6b9f3463a7057 HOST_BUILD_DEPENDS:=libsepol/host pcre/host PKG_LICENSE:=libselinux-1.0 From c8d1f8fda7722ab2e46847b49c2a1ef9afab6212 Mon Sep 17 00:00:00 2001 From: Dominick Grift Date: Fri, 22 Oct 2021 13:51:13 +0200 Subject: [PATCH 06/65] libsemanage: update to version 3.3 Update VERSIONs to 3.3 for release. Update VERSIONs to 3.3-rc3 for release. Update VERSIONs to 3.3-rc2 for release. Update VERSIONs and Python bindings version to 3.3-rc1 for release libsemanage: Fix USE_AFTER_FREE (CWE-672) in semanage_direct_write_langext() libsemanage: silence -Wextra-semi-stmt warning libsemanage: fix use-after-free in parse_module_store() Signed-off-by: Dominick Grift --- package/libs/libsemanage/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/libs/libsemanage/Makefile b/package/libs/libsemanage/Makefile index 2fde14c06c..8337b90bda 100644 --- a/package/libs/libsemanage/Makefile +++ b/package/libs/libsemanage/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libsemanage -PKG_VERSION:=3.2 -PKG_RELEASE:=2 +PKG_VERSION:=3.3 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 -PKG_HASH:=d722a55ca4fe2d4e2b30527720db657e6238b28079e69e2e4affeb8e733ee511 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) +PKG_HASH:=84d0ec5afa34bbbb471f602d8c1bf317d12443d07852a34b60741d428d597ce8 PKG_MAINTAINER:=Thomas Petazzoni PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:=COPYING From b97890d75e27c69afde9d3ba6f0f03d73b4f2e38 Mon Sep 17 00:00:00 2001 From: Dominick Grift Date: Fri, 22 Oct 2021 13:51:14 +0200 Subject: [PATCH 07/65] checkpolicy: update to version 3.3 Update VERSIONs to 3.3 for release. checkpolicy: Fix potential undefined shifts Update VERSIONs to 3.3-rc3 for release. checkpolicy: delay down-cast to avoid align warning checkpolicy: drop incorrect cast checkpolicy: update documentation checkpolicy: print reason of fopen failure checkpolicy: policy_define: cleanup declarations Update VERSIONs to 3.3-rc2 for release. checkpolicy: free extended permission memory checkpolicy: print warning on source line overflow checkpolicy: error out on parsing too big integers checkpolicy: avoid implicit conversion checkpolicy: resolve dismod memory leaks checkpolicy: add missing function declarations checkpolicy: mark file local functions in policy_define static checkpolicy: mark read-only parameters in module compiler const checkpolicy: misc checkpolicy tweaks checkpolicy: misc checkmodule tweaks checkpolicy: enclose macro argument in parentheses Update VERSIONs and Python bindings version to 3.3-rc1 for release checkpolicy: mark read-only parameters in policy define const checkpolicy/test: mark file local functions static checkpolicy: parse_util drop unused declaration checkpolicy: drop redundant cast to the same type checkpolicy: avoid potential use of uninitialized variable checkpolicy: check before potential NULL dereference checkpolicy: remove dead assignments checkpolicy: follow declaration-after-statement checkpolicy: use correct format specifier for unsigned checkpolicy: drop dead condition checkpolicy: simplify assignment checkpolicy: drop -pipe compile option checkpolicy: pass CFLAGS at link stage checkpolicy: silence -Wextra-semi-stmt warning checkpolicy: Do not automatically upgrade when using "-b" flag libsepol/checkpolicy: Set user roles using role value instead of dominance Signed-off-by: Dominick Grift --- package/utils/checkpolicy/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/utils/checkpolicy/Makefile b/package/utils/checkpolicy/Makefile index 206bf201c0..e9c10e293f 100644 --- a/package/utils/checkpolicy/Makefile +++ b/package/utils/checkpolicy/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=checkpolicy -PKG_VERSION:=3.2 +PKG_VERSION:=3.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 -PKG_HASH:=9b1c81fa86fe3867842164448d90c8e7ea94b2987497809c65d4caa87a5c5bc8 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) +PKG_HASH:=25c84edfa3a10ab8cb073b97bc55cb66377532d54a2723da9accdabd05431485 PKG_INSTALL:=1 PKG_BUILD_DEPENDS:=libselinux HOST_BUILD_DEPENDS:=libselinux/host From a8c293ce8def981578f5823952a705bbb0fc6bba Mon Sep 17 00:00:00 2001 From: Dominick Grift Date: Fri, 22 Oct 2021 13:51:15 +0200 Subject: [PATCH 08/65] policycoreutils: update to version 3.3 Update VERSIONs to 3.3 for release. Update VERSIONs to 3.3-rc3 for release. libselinux/semodule: Improve extracting message Correct some typos Update VERSIONs to 3.3-rc2 for release. Update VERSIONs and Python bindings version to 3.3-rc1 for release policycoreutils: free memory of allocated context in newrole policycoreutils: free memory of allocated context in run_init policycoreutils: free memory on lstat failure in sestatus policycoreutils: silence -Wextra-semi-stmt warning fixfiles: do not exclude /dev and /run in -C mode policycoreutils/setfiles: do not create useless setfiles.8.man file Signed-off-by: Dominick Grift --- package/utils/policycoreutils/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/utils/policycoreutils/Makefile b/package/utils/policycoreutils/Makefile index 249c2afb94..f724deda97 100644 --- a/package/utils/policycoreutils/Makefile +++ b/package/utils/policycoreutils/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=policycoreutils -PKG_VERSION:=3.2 +PKG_VERSION:=3.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 -PKG_HASH:=d1331c6fa766c547b071c491de90b9f343c8dbffdb119be8a5a7e491199b93a9 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) +PKG_HASH:=4199040ced8a81f2ddd0522b4faf2aba62fc821473f4051dc8474fb1c4a01078 PKG_INSTALL:=1 HOST_BUILD_DEPENDS:=libsemanage/host gettext-full/host PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_PAM:libpam gettext-full/host From 2da891e7357c83c54a30075fcddbb63eeca0af99 Mon Sep 17 00:00:00 2001 From: Dominick Grift Date: Fri, 22 Oct 2021 13:51:16 +0200 Subject: [PATCH 09/65] secilc: update to version 3.3 Update VERSIONs to 3.3 for release. Update VERSIONs to 3.3-rc3 for release. Correct some typos Update VERSIONs to 3.3-rc2 for release. Update VERSIONs and Python bindings version to 3.3-rc1 for release libsepol/secilc/docs: Update the CIL documentation secilc: fix memory leaks in secilc2conf secilc: fix memory leaks in secilc libsepol/cil: Add support for using qualified names to secil2conf libsepol/cil: Add support for using qualified names to secil2tree secilc: Add support for using qualified names to secilc secilc/test: Add test for anonymous args secilc/docs: Relocate and reword macro call name resolution order secilc/docs: Document the order that inherited rules are resolved in secilc: Create the new program called secil2tree to write out CIL AST secilc/docs: Update the CIL documentation for various blocks secilc.c: Don't fail if input file is empty cil_conditional_statements.md: fix expr definition secilc/docs: Lists are now allowed in constraint expressions Signed-off-by: Dominick Grift --- package/utils/secilc/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/utils/secilc/Makefile b/package/utils/secilc/Makefile index 7ed22615c0..6f059bfc81 100644 --- a/package/utils/secilc/Makefile +++ b/package/utils/secilc/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=secilc -PKG_VERSION:=3.2 +PKG_VERSION:=3.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 -PKG_HASH:=5f6e6528a281b29ac5e558babffc3d8aab682fd8df8977daff5f266a50292cc3 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) +PKG_HASH:=2c5e1a5d417baf1d2aa3eac294e12c3aac7184a5ef6a779dcbe469ed756e8651 HOST_BUILD_DEPENDS:=libsepol/host PKG_MAINTAINER:=Dominick Grift From 04c5bcd074d4a18763766ff15539fb9c6221b5dd Mon Sep 17 00:00:00 2001 From: Dominick Grift Date: Fri, 22 Oct 2021 19:42:40 +0200 Subject: [PATCH 10/65] selinux-policy: update to version 1.0 wifi: writes to terminal hotplugcall and sqm read class sysfile symlinks unbound and sqm related loose ends support/example: policycoreutils host-compile is required TODO: this was wrong and it is actually needed linguist detectable does not work this way linguist-detectable updates README adds workflows adds a note about persistent /var option project moved to https://github.com/DefenSec/selinux-policy Signed-off-by: Dominick Grift --- package/system/selinux-policy/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/selinux-policy/Makefile b/package/system/selinux-policy/Makefile index 219ebc7995..0b85920170 100644 --- a/package/system/selinux-policy/Makefile +++ b/package/system/selinux-policy/Makefile @@ -7,9 +7,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=selinux-policy PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://git.defensec.nl/selinux-policy.git -PKG_VERSION:=0.9 -PKG_MIRROR_HASH:=f1a37a4fc104fbacde3012178fc117b473899360f26a8735156394288441d99c +PKG_SOURCE_URL:=https://github.com/DefenSec/selinux-policy +PKG_VERSION:=1.0 +PKG_MIRROR_HASH:=2358a064d1231d39e6292d646e1a38898d949b8bef6558ac1e0992d3b5bca33f PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_BUILD_DEPENDS:=secilc/host policycoreutils/host From ae4069c577fc6d9a99d8b503f9a865418ee4c776 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 29 Oct 2021 14:08:48 +0100 Subject: [PATCH 11/65] Revert "libsepol: update to version 3.3" This reverts commit de8a800ca9bda1171bfe17ee7653532465a8b596. Host build uses host includes instead of staging/hostpkg. This breaks the build in case of selinux host libs being older than version 3.3. Revert for now until better fix is found. Signed-off-by: Daniel Golle --- package/libs/libsepol/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/libsepol/Makefile b/package/libs/libsepol/Makefile index 87f1ccd917..c7950a9ba0 100644 --- a/package/libs/libsepol/Makefile +++ b/package/libs/libsepol/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libsepol -PKG_VERSION:=3.3 +PKG_VERSION:=3.2 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) -PKG_HASH:=2d97df3eb8466169b389c3660acbb90c54200ac96e452eca9f41a9639f4f238b +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 +PKG_HASH:=dfc7f662af8000116e56a01de6a0394ed79be1b34b999e551346233c5dd19508 PKG_MAINTAINER:=Thomas Petazzoni From 19c52772069441d051f64a685d928dd81c3b69ce Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 29 Oct 2021 14:12:21 +0100 Subject: [PATCH 12/65] Revert "secilc: update to version 3.3" This reverts commit 2da891e7357c83c54a30075fcddbb63eeca0af99. secilc 3.3 requires libsepol to be version 3.3 as well and doesn't build otherwise. Revert for now. Signed-off-by: Daniel Golle --- package/utils/secilc/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/utils/secilc/Makefile b/package/utils/secilc/Makefile index 6f059bfc81..7ed22615c0 100644 --- a/package/utils/secilc/Makefile +++ b/package/utils/secilc/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=secilc -PKG_VERSION:=3.3 +PKG_VERSION:=3.2 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) -PKG_HASH:=2c5e1a5d417baf1d2aa3eac294e12c3aac7184a5ef6a779dcbe469ed756e8651 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 +PKG_HASH:=5f6e6528a281b29ac5e558babffc3d8aab682fd8df8977daff5f266a50292cc3 HOST_BUILD_DEPENDS:=libsepol/host PKG_MAINTAINER:=Dominick Grift From 524c687e05fa5e30899b018a406e439c62565ae4 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 29 Oct 2021 14:20:15 +0100 Subject: [PATCH 13/65] sunxi: add missing CONFIG_VIDEO_SUN4I_CSI Kconfig symbol Simply disable this for now, if anyone wants to use CSI feel free to package it as a kernel module package. Signed-off-by: Daniel Golle --- target/linux/sunxi/config-5.10 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/sunxi/config-5.10 b/target/linux/sunxi/config-5.10 index fc6ae720b7..36878e520e 100644 --- a/target/linux/sunxi/config-5.10 +++ b/target/linux/sunxi/config-5.10 @@ -498,6 +498,7 @@ CONFIG_VFPv3=y CONFIG_VHOST=y CONFIG_VHOST_IOTLB=y CONFIG_VHOST_NET=y +# CONFIG_VIDEO_SUN4I_CSI is not set CONFIG_VM_EVENT_COUNTERS=y CONFIG_VT=y CONFIG_VT_CONSOLE=y From a2f5a83af8553a571bea2943f3ec6bc6c5e848bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 29 Oct 2021 15:28:57 +0200 Subject: [PATCH 14/65] bcm53xx: backport patch fixing pinctrl driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This switches pinctrl driver to use the old & good DT binding. There is no more need to adjust upstream DTS file. Signed-off-by: Rafał Miłecki --- ...cm-ns-support-updated-DT-binding-as-.patch | 106 ++++++++++++++++++ ...01X-Update-Northstar-pinctrl-binding.patch | 33 ------ 2 files changed, 106 insertions(+), 33 deletions(-) create mode 100644 target/linux/bcm53xx/patches-5.10/081-v5.15-Revert-pinctrl-bcm-ns-support-updated-DT-binding-as-.patch delete mode 100644 target/linux/bcm53xx/patches-5.10/302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch diff --git a/target/linux/bcm53xx/patches-5.10/081-v5.15-Revert-pinctrl-bcm-ns-support-updated-DT-binding-as-.patch b/target/linux/bcm53xx/patches-5.10/081-v5.15-Revert-pinctrl-bcm-ns-support-updated-DT-binding-as-.patch new file mode 100644 index 0000000000..822716d8e6 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.10/081-v5.15-Revert-pinctrl-bcm-ns-support-updated-DT-binding-as-.patch @@ -0,0 +1,106 @@ +From 6dba4bdfd7a30e77b848a45404b224588bf989e5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 8 Oct 2021 22:59:38 +0200 +Subject: [PATCH] Revert "pinctrl: bcm: ns: support updated DT binding as + syscon subnode" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This reverts commit a49d784d5a8272d0f63c448fe8dc69e589db006e. + +The updated binding was wrong / invalid and has been reverted. There +isn't any upstream kernel DTS using it and Broadcom isn't known to use +it neither. There is close to zero chance this will cause regression for +anyone. + +Actually in-kernel bcm5301x.dtsi still uses the old good binding and so +it's broken since the driver update. This revert fixes it. + +Signed-off-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20211008205938.29925-3-zajec5@gmail.com +Signed-off-by: Linus Walleij +--- + drivers/pinctrl/bcm/pinctrl-ns.c | 29 ++++++++++------------------- + 1 file changed, 10 insertions(+), 19 deletions(-) + +--- a/drivers/pinctrl/bcm/pinctrl-ns.c ++++ b/drivers/pinctrl/bcm/pinctrl-ns.c +@@ -5,7 +5,6 @@ + + #include + #include +-#include + #include + #include + #include +@@ -13,7 +12,6 @@ + #include + #include + #include +-#include + #include + + #define FLAG_BCM4708 BIT(1) +@@ -24,8 +22,7 @@ struct ns_pinctrl { + struct device *dev; + unsigned int chipset_flag; + struct pinctrl_dev *pctldev; +- struct regmap *regmap; +- u32 offset; ++ void __iomem *base; + + struct pinctrl_desc pctldesc; + struct ns_pinctrl_group *groups; +@@ -232,9 +229,9 @@ static int ns_pinctrl_set_mux(struct pin + unset |= BIT(pin_number); + } + +- regmap_read(ns_pinctrl->regmap, ns_pinctrl->offset, &tmp); ++ tmp = readl(ns_pinctrl->base); + tmp &= ~unset; +- regmap_write(ns_pinctrl->regmap, ns_pinctrl->offset, tmp); ++ writel(tmp, ns_pinctrl->base); + + return 0; + } +@@ -266,13 +263,13 @@ static const struct of_device_id ns_pinc + static int ns_pinctrl_probe(struct platform_device *pdev) + { + struct device *dev = &pdev->dev; +- struct device_node *np = dev->of_node; + const struct of_device_id *of_id; + struct ns_pinctrl *ns_pinctrl; + struct pinctrl_desc *pctldesc; + struct pinctrl_pin_desc *pin; + struct ns_pinctrl_group *group; + struct ns_pinctrl_function *function; ++ struct resource *res; + int i; + + ns_pinctrl = devm_kzalloc(dev, sizeof(*ns_pinctrl), GFP_KERNEL); +@@ -290,18 +287,12 @@ static int ns_pinctrl_probe(struct platf + return -EINVAL; + ns_pinctrl->chipset_flag = (uintptr_t)of_id->data; + +- ns_pinctrl->regmap = syscon_node_to_regmap(of_get_parent(np)); +- if (IS_ERR(ns_pinctrl->regmap)) { +- int err = PTR_ERR(ns_pinctrl->regmap); +- +- dev_err(dev, "Failed to map pinctrl regs: %d\n", err); +- +- return err; +- } +- +- if (of_property_read_u32(np, "offset", &ns_pinctrl->offset)) { +- dev_err(dev, "Failed to get register offset\n"); +- return -ENOENT; ++ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, ++ "cru_gpio_control"); ++ ns_pinctrl->base = devm_ioremap_resource(dev, res); ++ if (IS_ERR(ns_pinctrl->base)) { ++ dev_err(dev, "Failed to map pinctrl regs\n"); ++ return PTR_ERR(ns_pinctrl->base); + } + + memcpy(pctldesc, &ns_pinctrl_desc, sizeof(*pctldesc)); diff --git a/target/linux/bcm53xx/patches-5.10/302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch b/target/linux/bcm53xx/patches-5.10/302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch deleted file mode 100644 index ca94f46652..0000000000 --- a/target/linux/bcm53xx/patches-5.10/302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Subject: [PATCH] ARM: dts: BCM5301X: Update Northstar pinctrl binding -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Rafał Miłecki ---- - ---- a/arch/arm/boot/dts/bcm5301x.dtsi -+++ b/arch/arm/boot/dts/bcm5301x.dtsi -@@ -422,7 +422,7 @@ - #size-cells = <1>; - - cru@100 { -- compatible = "simple-bus"; -+ compatible = "syscon", "simple-mfd"; - reg = <0x100 0x1a4>; - ranges; - #address-cells = <1>; -@@ -448,10 +448,9 @@ - "sata1", "sata2"; - }; - -- pinctrl: pin-controller@1c0 { -+ pinctrl: pin-controller { - compatible = "brcm,bcm4708-pinmux"; -- reg = <0x1c0 0x24>; -- reg-names = "cru_gpio_control"; -+ offset = <0xc0>; - - spi-pins { - groups = "spi_grp"; From 3c33ed02c236d3b8da3c77c965fa6c92c823b94f Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 29 Oct 2021 18:19:22 +0100 Subject: [PATCH 15/65] sunxi: add yet another missing Kconfig symbol Set CONFIG_CRYPTO_CRCT10DIF_ARM_CE=y for sunxi targets. Signed-off-by: Daniel Golle --- target/linux/sunxi/config-5.10 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/sunxi/config-5.10 b/target/linux/sunxi/config-5.10 index 36878e520e..81c7515b0e 100644 --- a/target/linux/sunxi/config-5.10 +++ b/target/linux/sunxi/config-5.10 @@ -104,6 +104,7 @@ CONFIG_CRC_T10DIF=y CONFIG_CRYPTO_CRC32=y CONFIG_CRYPTO_CRC32C=y CONFIG_CRYPTO_CRCT10DIF=y +CONFIG_CRYPTO_CRCT10DIF_ARM_CE=y CONFIG_CRYPTO_DES=y CONFIG_CRYPTO_DEV_ALLWINNER=y CONFIG_CRYPTO_DEV_SUN4I_SS=y From 1175e786f89a5fdb9f493d2f069d399f2db0bc58 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 29 Oct 2021 18:34:39 +0100 Subject: [PATCH 16/65] sunxi: add CONFIG_ARM_CRYPTO Kconfig symbol And another missing symbol... Reported-by: Chen Minqiang Signed-off-by: Daniel Golle --- target/linux/sunxi/config-5.10 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/sunxi/config-5.10 b/target/linux/sunxi/config-5.10 index 81c7515b0e..47d8ed0630 100644 --- a/target/linux/sunxi/config-5.10 +++ b/target/linux/sunxi/config-5.10 @@ -27,6 +27,7 @@ CONFIG_ARM_CCI=y CONFIG_ARM_CCI400_COMMON=y CONFIG_ARM_CCI400_PORT_CTRL=y CONFIG_ARM_CPU_SUSPEND=y +CONFIG_ARM_CRYPTO=y CONFIG_ARM_ERRATA_643719=y CONFIG_ARM_GIC=y CONFIG_ARM_HAS_SG_CHAIN=y From f5d071a508b3e3d218b8ed6f6f5a999384bb7f6d Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 29 Oct 2021 18:40:02 +0100 Subject: [PATCH 17/65] sunxi: deselect CONFIG_VIDEO_SUN6I_CSI by default Deselect CONFIG_VIDEO_SUN6I_CSI Kconfig symbol for now. If anyone wants to use CSI (camera interface) they should package the kernel module. After this change, sunxi targets build again. Signed-off-by: Daniel Golle --- target/linux/sunxi/config-5.10 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/sunxi/config-5.10 b/target/linux/sunxi/config-5.10 index 47d8ed0630..3f6f849e81 100644 --- a/target/linux/sunxi/config-5.10 +++ b/target/linux/sunxi/config-5.10 @@ -501,6 +501,7 @@ CONFIG_VHOST=y CONFIG_VHOST_IOTLB=y CONFIG_VHOST_NET=y # CONFIG_VIDEO_SUN4I_CSI is not set +# CONFIG_VIDEO_SUN6I_CSI is not set CONFIG_VM_EVENT_COUNTERS=y CONFIG_VT=y CONFIG_VT_CONSOLE=y From 6102f883ce7f32988d22b7fc5b79356e3d06c1dc Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sat, 12 Sep 2020 22:28:38 +0200 Subject: [PATCH 18/65] bcm53xx: MR32: replace i2c-gpio with SoC's i2c During review of the MR32, Florian Fainelli pointed out that the SoC has a real I2C-controller. Furthermore, the connected pins (SDA and SCL) would line up perfectly for use. This patch swaps out the the bitbanged i2c-gpio with the real deal. Signed-off-by: Christian Lamparter --- target/linux/bcm53xx/image/Makefile | 2 +- ...CM5301X-Fix-I2C-controller-interrupt.patch | 32 +++++++ .../332-Meraki-MR32-use-hw-i2c.patch | 85 +++++++++++++++++++ 3 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 target/linux/bcm53xx/patches-5.10/040-v5.16-ARM-dts-BCM5301X-Fix-I2C-controller-interrupt.patch create mode 100644 target/linux/bcm53xx/patches-5.10/332-Meraki-MR32-use-hw-i2c.patch diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index cb2643ca54..aadac9c3d4 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -318,7 +318,7 @@ TARGET_DEVICES += luxul_xwr-3150 define Device/meraki_mr32 DEVICE_VENDOR := Meraki DEVICE_MODEL := MR32 - DEVICE_PACKAGES := $(B43) kmod-i2c-bcm-iproc kmod-i2c-gpio kmod-eeprom-at24 \ + DEVICE_PACKAGES := $(B43) kmod-i2c-bcm-iproc kmod-eeprom-at24 \ kmod-leds-pwm kmod-hwmon-ina2xx kmod-bluetooth DEVICE_DTS := bcm53016-meraki-mr32 # Meraki FW r23 tries to resize the part.safe partition before it will diff --git a/target/linux/bcm53xx/patches-5.10/040-v5.16-ARM-dts-BCM5301X-Fix-I2C-controller-interrupt.patch b/target/linux/bcm53xx/patches-5.10/040-v5.16-ARM-dts-BCM5301X-Fix-I2C-controller-interrupt.patch new file mode 100644 index 0000000000..628569eca9 --- /dev/null +++ b/target/linux/bcm53xx/patches-5.10/040-v5.16-ARM-dts-BCM5301X-Fix-I2C-controller-interrupt.patch @@ -0,0 +1,32 @@ +From beda1bbdb19baa8319ed81fa370fe0c5b91d05df Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Tue, 26 Oct 2021 11:36:22 -0700 +Subject: [PATCH] ARM: dts: BCM5301X: Fix I2C controller interrupt + +The I2C interrupt controller line is off by 32 because the datasheet +describes interrupt inputs into the GIC which are for Shared Peripheral +Interrupts and are starting at offset 32. The ARM GIC binding expects +the SPI interrupts to be numbered from 0 relative to the SPI base. + +Fixes: bb097e3e0045 ("ARM: dts: BCM5301X: Add I2C support to the DT") +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm5301x.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi +index f92089290ccd..ec5de636796e 100644 +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -408,7 +408,7 @@ uart2: serial@18008000 { + i2c0: i2c@18009000 { + compatible = "brcm,iproc-i2c"; + reg = <0x18009000 0x50>; +- interrupts = ; ++ interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = <100000>; +-- +2.25.1 + diff --git a/target/linux/bcm53xx/patches-5.10/332-Meraki-MR32-use-hw-i2c.patch b/target/linux/bcm53xx/patches-5.10/332-Meraki-MR32-use-hw-i2c.patch new file mode 100644 index 0000000000..acd69edaab --- /dev/null +++ b/target/linux/bcm53xx/patches-5.10/332-Meraki-MR32-use-hw-i2c.patch @@ -0,0 +1,85 @@ +From: Christian Lamparter +Date: Sat, 12 Sep 2020 22:11:12 +0200 +Subject: bcm53xx: Meraki MR32 use hw i2c + +replace the i2c-gpio provided i2c functionality with the +hardware in the SoC. This can be activated once the +internal i2c works as well as the bit-banged i2c-gpio. + +Signed-off-by: Christian Lamparter + +--- a/arch/arm/boot/dts/bcm53016-meraki-mr32.dts ++++ b/arch/arm/boot/dts/bcm53016-meraki-mr32.dts +@@ -85,40 +85,6 @@ + max-brightness = <255>; + }; + }; +- +- i2c { +- /* +- * The platform provided I2C does not budge. +- * This is a replacement until I can figure +- * out what are the missing bits... +- */ +- +- compatible = "i2c-gpio"; +- sda-gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>; +- scl-gpios = <&chipcommon 4 GPIO_ACTIVE_HIGH>; +- i2c-gpio,delay-us = <10>; /* close to 100 kHz */ +- #address-cells = <1>; +- #size-cells = <0>; +- +- current_sense: ina219@45 { +- compatible = "ti,ina219"; +- reg = <0x45>; +- shunt-resistor = <60000>; /* = 60 mOhms */ +- }; +- +- eeprom: eeprom@50 { +- compatible = "atmel,24c64"; +- reg = <0x50>; +- pagesize = <32>; +- read-only; +- #address-cells = <1>; +- #size-cells = <1>; +- +- mac_address: mac-address@66 { +- reg = <0x66 0x6>; +- }; +- }; +- }; + }; + + &uart0 { +@@ -196,3 +168,31 @@ + }; + }; + }; ++ ++&i2c0 { ++ status = "okay"; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinmux_i2c>; ++ ++ clock-frequency = <100000>; ++ ++ current_sense: ina219@45 { ++ compatible = "ti,ina219"; ++ reg = <0x45>; ++ shunt-resistor = <60000>; /* = 60 mOhms */ ++ }; ++ ++ eeprom: eeprom@50 { ++ compatible = "atmel,24c64"; ++ reg = <0x50>; ++ pagesize = <32>; ++ read-only; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ mac_address: mac-address@66 { ++ reg = <0x66 0x6>; ++ }; ++ }; ++}; From daefc646e6d4f1f730c5957b5954b88abe7c00f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= Date: Thu, 24 Jun 2021 23:04:08 +0200 Subject: [PATCH 19/65] realtek: fix ZyXEL initramfs image generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current rule produces empty trailers, causing the OEM firmware update application to reject our images. The double expansion of a makefile variable does not work inside shell code. The second round is interpreted as a shell expansion, attempting to run the command ZYXEL_VERS instead of expanding the $(ZYXEL_VERS) makefile variable. Fix by removing one level of variable indirection. Fixes: c6c8d597e183 ("realtek: Add generic zyxel_gs1900 image definition") Tested-by: Sander Vanheule Signed-off-by: Bjørn Mork --- target/linux/realtek/image/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/realtek/image/Makefile b/target/linux/realtek/image/Makefile index 5e4b4cde80..a7961970a3 100644 --- a/target/linux/realtek/image/Makefile +++ b/target/linux/realtek/image/Makefile @@ -10,7 +10,7 @@ DEVICE_VARS += ZYXEL_VERS define Build/zyxel-vers ( echo VERS;\ - for hw in $(1); do\ + for hw in $(ZYXEL_VERS); do\ echo -n "V9.99($$hw.0) | ";\ date -d @$(SOURCE_DATE_EPOCH) +%m/%d/%Y;\ done ) >> $@ @@ -117,7 +117,7 @@ define Device/zyxel_gs1900 IMAGE_SIZE := 6976k DEVICE_VENDOR := ZyXEL UIMAGE_MAGIC := 0x83800000 - KERNEL_INITRAMFS := kernel-bin | append-dtb | gzip | zyxel-vers $$$$(ZYXEL_VERS) | \ + KERNEL_INITRAMFS := kernel-bin | append-dtb | gzip | zyxel-vers | \ uImage gzip endef From d990f805c0caa38ec06ad51b025b6d7b6015c232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= Date: Fri, 22 Oct 2021 18:09:18 +0200 Subject: [PATCH 20/65] realtek: re-enable IPv6 routing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 03e1d93e0779 ("realtek: add driver support for routing offload") added routing offload for IPv4, but broke IPv6 routing completely. The routing table is empty and cannot be updated: root@gs1900-10hp:~# ip -6 route root@gs1900-10hp:~# ip -6 route add unreachable default RTNETLINK answers: Invalid argument As a side effect, this breaks opkg on IPv4 only systems too, since uclient-fetch fails when there are no IPv6 routes: root@gs1900-10hp:~# uclient-fetch http://192.168.99.1 Downloading 'http://192.168.99.1' Failed to send request: Operation not permitted Fix by returning NOTIFY_DONE when offloading is unsupported, falling back to default behaviour. Fixes: 03e1d93e0779 ("realtek: add driver support for routing offload") Signed-off-by: Bjørn Mork --- .../linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c index 9691b8b5c7..6d2996f0af 100644 --- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c +++ b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c @@ -1342,7 +1342,7 @@ static int rtl83xx_fib_event(struct notifier_block *this, unsigned long event, v struct fib6_entry_notifier_info *fen6_info = ptr; pr_warn("%s: FIB_RULE ADD/DELL for IPv6 not supported\n", __func__); kfree(fib_work); - return notifier_from_errno(-EINVAL); + return NOTIFY_DONE; } break; From 88a2ea41da6b67d1575b958ed8f97bfd9b7d4cbb Mon Sep 17 00:00:00 2001 From: Jan-Niklas Burfeind Date: Tue, 26 Oct 2021 13:25:03 +0200 Subject: [PATCH 21/65] scripts: eva_ramboot.py: remove unused import concludes: commit e7bc8984d9ca ("scripts: make eva_ramboot.py offset configurable") Signed-off-by: Jan-Niklas Burfeind --- scripts/flashing/eva_ramboot.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/flashing/eva_ramboot.py b/scripts/flashing/eva_ramboot.py index b182f09d21..365fceecf6 100755 --- a/scripts/flashing/eva_ramboot.py +++ b/scripts/flashing/eva_ramboot.py @@ -3,7 +3,6 @@ import argparse from ftplib import FTP -from sys import argv from os import stat parser = argparse.ArgumentParser(description='Tool to boot AVM EVA ramdisk images.') From 5287defa1fa47a037ba29b653c4599ee145a7e03 Mon Sep 17 00:00:00 2001 From: Sven Roederer Date: Fri, 16 Jul 2021 00:44:53 +0200 Subject: [PATCH 22/65] dropbear: add config options for agent-forwarding support * SSH agent forwarding might cause security issues, locally and on the jump machine (https://defn.io/2019/04/12/ssh-forwarding/). So allow to completely disabling it. * separate options for client and server * keep it enabled by default Signed-off-by: Sven Roederer --- package/network/services/dropbear/Config.in | 9 +++++++++ package/network/services/dropbear/Makefile | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/package/network/services/dropbear/Config.in b/package/network/services/dropbear/Config.in index 15000eff53..d4644fc88f 100644 --- a/package/network/services/dropbear/Config.in +++ b/package/network/services/dropbear/Config.in @@ -95,6 +95,11 @@ config DROPBEAR_DBCLIENT bool "Build dropbear with dbclient" default y +config DROPBEAR_DBCLIENT_AGENTFORWARD + bool "Enable agent forwarding in dbclient" + default y + depends on DROPBEAR_DBCLIENT + config DROPBEAR_SCP bool "Build dropbear with scp" default y @@ -109,4 +114,8 @@ config DROPBEAR_ASKPASS Increases binary size by about 0.1 kB (MIPS). +config DROPBEAR_AGENTFORWARD + bool "Enable agent forwarding" + default y + endmenu diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 7fb4b7f123..d518de3f70 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -32,7 +32,8 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_DROPBEAR_CURVE25519 CONFIG_DROPBEAR_ZLIB \ CONFIG_DROPBEAR_ED25519 CONFIG_DROPBEAR_CHACHA20POLY1305 \ CONFIG_DROPBEAR_UTMP CONFIG_DROPBEAR_PUTUTLINE \ - CONFIG_DROPBEAR_DBCLIENT CONFIG_DROPBEAR_SCP CONFIG_DROPBEAR_ASKPASS + CONFIG_DROPBEAR_DBCLIENT CONFIG_DROPBEAR_SCP CONFIG_DROPBEAR_ASKPASS \ + CONFIG_DROPBEAR_DBCLIENT_AGENTFORWARD CONFIG_DROPBEAR_AGENTFORWARD include $(INCLUDE_DIR)/package.mk @@ -135,6 +136,8 @@ DB_OPT_CONFIG = \ !!DROPBEAR_ECC_384|CONFIG_DROPBEAR_ECC_FULL|1|0 \ !!DROPBEAR_ECC_521|CONFIG_DROPBEAR_ECC_FULL|1|0 \ DROPBEAR_CLI_ASKPASS_HELPER|CONFIG_DROPBEAR_ASKPASS|1|0 \ + DROPBEAR_CLI_AGENTFWD|CONFIG_DROPBEAR_DBCLIENT_AGENTFORWARD|1|0 \ + DROPBEAR_SVR_AGENTFWD|CONFIG_DROPBEAR_AGENTFORWARD|1|0 \ TARGET_CFLAGS += -DARGTYPE=3 -ffunction-sections -fdata-sections -flto From 4c8dd973ef8e76f9fc622f0baab981769c89b601 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sat, 9 Oct 2021 20:51:21 +0200 Subject: [PATCH 23/65] ath9k: OF: qca,disable-(2|5)ghz => ieee80211-freq-limit OpenWrt maintains two special out-of-tree DT properties: "qca,disable-5ghz" and "qca,disable-2ghz". These are implemented in a mac80211 ath9k patch "550-ath9k-disable-bands-via-dt.patch". With the things being what they are, now might be a good point to switch the devices to the generic and upstream "ieee80211-freq-limit" property. This property is much broader and works differently. Instead of disabling the drivers logic which would add the affected band and channels. It now disables all channels which are not within the specified frequency range. Reviewed-by: Martin Blumenstingl Tested-by: Martin Blumenstingl # HH5A Signed-off-by: Christian Lamparter --- ...-ieee80211-freq-limit-property-to-li.patch | 29 +++++++++++++++++++ .../550-ath9k-disable-bands-via-dt.patch | 15 ---------- .../patches/ath9k/552-ath9k-ahb_of.patch | 8 +---- target/linux/ath79/dts/ar9342_ubnt_wa.dtsi | 2 +- .../linux/ath79/dts/ar9344_atheros_db120.dts | 2 +- .../ath79/dts/ar9344_engenius_exx600.dtsi | 4 +-- target/linux/ath79/dts/ar9344_pcs_cap324.dts | 4 +-- .../boot/dts/lantiq/vr9_bt_homehub-v5a.dts | 2 +- .../boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi | 2 +- 9 files changed, 38 insertions(+), 30 deletions(-) create mode 100644 package/kernel/mac80211/patches/ath9k/040-ath9k-support-DT-ieee80211-freq-limit-property-to-li.patch delete mode 100644 package/kernel/mac80211/patches/ath9k/550-ath9k-disable-bands-via-dt.patch diff --git a/package/kernel/mac80211/patches/ath9k/040-ath9k-support-DT-ieee80211-freq-limit-property-to-li.patch b/package/kernel/mac80211/patches/ath9k/040-ath9k-support-DT-ieee80211-freq-limit-property-to-li.patch new file mode 100644 index 0000000000..4142cb6ffd --- /dev/null +++ b/package/kernel/mac80211/patches/ath9k/040-ath9k-support-DT-ieee80211-freq-limit-property-to-li.patch @@ -0,0 +1,29 @@ +From 03469e79fee9e8e908dae3bd1a80bcd9a66f2a88 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Mon, 11 Oct 2021 18:18:00 +0300 +Subject: ath9k: support DT ieee80211-freq-limit property to limit channels + +The common DT property can be used to limit the available channels +but ath9k has to manually call wiphy_read_of_freq_limits(). + +I would have put this into ath9k_of_init(). But it didn't work there. +The reason is that in ath9k_of_init() the channels and bands are not yet +registered in the wiphy struct. So there isn't any channel to flag as +disabled. + +Signed-off-by: Christian Lamparter +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20211009212847.1781986-1-chunkeey@gmail.com +--- +--- a/drivers/net/wireless/ath/ath9k/init.c ++++ b/drivers/net/wireless/ath/ath9k/init.c +@@ -1094,6 +1094,8 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, + ARRAY_SIZE(ath9k_tpt_blink)); + #endif + ++ wiphy_read_of_freq_limits(hw->wiphy); ++ + /* Register with mac80211 */ + error = ieee80211_register_hw(hw); + if (error) + diff --git a/package/kernel/mac80211/patches/ath9k/550-ath9k-disable-bands-via-dt.patch b/package/kernel/mac80211/patches/ath9k/550-ath9k-disable-bands-via-dt.patch deleted file mode 100644 index d1593339d2..0000000000 --- a/package/kernel/mac80211/patches/ath9k/550-ath9k-disable-bands-via-dt.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/init.c -+++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -625,6 +625,12 @@ static int ath9k_of_init(struct ath_soft - - ath_dbg(common, CONFIG, "parsing configuration from OF node\n"); - -+ if (of_property_read_bool(np, "qca,disable-2ghz")) -+ ah->disable_2ghz = true; -+ -+ if (of_property_read_bool(np, "qca,disable-5ghz")) -+ ah->disable_5ghz = true; -+ - if (of_property_read_bool(np, "qca,no-eeprom")) { - /* ath9k-eeprom--.bin */ - scnprintf(eeprom_name, sizeof(eeprom_name), diff --git a/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch b/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch index 2552bbc7a1..fce6db2167 100644 --- a/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch +++ b/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch @@ -16,7 +16,7 @@ static const struct platform_device_id ath9k_platform_id_table[] = { { -@@ -69,6 +77,242 @@ static const struct ath_bus_ops ath_ahb_ +@@ -69,6 +77,236 @@ static const struct ath_bus_ops ath_ahb_ .eeprom_read = ath_ahb_eeprom_read, }; @@ -218,12 +218,6 @@ + else + pdata->led_pin = -1; + -+ if (of_property_read_bool(pdev->dev.of_node, "qca,disable-2ghz")) -+ pdata->disable_2ghz = true; -+ -+ if (of_property_read_bool(pdev->dev.of_node, "qca,disable-5ghz")) -+ pdata->disable_5ghz = true; -+ + if (of_property_read_bool(pdev->dev.of_node, "qca,tx-gain-buffalo")) + pdata->tx_gain_buffalo = true; + diff --git a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi index 549daace7e..ba0f7ad23e 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi @@ -78,7 +78,7 @@ &wmac { status = "okay"; - qca,disable-5ghz; + ieee80211-freq-limit = <2402000 2482000>; mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/ar9344_atheros_db120.dts b/target/linux/ath79/dts/ar9344_atheros_db120.dts index f96e31caca..625a8e4fa2 100644 --- a/target/linux/ath79/dts/ar9344_atheros_db120.dts +++ b/target/linux/ath79/dts/ar9344_atheros_db120.dts @@ -207,7 +207,7 @@ compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; qca,no-eeprom; - qca,disable-2ghz; + ieee80211-freq-limit = <4900000 5990000>; #gpio-cells = <2>; gpio-controller; }; diff --git a/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi b/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi index 1c318f2083..09dc5806d7 100644 --- a/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi +++ b/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi @@ -69,7 +69,7 @@ ath9k: wifi@0,0,0 { compatible = "pci168c,0030"; reg = <0x0 0 0 0 0>; - qca,disable-5ghz; + ieee80211-freq-limit = <2402000 2482000>; qca,no-eeprom; #gpio-cells = <2>; gpio-controller; @@ -79,7 +79,7 @@ &wmac { status = "okay"; - qca,disable-2ghz; + ieee80211-freq-limit = <4900000 5990000>; mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/ar9344_pcs_cap324.dts b/target/linux/ath79/dts/ar9344_pcs_cap324.dts index 1f15a2e8b8..6ebd6a43bb 100644 --- a/target/linux/ath79/dts/ar9344_pcs_cap324.dts +++ b/target/linux/ath79/dts/ar9344_pcs_cap324.dts @@ -123,7 +123,7 @@ mac-address-increment = <(-2)>; mtd-cal-data = <&art 0x5000>; qca,no-eeprom; - qca,disable-5ghz; + ieee80211-freq-limit = <2402000 2482000>; #gpio-cells = <2>; gpio-controller; }; @@ -132,7 +132,7 @@ &wmac { status = "okay"; - qca,disable-2ghz; + ieee80211-freq-limit = <4900000 5990000>; mtd-cal-data = <&art 0x1000>; nvmem-cells = <&macaddr_art_0>; nvmem-cell-names = "mac-address"; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts index 76cf69335b..1cd0f2c6b6 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts @@ -256,7 +256,7 @@ compatible = "pci168c,002d"; reg = <0x7000 0 0 0 0>; qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:00:0e.0.bin */ - qca,disable-5ghz; + ieee80211-freq-limit = <2402000 2482000>; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi index bdf98fe98e..5b7c10bb9d 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi @@ -203,7 +203,7 @@ #gpio-cells = <2>; gpio-controller; qca,no-eeprom; - qca,disable-5ghz; + ieee80211-freq-limit = <2402000 2482000>; nvmem-cells = <&macaddr_ath9k_cal_f100>; nvmem-cell-names = "mac-address"; mac-address-increment = <2>; From fd717f54beaaa791123cd146af4e790cc19a05c6 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Fri, 22 Oct 2021 20:38:49 +0200 Subject: [PATCH 24/65] ipq40xx: detangle ath10k-board-qca4019 from ath10k-firmware-qca4019* Back in the day, the board-2.bin came with ath10k-firmware-qca4019. This changed with commit c3b2efaf24b5 ("linux-firmware: ath10k: add board firmware packages") which placed the board-2.bin into a separate package: ath10k-board-qca4019. This was great, because it addressed one of the caveat of the original ipq-wifi package: commit fa03d441e96e ("firmware: add custom IPQ wifi board definitions") | 2. updating ath10k-firmware-qca4019 will also replace | the board-2.bin. For this cases the user needs to | manually reinstall the wifi-board package once the | ath10k-firmware-qca4019 is updated. This could be extended further so that ipq-wifi packages no longer use "install-override" and the various QCA4019 variants list the ath10k-board-qca4019 as a CONFLICT package. Signed-off-by: Christian Lamparter --- package/firmware/ath10k-ct-firmware/Makefile | 3 --- package/firmware/linux-firmware/qca_ath10k.mk | 2 +- target/linux/ipq40xx/Makefile | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/package/firmware/ath10k-ct-firmware/Makefile b/package/firmware/ath10k-ct-firmware/Makefile index 4fd7266f22..b210f1a5e4 100644 --- a/package/firmware/ath10k-ct-firmware/Makefile +++ b/package/firmware/ath10k-ct-firmware/Makefile @@ -292,7 +292,6 @@ $(Package/ath10k-ct-firmware-default) CATEGORY:=Firmware PROVIDES:=ath10k-firmware-qca4019 CONFLICTS:=ath10k-firmware-qca4019 - DEPENDS:=+ath10k-board-qca4019 endef define Package/ath10k-firmware-qca4019-ct-full-htt $(Package/ath10k-ct-firmware-default) @@ -307,7 +306,6 @@ $(Package/ath10k-ct-firmware-default) ath10k-firmware-qca4019-ct \ ath10k-firmware-qca4019-ct-htt DEPENDS:=\ - +ath10k-board-qca4019 \ +!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct endef define Package/ath10k-firmware-qca4019-ct-htt @@ -322,7 +320,6 @@ $(Package/ath10k-firmware-default) ath10k-firmware-qca4019 \ ath10k-firmware-qca4019-ct DEPENDS:=\ - +ath10k-board-qca4019 \ +!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct endef diff --git a/package/firmware/linux-firmware/qca_ath10k.mk b/package/firmware/linux-firmware/qca_ath10k.mk index d30487441e..d2c709af7a 100644 --- a/package/firmware/linux-firmware/qca_ath10k.mk +++ b/package/firmware/linux-firmware/qca_ath10k.mk @@ -33,7 +33,7 @@ define Package/ath10k-board-qca4019/install $(1)/lib/firmware/ath10k/QCA4019/hw1.0/ endef $(eval $(call BuildPackage,ath10k-board-qca4019)) -Package/ath10k-firmware-qca4019 = $(call Package/firmware-default,ath10k qca4019 firmware,+ath10k-board-qca4019) +Package/ath10k-firmware-qca4019 = $(call Package/firmware-default,ath10k qca4019 firmware) define Package/ath10k-firmware-qca4019/install $(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0 $(INSTALL_DATA) \ diff --git a/target/linux/ipq40xx/Makefile b/target/linux/ipq40xx/Makefile index 7b1a0b5b0e..3d397cd992 100644 --- a/target/linux/ipq40xx/Makefile +++ b/target/linux/ipq40xx/Makefile @@ -19,6 +19,6 @@ DEFAULT_PACKAGES += \ kmod-leds-gpio kmod-gpio-button-hotplug swconfig \ kmod-ath10k-ct wpad-basic-wolfssl \ kmod-usb3 kmod-usb-dwc3 ath10k-firmware-qca4019-ct \ - uboot-envtools + ath10k-board-qca4019 uboot-envtools $(eval $(call BuildTarget)) From 4eba313065f372ef0edf4abdbe00538fdbe7538f Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sat, 30 Oct 2021 20:51:31 +0200 Subject: [PATCH 25/65] netifd: fix deletion of ip tunnels (FS#4058) 8f82742 system-linux: fix deletion of ip tunnels (FS#4058) Signed-off-by: Hans Dedecker --- package/network/config/netifd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index 23d494819e..e4399b2473 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2021-10-21 -PKG_SOURCE_VERSION:=f78bdec2ed5f4c83d2c93f422c8bd21b68b02517 -PKG_MIRROR_HASH:=579fdf2357bd8ccf528e18ac770d80c0f42eb916fd8442f747e29e7f121b76e7 +PKG_SOURCE_DATE:=2021-10-30 +PKG_SOURCE_VERSION:=8f82742ca4f47f459284f3a07323d04da72ea5f6 +PKG_MIRROR_HASH:=5e519bb1aec9bb30782213f32f19f12e874c909e42826618dd4332ded816d2fe PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 From c4d292969fb0ebf0dbbadca3e479dae8b33eda71 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sat, 30 Oct 2021 20:56:48 +0200 Subject: [PATCH 26/65] 6rd : remove 6rd tunnel delete workaround Remove 6rd tunnel delete workaround in as the real issue is now solved in netifd (https://git.openwrt.org/?p=project/netifd.git;a=commit;h=8f82742ca4f47f459284f3a07323d04da72ea5f6) Signed-off-by: Hans Dedecker --- package/network/ipv6/6rd/Makefile | 2 +- package/network/ipv6/6rd/files/6rd.sh | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/package/network/ipv6/6rd/Makefile b/package/network/ipv6/6rd/Makefile index f9c4c6f7a5..e2ca4e1200 100644 --- a/package/network/ipv6/6rd/Makefile +++ b/package/network/ipv6/6rd/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6rd -PKG_RELEASE:=11 +PKG_RELEASE:=12 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/6rd/files/6rd.sh b/package/network/ipv6/6rd/files/6rd.sh index 3c913e54f1..62a20314d9 100644 --- a/package/network/ipv6/6rd/files/6rd.sh +++ b/package/network/ipv6/6rd/files/6rd.sh @@ -82,8 +82,6 @@ proto_6rd_setup() { proto_6rd_teardown() { local cfg="$1" - local link="6rd-$cfg" - ip link del $link } proto_6rd_init_config() { From 2d2c7c4250016a34f67b3e62c25f5fcc1a2f07e2 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sat, 30 Oct 2021 21:08:38 +0200 Subject: [PATCH 27/65] 6in4: remove 6in4 tunnel delete workaround (FS#3690) Remove 6in4 tunnel delete workaround as the real issue is now solved in netifd (https://git.openwrt.org/?p=project/netifd.git;a=commit;h=8f82742ca4f47f459284f3a07323d04da72ea5f6) Signed-off-by: Hans Dedecker --- package/network/ipv6/6in4/Makefile | 2 +- package/network/ipv6/6in4/files/6in4.sh | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/package/network/ipv6/6in4/Makefile b/package/network/ipv6/6in4/Makefile index 331295ba7a..edbb7d71a0 100644 --- a/package/network/ipv6/6in4/Makefile +++ b/package/network/ipv6/6in4/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6in4 -PKG_RELEASE:=27 +PKG_RELEASE:=28 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/6in4/files/6in4.sh b/package/network/ipv6/6in4/files/6in4.sh index d0904952fd..5b5c7b36af 100755 --- a/package/network/ipv6/6in4/files/6in4.sh +++ b/package/network/ipv6/6in4/files/6in4.sh @@ -138,8 +138,6 @@ proto_6in4_setup() { proto_6in4_teardown() { local cfg="$1" - local link="6in4-$cfg" - ip link del $link } proto_6in4_init_config() { From e6a486fe79174bb256db489363304ce236d012bb Mon Sep 17 00:00:00 2001 From: Zhijun You Date: Wed, 27 Oct 2021 02:35:21 +0800 Subject: [PATCH 28/65] ath10k: backport fix for module load regression with iram-recovery Backport upstream fix for module load regression caused by IRAM recovery. Without this patch devices using mainline ath10k driver could lost wireless function because ath10k module failed to load. Signed-off-by: Zhijun You --- ...egression-with-iram-recovery-feature.patch | 121 ++++++++++++++++++ ...21-ath10k_init_devices_synchronously.patch | 2 +- ...rolling-support-for-various-chipsets.patch | 6 +- ...h10k-Try-to-get-mac-address-from-dts.patch | 2 +- 4 files changed, 126 insertions(+), 5 deletions(-) create mode 100644 package/kernel/mac80211/patches/ath10k/081-ath10k-fix-module-load-regression-with-iram-recovery-feature.patch diff --git a/package/kernel/mac80211/patches/ath10k/081-ath10k-fix-module-load-regression-with-iram-recovery-feature.patch b/package/kernel/mac80211/patches/ath10k/081-ath10k-fix-module-load-regression-with-iram-recovery-feature.patch new file mode 100644 index 0000000000..7a7d08be48 --- /dev/null +++ b/package/kernel/mac80211/patches/ath10k/081-ath10k-fix-module-load-regression-with-iram-recovery-feature.patch @@ -0,0 +1,121 @@ +From 6f8c8bf4c7c9be1c42088689fd4370e06b46608a Mon Sep 17 00:00:00 2001 +From: Abinaya Kalaiselvan +Date: Wed, 20 Oct 2021 11:59:07 +0300 +Subject: ath10k: fix module load regression with iram-recovery feature + +Commit 9af7c32ceca8 ("ath10k: add target IRAM recovery feature support") +introduced a new firmware feature flag ATH10K_FW_FEATURE_IRAM_RECOVERY. But +this caused ath10k_pci module load to fail if ATH10K_FW_CRASH_DUMP_RAM_DATA bit +was not enabled in the ath10k coredump_mask module parameter: + +[ 2209.328190] ath10k_pci 0000:02:00.0: qca9984/qca9994 hw1.0 target 0x01000000 chip_id 0x00000000 sub 168c:cafe +[ 2209.434414] ath10k_pci 0000:02:00.0: kconfig debug 1 debugfs 1 tracing 1 dfs 1 testmode 1 +[ 2209.547191] ath10k_pci 0000:02:00.0: firmware ver 10.4-3.9.0.2-00099 api 5 features no-p2p,mfp,peer-flow-ctrl,btcoex-param,allows-mesh-bcast,no-ps,peer-fixed-rate,iram-recovery crc32 cbade90a +[ 2210.896485] ath10k_pci 0000:02:00.0: board_file api 1 bmi_id 0:1 crc32 a040efc2 +[ 2213.603339] ath10k_pci 0000:02:00.0: failed to copy target iram contents: -12 +[ 2213.839027] ath10k_pci 0000:02:00.0: could not init core (-12) +[ 2213.933910] ath10k_pci 0000:02:00.0: could not probe fw (-12) + +And by default coredump_mask does not have ATH10K_FW_CRASH_DUMP_RAM_DATA +enabled so anyone using a firmware with iram-recovery feature would fail. To my +knowledge only QCA9984 firmwares starting from release 10.4-3.9.0.2-00099 +enabled the feature. + +The reason for regression was that ath10k_core_copy_target_iram() used +ath10k_coredump_get_mem_layout() to get the memory layout, but when +ATH10K_FW_CRASH_DUMP_RAM_DATA was disabled it would get just NULL and bail out +with an error. + +While looking at all this I noticed another bug: if CONFIG_DEV_COREDUMP is +disabled but the firmware has iram-recovery enabled the module load fails with +similar error messages. I fixed that by returning 0 from +ath10k_core_copy_target_iram() when _ath10k_coredump_get_mem_layout() returns +NULL. + +Tested-on: QCA9984 hw2.0 PCI 10.4-3.9.0.2-00139 + +Fixes: 9af7c32ceca8 ("ath10k: add target IRAM recovery feature support") +Signed-off-by: Abinaya Kalaiselvan +Signed-off-by: Jouni Malinen +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20211020075054.23061-1-kvalo@codeaurora.org +--- + drivers/net/wireless/ath/ath10k/core.c | 11 +++++++++-- + drivers/net/wireless/ath/ath10k/coredump.c | 11 ++++++++--- + drivers/net/wireless/ath/ath10k/coredump.h | 7 +++++++ + 3 files changed, 24 insertions(+), 5 deletions(-) + +--- a/drivers/net/wireless/ath/ath10k/core.c ++++ b/drivers/net/wireless/ath/ath10k/core.c +@@ -2690,9 +2690,16 @@ static int ath10k_core_copy_target_iram( + int i, ret; + u32 len, remaining_len; + +- hw_mem = ath10k_coredump_get_mem_layout(ar); ++ /* copy target iram feature must work also when ++ * ATH10K_FW_CRASH_DUMP_RAM_DATA is disabled, so ++ * _ath10k_coredump_get_mem_layout() to accomplist that ++ */ ++ hw_mem = _ath10k_coredump_get_mem_layout(ar); + if (!hw_mem) +- return -ENOMEM; ++ /* if CONFIG_DEV_COREDUMP is disabled we get NULL, then ++ * just silently disable the feature by doing nothing ++ */ ++ return 0; + + for (i = 0; i < hw_mem->region_table.size; i++) { + tmp = &hw_mem->region_table.regions[i]; +--- a/drivers/net/wireless/ath/ath10k/coredump.c ++++ b/drivers/net/wireless/ath/ath10k/coredump.c +@@ -1447,11 +1447,17 @@ static u32 ath10k_coredump_get_ramdump_s + + const struct ath10k_hw_mem_layout *ath10k_coredump_get_mem_layout(struct ath10k *ar) + { +- int i; +- + if (!test_bit(ATH10K_FW_CRASH_DUMP_RAM_DATA, &ath10k_coredump_mask)) + return NULL; + ++ return _ath10k_coredump_get_mem_layout(ar); ++} ++EXPORT_SYMBOL(ath10k_coredump_get_mem_layout); ++ ++const struct ath10k_hw_mem_layout *_ath10k_coredump_get_mem_layout(struct ath10k *ar) ++{ ++ int i; ++ + if (WARN_ON(ar->target_version == 0)) + return NULL; + +@@ -1464,7 +1470,6 @@ const struct ath10k_hw_mem_layout *ath10 + + return NULL; + } +-EXPORT_SYMBOL(ath10k_coredump_get_mem_layout); + + struct ath10k_fw_crash_data *ath10k_coredump_new(struct ath10k *ar) + { +--- a/drivers/net/wireless/ath/ath10k/coredump.h ++++ b/drivers/net/wireless/ath/ath10k/coredump.h +@@ -176,6 +176,7 @@ int ath10k_coredump_register(struct ath1 + void ath10k_coredump_unregister(struct ath10k *ar); + void ath10k_coredump_destroy(struct ath10k *ar); + ++const struct ath10k_hw_mem_layout *_ath10k_coredump_get_mem_layout(struct ath10k *ar); + const struct ath10k_hw_mem_layout *ath10k_coredump_get_mem_layout(struct ath10k *ar); + + #else /* CONFIG_DEV_COREDUMP */ +@@ -213,6 +214,12 @@ ath10k_coredump_get_mem_layout(struct at + { + return NULL; + } ++ ++static inline const struct ath10k_hw_mem_layout * ++_ath10k_coredump_get_mem_layout(struct ath10k *ar) ++{ ++ return NULL; ++} + + #endif /* CONFIG_DEV_COREDUMP */ + diff --git a/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch index 7648ec3b7a..9ff1224c43 100644 --- a/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch +++ b/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch @@ -14,7 +14,7 @@ Signed-off-by: Sven Eckelmann --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c -@@ -3345,6 +3345,16 @@ int ath10k_core_register(struct ath10k * +@@ -3352,6 +3352,16 @@ int ath10k_core_register(struct ath10k * queue_work(ar->workqueue, &ar->register_work); diff --git a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch index d815ba2742..69491fc653 100644 --- a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch @@ -172,7 +172,7 @@ v13: .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -3060,6 +3066,10 @@ int ath10k_core_start(struct ath10k *ar, +@@ -3067,6 +3073,10 @@ int ath10k_core_start(struct ath10k *ar, goto err_hif_stop; } @@ -183,7 +183,7 @@ v13: return 0; err_hif_stop: -@@ -3318,9 +3328,18 @@ static void ath10k_core_register_work(st +@@ -3325,9 +3335,18 @@ static void ath10k_core_register_work(st goto err_spectral_destroy; } @@ -202,7 +202,7 @@ v13: err_spectral_destroy: ath10k_spectral_destroy(ar); err_debug_destroy: -@@ -3366,6 +3385,8 @@ void ath10k_core_unregister(struct ath10 +@@ -3373,6 +3392,8 @@ void ath10k_core_unregister(struct ath10 if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) return; diff --git a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch index e9d3ac6560..ce3ebcc2a6 100644 --- a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch +++ b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch @@ -26,7 +26,7 @@ Signed-off-by: Ansuel Smith #include #include #include -@@ -3236,6 +3237,8 @@ static int ath10k_core_probe_fw(struct a +@@ -3243,6 +3244,8 @@ static int ath10k_core_probe_fw(struct a device_get_mac_address(ar->dev, ar->mac_addr, sizeof(ar->mac_addr)); From 02026d0a6f2e4b939178219a703158cd7b9d658a Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Wed, 27 Oct 2021 11:10:45 +0100 Subject: [PATCH 29/65] kernel: bump 5.10 to 5.10.76 Deleted (upstreamed): bcm27xx/patches-5.10/950-0145-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch [1] Manually rebased: bcm27xx/patches-5.10/950-0355-xhci-quirks-add-link-TRB-quirk-for-VL805.patch bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch Note: although automatically rebaseable, the last patch has been edited to avoid conflicting bit definitions. [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=b6f32897af190d4716412e156ee0abcc16e4f1e5 Signed-off-by: Rui Salvaterra --- include/kernel-version.mk | 4 +- .../802-usb-xhci-force-msi-renesas-xhci.patch | 2 +- ...425-at803x-allow-sgmii-aneg-override.patch | 2 +- ...or-host-controllers-that-don-t-updat.patch | 90 ------------------- ...-quirks-add-link-TRB-quirk-for-VL805.patch | 4 +- ...support-for-performing-fake-doorbell.patch | 6 +- ...ve-forwarding-path-for-VLAN-tag-acti.patch | 4 +- ...ter-flowtable-bridge-and-vlan-suppor.patch | 2 +- ...-mt7530-MT7530-optional-GPIO-support.patch | 4 +- ...-mt7530-Add-support-for-EEE-features.patch | 6 +- ...the-dst-buffer-to-of_get_mac_address.patch | 2 +- .../hack-5.10/220-arm-gc_sections.patch | 2 +- ...hdev-Send-FDB-notifications-for-host.patch | 4 +- ...arch-arm-force-ZRELADDR-on-arch-qcom.patch | 2 +- ...Mangle-bootloader-s-kernel-arguments.patch | 2 +- .../900-arm-add-cmdline-override.patch | 2 +- .../500-gsw-rtl8367s-mt7622-support.patch | 2 +- ...Mangle-bootloader-s-kernel-arguments.patch | 2 +- ...Mangle-bootloader-s-kernel-arguments.patch | 2 +- .../ramips/patches-5.10/710-at803x.patch | 20 ++--- ...y-simplify-phy_link_change-arguments.patch | 2 +- .../721-NET-no-auto-carrier-off-support.patch | 2 +- ...nclude-linux-add-phy-ops-for-rtl838x.patch | 2 +- ...04-include-linux-add-phy-hsgmii-mode.patch | 6 +- .../patches-5.10/705-add-rtl-phy.patch | 2 +- ...rease-phy-address-number-for-rtl839x.patch | 2 +- 26 files changed, 45 insertions(+), 135 deletions(-) delete mode 100644 target/linux/bcm27xx/patches-5.10/950-0145-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index cb4f72716f..531a760281 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -7,10 +7,10 @@ ifdef CONFIG_TESTING_KERNEL endif LINUX_VERSION-5.4 = .155 -LINUX_VERSION-5.10 = .75 +LINUX_VERSION-5.10 = .76 LINUX_KERNEL_HASH-5.4.155 = cc0c0f902748d251cb22d0e69e3b8d260c447eb0072ef853da15da6cce775038 -LINUX_KERNEL_HASH-5.10.75 = 0a2b2f5fefb90773190aaef4726ac363e03992aedc424b0a57eca092d084304b +LINUX_KERNEL_HASH-5.10.76 = 480a09ba1962862ff18df9453fa0df6ba11cbe19eefedeab81bf2c84f49e1890 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/apm821xx/patches-5.10/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-5.10/802-usb-xhci-force-msi-renesas-xhci.patch index 52198e41f4..3b17a27e79 100644 --- a/target/linux/apm821xx/patches-5.10/802-usb-xhci-force-msi-renesas-xhci.patch +++ b/target/linux/apm821xx/patches-5.10/802-usb-xhci-force-msi-renesas-xhci.patch @@ -43,7 +43,7 @@ produce a noisy warning. hcd->msi_enabled = 1; --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1891,6 +1891,7 @@ struct xhci_hcd { +@@ -1892,6 +1892,7 @@ struct xhci_hcd { struct xhci_hub usb2_rhub; struct xhci_hub usb3_rhub; /* support xHCI 1.0 spec USB2 hardware LPM */ diff --git a/target/linux/ath79/patches-5.10/425-at803x-allow-sgmii-aneg-override.patch b/target/linux/ath79/patches-5.10/425-at803x-allow-sgmii-aneg-override.patch index db3427683f..bf224b5f47 100644 --- a/target/linux/ath79/patches-5.10/425-at803x-allow-sgmii-aneg-override.patch +++ b/target/linux/ath79/patches-5.10/425-at803x-allow-sgmii-aneg-override.patch @@ -1,6 +1,6 @@ --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c -@@ -733,6 +733,13 @@ static int at803x_aneg_done(struct phy_d +@@ -830,6 +830,13 @@ static int at803x_aneg_done(struct phy_d if (!(phy_read(phydev, AT803X_PSSR) & AT803X_PSSR_MR_AN_COMPLETE)) { phydev_warn(phydev, "803x_aneg_done: SGMII link is not ok\n"); aneg_done = 0; diff --git a/target/linux/bcm27xx/patches-5.10/950-0145-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch b/target/linux/bcm27xx/patches-5.10/950-0145-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch deleted file mode 100644 index 0fcb3f672d..0000000000 --- a/target/linux/bcm27xx/patches-5.10/950-0145-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch +++ /dev/null @@ -1,90 +0,0 @@ -From e47ad4978bde4920c1e1eb381531a6904025c852 Mon Sep 17 00:00:00 2001 -From: Jonathan Bell -Date: Thu, 11 Jul 2019 17:55:43 +0100 -Subject: [PATCH] xhci: add quirk for host controllers that don't - update endpoint DCS - -Seen on a VLI VL805 PCIe to USB controller. For non-stream endpoints -at least, if the xHC halts on a particular TRB due to an error then -the DCS field in the Out Endpoint Context maintained by the hardware -is not updated with the current cycle state. - -Using the quirk XHCI_EP_CTX_BROKEN_DCS and instead fetch the DCS bit -from the TRB that the xHC stopped on. - -See: https://github.com/raspberrypi/linux/issues/3060 - -Signed-off-by: Jonathan Bell ---- - drivers/usb/host/xhci-pci.c | 4 +++- - drivers/usb/host/xhci-ring.c | 26 +++++++++++++++++++++++++- - drivers/usb/host/xhci.h | 1 + - 3 files changed, 29 insertions(+), 2 deletions(-) - ---- a/drivers/usb/host/xhci-pci.c -+++ b/drivers/usb/host/xhci-pci.c -@@ -276,8 +276,10 @@ static void xhci_pci_quirks(struct devic - pdev->device == 0x3432) - xhci->quirks |= XHCI_BROKEN_STREAMS; - -- if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) -+ if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) { - xhci->quirks |= XHCI_LPM_SUPPORT; -+ xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS; -+ } - - if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && - pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) ---- a/drivers/usb/host/xhci-ring.c -+++ b/drivers/usb/host/xhci-ring.c -@@ -562,7 +562,10 @@ void xhci_find_new_dequeue_state(struct - struct xhci_virt_ep *ep = &dev->eps[ep_index]; - struct xhci_ring *ep_ring; - struct xhci_segment *new_seg; -+ struct xhci_segment *halted_seg = NULL; - union xhci_trb *new_deq; -+ union xhci_trb *halted_trb; -+ int index = 0; - dma_addr_t addr; - u64 hw_dequeue; - bool cycle_found = false; -@@ -600,7 +603,28 @@ void xhci_find_new_dequeue_state(struct - hw_dequeue = xhci_get_hw_deq(xhci, dev, ep_index, stream_id); - new_seg = ep_ring->deq_seg; - new_deq = ep_ring->dequeue; -- state->new_cycle_state = hw_dequeue & 0x1; -+ -+ /* -+ * Quirk: xHC write-back of the DCS field in the hardware dequeue -+ * pointer is wrong - use the cycle state of the TRB pointed to by -+ * the dequeue pointer. -+ */ -+ if (xhci->quirks & XHCI_EP_CTX_BROKEN_DCS && -+ !(ep->ep_state & EP_HAS_STREAMS)) -+ halted_seg = trb_in_td(xhci, cur_td->start_seg, -+ cur_td->first_trb, cur_td->last_trb, -+ hw_dequeue & ~0xf, false); -+ if (halted_seg) { -+ index = ((dma_addr_t)(hw_dequeue & ~0xf) - halted_seg->dma) / -+ sizeof(*halted_trb); -+ halted_trb = &halted_seg->trbs[index]; -+ state->new_cycle_state = halted_trb->generic.field[3] & 0x1; -+ xhci_dbg(xhci, "Endpoint DCS = %d TRB index = %d cycle = %d\n", -+ (u8)(hw_dequeue & 0x1), index, -+ state->new_cycle_state); -+ } else { -+ state->new_cycle_state = hw_dequeue & 0x1; -+ } - state->stream_id = stream_id; - - /* ---- a/drivers/usb/host/xhci.h -+++ b/drivers/usb/host/xhci.h -@@ -1884,6 +1884,7 @@ struct xhci_hcd { - #define XHCI_DISABLE_SPARSE BIT_ULL(38) - #define XHCI_SG_TRB_CACHE_SIZE_QUIRK BIT_ULL(39) - #define XHCI_NO_SOFT_RETRY BIT_ULL(40) -+#define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(41) - - unsigned int num_active_eps; - unsigned int limit_active_eps; diff --git a/target/linux/bcm27xx/patches-5.10/950-0355-xhci-quirks-add-link-TRB-quirk-for-VL805.patch b/target/linux/bcm27xx/patches-5.10/950-0355-xhci-quirks-add-link-TRB-quirk-for-VL805.patch index f63da53b8f..825b5969df 100644 --- a/target/linux/bcm27xx/patches-5.10/950-0355-xhci-quirks-add-link-TRB-quirk-for-VL805.patch +++ b/target/linux/bcm27xx/patches-5.10/950-0355-xhci-quirks-add-link-TRB-quirk-for-VL805.patch @@ -54,8 +54,8 @@ Signed-off-by: Jonathan Bell @@ -1885,6 +1885,7 @@ struct xhci_hcd { #define XHCI_SG_TRB_CACHE_SIZE_QUIRK BIT_ULL(39) #define XHCI_NO_SOFT_RETRY BIT_ULL(40) - #define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(41) -+#define XHCI_AVOID_DQ_ON_LINK BIT_ULL(42) + #define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(42) ++#define XHCI_AVOID_DQ_ON_LINK BIT_ULL(43) unsigned int num_active_eps; unsigned int limit_active_eps; diff --git a/target/linux/bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch b/target/linux/bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch index 36fc3945c7..c497db727f 100644 --- a/target/linux/bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch +++ b/target/linux/bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch @@ -127,11 +127,11 @@ it on BCM4708 family. /* --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1884,6 +1884,7 @@ struct xhci_hcd { - #define XHCI_DISABLE_SPARSE BIT_ULL(38) +@@ -1885,6 +1885,7 @@ struct xhci_hcd { #define XHCI_SG_TRB_CACHE_SIZE_QUIRK BIT_ULL(39) #define XHCI_NO_SOFT_RETRY BIT_ULL(40) -+#define XHCI_FAKE_DOORBELL BIT_ULL(41) + #define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(42) ++#define XHCI_FAKE_DOORBELL BIT_ULL(44) unsigned int num_active_eps; unsigned int limit_active_eps; diff --git a/target/linux/generic/backport-5.10/610-v5.13-14-net-bridge-resolve-forwarding-path-for-VLAN-tag-acti.patch b/target/linux/generic/backport-5.10/610-v5.13-14-net-bridge-resolve-forwarding-path-for-VLAN-tag-acti.patch index 2c1d935d9e..9abc6e6778 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-14-net-bridge-resolve-forwarding-path-for-VLAN-tag-acti.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-14-net-bridge-resolve-forwarding-path-for-VLAN-tag-acti.patch @@ -109,7 +109,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h -@@ -1095,6 +1095,13 @@ void br_vlan_notify(const struct net_bri +@@ -1093,6 +1093,13 @@ void br_vlan_notify(const struct net_bri bool br_vlan_can_enter_range(const struct net_bridge_vlan *v_curr, const struct net_bridge_vlan *range_end); @@ -123,7 +123,7 @@ Signed-off-by: Pablo Neira Ayuso static inline struct net_bridge_vlan_group *br_vlan_group( const struct net_bridge *br) { -@@ -1252,6 +1259,19 @@ static inline int nbp_get_num_vlan_infos +@@ -1250,6 +1257,19 @@ static inline int nbp_get_num_vlan_infos { return 0; } diff --git a/target/linux/generic/backport-5.10/610-v5.13-24-selftests-netfilter-flowtable-bridge-and-vlan-suppor.patch b/target/linux/generic/backport-5.10/610-v5.13-24-selftests-netfilter-flowtable-bridge-and-vlan-suppor.patch index 4924fda494..3f332c70d3 100644 --- a/target/linux/generic/backport-5.10/610-v5.13-24-selftests-netfilter-flowtable-bridge-and-vlan-suppor.patch +++ b/target/linux/generic/backport-5.10/610-v5.13-24-selftests-netfilter-flowtable-bridge-and-vlan-suppor.patch @@ -16,7 +16,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/tools/testing/selftests/netfilter/nft_flowtable.sh +++ b/tools/testing/selftests/netfilter/nft_flowtable.sh -@@ -371,6 +371,88 @@ else +@@ -370,6 +370,88 @@ else ip netns exec nsr1 nft list ruleset fi diff --git a/target/linux/generic/backport-5.10/781-v5.12-net-dsa-mt7530-MT7530-optional-GPIO-support.patch b/target/linux/generic/backport-5.10/781-v5.12-net-dsa-mt7530-MT7530-optional-GPIO-support.patch index 6931500c44..9e5047a16b 100644 --- a/target/linux/generic/backport-5.10/781-v5.12-net-dsa-mt7530-MT7530-optional-GPIO-support.patch +++ b/target/linux/generic/backport-5.10/781-v5.12-net-dsa-mt7530-MT7530-optional-GPIO-support.patch @@ -27,7 +27,7 @@ Signed-off-by: Jakub Kicinski #include #include "mt7530.h" -@@ -1540,6 +1541,109 @@ mtk_get_tag_protocol(struct dsa_switch * +@@ -1534,6 +1535,109 @@ mtk_get_tag_protocol(struct dsa_switch * } } @@ -137,7 +137,7 @@ Signed-off-by: Jakub Kicinski static int mt7530_setup(struct dsa_switch *ds) { -@@ -1681,6 +1785,12 @@ mt7530_setup(struct dsa_switch *ds) +@@ -1675,6 +1779,12 @@ mt7530_setup(struct dsa_switch *ds) } } diff --git a/target/linux/generic/backport-5.10/781-v5.13-net-dsa-mt7530-Add-support-for-EEE-features.patch b/target/linux/generic/backport-5.10/781-v5.13-net-dsa-mt7530-Add-support-for-EEE-features.patch index 4952abdb1e..38dd8a7296 100644 --- a/target/linux/generic/backport-5.10/781-v5.13-net-dsa-mt7530-Add-support-for-EEE-features.patch +++ b/target/linux/generic/backport-5.10/781-v5.13-net-dsa-mt7530-Add-support-for-EEE-features.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c -@@ -2377,6 +2377,17 @@ static void mt753x_phylink_mac_link_up(s +@@ -2371,6 +2371,17 @@ static void mt753x_phylink_mac_link_up(s mcr |= PMCR_RX_FC_EN; } @@ -35,7 +35,7 @@ Signed-off-by: David S. Miller mt7530_set(priv, MT7530_PMCR_P(port), mcr); } -@@ -2607,6 +2618,36 @@ mt753x_phy_write(struct dsa_switch *ds, +@@ -2601,6 +2612,36 @@ mt753x_phy_write(struct dsa_switch *ds, return priv->info->phy_write(ds, port, regnum, val); } @@ -72,7 +72,7 @@ Signed-off-by: David S. Miller static const struct dsa_switch_ops mt7530_switch_ops = { .get_tag_protocol = mtk_get_tag_protocol, .setup = mt753x_setup, -@@ -2635,6 +2676,8 @@ static const struct dsa_switch_ops mt753 +@@ -2629,6 +2670,8 @@ static const struct dsa_switch_ops mt753 .phylink_mac_an_restart = mt753x_phylink_mac_an_restart, .phylink_mac_link_down = mt753x_phylink_mac_link_down, .phylink_mac_link_up = mt753x_phylink_mac_link_up, diff --git a/target/linux/generic/backport-5.10/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch b/target/linux/generic/backport-5.10/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch index a2e31fab82..4d721c4f56 100644 --- a/target/linux/generic/backport-5.10/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch +++ b/target/linux/generic/backport-5.10/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch @@ -1398,7 +1398,7 @@ Signed-off-by: David S. Miller } phy_mode = device_get_phy_mode(&pdev->dev); -@@ -635,7 +635,7 @@ void stmmac_remove_config_dt(struct plat +@@ -643,7 +643,7 @@ void stmmac_remove_config_dt(struct plat } #else struct plat_stmmacenet_data * diff --git a/target/linux/generic/hack-5.10/220-arm-gc_sections.patch b/target/linux/generic/hack-5.10/220-arm-gc_sections.patch index 5c3ebcc810..d4f4efc505 100644 --- a/target/linux/generic/hack-5.10/220-arm-gc_sections.patch +++ b/target/linux/generic/hack-5.10/220-arm-gc_sections.patch @@ -12,7 +12,7 @@ Signed-off-by: Gabor Juhos --- --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -113,6 +113,7 @@ config ARM +@@ -114,6 +114,7 @@ config ARM select HAVE_UID16 select HAVE_VIRT_CPU_ACCOUNTING_GEN select IRQ_FORCED_THREADING diff --git a/target/linux/generic/pending-5.10/764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch b/target/linux/generic/pending-5.10/764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch index 0e773888df..630e03bbfd 100644 --- a/target/linux/generic/pending-5.10/764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch +++ b/target/linux/generic/pending-5.10/764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch @@ -37,7 +37,7 @@ Signed-off-by: Tobias Waldekranz if (skb == NULL) --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h -@@ -1527,8 +1527,8 @@ bool nbp_switchdev_allowed_egress(const +@@ -1525,8 +1525,8 @@ bool nbp_switchdev_allowed_egress(const int br_switchdev_set_port_flag(struct net_bridge_port *p, unsigned long flags, unsigned long mask); @@ -48,7 +48,7 @@ Signed-off-by: Tobias Waldekranz int br_switchdev_port_vlan_add(struct net_device *dev, u16 vid, u16 flags, struct netlink_ext_ack *extack); int br_switchdev_port_vlan_del(struct net_device *dev, u16 vid); -@@ -1574,7 +1574,8 @@ static inline int br_switchdev_port_vlan +@@ -1572,7 +1572,8 @@ static inline int br_switchdev_port_vlan } static inline void diff --git a/target/linux/ipq806x/patches-5.10/0060-HACK-arch-arm-force-ZRELADDR-on-arch-qcom.patch b/target/linux/ipq806x/patches-5.10/0060-HACK-arch-arm-force-ZRELADDR-on-arch-qcom.patch index b56480deaa..b73218e71b 100644 --- a/target/linux/ipq806x/patches-5.10/0060-HACK-arch-arm-force-ZRELADDR-on-arch-qcom.patch +++ b/target/linux/ipq806x/patches-5.10/0060-HACK-arch-arm-force-ZRELADDR-on-arch-qcom.patch @@ -33,7 +33,7 @@ Signed-off-by: Mathieu Olivari --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -321,7 +321,7 @@ config ARCH_MULTIPLATFORM +@@ -322,7 +322,7 @@ config ARCH_MULTIPLATFORM select ARCH_SELECT_MEMORY_MODEL select ARM_HAS_SG_CHAIN select ARM_PATCH_PHYS_VIRT diff --git a/target/linux/ipq806x/patches-5.10/0067-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/ipq806x/patches-5.10/0067-generic-Mangle-bootloader-s-kernel-arguments.patch index c38e0a4669..25c58bee49 100644 --- a/target/linux/ipq806x/patches-5.10/0067-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/ipq806x/patches-5.10/0067-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -22,7 +22,7 @@ Signed-off-by: Adrian Panella --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1780,6 +1780,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN +@@ -1781,6 +1781,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN The command-line arguments provided by the boot loader will be appended to the the device tree bootargs property. diff --git a/target/linux/ipq806x/patches-5.10/900-arm-add-cmdline-override.patch b/target/linux/ipq806x/patches-5.10/900-arm-add-cmdline-override.patch index 2459e6a2f0..830a14924c 100644 --- a/target/linux/ipq806x/patches-5.10/900-arm-add-cmdline-override.patch +++ b/target/linux/ipq806x/patches-5.10/900-arm-add-cmdline-override.patch @@ -1,6 +1,6 @@ --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1793,6 +1793,14 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_MANGL +@@ -1794,6 +1794,14 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_MANGL endchoice diff --git a/target/linux/mediatek/patches-5.10/500-gsw-rtl8367s-mt7622-support.patch b/target/linux/mediatek/patches-5.10/500-gsw-rtl8367s-mt7622-support.patch index bdd482def3..4ff9fb6bc9 100644 --- a/target/linux/mediatek/patches-5.10/500-gsw-rtl8367s-mt7622-support.patch +++ b/target/linux/mediatek/patches-5.10/500-gsw-rtl8367s-mt7622-support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -334,6 +334,12 @@ config ROCKCHIP_PHY +@@ -335,6 +335,12 @@ config ROCKCHIP_PHY help Currently supports the integrated Ethernet PHY. diff --git a/target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch index f2a0478693..15128828e9 100644 --- a/target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/mvebu/patches-5.10/300-mvebu-Mangle-bootloader-s-kernel-arguments.patch @@ -28,7 +28,7 @@ Signed-off-by: Michael Gray --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1780,6 +1780,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN +@@ -1781,6 +1781,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN The command-line arguments provided by the boot loader will be appended to the the device tree bootargs property. diff --git a/target/linux/oxnas/patches-5.10/996-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/oxnas/patches-5.10/996-generic-Mangle-bootloader-s-kernel-arguments.patch index 07abd0c648..4b89260660 100644 --- a/target/linux/oxnas/patches-5.10/996-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/oxnas/patches-5.10/996-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -22,7 +22,7 @@ Signed-off-by: Adrian Panella --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -1780,6 +1780,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN +@@ -1781,6 +1781,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN The command-line arguments provided by the boot loader will be appended to the the device tree bootargs property. diff --git a/target/linux/ramips/patches-5.10/710-at803x.patch b/target/linux/ramips/patches-5.10/710-at803x.patch index ec8f3ba55f..1b59f70cea 100644 --- a/target/linux/ramips/patches-5.10/710-at803x.patch +++ b/target/linux/ramips/patches-5.10/710-at803x.patch @@ -40,9 +40,9 @@ Signed-off-by: René van Dorst +#define PSSR_SPEED_1000 BIT(15) +#define PSSR_SPEED_100 BIT(14) - #define AT803X_DEBUG_REG_0 0x00 - #define AT803X_DEBUG_RX_CLK_DLY_EN BIT(15) -@@ -532,12 +543,75 @@ static int at803x_parse_dt(struct phy_de + #define AT803X_DEBUG_ANALOG_TEST_CTRL 0x00 + #define QCA8327_DEBUG_MANU_CTRL_EN BIT(2) +@@ -629,12 +640,75 @@ static int at803x_parse_dt(struct phy_de return 0; } @@ -118,7 +118,7 @@ Signed-off-by: René van Dorst priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; -@@ -554,6 +628,7 @@ static int at803x_probe(struct phy_devic +@@ -651,6 +725,7 @@ static int at803x_probe(struct phy_devic return ret; } @@ -126,7 +126,7 @@ Signed-off-by: René van Dorst /* Some bootloaders leave the fiber page selected. * Switch to the copper page, as otherwise we read * the PHY capabilities from the fiber side. -@@ -565,6 +640,7 @@ static int at803x_probe(struct phy_devic +@@ -662,6 +737,7 @@ static int at803x_probe(struct phy_devic if (ret) goto err; } @@ -134,7 +134,7 @@ Signed-off-by: René van Dorst return 0; -@@ -744,6 +820,10 @@ static int at803x_read_status(struct phy +@@ -841,6 +917,10 @@ static int at803x_read_status(struct phy { int ss, err, old_link = phydev->link; @@ -145,7 +145,7 @@ Signed-off-by: René van Dorst /* Update the link, but return if there was an error */ err = genphy_update_link(phydev); if (err) -@@ -844,6 +924,12 @@ static int at803x_config_aneg(struct phy +@@ -941,6 +1021,12 @@ static int at803x_config_aneg(struct phy { int ret; @@ -158,7 +158,7 @@ Signed-off-by: René van Dorst ret = at803x_config_mdix(phydev, phydev->mdix_ctrl); if (ret < 0) return ret; -@@ -943,6 +1029,7 @@ static int at803x_get_features(struct ph +@@ -1040,6 +1126,7 @@ static int at803x_get_features(struct ph if (err) return err; @@ -166,7 +166,7 @@ Signed-off-by: René van Dorst if (!at803x_match_phy_id(phydev, ATH8031_PHY_ID)) return 0; -@@ -960,6 +1047,7 @@ static int at803x_get_features(struct ph +@@ -1057,6 +1144,7 @@ static int at803x_get_features(struct ph */ linkmode_clear_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT, phydev->supported); @@ -174,7 +174,7 @@ Signed-off-by: René van Dorst return 0; } -@@ -1173,6 +1261,7 @@ static struct phy_driver at803x_driver[] +@@ -1381,6 +1469,7 @@ static struct phy_driver at803x_driver[] /* Qualcomm Atheros AR8031/AR8033 */ PHY_ID_MATCH_EXACT(ATH8031_PHY_ID), .name = "Qualcomm Atheros AR8031/AR8033", diff --git a/target/linux/ramips/patches-5.10/720-Revert-net-phy-simplify-phy_link_change-arguments.patch b/target/linux/ramips/patches-5.10/720-Revert-net-phy-simplify-phy_link_change-arguments.patch index a4398f9f8a..a2ace6057f 100644 --- a/target/linux/ramips/patches-5.10/720-Revert-net-phy-simplify-phy_link_change-arguments.patch +++ b/target/linux/ramips/patches-5.10/720-Revert-net-phy-simplify-phy_link_change-arguments.patch @@ -107,7 +107,7 @@ still required by target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c bool tx_pause, rx_pause; --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -638,7 +638,7 @@ struct phy_device { +@@ -642,7 +642,7 @@ struct phy_device { u8 mdix; u8 mdix_ctrl; diff --git a/target/linux/ramips/patches-5.10/721-NET-no-auto-carrier-off-support.patch b/target/linux/ramips/patches-5.10/721-NET-no-auto-carrier-off-support.patch index c9cbef7429..02bcb17354 100644 --- a/target/linux/ramips/patches-5.10/721-NET-no-auto-carrier-off-support.patch +++ b/target/linux/ramips/patches-5.10/721-NET-no-auto-carrier-off-support.patch @@ -37,7 +37,7 @@ Signed-off-by: John Crispin break; --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -557,6 +557,7 @@ struct phy_device { +@@ -561,6 +561,7 @@ struct phy_device { unsigned sysfs_links:1; unsigned loopback_enabled:1; unsigned downshifted_rate:1; diff --git a/target/linux/realtek/patches-5.10/703-include-linux-add-phy-ops-for-rtl838x.patch b/target/linux/realtek/patches-5.10/703-include-linux-add-phy-ops-for-rtl838x.patch index 0a771b64f0..0841b85fd8 100644 --- a/target/linux/realtek/patches-5.10/703-include-linux-add-phy-ops-for-rtl838x.patch +++ b/target/linux/realtek/patches-5.10/703-include-linux-add-phy-ops-for-rtl838x.patch @@ -1,6 +1,6 @@ --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -881,6 +881,10 @@ struct phy_driver { +@@ -885,6 +885,10 @@ struct phy_driver { int (*get_sqi)(struct phy_device *dev); /** @get_sqi_max: Get the maximum signal quality indication */ int (*get_sqi_max)(struct phy_device *dev); diff --git a/target/linux/realtek/patches-5.10/704-include-linux-add-phy-hsgmii-mode.patch b/target/linux/realtek/patches-5.10/704-include-linux-add-phy-hsgmii-mode.patch index d47e7bad50..58f4fef456 100644 --- a/target/linux/realtek/patches-5.10/704-include-linux-add-phy-hsgmii-mode.patch +++ b/target/linux/realtek/patches-5.10/704-include-linux-add-phy-hsgmii-mode.patch @@ -1,14 +1,14 @@ --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -133,6 +133,7 @@ typedef enum { +@@ -134,6 +134,7 @@ typedef enum { PHY_INTERFACE_MODE_XGMII, PHY_INTERFACE_MODE_XLGMII, PHY_INTERFACE_MODE_MOCA, + PHY_INTERFACE_MODE_HSGMII, PHY_INTERFACE_MODE_QSGMII, PHY_INTERFACE_MODE_TRGMII, - PHY_INTERFACE_MODE_1000BASEX, -@@ -199,6 +200,8 @@ static inline const char *phy_modes(phy_ + PHY_INTERFACE_MODE_100BASEX, +@@ -201,6 +202,8 @@ static inline const char *phy_modes(phy_ return "xlgmii"; case PHY_INTERFACE_MODE_MOCA: return "moca"; diff --git a/target/linux/realtek/patches-5.10/705-add-rtl-phy.patch b/target/linux/realtek/patches-5.10/705-add-rtl-phy.patch index dbd936b446..3046a6aed5 100644 --- a/target/linux/realtek/patches-5.10/705-add-rtl-phy.patch +++ b/target/linux/realtek/patches-5.10/705-add-rtl-phy.patch @@ -1,6 +1,6 @@ --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -324,6 +324,12 @@ config REALTEK_PHY +@@ -325,6 +325,12 @@ config REALTEK_PHY help Supports the Realtek 821x PHY. diff --git a/target/linux/realtek/patches-5.10/705-include-linux-phy-increase-phy-address-number-for-rtl839x.patch b/target/linux/realtek/patches-5.10/705-include-linux-phy-increase-phy-address-number-for-rtl839x.patch index 64e6b5d309..ab3ea8e689 100644 --- a/target/linux/realtek/patches-5.10/705-include-linux-phy-increase-phy-address-number-for-rtl839x.patch +++ b/target/linux/realtek/patches-5.10/705-include-linux-phy-increase-phy-address-number-for-rtl839x.patch @@ -1,6 +1,6 @@ --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -229,7 +229,7 @@ static inline const char *phy_modes(phy_ +@@ -233,7 +233,7 @@ static inline const char *phy_modes(phy_ #define PHY_INIT_TIMEOUT 100000 #define PHY_FORCE_TIMEOUT 10 From 3bd31cc4d2ff02c2d3c3db80ade7badab08f3e93 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 24 Oct 2021 11:10:26 -0700 Subject: [PATCH 30/65] tools/meson: update to 0.60.0 Add cmake support to meson. Otherwise only pkgconfig can be used. Signed-off-by: Rosen Penev --- include/meson.mk | 2 ++ tools/meson/Makefile | 4 ++-- tools/meson/files/openwrt-cross.txt.in | 1 + tools/meson/files/openwrt-native.txt.in | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/meson.mk b/include/meson.mk index 12e38b9e71..ae17e18d2d 100644 --- a/include/meson.mk +++ b/include/meson.mk @@ -64,6 +64,7 @@ define Meson/CreateNativeFile -e "s|@CC@|$(foreach BIN,$(HOSTCC),'$(BIN)',)|" \ -e "s|@CXX@|$(foreach BIN,$(HOSTCXX),'$(BIN)',)|" \ -e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \ + -e "s|@CMAKE@|$(STAGING_DIR_HOST)/bin/cmake|" \ -e "s|@CFLAGS@|$(foreach FLAG,$(HOST_CFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@CXXFLAGS@|$(foreach FLAG,$(HOST_CXXFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@LDFLAGS@|$(foreach FLAG,$(HOST_LDFLAGS),'$(FLAG)',)|" \ @@ -80,6 +81,7 @@ define Meson/CreateCrossFile -e "s|@STRIP@|$(TARGET_CROSS)strip|" \ -e "s|@NM@|$(TARGET_NM)|" \ -e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \ + -e "s|@CMAKE@|$(STAGING_DIR_HOST)/bin/cmake|" \ -e "s|@CFLAGS@|$(foreach FLAG,$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@CXXFLAGS@|$(foreach FLAG,$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@LDFLAGS@|$(foreach FLAG,$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS),'$(FLAG)',)|" \ diff --git a/tools/meson/Makefile b/tools/meson/Makefile index 1aab5d8fcb..f648085f90 100644 --- a/tools/meson/Makefile +++ b/tools/meson/Makefile @@ -1,11 +1,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=meson -PKG_VERSION:=0.59.2 +PKG_VERSION:=0.60.0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/mesonbuild/meson/releases/download/$(PKG_VERSION) -PKG_HASH:=13dee549a7ba758b7e33ce7719f28d1d337a98d10d378a4779ccc996f5a2fc49 +PKG_HASH:=080d68b685e9a0d9c9bb475457e097b49e1d1a6f750abc971428a8d2e1b12d47 PKG_MAINTAINER:=Andre Heider PKG_LICENSE:=Apache-2.0 diff --git a/tools/meson/files/openwrt-cross.txt.in b/tools/meson/files/openwrt-cross.txt.in index 30b4c116c4..56aa393d63 100644 --- a/tools/meson/files/openwrt-cross.txt.in +++ b/tools/meson/files/openwrt-cross.txt.in @@ -5,6 +5,7 @@ ar = '@AR@' strip = '@STRIP@' nm = '@NM@' pkgconfig = '@PKGCONFIG@' +cmake = '@CMAKE@' [built-in options] c_args = [@CFLAGS@] diff --git a/tools/meson/files/openwrt-native.txt.in b/tools/meson/files/openwrt-native.txt.in index 50308ec8e4..eba63c00b1 100644 --- a/tools/meson/files/openwrt-native.txt.in +++ b/tools/meson/files/openwrt-native.txt.in @@ -2,6 +2,7 @@ c = [@CC@] cpp = [@CXX@] pkgconfig = '@PKGCONFIG@' +cmake = '@CMAKE@' [built-in options] c_args = [@CFLAGS@] From cc2a8c25459f437e82b58b1bb94afd811cbb131f Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Fri, 15 Oct 2021 22:04:00 +0800 Subject: [PATCH 31/65] rockchip: move r8152 related patches to generic These patches can be used on other platforms, so move it to generic. Signed-off-by: Chukun Pan --- .../760-net-usb-r8152-add-LED-configuration-from-OF.patch} | 0 .../761-dt-bindings-net-add-RTL8152-binding-documentation.patch} | 0 .../760-net-usb-r8152-add-LED-configuration-from-OF.patch} | 0 .../761-dt-bindings-net-add-RTL8152-binding-documentation.patch} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename target/linux/{rockchip/patches-5.10/002-net-usb-r8152-add-LED-configuration-from-OF.patch => generic/hack-5.10/760-net-usb-r8152-add-LED-configuration-from-OF.patch} (100%) rename target/linux/{rockchip/patches-5.10/003-dt-bindings-net-add-RTL8152-binding-documentation.patch => generic/hack-5.10/761-dt-bindings-net-add-RTL8152-binding-documentation.patch} (100%) rename target/linux/{rockchip/patches-5.4/002-net-usb-r8152-add-LED-configuration-from-OF.patch => generic/hack-5.4/760-net-usb-r8152-add-LED-configuration-from-OF.patch} (100%) rename target/linux/{rockchip/patches-5.4/003-dt-bindings-net-add-RTL8152-binding-documentation.patch => generic/hack-5.4/761-dt-bindings-net-add-RTL8152-binding-documentation.patch} (100%) diff --git a/target/linux/rockchip/patches-5.10/002-net-usb-r8152-add-LED-configuration-from-OF.patch b/target/linux/generic/hack-5.10/760-net-usb-r8152-add-LED-configuration-from-OF.patch similarity index 100% rename from target/linux/rockchip/patches-5.10/002-net-usb-r8152-add-LED-configuration-from-OF.patch rename to target/linux/generic/hack-5.10/760-net-usb-r8152-add-LED-configuration-from-OF.patch diff --git a/target/linux/rockchip/patches-5.10/003-dt-bindings-net-add-RTL8152-binding-documentation.patch b/target/linux/generic/hack-5.10/761-dt-bindings-net-add-RTL8152-binding-documentation.patch similarity index 100% rename from target/linux/rockchip/patches-5.10/003-dt-bindings-net-add-RTL8152-binding-documentation.patch rename to target/linux/generic/hack-5.10/761-dt-bindings-net-add-RTL8152-binding-documentation.patch diff --git a/target/linux/rockchip/patches-5.4/002-net-usb-r8152-add-LED-configuration-from-OF.patch b/target/linux/generic/hack-5.4/760-net-usb-r8152-add-LED-configuration-from-OF.patch similarity index 100% rename from target/linux/rockchip/patches-5.4/002-net-usb-r8152-add-LED-configuration-from-OF.patch rename to target/linux/generic/hack-5.4/760-net-usb-r8152-add-LED-configuration-from-OF.patch diff --git a/target/linux/rockchip/patches-5.4/003-dt-bindings-net-add-RTL8152-binding-documentation.patch b/target/linux/generic/hack-5.4/761-dt-bindings-net-add-RTL8152-binding-documentation.patch similarity index 100% rename from target/linux/rockchip/patches-5.4/003-dt-bindings-net-add-RTL8152-binding-documentation.patch rename to target/linux/generic/hack-5.4/761-dt-bindings-net-add-RTL8152-binding-documentation.patch From e43eb16efe97a597a2ebaa9f549d1daec2c8c2ab Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Sat, 16 Oct 2021 18:02:40 +0800 Subject: [PATCH 32/65] uboot-sunxi: add support for FriendlyARM NanoPi R1S H5 Merged in https://github.com/u-boot/u-boot/commit/e7510d2, adjust back to the current 2020.04 version. Signed-off-by: Chukun Pan --- package/boot/uboot-sunxi/Makefile | 10 + ...nxi-h5-add-support-for-nanopi-r1s-h5.patch | 271 ++++++++++++++++++ 2 files changed, 281 insertions(+) create mode 100644 package/boot/uboot-sunxi/patches/253-sunxi-h5-add-support-for-nanopi-r1s-h5.patch diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile index 9dce3e448a..5c27407d15 100644 --- a/package/boot/uboot-sunxi/Makefile +++ b/package/boot/uboot-sunxi/Makefile @@ -270,6 +270,15 @@ define U-Boot/nanopi_neo2 ATF:=a64 endef +define U-Boot/nanopi_r1s_h5 + BUILD_SUBTARGET:=cortexa53 + NAME:=NanoPi R1S (H5) + BUILD_DEVICES:=friendlyarm_nanopi-r1s-h5 + DEPENDS:=+PACKAGE_u-boot-nanopi_r1s_h5:arm-trusted-firmware-sunxi-a64 + UENV:=a64 + ATF:=a64 +endef + define U-Boot/pine64_plus BUILD_SUBTARGET:=cortexa53 NAME:=Pine64 Plus A64 @@ -357,6 +366,7 @@ UBOOT_TARGETS := \ nanopi_neo_plus2 \ nanopi_neo2 \ nanopi_r1 \ + nanopi_r1s_h5 \ orangepi_zero \ orangepi_r1 \ orangepi_one \ diff --git a/package/boot/uboot-sunxi/patches/253-sunxi-h5-add-support-for-nanopi-r1s-h5.patch b/package/boot/uboot-sunxi/patches/253-sunxi-h5-add-support-for-nanopi-r1s-h5.patch new file mode 100644 index 0000000000..b89351d2e9 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/253-sunxi-h5-add-support-for-nanopi-r1s-h5.patch @@ -0,0 +1,271 @@ +From e7510d24cab4741f72489b9d67c2d42b18fe5374 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Sun, 10 Oct 2021 21:36:57 +0800 +Subject: [PATCH] sunxi: Add support for FriendlyARM NanoPi R1S H5 + +This adds support for the NanoPi R1S H5 board. + +Allwinner H5 SoC +512MB DDR3 RAM +10/100/1000M Ethernet x 2 +RTL8189ETV WiFi 802.11b/g/n +USB 2.0 host port (A) +MicroSD Slot +Reset button +Serial Debug Port +WAN - LAN - SYS LED + +Signed-off-by: Chukun Pan +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/sun50i-h5-nanopi-r1s-h5.dts | 195 +++++++++++++++++++++++ + board/sunxi/MAINTAINERS | 5 + + configs/nanopi_r1s_h5_defconfig | 14 ++ + 4 files changed, 215 insertions(+) + create mode 100644 arch/arm/dts/sun50i-h5-nanopi-r1s-h5.dts + create mode 100644 configs/nanopi_r1s_h5_defconfig + +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index b8a382d1539..ed3d360bb10 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -638,6 +638,7 @@ dtb-$(CONFIG_MACH_SUN50I_H5) += \ + sun50i-h5-libretech-all-h5-cc.dtb \ + sun50i-h5-nanopi-neo2.dtb \ + sun50i-h5-nanopi-neo-plus2.dtb \ ++ sun50i-h5-nanopi-r1s-h5.dtb \ + sun50i-h5-orangepi-zero-plus.dtb \ + sun50i-h5-orangepi-pc2.dtb \ + sun50i-h5-orangepi-prime.dtb \ +diff --git a/arch/arm/dts/sun50i-h5-nanopi-r1s-h5.dts b/arch/arm/dts/sun50i-h5-nanopi-r1s-h5.dts +new file mode 100644 +index 00000000000..55bcdf8d1a0 +--- /dev/null ++++ b/arch/arm/dts/sun50i-h5-nanopi-r1s-h5.dts +@@ -0,0 +1,190 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (C) 2021 Chukun Pan ++ * ++ * Based on sun50i-h5-nanopi-neo-plus2.dts, which is: ++ * Copyright (C) 2017 Antony Antony ++ * Copyright (C) 2016 ARM Ltd. ++ */ ++ ++/dts-v1/; ++#include "sun50i-h5.dtsi" ++ ++#include ++#include ++ ++/ { ++ model = "FriendlyARM NanoPi R1S H5"; ++ compatible = "friendlyarm,nanopi-r1s-h5", "allwinner,sun50i-h5"; ++ ++ aliases { ++ ethernet0 = &emac; ++ ethernet1 = &rtl8189etv; ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ sys { ++ label = "nanopi:red:sys"; ++ gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ ++ lan { ++ label = "nanopi:green:lan"; ++ gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ wan { ++ label = "nanopi:green:wan"; ++ gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ r-gpio-keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ reg_gmac_3v3: gmac-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "gmac-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ startup-delay-us = <100000>; ++ enable-active-high; ++ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ reg_vcc3v3: vcc3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++ ++ reg_usb0_vbus: usb0-vbus { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb0-vbus"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ enable-active-high; ++ gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */ ++ status = "okay"; ++ }; ++ ++ vdd_cpux: gpio-regulator { ++ compatible = "regulator-gpio"; ++ regulator-name = "vdd-cpux"; ++ regulator-type = "voltage"; ++ regulator-boot-on; ++ regulator-always-on; ++ regulator-min-microvolt = <1100000>; ++ regulator-max-microvolt = <1300000>; ++ regulator-ramp-delay = <50>; /* 4ms */ ++ gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; ++ gpios-states = <0x1>; ++ states = <1100000 0x0>, <1300000 0x1>; ++ }; ++ ++ wifi_pwrseq: wifi_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ ++ post-power-on-delay-ms = <200>; ++ }; ++}; ++ ++&cpu0 { ++ cpu-supply = <&vdd_cpux>; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&ehci2 { ++ status = "okay"; ++}; ++ ++&emac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emac_rgmii_pins>; ++ phy-supply = <®_gmac_3v3>; ++ phy-handle = <&ext_rgmii_phy>; ++ phy-mode = "rgmii-id"; ++ status = "okay"; ++}; ++ ++&external_mdio { ++ ext_rgmii_phy: ethernet-phy@7 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <7>; ++ }; ++}; ++ ++&i2c0 { ++ status = "okay"; ++ ++ eeprom@51 { ++ compatible = "microchip,24c02"; ++ reg = <0x51>; ++ pagesize = <16>; ++ }; ++}; ++ ++&mmc0 { ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ ++ status = "okay"; ++}; ++ ++&mmc1 { ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc3v3>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ rtl8189etv: sdio_wifi@1 { ++ reg = <1>; ++ }; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&ohci2 { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pa_pins>; ++ status = "okay"; ++}; ++ ++&usb_otg { ++ dr_mode = "peripheral"; ++ status = "okay"; ++}; ++ ++&usbphy { ++ /* USB Type-A port's VBUS is always on */ ++ usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ ++ usb0_vbus-supply = <®_usb0_vbus>; ++ status = "okay"; ++}; +diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS +index 2543c94de79..56a0ee3689b 100644 +--- a/board/sunxi/MAINTAINERS ++++ b/board/sunxi/MAINTAINERS +@@ -358,6 +358,11 @@ M: Jelle van der Waa + S: Maintained + F: configs/nanopi_neo_air_defconfig + ++NANOPI-R1S-H5 BOARD ++M: Chukun Pan ++S: Maintained ++F: configs/nanopi_r1s_h5_defconfig ++ + NANOPI-A64 BOARD + M: Jagan Teki + S: Maintained +diff --git a/configs/nanopi_r1s_h5_defconfig b/configs/nanopi_r1s_h5_defconfig +new file mode 100644 +index 00000000000..27cf172d72a +--- /dev/null ++++ b/configs/nanopi_r1s_h5_defconfig +@@ -0,0 +1,14 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_SPL=y ++CONFIG_MACH_SUN50I_H5=y ++CONFIG_DRAM_CLK=672 ++CONFIG_DRAM_ZQ=3881977 ++# CONFIG_DRAM_ODT_EN is not set ++CONFIG_MACPWR="PD6" ++CONFIG_MMC_SUNXI_SLOT_EXTRA=2 ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-nanopi-r1s-h5" ++CONFIG_SUN8I_EMAC=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_OHCI_HCD=y From fde68cb80941a60be93ece75e808b5b407d11cc8 Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Mon, 18 Oct 2021 12:20:03 +0800 Subject: [PATCH 33/65] sunxi: add support for FriendlyARM NanoPi R1S H5 Specification: CPU: Allwinner H5, Quad-core Cortex-A53 DDR3 RAM: 512MB Network: 10/100/1000M Ethernet x 2 USB Host: Type-A x 1 MicroSD Slot x 1 MicroUSB: for power input Debug Serial Port: 3Pin pin-header LED: WAN, LAN, SYS KEY: Reset Power Supply: DC 5V/2A Installation: Write the image to SD Card with dd. Note: 1. OpenWrt currently does not support LED_FUNCTION, change back to the previous practice (Consistent with NanoPi R1). 2. Since the upstream commit https://github.com/torvalds/linux/bbc4d71 ("net: phy: realtek: fix rtl8211e rx/tx delay config"), we need to change the phy-mode from rgmii to rgmii-id. So set phy-mode for 5.4 and 5.10 respectively. Signed-off-by: Chukun Pan --- .../sunxi/base-files/etc/board.d/01_leds | 3 +- .../sunxi/base-files/etc/board.d/02_network | 65 +++-- target/linux/sunxi/cortexa53/config-5.10 | 1 + target/linux/sunxi/cortexa53/config-5.4 | 1 + target/linux/sunxi/image/cortexa53.mk | 9 + ...nxi-h5-add-support-for-nanopi-r1s-h5.patch | 230 ++++++++++++++++++ ...lwinner-nanopi-r1s-h5-add-status-LED.patch | 35 +++ ...nxi-h5-add-support-for-nanopi-r1s-h5.patch | 229 +++++++++++++++++ ...lwinner-nanopi-r1s-h5-add-status-LED.patch | 35 +++ 9 files changed, 588 insertions(+), 20 deletions(-) create mode 100644 target/linux/sunxi/patches-5.10/101-sunxi-h5-add-support-for-nanopi-r1s-h5.patch create mode 100644 target/linux/sunxi/patches-5.10/431-arm64-dts-allwinner-nanopi-r1s-h5-add-status-LED.patch create mode 100644 target/linux/sunxi/patches-5.4/101-sunxi-h5-add-support-for-nanopi-r1s-h5.patch create mode 100644 target/linux/sunxi/patches-5.4/431-arm64-dts-allwinner-nanopi-r1s-h5-add-status-LED.patch diff --git a/target/linux/sunxi/base-files/etc/board.d/01_leds b/target/linux/sunxi/base-files/etc/board.d/01_leds index 45153b44dc..60783363de 100644 --- a/target/linux/sunxi/base-files/etc/board.d/01_leds +++ b/target/linux/sunxi/base-files/etc/board.d/01_leds @@ -7,7 +7,8 @@ boardname="${board##*,}" board_config_update case $board in -friendlyarm,nanopi-r1) +friendlyarm,nanopi-r1|\ +friendlyarm,nanopi-r1s-h5) ucidef_set_led_netdev "wan" "WAN" "nanopi:green:wan" "eth0" ucidef_set_led_netdev "lan" "LAN" "nanopi:green:lan" "eth1" ;; diff --git a/target/linux/sunxi/base-files/etc/board.d/02_network b/target/linux/sunxi/base-files/etc/board.d/02_network index d5c615e7f2..46ace1f67c 100644 --- a/target/linux/sunxi/base-files/etc/board.d/02_network +++ b/target/linux/sunxi/base-files/etc/board.d/02_network @@ -3,27 +3,54 @@ # . /lib/functions/uci-defaults.sh +. /lib/functions/system.sh + +sunxi_setup_interfaces() +{ + local board="$1" + + case "$board" in + friendlyarm,nanopi-r1|\ + friendlyarm,nanopi-r1s-h5) + ucidef_set_interfaces_lan_wan "eth1" "eth0" + ;; + lamobo,lamobo-r1) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan + ;; + olimex,a20-olinuxino-micro) + ucidef_set_interface_lan "wlan0" + ;; + xunlong,orangepi-r1) + ucidef_set_interfaces_lan_wan "eth0" "eth1" + ;; + *) + ucidef_set_interface_lan "eth0" + ;; + esac +} + +sunxi_setup_macs() +{ + local board="$1" + local lan_mac="" + local wan_mac="" + local label_mac="" + + case "$board" in + friendlyarm,nanopi-r1s-h5) + lan_mac=$(get_mac_binary "/sys/bus/i2c/devices/0-0051/eeprom" 0xfa) + ;; + esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac + [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac +} board_config_update - -case $(board_name) in -friendlyarm,nanopi-r1) - ucidef_set_interfaces_lan_wan "eth1" "eth0" - ;; -lamobo,lamobo-r1) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan - ;; -olimex,a20-olinuxino-micro) - ucidef_set_interface_lan "wlan0" - ;; -xunlong,orangepi-r1) - ucidef_set_interfaces_lan_wan "eth0" "eth1" - ;; -*) - ucidef_set_interface_lan "eth0" - ;; -esac - +board=$(board_name) +sunxi_setup_interfaces $board +sunxi_setup_macs $board board_config_flush exit 0 diff --git a/target/linux/sunxi/cortexa53/config-5.10 b/target/linux/sunxi/cortexa53/config-5.10 index f5f0ab066d..f2586949ce 100644 --- a/target/linux/sunxi/cortexa53/config-5.10 +++ b/target/linux/sunxi/cortexa53/config-5.10 @@ -26,6 +26,7 @@ CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y CONFIG_DMA_DIRECT_REMAP=y CONFIG_DWMAC_SUN8I=y +CONFIG_EEPROM_AT24=y # CONFIG_FLATMEM_MANUAL is not set CONFIG_FRAME_POINTER=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y diff --git a/target/linux/sunxi/cortexa53/config-5.4 b/target/linux/sunxi/cortexa53/config-5.4 index b0f92faf23..aa19a41622 100644 --- a/target/linux/sunxi/cortexa53/config-5.4 +++ b/target/linux/sunxi/cortexa53/config-5.4 @@ -69,6 +69,7 @@ CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y CONFIG_DMA_DIRECT_REMAP=y CONFIG_DRM_RCAR_WRITEBACK=y CONFIG_DWMAC_SUN8I=y +CONFIG_EEPROM_AT24=y CONFIG_EFI_EARLYCON=y # CONFIG_FLATMEM_MANUAL is not set CONFIG_FRAME_POINTER=y diff --git a/target/linux/sunxi/image/cortexa53.mk b/target/linux/sunxi/image/cortexa53.mk index 2d18b0b227..c88aee2d7c 100644 --- a/target/linux/sunxi/image/cortexa53.mk +++ b/target/linux/sunxi/image/cortexa53.mk @@ -40,6 +40,15 @@ define Device/friendlyarm_nanopi-neo2 endef TARGET_DEVICES += friendlyarm_nanopi-neo2 +define Device/friendlyarm_nanopi-r1s-h5 + DEVICE_VENDOR := FriendlyARM + DEVICE_MODEL := Nanopi R1S H5 + DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-usb-net-rtl8152 + SUPPORTED_DEVICES:=nanopi-r1s-h5 + $(Device/sun50i-h5) +endef +TARGET_DEVICES += friendlyarm_nanopi-r1s-h5 + define Device/libretech_all-h3-cc-h5 DEVICE_VENDOR := Libre Computer DEVICE_MODEL := ALL-H3-CC diff --git a/target/linux/sunxi/patches-5.10/101-sunxi-h5-add-support-for-nanopi-r1s-h5.patch b/target/linux/sunxi/patches-5.10/101-sunxi-h5-add-support-for-nanopi-r1s-h5.patch new file mode 100644 index 0000000000..e0c25bcb53 --- /dev/null +++ b/target/linux/sunxi/patches-5.10/101-sunxi-h5-add-support-for-nanopi-r1s-h5.patch @@ -0,0 +1,230 @@ +From 9962cb9be2db877c232aaf00db40125c0d7bf4bc Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Mon, 17 May 2021 00:35:22 +0800 +Subject: [PATCH] arm64: dts: allwinner: h5: Add NanoPi R1S H5 support + +The NanoPi R1S H5 is a open source board made by FriendlyElec. +It has the following features: + +- Allwinner H5, Quad-core Cortex-A53 +- 512MB DDR3 RAM +- 10/100/1000M Ethernet x 2 +- RTL8189ETV WiFi 802.11b/g/n +- USB 2.0 host port (A) +- MicroSD Slot +- Serial Debug Port +- 5V 2A DC power-supply + +Signed-off-by: Chukun Pan +Signed-off-by: Maxime Ripard +Link: https://lore.kernel.org/r/20210516163523.9484-2-amadeus@jmu.edu.cn +--- + arch/arm64/boot/dts/allwinner/Makefile | 1 + + .../dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 195 ++++++++++++++++++ + 2 files changed, 196 insertions(+) + create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts + +--- a/arch/arm64/boot/dts/allwinner/Makefile ++++ b/arch/arm64/boot/dts/allwinner/Makefile +@@ -24,6 +24,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-li + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-libretech-all-h5-cc.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo-plus2.dtb ++dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-r1s-h5.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus.dtb +--- /dev/null ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts +@@ -0,0 +1,191 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (C) 2021 Chukun Pan ++ * ++ * Based on sun50i-h5-nanopi-neo-plus2.dts, which is: ++ * Copyright (C) 2017 Antony Antony ++ * Copyright (C) 2016 ARM Ltd. ++ */ ++ ++/dts-v1/; ++#include "sun50i-h5.dtsi" ++#include "sun50i-h5-cpu-opp.dtsi" ++ ++#include ++#include ++ ++/ { ++ model = "FriendlyARM NanoPi R1S H5"; ++ compatible = "friendlyarm,nanopi-r1s-h5", "allwinner,sun50i-h5"; ++ ++ aliases { ++ ethernet0 = &emac; ++ ethernet1 = &rtl8189etv; ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ sys { ++ label = "nanopi:red:sys"; ++ gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ ++ lan { ++ label = "nanopi:green:lan"; ++ gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ wan { ++ label = "nanopi:green:wan"; ++ gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ r-gpio-keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ reg_gmac_3v3: gmac-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "gmac-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ startup-delay-us = <100000>; ++ enable-active-high; ++ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ reg_vcc3v3: vcc3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++ ++ reg_usb0_vbus: usb0-vbus { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb0-vbus"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ enable-active-high; ++ gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */ ++ status = "okay"; ++ }; ++ ++ vdd_cpux: gpio-regulator { ++ compatible = "regulator-gpio"; ++ regulator-name = "vdd-cpux"; ++ regulator-type = "voltage"; ++ regulator-boot-on; ++ regulator-always-on; ++ regulator-min-microvolt = <1100000>; ++ regulator-max-microvolt = <1300000>; ++ regulator-ramp-delay = <50>; /* 4ms */ ++ gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; ++ gpios-states = <0x1>; ++ states = <1100000 0x0>, <1300000 0x1>; ++ }; ++ ++ wifi_pwrseq: wifi_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ ++ post-power-on-delay-ms = <200>; ++ }; ++}; ++ ++&cpu0 { ++ cpu-supply = <&vdd_cpux>; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&ehci2 { ++ status = "okay"; ++}; ++ ++&emac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emac_rgmii_pins>; ++ phy-supply = <®_gmac_3v3>; ++ phy-handle = <&ext_rgmii_phy>; ++ phy-mode = "rgmii-id"; ++ status = "okay"; ++}; ++ ++&external_mdio { ++ ext_rgmii_phy: ethernet-phy@7 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <7>; ++ }; ++}; ++ ++&i2c0 { ++ status = "okay"; ++ ++ eeprom@51 { ++ compatible = "microchip,24c02"; ++ reg = <0x51>; ++ pagesize = <16>; ++ }; ++}; ++ ++&mmc0 { ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ ++ status = "okay"; ++}; ++ ++&mmc1 { ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc3v3>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ rtl8189etv: sdio_wifi@1 { ++ reg = <1>; ++ }; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&ohci2 { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pa_pins>; ++ status = "okay"; ++}; ++ ++&usb_otg { ++ dr_mode = "peripheral"; ++ status = "okay"; ++}; ++ ++&usbphy { ++ /* USB Type-A port's VBUS is always on */ ++ usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ ++ usb0_vbus-supply = <®_usb0_vbus>; ++ status = "okay"; ++}; diff --git a/target/linux/sunxi/patches-5.10/431-arm64-dts-allwinner-nanopi-r1s-h5-add-status-LED.patch b/target/linux/sunxi/patches-5.10/431-arm64-dts-allwinner-nanopi-r1s-h5-add-status-LED.patch new file mode 100644 index 0000000000..4a429c746e --- /dev/null +++ b/target/linux/sunxi/patches-5.10/431-arm64-dts-allwinner-nanopi-r1s-h5-add-status-LED.patch @@ -0,0 +1,35 @@ +From 1845163a052efac124f00656eb72f38947630a42 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Sun, 10 Oct 2021 21:50:18 +0800 +Subject: [PATCH] arm64: dts: allwinner: NanoPi R1S H5: add status LED aliases + +Use the SYS LED on the casing for showing system status. + +Signed-off-by: Chukun Pan +--- + arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts +@@ -22,6 +22,11 @@ + ethernet0 = &emac; + ethernet1 = &rtl8189etv; + serial0 = &uart0; ++ ++ led-boot = &led_sys; ++ led-failsafe = &led_sys; ++ led-running = &led_sys; ++ led-upgrade = &led_sys; + }; + + chosen { +@@ -31,7 +36,7 @@ + leds { + compatible = "gpio-leds"; + +- sys { ++ led_sys: sys { + label = "nanopi:red:sys"; + gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; diff --git a/target/linux/sunxi/patches-5.4/101-sunxi-h5-add-support-for-nanopi-r1s-h5.patch b/target/linux/sunxi/patches-5.4/101-sunxi-h5-add-support-for-nanopi-r1s-h5.patch new file mode 100644 index 0000000000..339eadcd23 --- /dev/null +++ b/target/linux/sunxi/patches-5.4/101-sunxi-h5-add-support-for-nanopi-r1s-h5.patch @@ -0,0 +1,229 @@ +From 9962cb9be2db877c232aaf00db40125c0d7bf4bc Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Mon, 17 May 2021 00:35:22 +0800 +Subject: [PATCH] arm64: dts: allwinner: h5: Add NanoPi R1S H5 support + +The NanoPi R1S H5 is a open source board made by FriendlyElec. +It has the following features: + +- Allwinner H5, Quad-core Cortex-A53 +- 512MB DDR3 RAM +- 10/100/1000M Ethernet x 2 +- RTL8189ETV WiFi 802.11b/g/n +- USB 2.0 host port (A) +- MicroSD Slot +- Serial Debug Port +- 5V 2A DC power-supply + +Signed-off-by: Chukun Pan +Signed-off-by: Maxime Ripard +Link: https://lore.kernel.org/r/20210516163523.9484-2-amadeus@jmu.edu.cn +--- + arch/arm64/boot/dts/allwinner/Makefile | 1 + + .../dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 195 ++++++++++++++++++ + 2 files changed, 196 insertions(+) + create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts + +--- a/arch/arm64/boot/dts/allwinner/Makefile ++++ b/arch/arm64/boot/dts/allwinner/Makefile +@@ -17,6 +17,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-em + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-libretech-all-h3-cc.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo-plus2.dtb ++dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-r1s-h5.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus.dtb +--- /dev/null ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts +@@ -0,0 +1,190 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (C) 2021 Chukun Pan ++ * ++ * Based on sun50i-h5-nanopi-neo-plus2.dts, which is: ++ * Copyright (C) 2017 Antony Antony ++ * Copyright (C) 2016 ARM Ltd. ++ */ ++ ++/dts-v1/; ++#include "sun50i-h5.dtsi" ++ ++#include ++#include ++ ++/ { ++ model = "FriendlyARM NanoPi R1S H5"; ++ compatible = "friendlyarm,nanopi-r1s-h5", "allwinner,sun50i-h5"; ++ ++ aliases { ++ ethernet0 = &emac; ++ ethernet1 = &rtl8189etv; ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ sys { ++ label = "nanopi:red:sys"; ++ gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ ++ lan { ++ label = "nanopi:green:lan"; ++ gpios = <&pio 0 9 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ wan { ++ label = "nanopi:green:wan"; ++ gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ r-gpio-keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ reg_gmac_3v3: gmac-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "gmac-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ startup-delay-us = <100000>; ++ enable-active-high; ++ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ reg_vcc3v3: vcc3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++ ++ reg_usb0_vbus: usb0-vbus { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb0-vbus"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ enable-active-high; ++ gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */ ++ status = "okay"; ++ }; ++ ++ vdd_cpux: gpio-regulator { ++ compatible = "regulator-gpio"; ++ regulator-name = "vdd-cpux"; ++ regulator-type = "voltage"; ++ regulator-boot-on; ++ regulator-always-on; ++ regulator-min-microvolt = <1100000>; ++ regulator-max-microvolt = <1300000>; ++ regulator-ramp-delay = <50>; /* 4ms */ ++ gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; ++ gpios-states = <0x1>; ++ states = <1100000 0x0>, <1300000 0x1>; ++ }; ++ ++ wifi_pwrseq: wifi_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ ++ post-power-on-delay-ms = <200>; ++ }; ++}; ++ ++&cpu0 { ++ cpu-supply = <&vdd_cpux>; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&ehci2 { ++ status = "okay"; ++}; ++ ++&emac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emac_rgmii_pins>; ++ phy-supply = <®_gmac_3v3>; ++ phy-handle = <&ext_rgmii_phy>; ++ phy-mode = "rgmii"; ++ status = "okay"; ++}; ++ ++&external_mdio { ++ ext_rgmii_phy: ethernet-phy@7 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <7>; ++ }; ++}; ++ ++&i2c0 { ++ status = "okay"; ++ ++ eeprom@51 { ++ compatible = "microchip,24c02"; ++ reg = <0x51>; ++ pagesize = <16>; ++ }; ++}; ++ ++&mmc0 { ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ ++ status = "okay"; ++}; ++ ++&mmc1 { ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc3v3>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ rtl8189etv: sdio_wifi@1 { ++ reg = <1>; ++ }; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&ohci2 { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pa_pins>; ++ status = "okay"; ++}; ++ ++&usb_otg { ++ dr_mode = "peripheral"; ++ status = "okay"; ++}; ++ ++&usbphy { ++ /* USB Type-A port's VBUS is always on */ ++ usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ ++ usb0_vbus-supply = <®_usb0_vbus>; ++ status = "okay"; ++}; diff --git a/target/linux/sunxi/patches-5.4/431-arm64-dts-allwinner-nanopi-r1s-h5-add-status-LED.patch b/target/linux/sunxi/patches-5.4/431-arm64-dts-allwinner-nanopi-r1s-h5-add-status-LED.patch new file mode 100644 index 0000000000..8281f78e06 --- /dev/null +++ b/target/linux/sunxi/patches-5.4/431-arm64-dts-allwinner-nanopi-r1s-h5-add-status-LED.patch @@ -0,0 +1,35 @@ +From 1845163a052efac124f00656eb72f38947630a42 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Sun, 10 Oct 2021 21:50:18 +0800 +Subject: [PATCH] arm64: dts: allwinner: NanoPi R1S H5: add status LED aliases + +Use the SYS LED on the casing for showing system status. + +Signed-off-by: Chukun Pan +--- + arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts +@@ -21,6 +21,11 @@ + ethernet0 = &emac; + ethernet1 = &rtl8189etv; + serial0 = &uart0; ++ ++ led-boot = &led_sys; ++ led-failsafe = &led_sys; ++ led-running = &led_sys; ++ led-upgrade = &led_sys; + }; + + chosen { +@@ -30,7 +35,7 @@ + leds { + compatible = "gpio-leds"; + +- sys { ++ led_sys: sys { + label = "nanopi:red:sys"; + gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; From 1b18195f59b09844ab8fdfd669bc506c25df111b Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Tue, 19 Oct 2021 18:50:20 +0800 Subject: [PATCH 34/65] sunxi: Nanopi R1S H5: enable LAN LED configuration This enables the LEDs on the LAN interfaces. Signed-off-by: Chukun Pan --- ...OF-node-for-USB-eth-on-NanoPi-R1S-H5.patch | 30 +++++++++++++++++++ ...OF-node-for-USB-eth-on-NanoPi-R1S-H5.patch | 30 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 target/linux/sunxi/patches-5.10/102-sunxi-add-OF-node-for-USB-eth-on-NanoPi-R1S-H5.patch create mode 100644 target/linux/sunxi/patches-5.4/102-sunxi-add-OF-node-for-USB-eth-on-NanoPi-R1S-H5.patch diff --git a/target/linux/sunxi/patches-5.10/102-sunxi-add-OF-node-for-USB-eth-on-NanoPi-R1S-H5.patch b/target/linux/sunxi/patches-5.10/102-sunxi-add-OF-node-for-USB-eth-on-NanoPi-R1S-H5.patch new file mode 100644 index 0000000000..e14311aa64 --- /dev/null +++ b/target/linux/sunxi/patches-5.10/102-sunxi-add-OF-node-for-USB-eth-on-NanoPi-R1S-H5.patch @@ -0,0 +1,30 @@ +From a896bc1d79e3c00f0aacfe225499d811775616f3 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Sun, 10 Oct 2021 21:50:17 +0800 +Subject: [PATCH] arm64: allwinner: add OF node for USB eth on NanoPi R1S H5 + +This adds the OF node for the USB3 ethernet adapter on the FriendlyARM +NanoPi R1S H5. Add the correct value for the RTL8153 LED configuration +register to match the blink behavior of the other port on the device. + +Signed-off-by: Chukun Pan +--- + arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts +@@ -112,6 +112,13 @@ + + &ehci1 { + status = "okay"; ++ ++ usb-eth@1 { ++ compatible = "realtek,rtl8153"; ++ reg = <1>; ++ ++ realtek,led-data = <0x78>; ++ }; + }; + + &ehci2 { diff --git a/target/linux/sunxi/patches-5.4/102-sunxi-add-OF-node-for-USB-eth-on-NanoPi-R1S-H5.patch b/target/linux/sunxi/patches-5.4/102-sunxi-add-OF-node-for-USB-eth-on-NanoPi-R1S-H5.patch new file mode 100644 index 0000000000..1ee240afb5 --- /dev/null +++ b/target/linux/sunxi/patches-5.4/102-sunxi-add-OF-node-for-USB-eth-on-NanoPi-R1S-H5.patch @@ -0,0 +1,30 @@ +From a896bc1d79e3c00f0aacfe225499d811775616f3 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Sun, 10 Oct 2021 21:50:17 +0800 +Subject: [PATCH] arm64: allwinner: add OF node for USB eth on NanoPi R1S H5 + +This adds the OF node for the USB3 ethernet adapter on the FriendlyARM +NanoPi R1S H5. Add the correct value for the RTL8153 LED configuration +register to match the blink behavior of the other port on the device. + +Signed-off-by: Chukun Pan +--- + arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts +@@ -111,6 +111,13 @@ + + &ehci1 { + status = "okay"; ++ ++ usb-eth@1 { ++ compatible = "realtek,rtl8153"; ++ reg = <1>; ++ ++ realtek,led-data = <0x78>; ++ }; + }; + + &ehci2 { From 1b814974e12ede0ade19302332d49336ae208f08 Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Fri, 23 Apr 2021 18:36:15 +0900 Subject: [PATCH 35/65] build: move elecom-wrc-gs-factory to image-commands.mk ELECOM WRC-X3200GST3 uses the same header/footer as WRC-GS/GST devices in ramips/mt7621 subtarget, so move "Build/elecom-wrc-gs-factory" to image-commands.mk to use from mediatek/mt7622 subtarget. Signed-off-by: INAGAKI Hiroshi --- include/image-commands.mk | 13 +++++++++++++ target/linux/ramips/image/mt7621.mk | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/image-commands.mk b/include/image-commands.mk index 1c9e8c12bb..91865e1e7e 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -187,6 +187,19 @@ define Build/elecom-product-header mv $(fw).new $(fw) endef +define Build/elecom-wrc-gs-factory + $(eval product=$(word 1,$(1))) + $(eval version=$(word 2,$(1))) + $(eval hash_opt=$(word 3,$(1))) + $(MKHASH) md5 $(hash_opt) $@ >> $@ + ( \ + echo -n "ELECOM $(product) v$(version)" | \ + dd bs=32 count=1 conv=sync; \ + dd if=$@; \ + ) > $@.new + mv $@.new $@ +endef + define Build/elx-header $(eval hw_id=$(word 1,$(1))) $(eval xor_pattern=$(word 2,$(1))) diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index c81e79c900..a0236234d1 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -9,19 +9,6 @@ DEFAULT_SOC := mt7621 KERNEL_DTB += -d21 DEVICE_VARS += ELECOM_HWNAME LINKSYS_HWNAME -define Build/elecom-wrc-gs-factory - $(eval product=$(word 1,$(1))) - $(eval version=$(word 2,$(1))) - $(eval hash_opt=$(word 3,$(1))) - $(MKHASH) md5 $(hash_opt) $@ >> $@ - ( \ - echo -n "ELECOM $(product) v$(version)" | \ - dd bs=32 count=1 conv=sync; \ - dd if=$@; \ - ) > $@.new - mv $@.new $@ -endef - define Build/gemtek-trailer printf "%s%08X" ".GEMTEK." "$$(cksum $@ | cut -d ' ' -f1)" >> $@ endef From b4f2e523094afc099e36111b7d942c5f39a500b5 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sat, 30 Oct 2021 19:02:06 +0200 Subject: [PATCH 36/65] firmware-utils: bump to latest git HEAD 7073760 ramips: add support for TP-Link RE305 v3 86739f2 Add more missing include for byte swap operations Signed-off-by: Adrian Schmutzler --- tools/firmware-utils/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 5929c468db..d980ddfda1 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=firmware-utils -PKG_RELEASE:=13 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git -PKG_SOURCE_DATE:=2021-10-05 -PKG_SOURCE_VERSION:=f9ad6b335e0fd699398370d4c6e2e45e1c459dea -PKG_MIRROR_HASH:=a1a5c22e8a05b4521e7f6ec20cfa443e9f33a9c07e30718e2f328ee99cebf6cf +PKG_SOURCE_DATE:=2021-10-30 +PKG_SOURCE_VERSION:=70737600d9385486df5c1970b4ab41ccb17006fa +PKG_MIRROR_HASH:=a2c64e34827992c0f0c71974aa0b66e0a2aafb38a838649500ecd78095098d4c include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk From c12ef2f76098923fc08ef9d7aa3d080b6e72dfb1 Mon Sep 17 00:00:00 2001 From: Michal Kozuch Date: Fri, 19 Mar 2021 20:20:11 +0100 Subject: [PATCH 37/65] ramips: add support for TP-Link RE305 v3 Specs (same as in v1): - MT7628AN (575 MHz) - 64MB RAM - 8MB of flash (SPI NOR) - 1x 10/100Mbps Ethernet (MT7628AN built-in switch with vlan) - 1x 2.4GHz wifi (MT7628AN) - 1x 5Ghz wifi (MT7612E) - 4x LEDs (5 GPIO-controlled) - 1x reset button - 1x WPS button The only and important difference between v1 & v3 is in flash memory layout, so pls don't interchange these 2 builds! Installation through web-ui (on OEM factory firmware): 1. Visit http://tplinkrepeater.net or the configured IP address of your RE305 v3 (default 192.168.0.254). 2. Log in with the password you've set during initial setup of the RE305 (there is no default password). 3. Go to Settings -> System Tools -> Firmware upgrade 4. Click Browse and select the OpenWRT image with factory.bin suffix (not sysupgrade.bin) 5. A window with a progress bar will appear. Wait until it completes. 6. The RE305 will reboot into OpenWRT and serve DHCP requests on the ethernet port. 7. Connect an RJ45 cable from the RE305 to your computer and access LuCI at http://192.168.1.1/ to configure (or use ssh). Disassembly: Just unscrew 4 screws in the corners & take off the back cover. Serial is exposed to the right side of the main board (in the middle) and marked with TX/RX/3V3/GND, but the holes are filled with solder. Installation through serial: 1. connect trough serial (1n8, baudrate=57600) 2. setup the TFTP server and connect it via ethernet (ipaddr=192.168.0.254 of device, serverip=192.168.0.184 - your pc) 3. boot from a initramfs image first (choose 1 in the bootloader options) 4. test it a bit with that, then proceed to run sysupgrade build MAC addresses as verified by OEM firmware: use OpenWrt address reference LAN eth0 *:d2 label 2g wlan0 *:d1 label - 1 5g wlan1 *:d0 label - 2 The label MAC address can be found in config 0x2008. Signed-off-by: Michal Kozuch [redistribute WLAN node properties between DTS/DTSI, remove compatible on DTSI, fix indent/wrapping, split out firmware-utils change] Signed-off-by: Adrian Schmutzler --- .../ramips/dts/mt7628an_tplink_re305-v1.dts | 88 ++----------------- .../ramips/dts/mt7628an_tplink_re305-v3.dts | 79 +++++++++++++++++ .../ramips/dts/mt7628an_tplink_re305.dtsi | 86 ++++++++++++++++++ target/linux/ramips/image/mt76x8.mk | 10 +++ .../mt76x8/base-files/etc/board.d/02_network | 1 + 5 files changed, 183 insertions(+), 81 deletions(-) create mode 100644 target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts create mode 100644 target/linux/ramips/dts/mt7628an_tplink_re305.dtsi diff --git a/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts b/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts index 6ac3730194..7948668b84 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_re305-v1.dts @@ -1,68 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "mt7628an.dtsi" - -#include -#include +#include "mt7628an_tplink_re305.dtsi" / { compatible = "tplink,re305-v1", "mediatek,mt7628an-soc"; model = "TP-Link RE305 v1"; - - aliases { - led-boot = &led_power; - led-failsafe = &led_power; - led-running = &led_power; - led-upgrade = &led_power; - label-mac-device = ðernet; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - gpios = <&gpio 37 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - - wps { - label = "wps"; - gpios = <&gpio 38 GPIO_ACTIVE_LOW>; - linux,code = ; - }; - }; - - leds { - compatible = "gpio-leds"; - - led_power: power { - label = "blue:power"; - gpios = <&gpio 39 GPIO_ACTIVE_LOW>; - }; - - wlan2g { - label = "blue:wlan2g"; - gpios = <&gpio 41 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - - wlan5g { - label = "blue:wlan5g"; - gpios = <&gpio 40 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1tpt"; - }; - - rssi1 { - label = "red:rssi"; - gpios = <&gpio 43 GPIO_ACTIVE_LOW>; - }; - - rssi2 { - label = "blue:rssi"; - gpios = <&gpio 42 GPIO_ACTIVE_LOW>; - }; - }; }; &spi0 { @@ -110,33 +52,17 @@ }; }; -&state_default { - gpio { - groups = "refclk", "wdt", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an"; - function = "gpio"; - }; -}; +&wlan5g { + mediatek,mtd-eeprom = <&radio 0x8000>; -&pcie { - status = "okay"; -}; - -&pcie0 { - mt76@0,0 { - compatible = "mediatek,mt76"; - reg = <0x0000 0 0 0 0>; - mediatek,mtd-eeprom = <&radio 0x8000>; - ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_config_10008>; - nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; - }; + nvmem-cells = <&macaddr_config_10008>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; }; &wmac { - status = "okay"; - mediatek,mtd-eeprom = <&radio 0x0>; + nvmem-cells = <&macaddr_config_10008>; nvmem-cell-names = "mac-address"; mac-address-increment = <1>; diff --git a/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts b/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts new file mode 100644 index 0000000000..652aebec83 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_tplink_re305-v3.dts @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an_tplink_re305.dtsi" + +/ { + compatible = "tplink,re305-v3", "mediatek,mt7628an-soc"; + model = "TP-Link RE305 v3"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x20000>; + read-only; + }; + + partition@20000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x20000 0x7a0000>; + }; + + config: partition@7c0000 { + label = "config"; + reg = <0x7c0000 0x30000>; + read-only; + }; + + radio: partition@7f0000 { + label = "radio"; + reg = <0x7f0000 0x10000>; + read-only; + }; + }; + }; +}; + +&wlan5g { + mediatek,mtd-eeprom = <&radio 0x8000>; + + nvmem-cells = <&macaddr_config_2008>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-2)>; +}; + +&wmac { + mediatek,mtd-eeprom = <&radio 0x0>; + + nvmem-cells = <&macaddr_config_2008>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; +}; + +ðernet { + nvmem-cells = <&macaddr_config_2008>; + nvmem-cell-names = "mac-address"; +}; + +&config { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_2008: macaddr@2008 { + reg = <0x2008 0x6>; + }; +}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_re305.dtsi b/target/linux/ramips/dts/mt7628an_tplink_re305.dtsi new file mode 100644 index 0000000000..029b955911 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_tplink_re305.dtsi @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = ðernet; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 37 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "blue:power"; + gpios = <&gpio 39 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "blue:wlan2g"; + gpios = <&gpio 41 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g { + label = "blue:wlan5g"; + gpios = <&gpio 40 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + rssi1 { + label = "red:rssi"; + gpios = <&gpio 43 GPIO_ACTIVE_LOW>; + }; + + rssi2 { + label = "blue:rssi"; + gpios = <&gpio 42 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&state_default { + gpio { + groups = "refclk", "wdt", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an"; + function = "gpio"; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wlan5g: mt76@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&wmac { + status = "okay"; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 7862f7b799..5f5d281d5c 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -512,6 +512,16 @@ define Device/tplink_re305-v1 endef TARGET_DEVICES += tplink_re305-v1 +define Device/tplink_re305-v3 + $(Device/tplink-safeloader) + IMAGE_SIZE := 7808k + DEVICE_MODEL := RE305 + DEVICE_VARIANT := v3 + DEVICE_PACKAGES := kmod-mt76x2 + TPLINK_BOARD_ID := RE305-V3 +endef +TARGET_DEVICES += tplink_re305-v3 + define Device/tplink_tl-mr3020-v3 $(Device/tplink-v2) IMAGE_SIZE := 7808k diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 7cdf27c004..638b8f2181 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -25,6 +25,7 @@ ramips_setup_interfaces() tplink,re200-v4|\ tplink,re220-v2|\ tplink,re305-v1|\ + tplink,re305-v3|\ tplink,tl-mr3020-v3|\ tplink,tl-wr802n-v4|\ tplink,tl-wa801nd-v5|\ From f44e933458b13ab99c76dac840908104814442c8 Mon Sep 17 00:00:00 2001 From: Ansuel Smith Date: Thu, 22 Jul 2021 13:35:42 +0200 Subject: [PATCH 38/65] ipq806x: provide WiFI mac-addresses from dts Use nvmem framework for supported mac-address stored in nvmem cells and drop mac patch function for hotplug script for supported devices. Signed-off-by: Ansuel Smith [rebase, move to correct node for d7800, include xr500] Signed-off-by: Adrian Schmutzler --- .../etc/hotplug.d/firmware/11-ath10k-caldata | 12 ------ .../arm/boot/dts/qcom-ipq8062-wg2600hp3.dts | 14 +++++++ .../boot/dts/qcom-ipq8064-ad7200-c2600.dtsi | 31 +++++++++++++++ .../arch/arm/boot/dts/qcom-ipq8064-d7800.dts | 32 ++++++++++++++++ .../arm/boot/dts/qcom-ipq8064-r7500v2.dts | 32 ++++++++++++++++ .../arm/boot/dts/qcom-ipq8064-vr2600v.dts | 31 +++++++++++++++ .../arm/boot/dts/qcom-ipq8064-wg2600hp.dts | 38 +++++++++++++++++++ .../arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts | 38 +++++++++++++++++++ 8 files changed, 216 insertions(+), 12 deletions(-) diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index a1cbe0a8f6..2746ef1e2a 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -22,7 +22,6 @@ case "$FIRMWARE" in ;; buffalo,wxr-2533dhp) caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary ART 0x1e) ;; edgecore,ecw5410) if [ -b "$(find_mtd_part 0:art)" ]; then @@ -40,26 +39,21 @@ case "$FIRMWARE" in nec,wg2600hp |\ nec,wg2600hp3) caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary PRODUCTDATA 0x12) ;; netgear,d7800 |\ netgear,r7500v2 |\ netgear,r7800) caldata_extract "art" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) 1) ;; netgear,xr500) caldata_extract "art" 0x1000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary art 0xc) ;; tplink,ad7200 |\ tplink,c2600) caldata_extract "radio" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 0x8) -1) ;; tplink,vr2600v) caldata_extract "ART" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 0x0) -1) ;; zyxel,nbg6817) if [ -b "$(find_mtd_part 0:art)" ]; then @@ -88,7 +82,6 @@ case "$FIRMWARE" in ;; buffalo,wxr-2533dhp) caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary ART 0x18) ;; linksys,ea7500-v1 |\ linksys,ea8500) @@ -98,26 +91,21 @@ case "$FIRMWARE" in nec,wg2600hp |\ nec,wg2600hp3) caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary PRODUCTDATA 0xc) ;; netgear,d7800 |\ netgear,r7500v2 |\ netgear,r7800) caldata_extract "art" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) 2) ;; netgear,xr500) caldata_extract "art" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary art 0x0) ;; tplink,ad7200 |\ tplink,c2600) caldata_extract "radio" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary default-mac 0x8) ;; tplink,vr2600v) caldata_extract "ART" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_binary default-mac 0x0) ;; zyxel,nbg6817) if [ -b "$(find_mtd_part 0:art)" ]; then diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts index c6feb71a8e..8f1bb74540 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts @@ -359,6 +359,9 @@ reg = <0x00010000 0 0 0 0>; qcom,ath10k-calibration-variant = "NEC-Platforms-WG2600HP3"; + + nvmem-cells = <&macaddr_PRODUCTDATA_12>; + nvmem-cell-names = "mac-address"; }; }; }; @@ -379,6 +382,9 @@ ieee80211-freq-limit = <2400000 2483000>; qcom,ath10k-calibration-variant = "NEC-Platforms-WG2600HP3"; + + nvmem-cells = <&macaddr_PRODUCTDATA_c>; + nvmem-cell-names = "mac-address"; }; }; }; @@ -451,4 +457,12 @@ macaddr_factory_6: macaddr@6 { reg = <0x6 0x6>; }; + + macaddr_PRODUCTDATA_c: macaddr@c { + reg = <0xc 0x6>; + }; + + macaddr_PRODUCTDATA_12: macaddr@12 { + reg = <0x12 0x6>; + }; }; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi index cd6c0ea77d..5842c34c16 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi @@ -255,11 +255,42 @@ &pcie0 { status = "okay"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_defaultmac_8>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; + }; + }; }; &pcie1 { status = "okay"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_defaultmac_8>; + nvmem-cell-names = "mac-address"; + }; + }; }; &mdio0 { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts index 6e022cece0..940e01439d 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts @@ -175,6 +175,22 @@ reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_HIGH>; pinctrl-0 = <&pcie0_pins>; pinctrl-names = "default"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(1)>; + }; + }; }; &pcie1 { @@ -183,6 +199,22 @@ pinctrl-0 = <&pcie1_pins>; pinctrl-names = "default"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(2)>; + }; + }; }; &nand_controller { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts index 0f22480434..f2bd1705b5 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts @@ -186,6 +186,22 @@ reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_LOW>; pinctrl-0 = <&pcie0_pins>; pinctrl-names = "default"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(1)>; + }; + }; }; &pcie1 { @@ -194,6 +210,22 @@ pinctrl-0 = <&pcie1_pins>; pinctrl-names = "default"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(2)>; + }; + }; }; &nand_controller { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts index 54ae07590a..863c5d7b1c 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts @@ -284,11 +284,42 @@ &pcie0 { status = "okay"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_defaultmac_0>; + nvmem-cell-names = "mac-address"; + mtd-mac-address-increment = <(-1)>; + }; + }; }; &pcie1 { status = "okay"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_defaultmac_0>; + nvmem-cell-names = "mac-address"; + }; + }; }; &mdio0 { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts index 7148fdf143..45da4a2b11 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts @@ -320,11 +320,41 @@ &pcie0 { status = "okay"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_PRODUCTDATA_12>; + nvmem-cell-names = "mac-address"; + }; + }; }; &pcie1 { status = "okay"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_PRODUCTDATA_c>; + nvmem-cell-names = "mac-address"; + }; + }; }; &qcom_pinmux { @@ -395,4 +425,12 @@ macaddr_PRODUCTDATA_6: macaddr@6 { reg = <0x6 0x6>; }; + + macaddr_PRODUCTDATA_c: macaddr@c { + reg = <0xc 0x6>; + }; + + macaddr_PRODUCTDATA_12: macaddr@12 { + reg = <0x12 0x6>; + }; }; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts index 1cf5e3452f..4b4e8736d4 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts @@ -395,11 +395,41 @@ &pcie0 { status = "okay"; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_ART_1e>; + nvmem-cell-names = "mac-address"; + }; + }; }; &pcie1 { status = "okay"; max-link-speed = <1>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "pci168c,0040"; + reg = <0x00010000 0 0 0 0>; + + nvmem-cells = <&macaddr_ART_18>; + nvmem-cell-names = "mac-address"; + }; + }; }; &qcom_pinmux { @@ -479,4 +509,12 @@ macaddr_ART_6: macaddr@6 { reg = <0x6 0x6>; }; + + macaddr_ART_18: macaddr@18 { + reg = <0x18 0x6>; + }; + + macaddr_ART_1e: macaddr@1e { + reg = <0x1e 0x6>; + }; }; From 6a27e8036e63f2477333c324ae41f038e9ac6297 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sat, 30 Oct 2021 20:06:58 +0200 Subject: [PATCH 39/65] ipq806x: remove transition workarounds for qcom-smem partitions The out-of-tree qcom-smem patches traditionally displayed mtd partition names in upper case, starting with the new mainline qcom-smem support in kernel v5.10, it switched to normalizing the partition names to lower case. While both 5.4 and 5.10 were supported in the target, we carried a workaround to support both of them. Since the target has dropped 5.4 recently, those can be removed now. Ref: 2db9dded0a1a ("ipq806x: nbg6817: case-insensitive qcom-smem partitions") 435dc2e77e3b ("ipq806x: ecw5410: case-insensitive qcom-smem partitions") f70e11cd974e ("ipq806x: g10: case-insensitive qcom-smem partitions") Signed-off-by: Adrian Schmutzler --- .../ipq806x/base-files/etc/board.d/02_network | 13 +---- .../etc/hotplug.d/firmware/11-ath10k-caldata | 48 ++++--------------- .../ipq806x/base-files/lib/upgrade/asrock.sh | 2 - .../ipq806x/base-files/lib/upgrade/zyxel.sh | 3 -- 4 files changed, 10 insertions(+), 56 deletions(-) diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index bb77332ef9..a75d32ab6f 100644 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -29,14 +29,8 @@ tplink,vr2600v) ;; edgecore,ecw5410) ucidef_set_interfaces_lan_wan "eth1" "eth0" - if [ -b "$(find_mtd_part 0:art)" ]; then - ucidef_set_interface_macaddr "lan" "$(mtd_get_mac_binary "0:art" 0x6)" - ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary "0:art" 0x0)" - else - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - ucidef_set_interface_macaddr "lan" "$(mtd_get_mac_binary "0:ART" 0x6)" - ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary "0:ART" 0x0)" - fi + ucidef_set_interface_macaddr "lan" "$(mtd_get_mac_binary "0:art" 0x6)" + ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary "0:art" 0x0)" ;; linksys,ea7500-v1) hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr) @@ -81,9 +75,6 @@ ubnt,unifi-ac-hd) ;; zyxel,nbg6817) hw_mac_addr=$(mtd_get_mac_ascii 0:appsblenv ethaddr) - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - [ -n "$hw_mac_addr" ] || \ - hw_mac_addr=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0" ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 2)" diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 2746ef1e2a..c8924df92f 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -13,23 +13,13 @@ case "$FIRMWARE" in caldata_extract "0:ART" 0x1000 0x2f20 ;; asrock,g10) - if [ -b "$(find_mtd_part 0:art)" ]; then - caldata_extract "0:art" 0x1000 0x2f20 - else - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - caldata_extract "0:ART" 0x1000 0x2f20 - fi + caldata_extract "0:art" 0x1000 0x2f20 ;; buffalo,wxr-2533dhp) caldata_extract "ART" 0x1000 0x2f20 ;; edgecore,ecw5410) - if [ -b "$(find_mtd_part 0:art)" ]; then - caldata_extract "0:art" 0x1000 0x2f20 - else - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - caldata_extract "0:ART" 0x1000 0x2f20 - fi + caldata_extract "0:art" 0x1000 0x2f20 ;; linksys,ea7500-v1 |\ linksys,ea8500) @@ -56,14 +46,8 @@ case "$FIRMWARE" in caldata_extract "ART" 0x1000 0x2f20 ;; zyxel,nbg6817) - if [ -b "$(find_mtd_part 0:art)" ]; then - caldata_extract "0:art" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) 1) - else - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - caldata_extract "0:ART" 0x1000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) 1) - fi + caldata_extract "0:art" 0x1000 0x2f20 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) 1) ;; esac ;; @@ -73,12 +57,7 @@ case "$FIRMWARE" in caldata_extract "0:ART" 0x5000 0x2f20 ;; asrock,g10) - if [ -b "$(find_mtd_part 0:art)" ]; then - caldata_extract "0:art" 0x5000 0x2f20 - else - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - caldata_extract "0:ART" 0x5000 0x2f20 - fi + caldata_extract "0:art" 0x5000 0x2f20 ;; buffalo,wxr-2533dhp) caldata_extract "ART" 0x5000 0x2f20 @@ -108,26 +87,15 @@ case "$FIRMWARE" in caldata_extract "ART" 0x5000 0x2f20 ;; zyxel,nbg6817) - if [ -b "$(find_mtd_part 0:art)" ]; then - caldata_extract "0:art" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_ascii 0:appsblenv ethaddr) - else - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - caldata_extract "0:ART" 0x5000 0x2f20 - ath10k_patch_mac $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) - fi + caldata_extract "0:art" 0x5000 0x2f20 + ath10k_patch_mac $(mtd_get_mac_ascii 0:appsblenv ethaddr) ;; esac ;; "ath10k/pre-cal-pci-0002:01:00.0.bin") case $board in edgecore,ecw5410) - if [ -b "$(find_mtd_part 0:art)" ]; then - caldata_extract "0:art" 0x5000 0x2f20 - else - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - caldata_extract "0:ART" 0x5000 0x2f20 - fi + caldata_extract "0:art" 0x5000 0x2f20 ;; esac ;; diff --git a/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh b/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh index 8be737d2da..9645b64671 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/asrock.sh @@ -2,8 +2,6 @@ asrock_bootconfig_mangle() { local mtdnum="$(find_mtd_index 0:bootconfig)" - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - [ -n "$mtdnum" ] || mtdnum="$(find_mtd_index 0:BOOTCONFIG)" if [ -z "$mtdnum" ]; then echo "cannot find bootconfig mtd partition" diff --git a/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh b/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh index 50f8a3ceaf..f5501822f3 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/zyxel.sh @@ -91,9 +91,6 @@ zyxel_do_upgrade() { case "$board" in zyxel,nbg6817) local dualflagmtd="$(find_mtd_part 0:dual_flag)" - # XXX: drop upper case after kernel v5.4 is gone (qcom-smem) - [ -b $dualflagmtd ] || \ - dualflagmtd="$(find_mtd_part 0:DUAL_FLAG)" [ -b $dualflagmtd ] || return 1 case "$rootfs" in From fbddb384422c3c9583b3112dad6387d0e87dea74 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sat, 30 Oct 2021 20:16:21 +0200 Subject: [PATCH 40/65] ipq806x: consolidate 11-ath10k-caldata After the ath10k_patch_mac lines have been removed, a lot of blocks can be consolidated. Signed-off-by: Adrian Schmutzler --- .../etc/hotplug.d/firmware/11-ath10k-caldata | 40 ++++++------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index c8924df92f..87c4794552 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -12,29 +12,24 @@ case "$FIRMWARE" in askey,rt4230w-rev6) caldata_extract "0:ART" 0x1000 0x2f20 ;; - asrock,g10) - caldata_extract "0:art" 0x1000 0x2f20 - ;; - buffalo,wxr-2533dhp) - caldata_extract "ART" 0x1000 0x2f20 - ;; + asrock,g10 |\ edgecore,ecw5410) caldata_extract "0:art" 0x1000 0x2f20 ;; + buffalo,wxr-2533dhp |\ + nec,wg2600hp |\ + nec,wg2600hp3 |\ + tplink,vr2600v) + caldata_extract "ART" 0x1000 0x2f20 + ;; linksys,ea7500-v1 |\ linksys,ea8500) caldata_extract "art" 0x1000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 1) ;; - nec,wg2600hp |\ - nec,wg2600hp3) - caldata_extract "ART" 0x1000 0x2f20 - ;; netgear,d7800 |\ netgear,r7500v2 |\ - netgear,r7800) - caldata_extract "art" 0x1000 0x2f20 - ;; + netgear,r7800 |\ netgear,xr500) caldata_extract "art" 0x1000 0x2f20 ;; @@ -42,9 +37,6 @@ case "$FIRMWARE" in tplink,c2600) caldata_extract "radio" 0x1000 0x2f20 ;; - tplink,vr2600v) - caldata_extract "ART" 0x1000 0x2f20 - ;; zyxel,nbg6817) caldata_extract "0:art" 0x1000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) 1) @@ -59,7 +51,10 @@ case "$FIRMWARE" in asrock,g10) caldata_extract "0:art" 0x5000 0x2f20 ;; - buffalo,wxr-2533dhp) + buffalo,wxr-2533dhp |\ + nec,wg2600hp |\ + nec,wg2600hp3 |\ + tplink,vr2600v) caldata_extract "ART" 0x5000 0x2f20 ;; linksys,ea7500-v1 |\ @@ -67,15 +62,9 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 2) ;; - nec,wg2600hp |\ - nec,wg2600hp3) - caldata_extract "ART" 0x5000 0x2f20 - ;; netgear,d7800 |\ netgear,r7500v2 |\ - netgear,r7800) - caldata_extract "art" 0x5000 0x2f20 - ;; + netgear,r7800 |\ netgear,xr500) caldata_extract "art" 0x5000 0x2f20 ;; @@ -83,9 +72,6 @@ case "$FIRMWARE" in tplink,c2600) caldata_extract "radio" 0x5000 0x2f20 ;; - tplink,vr2600v) - caldata_extract "ART" 0x5000 0x2f20 - ;; zyxel,nbg6817) caldata_extract "0:art" 0x5000 0x2f20 ath10k_patch_mac $(mtd_get_mac_ascii 0:appsblenv ethaddr) From e06aaba4e3bef4ebd3e2b153dbc5e04dd5ba92e1 Mon Sep 17 00:00:00 2001 From: Jani Partanen Date: Mon, 18 Oct 2021 02:12:27 +0300 Subject: [PATCH 41/65] ramips: fix LAVA LR-25G001 broken wifi led triggers LED labels for this device are different in 01_leds file and in device DTS. Switch to DT triggers, which works on Telewell TW-4 (LTE) clone device. This has not been tested on the LR-25G001 itself, just on the clone mentioned above. Fixes: 20b09a2125f5 ("ramips: add support for Lava LR-25G001") Signed-off-by: Jani Partanen [rephrase commit title/message] Signed-off-by: Adrian Schmutzler --- target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts | 2 ++ target/linux/ramips/mt7620/base-files/etc/board.d/01_leds | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts index 1966e4cffd..b7fa78661e 100644 --- a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts +++ b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts @@ -41,11 +41,13 @@ wifi2g { label = "green:wifi2g"; gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; }; wifi5g { label = "green:wifi5g"; gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; }; }; diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds index ff3a5c8c0c..694f3d1541 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds @@ -143,10 +143,6 @@ kingston,mlwg2|\ sanlinking,d240) ucidef_set_led_netdev "wifi_led" "wifi" "blue:wifi" "wlan0" ;; -lava,lr-25g001) - ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "green:wlan2g" "wlan1" - ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "green:wlan5g" "wlan0" - ;; lenovo,newifi-y1) ucidef_set_led_netdev "wifi" "WIFI" "blue:wifi" "wlan1" ucidef_set_led_netdev "wifi5g" "WIFI5G" "blue:wifi5g" "wlan0" From 25e15f5951cf232b1a247a3df8f9120f2ecd3fe5 Mon Sep 17 00:00:00 2001 From: Dominick Grift Date: Fri, 22 Oct 2021 13:51:11 +0200 Subject: [PATCH 42/65] libsepol: update to version 3.3 Update VERSIONs to 3.3 for release. libsepol/cil: Fix potential undefined shifts libsepol: Fix potential undefined shifts Update VERSIONs to 3.3-rc3 for release. libsepol/cil: Do not skip macros when resolving until later passes libsepol/cil: Limit the amount of reporting for bounds failures libsepol/cil: silence clang void-pointer-to-enum-cast warning libsepol: resolve GCC warning about null-dereference libsepol: use correct cast libsepol: ebitmap: mark nodes of const ebitmaps const Update VERSIONs to 3.3-rc2 for release. libsepol/cil: Handle operations in a class mapping when verifying libsepol/cil: Do not use original type and typeattribute datums libsepol: free memory after policy validation libsepol: avoid implicit conversions libsepol: fix typo libsepol/cil: Free duplicate datums in original calling function libsepol/cil: Fix detected RESOURCE_LEAK (CWE-772) Update VERSIONs and Python bindings version to 3.3-rc1 for release libsepol/cil: Limit the number of active line marks libsepol/cil: Add function to get number of items in a stack libsepol: Fix detected RESOURCE_LEAKs libsepol/cil: Fix syntax checking in __cil_verify_syntax() libsepol/cil: Use size_t for len in __cil_verify_syntax() libsepol/cil: Remove redundant syntax checking libsepol/cil: Improve in-statement to allow use after inheritance libsepol/cil: Simplify cil_tree_children_destroy() libsepol/cil: Refactor the function __cil_build_ast_node_helper() libsepol/cil: Don't destroy optionals whose parent will be destroyed libsepol/cil: Properly check for parameter when inserting name libsepol/cil: Reset expandtypeattribute rules when resetting AST libsepol/cil: Properly check parse tree when printing error messages libsepol/cil: Allow some duplicate macro and block declarations libsepol/cil: When writing AST use line marks for src_info nodes libsepol/cil: Report correct high-level language line numbers libsepol/cil: Add line mark kind and line number to src info libsepol/cil: Create common string-to-unsigned-integer functions libsepol/cil: Push line mark state first when processing a line mark libsepol/cil: Check for valid line mark type immediately libsepol/cil: Check the token type after getting the next token libsepol/cil: Check syntax of src_info statement libsepol/cil: move the fuzz target and build script to the selinux repository libsepol: replace strerror by %m libsepol/cil: remove obsolete comment libsepol/cil: do not allow \0 in quoted strings libsepol/cil: Fix handling category sets in an expression libsepol: assure string NUL-termination of ibdev_name libsepol: avoid implicit conversions libsepol: ignore UBSAN false-positives libsepol: avoid unsigned integer overflow libsepol/cil: Improve checking for bad inheritance patterns libsepol: silence -Wextra-semi-stmt warning libsepol/cil: do not override previous results of __cil_verify_classperms libsepol/cil: Provide option to allow qualified names in declarations libsepol/cil: make array cil_sym_sizes const libsepol/cil: Only reset AST if optional has a declaration libsepol/cil: Add function to determine if a subtree has a declaration libsepol/cil: Improve degenerate inheritance check libsepol/cil: Reduce the initial symtab sizes for blocks libsepol/cil: Check for empty list when marking neverallow attributes libsepol/cil: Fix syntax checking of defaultrange rule libsepol/cil: Properly check for loops in sets libsepol/cil: Allow duplicate optional blocks in most cases libsepol: declare read-only arrays const libsepol: declare file local variable static libsepol: drop unnecessary casts libsepol: drop repeated semicolons libsepol/cil: avoid using maybe uninitialized variables libsepol/cil: drop unnecessary casts libsepol/cil: drop dead store libsepol/cil: drop extra semicolon libsepol/cil: silence cast warning libsepol: remove dead stores libsepol: do not allocate memory of size 0 libsepol: mark read-only parameters of type_set_ interfaces const libsepol: mark read-only parameters of ebitmap interfaces const libsepol: remove dead stores libsepol/cil: follow declaration-after-statement libsepol: follow declaration-after-statement libsepol: avoid unsigned integer overflow libsepol: remove unused functions libsepol: resolve missing prototypes libsepol: fix typos libsepol: Quote paths when generating policy.conf from binary policy libsepol/cil: Account for anonymous category sets in an expression libsepol/cil: Fix anonymous IP address call arguments libsepol: quote paths in CIL conversion libsepol/cil: Resolve anonymous levels only once libsepol/cil: Pointers to datums should be set to NULL when resetting libsepol/cil: Resolve anonymous class permission sets only once libsepol/cil: Limit the number of open parenthesis allowed libsepol/cil: Destroy the permission nodes when exiting with an error libsepol/cil: Handle disabled optional blocks in earlier passes libsepol/cil: Do not resolve arguments to declarations in the call libsepo/cil: Refactor macro call resolution libsepol/cil: Do not add NULL node when inserting key into symtab libsepol/cil: Make name resolution in macros work as documented libsepol/cil: Fix name resolution involving inherited blocks libsepol/cil: Check for self-referential loops in sets libsepol/cil: Return an error if a call argument fails to resolve libsepol/cil: Check datum in ordered list for expected flavor libsepol/cil: Detect degenerate inheritance and exit with an error libsepol/cil: Fix instances where an error returns SEPOL_OK libsepol/cil: Properly reset an anonymous classperm set libsepol: use checked arithmetic builtin to perform safe addition libsepol/cil: Add functions to make use of cil_write_ast() libsepol/cil: Create functions to write the CIL AST libsepol/cil: Use CIL_ERR for error messages in cil_compile() libsepol/cil: Make invalid statement error messages consistent libsepol/cil: Do not allow tunable declarations in in-statements libsepol/cil: Sync checks for invalid rules in macros libsepol/cil: Check for statements not allowed in optional blocks libsepol/cil: Sync checks for invalid rules in booleanifs libsepol/cil: Reorder checks for invalid rules when resolving AST libsepol/cil: Use AST to track blocks and optionals when resolving libsepol/cil: Create new first child helper function for building AST libsepol/cil: Cleanup build AST helper functions libsepol/cil: Reorder checks for invalid rules when building AST libsepol/cil: Move check for the shadowing of macro parameters libsepol/cil: Create function cil_add_decl_to_symtab() and refactor libsepol/cil: Refactor helper function for cil_gen_node() libsepol/cil: Allow permission expressions when using map classes libsepol/cil: Exit with an error if declaration name is a reserved word libsepol/cil: More strict verification of constraint leaf expressions libsepol/cil: Set class field to NULL when resetting struct cil_classperms libsepol/cil: cil_reset_classperms_set() should not reset classpermission libsepol/cil: Destroy classperm list when resetting map perms libsepol/cil: Destroy classperms list when resetting classpermission libsepol/cil: Fix out-of-bound read of file context pattern ending with "\" libsepol/cil: Check for duplicate blocks, optionals, and macros libsepol: Write "NO_IDENTIFIER" for empty CIL constraint expression libsepol: Enclose identifier lists in CIL constraint expressions libsepol/cil: Allow lists in constraint expressions libsepol: Enclose identifier lists in constraint expressions libsepol: Write "NO_IDENTIFIER" for empty constraint expression libsepol: make num_* unsigned int in module_to_cil libsepol/cil: do not leak avrulex_ioctl_table memory when an error occurs libsepol/cil: fix NULL pointer dereference in __cil_insert_name libsepol/cil: replace printf with proper cil_tree_log libsepol/cil: remove stray printf libsepol/cil: make cil_post_fc_fill_data static libsepol: Check kernel to CIL and Conf functions for supported versions libsepol: Remove unnecessary copying of declarations from link.c libsepol: Properly handle types associated to role attributes libsepol: Expand role attributes in constraint expressions Signed-off-by: Daniel Golle [re-apply now that buildbot phase1 has caught up] Signed-off-by: Dominick Grift --- package/libs/libsepol/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/libsepol/Makefile b/package/libs/libsepol/Makefile index c7950a9ba0..87f1ccd917 100644 --- a/package/libs/libsepol/Makefile +++ b/package/libs/libsepol/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libsepol -PKG_VERSION:=3.2 +PKG_VERSION:=3.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 -PKG_HASH:=dfc7f662af8000116e56a01de6a0394ed79be1b34b999e551346233c5dd19508 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) +PKG_HASH:=2d97df3eb8466169b389c3660acbb90c54200ac96e452eca9f41a9639f4f238b PKG_MAINTAINER:=Thomas Petazzoni From 61a36cefd67732c5d5e51fb3140c80aac3dda555 Mon Sep 17 00:00:00 2001 From: Dominick Grift Date: Fri, 22 Oct 2021 13:51:16 +0200 Subject: [PATCH 43/65] secilc: update to version 3.3 Update VERSIONs to 3.3 for release. Update VERSIONs to 3.3-rc3 for release. Correct some typos Update VERSIONs to 3.3-rc2 for release. Update VERSIONs and Python bindings version to 3.3-rc1 for release libsepol/secilc/docs: Update the CIL documentation secilc: fix memory leaks in secilc2conf secilc: fix memory leaks in secilc libsepol/cil: Add support for using qualified names to secil2conf libsepol/cil: Add support for using qualified names to secil2tree secilc: Add support for using qualified names to secilc secilc/test: Add test for anonymous args secilc/docs: Relocate and reword macro call name resolution order secilc/docs: Document the order that inherited rules are resolved in secilc: Create the new program called secil2tree to write out CIL AST secilc/docs: Update the CIL documentation for various blocks secilc.c: Don't fail if input file is empty cil_conditional_statements.md: fix expr definition secilc/docs: Lists are now allowed in constraint expressions Signed-off-by: Daniel Golle [re-apply now that libsepol is up-to-date as well] Signed-off-by: Dominick Grift --- package/utils/secilc/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/utils/secilc/Makefile b/package/utils/secilc/Makefile index 7ed22615c0..6f059bfc81 100644 --- a/package/utils/secilc/Makefile +++ b/package/utils/secilc/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=secilc -PKG_VERSION:=3.2 +PKG_VERSION:=3.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/3.2 -PKG_HASH:=5f6e6528a281b29ac5e558babffc3d8aab682fd8df8977daff5f266a50292cc3 +PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) +PKG_HASH:=2c5e1a5d417baf1d2aa3eac294e12c3aac7184a5ef6a779dcbe469ed756e8651 HOST_BUILD_DEPENDS:=libsepol/host PKG_MAINTAINER:=Dominick Grift From a2fcd3900c0c7c168c4d3c04da189e408860483d Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 31 Oct 2021 12:54:06 +0000 Subject: [PATCH 44/65] dnsmasq: improve init script * fix restart in LuCI (inherited umask was to restrictive) * make directory of hosts-file (!= /tmp) accessible in ujail Reported-by: Hannu Nyman Signed-off-by: Daniel Golle --- package/network/services/dnsmasq/files/dnsmasq.init | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 3250b2179b..19135af1c2 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -829,12 +829,14 @@ dnsmasq_start() CONFIGFILE_TMP="${CONFIGFILE}.$$" HOSTFILE="${BASEHOSTFILE}.${cfg}" HOSTFILE_TMP="${HOSTFILE}.$$" + HOSTFILE_DIR="$(dirname "$HOSTFILE")" BASEDHCPSTAMPFILE_CFG="${BASEDHCPSTAMPFILE}.${cfg}" # before we can call xappend + umask u=rwx,g=rx,o=rx mkdir -p /var/run/dnsmasq/ mkdir -p $(dirname $CONFIGFILE) - mkdir -p $(dirname $HOSTFILE) + mkdir -p "$HOSTFILE_DIR" mkdir -p /var/lib/misc chown dnsmasq:dnsmasq /var/run/dnsmasq @@ -1154,6 +1156,7 @@ dnsmasq_start() procd_add_jail_mount $EXTRA_MOUNT $RFC6761FILE $TRUSTANCHORSFILE procd_add_jail_mount $dnsmasqconffile $dnsmasqconfdir $resolvdir $user_dhcpscript procd_add_jail_mount /etc/passwd /etc/group /etc/TZ /etc/hosts /etc/ethers + [ "$HOSTFILE_DIR" != "/tmp" ] && procd_add_jail_mount "$HOSTFILE_DIR" procd_add_jail_mount_rw /var/run/dnsmasq/ $leasefile procd_close_instance From 6801b827e41dead8fe2e77654f4309ff7fcd47fa Mon Sep 17 00:00:00 2001 From: Roger Pueyo Centelles Date: Wed, 27 Oct 2021 19:40:45 +0200 Subject: [PATCH 45/65] ath79: mikrotik: enable SFP on RB921GS-5HPacD (mANTBox 15s) This patch enables the SFP cage on the MikroTik RouterBOARD 921GS-5HPacD (mANTBox 15s). The RB922UAGS-5HPacD had it already working, so the support code is moved to the common DTSI file both devices share. Tested on a RouterBOARD 921GS-5HPacD with a MikroTik S-53LC20D module. Signed-off-by: Roger Pueyo Centelles --- ...58_mikrotik_routerboard-922uags-5hpacd.dts | 48 ------------------- .../dts/qca9558_mikrotik_routerboard-92x.dtsi | 48 +++++++++++++++++++ target/linux/ath79/image/mikrotik.mk | 3 +- .../base-files/etc/board.d/02_network | 3 +- 4 files changed, 51 insertions(+), 51 deletions(-) diff --git a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts index 36979bbd33..8ad834fe61 100644 --- a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts @@ -23,27 +23,6 @@ gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; }; }; - - i2c: i2c { - compatible = "i2c-gpio"; - - sda-gpios = <&gpio 18 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; - scl-gpios = <&gpio 19 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; - i2c-gpio,delay-us = <5>; - i2c-gpio,timeout-ms = <1>; - }; - - sfp1: sfp { - compatible = "sff,sfp"; - - i2c-bus = <&i2c>; - maximum-power-milliwatt = <1000>; - los-gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; - mod-def0-gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - tx-disable-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; - // Toggling GPIO16 actually enables/disables the transmitter, - // but the SFP driver does not seem to be using it. - }; }; &pcie0 { @@ -76,30 +55,3 @@ &usb_phy1 { status = "okay"; }; - -&mdio1 { - status = "okay"; - - phy_sfp: ethernet-phy@0 { - reg = <0>; - phy-mode = "sgmii"; - sfp = <&sfp1>; - }; -}; - -ð1 { - status = "okay"; - - phy-handle = <&phy_sfp>; - pll-data = <0x03000000 0x00000101 0x00001616>; - qca955x-sgmii-fixup; - - gmac-config { - device = <&gmac>; - }; - - fixed-link { - speed = <1000>; - full-duplex; - }; -}; diff --git a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi index 5e919856a5..d71c12c1fd 100644 --- a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi @@ -42,6 +42,27 @@ gpios = <&gpio 23 GPIO_ACTIVE_LOW>; }; }; + + i2c: i2c { + compatible = "i2c-gpio"; + + sda-gpios = <&gpio 18 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&gpio 19 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + i2c-gpio,delay-us = <5>; + i2c-gpio,timeout-ms = <1>; + }; + + sfp1: sfp { + compatible = "sff,sfp"; + + i2c-bus = <&i2c>; + maximum-power-milliwatt = <1000>; + los-gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; + mod-def0-gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + tx-disable-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + // Toggling GPIO16 actually enables/disables the transmitter, + // but the SFP driver does not seem to be using it. + }; }; &mdio0 { @@ -64,6 +85,33 @@ }; }; +&mdio1 { + status = "okay"; + + phy_sfp: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + sfp = <&sfp1>; + }; +}; + +ð1 { + status = "okay"; + + phy-handle = <&phy_sfp>; + pll-data = <0x03000000 0x00000101 0x00001616>; + qca955x-sgmii-fixup; + + gmac-config { + device = <&gmac>; + }; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + &spi { status = "okay"; diff --git a/target/linux/ath79/image/mikrotik.mk b/target/linux/ath79/image/mikrotik.mk index 4256f77379..2324ecc195 100644 --- a/target/linux/ath79/image/mikrotik.mk +++ b/target/linux/ath79/image/mikrotik.mk @@ -22,7 +22,8 @@ define Device/mikrotik_routerboard-921gs-5hpacd-15s $(Device/mikrotik_nand) SOC := qca9558 DEVICE_MODEL := RouterBOARD 921GS-5HPacD-15s (mANTBox 15s) - DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-i2c-gpio \ + kmod-sfp SUPPORTED_DEVICES += rb-921gs-5hpacd-r2 endef TARGET_DEVICES += mikrotik_routerboard-921gs-5hpacd-15s diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network index d4a32c1e1a..4058742133 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network @@ -15,7 +15,6 @@ ath79_setup_interfaces() "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3" ;; mikrotik,routerboard-912uag-2hpnd|\ - mikrotik,routerboard-921gs-5hpacd-15s|\ mikrotik,routerboard-lhg-2nd|\ mikrotik,routerboard-sxt-5nd-r2|\ mikrotik,routerboard-wap-g-5hact2hnd|\ @@ -38,7 +37,6 @@ ath79_setup_macs() case "$board" in mikrotik,routerboard-912uag-2hpnd|\ - mikrotik,routerboard-921gs-5hpacd-15s|\ mikrotik,routerboard-lhg-2nd|\ mikrotik,routerboard-sxt-5nd-r2|\ mikrotik,routerboard-wap-g-5hact2hnd|\ @@ -46,6 +44,7 @@ ath79_setup_macs() label_mac="$mac_base" lan_mac="$mac_base" ;; + mikrotik,routerboard-921gs-5hpacd-15s|\ mikrotik,routerboard-922uags-5hpacd) label_mac="$mac_base" lan_mac="$mac_base" From 3c97fb4346d11ab3e7cc453ffd7b66b4b9140aec Mon Sep 17 00:00:00 2001 From: Eduardo Santos Date: Wed, 20 Oct 2021 14:54:16 +0100 Subject: [PATCH 46/65] ramips: add support for Xiaomi MiWifi 3C MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds support for Xiaomi MiWiFi 3C device. Xiaomi MiWifi 3C has almost the same system architecture as the Xiaomi Mi WiFi Nano, which is already officially supported by OpenWrt. The differences are: - Numbers of antennas (4 instead of 2). The antenna management is done via the µC. There is no configuration needed in the software code. - LAN port assignments are different. LAN1 and WAN are interchanged. OpenWrt Wiki: https://openwrt.org/toh/xiaomi/mir3c OpenWrt developers forum page: https://forum.openwrt.org/t/support-for-xiaomi-mi-3c Specifications: - CPU: MediaTek MT7628AN (575MHz) - Flash: 16MB - RAM: 64MB DDR2 - 2.4 GHz: IEEE 802.11b/g/n with Integrated LNA and PA - Antennas: 4x external single band antennas - WAN: 1x 10/100M - LAN: 2x 10/100M - LED: 1x amber/blue/red. Programmable - Button: Reset MAC addresses as verified by OEM firmware: use address source LAN *:92 factory 0x28 WAN *:92 factory 0x28 2g *:93 factory 0x4 OEM firmware uses VLAN's to create the network interface for WAN and LAN. Bootloader info: The stock bootloader uses a "Dual ROM Partition System". OS1 is a deep copy of OS2. The bootloader start OS2 by default. To force start OS1 it is needed to set "flag_try_sys2_failed=1". How to install: 1- Use OpenWRTInvasion to gain telnet, ssh and ftp access. https://github.com/acecilia/OpenWRTInvasion (IP: 192.168.31.1 - Username: root - Password: root) 2- Connect to router using telnet or ssh. 3- Backup all partitions. Use command "dd if=/dev/mtd0 of=/tmp/mtd0". Copy /tmp/mtd0 to computer using ftp. 4- Copy openwrt-ramips-mt76x8-xiaomi_miwifi-3c-squashfs-sysupgrade.bin to /tmp in router using ftp. 5- Enable UART access and change start image for OS1. ``` nvram set uart_en=1 nvram set flag_last_success=1 nvram set boot_wait=on nvram set flag_try_sys2_failed=1 nvram commit ``` 6- Installing Openwrt on OS1 and free OS2. ``` mtd erase OS1 mtd erase OS2 mtd -r write /tmp/openwrt-ramips-mt76x8-xiaomi_miwifi-3c-squashfs-sysupgrade.bin OS1 ``` Limitations: For the first install the image size needs to be less than 7733248 bits. Thanks for all community and especially for this device: minax007, earth08, S.Farid Signed-off-by: Eduardo Santos [wrap lines, remove whitespace errors, add mediatek,mtd-eeprom to &wmac, convert to nvmem] Signed-off-by: Adrian Schmutzler --- package/boot/uboot-envtools/files/ramips | 1 + .../ramips/dts/mt7628an_xiaomi_miwifi-3c.dts | 156 ++++++++++++++++++ target/linux/ramips/image/mt76x8.mk | 8 + .../mt76x8/base-files/etc/board.d/02_network | 4 + 4 files changed, 169 insertions(+) create mode 100644 target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 593f503cf2..9ad4d64ed9 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -37,6 +37,7 @@ samknows,whitebox-v8|\ xiaomi,mi-router-3g-v2|\ xiaomi,mi-router-4a-gigabit|\ xiaomi,mi-router-4c|\ +xiaomi,miwifi-3c|\ xiaomi,miwifi-nano|\ zbtlink,zbt-wg2626|\ zte,mf283plus) diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts new file mode 100644 index 0000000000..c45f94b2f1 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-3c.dts @@ -0,0 +1,156 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an.dtsi" + +#include +#include + +/ { + compatible = "xiaomi,miwifi-3c", "mediatek,mt7628an-soc"; + model = "Xiaomi MiWiFi 3C"; + + aliases { + led-boot = &led_status_amber; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_amber; + label-mac-device = ðernet; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_status_blue: status_blue { + label = "blue:status"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + led_status_red: status_red { + label = "red:status"; + gpios = <&gpio 37 GPIO_ACTIVE_LOW>; + }; + + led_status_amber: status_amber { + label = "amber:status"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&state_default { + gpio { + groups = "gpio", "refclk", "wdt", "wled_an"; + function = "gpio"; + }; +}; + +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + +&esw { + mediatek,portmap = <0x3e>; + mediatek,portdisable = <0x2a>; +}; + +&wmac { + status = "okay"; + + mediatek,mtd-eeprom = <&factory 0x0>; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_28>; + nvmem-cell-names = "mac-address"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Bootloader"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "Config"; + reg = <0x30000 0x10000>; + }; + + partition@40000 { + label = "Bdata"; + reg = <0x40000 0x10000>; + read-only; + }; + + factory: partition@50000 { + label = "factory"; + reg = <0x50000 0x10000>; + read-only; + }; + + partition@60000 { + label = "crash"; + reg = <0x60000 0x10000>; + read-only; + }; + + partition@70000 { + label = "cfg_bak"; + reg = <0x70000 0x10000>; + read-only; + }; + + partition@80000 { + label = "overlay"; + reg = <0x80000 0xc0000>; + read-only; + }; + + partition@140000 { + label = "firmware"; + compatible = "denx,uimage"; + reg = <0x140000 0xec0000>; + }; + }; + }; +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_28: macaddr@28 { + reg = <0x28 0x6>; + }; +}; diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 5f5d281d5c..7d28cd62e8 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -841,6 +841,14 @@ define Device/xiaomi_mi-router-4c endef TARGET_DEVICES += xiaomi_mi-router-4c +define Device/xiaomi_miwifi-3c + IMAGE_SIZE := 15104k + DEVICE_VENDOR := Xiaomi + DEVICE_MODEL := MiWiFi 3C + DEVICE_PACKAGES := uboot-envtools +endef +TARGET_DEVICES += xiaomi_miwifi-3c + define Device/xiaomi_miwifi-nano IMAGE_SIZE := 16064k DEVICE_VENDOR := Xiaomi diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 638b8f2181..12a29b3907 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -150,6 +150,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "4:lan:1" "2:lan:2" "1:wan" "6@eth0" ;; + xiaomi,miwifi-3c) + ucidef_add_switch "switch0" \ + "0:wan" "2:lan:2" "4:lan:1" "6@eth0" + ;; xiaomi,miwifi-nano) ucidef_add_switch "switch0" \ "0:lan:2" "2:lan:1" "4:wan" "6@eth0" From eb00fb8f7153535512b2dad365e76a2bc0dfb6c1 Mon Sep 17 00:00:00 2001 From: Sergio Paracuellos Date: Sun, 4 Apr 2021 08:50:26 +0200 Subject: [PATCH 47/65] ramips: add support for HiLink HLK-7621A evaluation board Specifications: - SoC: MediaTek MT7621AT - RAM: 256 MB (DDR3) - Flash: 32 MB SPI NOR 44MHz - Switch: 1 WAN, 4 LAN (Gigabit) - LEDs: 1 WAN, 4 LAN (controlled by PHY) - USB Ports: 1 x USB2, 1 x USB3 - WLAN: 1 x 2.4, 5 GHz 866Mbps (MT7612E) - Button: 1 button (reset) - UART Serial: UART1 as console : 57600 baud - Power: 12VDC, 1A Installation: Update openWRT firmware using internal GNUBEE uboot: https://github.com/gnubee-git/GnuBee-MT7621-uboot By HTTP: Initial uboot address is http://10.10.10.123, your address needs to be 10.10.10.x, and mask 255.255.255.0. By TFTP: Uboot is in client mode, the address of the firmware must be tftp://10.10.10.3/uboot.bin Recovery: Manufacturer provides MTK OpenWrt 14.07 source code, compile then flash it by uboot. HLK-7621A is a stamp hole package module for embedded development, users have to design IO boards to use it. MAC addresses: - u-boot-env contains a placeholder address: > mtd_get_mac_ascii u-boot-env ethaddr 03:17:73:ab:cd:ef - phy0 gets a valid-looking address: > cat /sys/class/ieee80211/phy0/macaddress f8:62:aa:**:**:a8 - Calibration data for &pcie2 contains a valid address, however the zeros in the right half look like it's not real: 8c:88:2b:00:00:1b - Since it's an evaluation board and there is no solid information about the MAC address assignment, the ethernet MAC address is left random. Signed-off-by: Chen Yijun [add keys and pcie nodes to properly support evaluation board] Signed-off-by: Sergio Paracuellos [remove ethernet address, wrap lines properly] Signed-off-by: Adrian Schmutzler --- .../dts/mt7621_hilink_hlk-7621a-evb.dts | 109 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 10 ++ 2 files changed, 119 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts diff --git a/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts b/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts new file mode 100644 index 0000000000..4b807fcaa5 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts @@ -0,0 +1,109 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "hilink,hlk-7621a-evb", "mediatek,mt7621-soc"; + model = "HiLink HLK-7621A evaluation board"; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_HIGH>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <44000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x1fb0000>; + }; + }; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan1"; + }; + + port@1 { + status = "okay"; + label = "lan2"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + + port@3 { + status = "okay"; + label = "lan4"; + }; + + port@4 { + status = "okay"; + label = "wan"; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie2 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + }; +}; + +&state_default { + gpio { + groups = "wdt"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index a0236234d1..3b68a76b3e 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -610,6 +610,16 @@ define Device/gnubee_gb-pc2 endef TARGET_DEVICES += gnubee_gb-pc2 +define Device/hilink_hlk-7621a-evb + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + DEVICE_VENDOR := HiLink + DEVICE_MODEL := HLK-7621A evaluation board + DEVICE_PACKAGES += kmod-mt76x2 kmod-usb3 + IMAGE_SIZE := 32448k +endef +TARGET_DEVICES += hilink_hlk-7621a-evb + define Device/hiwifi_hc5962 $(Device/dsa-migration) BLOCKSIZE := 128k From 766d1d675baf332251d0d80a11e835eeb05ada11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Valentin?= Date: Fri, 17 Sep 2021 21:48:55 +0200 Subject: [PATCH 48/65] ath79: fix parallel image generation for Zyxel NBG6716 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This changes the image generation to use a unique directory. With parallel building it may occur that two concurrent jobs try to create an image which leds to errors. It also removes a needless subdirecory. Signed-off-by: André Valentin --- target/linux/ath79/image/nand.mk | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index 52631789d9..8d3d2ce5b2 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -1,13 +1,12 @@ # attention: only zlib compression is allowed for the boot fs define Build/zyxel-buildkerneljffs - rm -rf $(KDIR_TMP)/zyxelnbg6716 - mkdir -p $(KDIR_TMP)/zyxelnbg6716/image/boot - cp $@ $(KDIR_TMP)/zyxelnbg6716/image/boot/vmlinux.lzma.uImage + mkdir -p $@.tmp/boot + cp $@ $@.tmp/boot/vmlinux.lzma.uImage $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \ --big-endian --squash-uids -v -e 128KiB -q -f -n -x lzma -x rtime \ -o $@ \ - -d $(KDIR_TMP)/zyxelnbg6716/image - rm -rf $(KDIR_TMP)/zyxelnbg6716 + -d $@.tmp + rm -rf $@.tmp endef define Build/zyxel-factory From fa3646c0033eb93d6397b55c1a4e921dff1049f8 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sun, 31 Oct 2021 11:38:31 +0100 Subject: [PATCH 49/65] ipq806x: ecw5410: drop GPIO based MDIO1 node It looks like this is a leftover before there was a proper MDIO driver. Since both PHY-s are connected to the HW MDIO bus there is no reason for this to exist anymore, especially since it uses the same pins as the HW controller and has the pinmux for the set to "MDIO" so this worked by pure luck as GPIO MDIO would probe first and override the HW driver. Move the GMAC3 to simply use the same MDIO bus phandle. Signed-off-by: Robert Marko --- .../arm/boot/dts/qcom-ipq8068-ecw5410.dts | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts index 43bed451cb..57724c19d7 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts @@ -34,7 +34,6 @@ aliases { serial1 = &gsbi1_serial; - mdio-gpio0 = &mdio0; ethernet0 = &gmac3; ethernet1 = &gmac2; @@ -293,26 +292,18 @@ }; }; -&soc { - mdio1: mdio { - compatible = "virtual,mdio-gpio"; - #address-cells = <1>; - #size-cells = <0>; +&mdio0 { + status = "okay"; - status = "okay"; + pinctrl-0 = <&mdio0_pins>; + pinctrl-names = "default"; - pinctrl-0 = <&mdio0_pins>; - pinctrl-names = "default"; + phy0: ethernet-phy@0 { + reg = <0>; + }; - gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH &qcom_pinmux 0 GPIO_ACTIVE_HIGH>; - - phy0: ethernet-phy@0 { - reg = <0>; - }; - - phy1: ethernet-phy@1 { - reg = <1>; - }; + phy1: ethernet-phy@1 { + reg = <1>; }; }; @@ -330,7 +321,7 @@ status = "okay"; qcom,id = <3>; - mdiobus = <&mdio1>; + mdiobus = <&mdio0>; phy-mode = "sgmii"; phy-handle = <&phy0>; From 2e3c79ef83588a4e207e2f99ab404536cfc0e95d Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sun, 31 Oct 2021 12:27:23 +0100 Subject: [PATCH 50/65] ipq806x: ecw5410: fix PCI1 radio caldata ECW5410 has 2 QCA9984 cards, one per PCI controller. They are located at PCI adresses 0001:01:00.0 and 0002:01:00.0. Currently, pre-cal is not provided for 0001:01:00.0 at all,but for 0000:01:00.0 which is incorrect and causes the ath10k driver to not be able to fetch the BMI ID and use that to fetch the proper BDF but rather fail with: [ 12.029708] ath10k 5.10 driver, optimized for CT firmware, probing pci device: 0x46. [ 12.031816] ath10k_pci 0001:01:00.0: enabling device (0140 -> 0142) [ 12.037660] ath10k_pci 0001:01:00.0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0 [ 13.173898] ath10k_pci 0001:01:00.0: qca9984/qca9994 hw1.0 target 0x01000000 chip_id 0x00000000 sub 168c:cafe [ 13.174015] ath10k_pci 0001:01:00.0: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0 [ 13.189304] ath10k_pci 0001:01:00.0: firmware ver 10.4b-ct-9984-fW-13-5ae337bb1 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc35 [ 15.492322] ath10k_pci 0001:01:00.0: failed to fetch board data for bus=pci,vendor=168c,device=0046,subsystem-vendor=168c,subsystem-device=cafe,variant=Edgecore-ECW541 from ath10k/QCA9984/hw1.0/board-2.bin [ 15.543883] ath10k_pci 0001:01:00.0: failed to fetch board-2.bin or board.bin from ath10k/QCA9984/hw1.0 [ 15.543920] ath10k_pci 0001:01:00.0: failed to fetch board file: -12 [ 15.552281] ath10k_pci 0001:01:00.0: could not probe fw (-12) So, provide the pre-cal for the actual PCI card and not the non-existent one. Fixes: 59f0a0f ("ipq806x: add Edgecore ECW5410 support") Signed-off-by: Robert Marko --- .../base-files/etc/hotplug.d/firmware/11-ath10k-caldata | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 87c4794552..8de4e052cc 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -12,8 +12,7 @@ case "$FIRMWARE" in askey,rt4230w-rev6) caldata_extract "0:ART" 0x1000 0x2f20 ;; - asrock,g10 |\ - edgecore,ecw5410) + asrock,g10) caldata_extract "0:art" 0x1000 0x2f20 ;; buffalo,wxr-2533dhp |\ @@ -57,6 +56,9 @@ case "$FIRMWARE" in tplink,vr2600v) caldata_extract "ART" 0x5000 0x2f20 ;; + edgecore,ecw5410) + caldata_extract "0:art" 0x1000 0x2f20 + ;; linksys,ea7500-v1 |\ linksys,ea8500) caldata_extract "art" 0x5000 0x2f20 From 76fff69180039ace23ce10a2570ec9f441a0cab6 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sun, 31 Oct 2021 14:33:15 +0100 Subject: [PATCH 51/65] ipq806x: ecw5410: use bootloader provided MAC-s Currently, we are overriding the bootloader provided MAC-s as the ethernet aliases are reversed so MAC-s were fixed up in userspace. There is no need to do that as we can just fix the aliases instead and get rid of MAC setting via userspace helper. Fixes: 59f0a0f ("ipq806x: add Edgecore ECW5410 support") Signed-off-by: Robert Marko --- target/linux/ipq806x/base-files/etc/board.d/02_network | 2 -- .../ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index a75d32ab6f..65a0e98b3b 100644 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -29,8 +29,6 @@ tplink,vr2600v) ;; edgecore,ecw5410) ucidef_set_interfaces_lan_wan "eth1" "eth0" - ucidef_set_interface_macaddr "lan" "$(mtd_get_mac_binary "0:art" 0x6)" - ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary "0:art" 0x0)" ;; linksys,ea7500-v1) hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr) diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts index 57724c19d7..377bb09616 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-ecw5410.dts @@ -34,8 +34,8 @@ aliases { serial1 = &gsbi1_serial; - ethernet0 = &gmac3; - ethernet1 = &gmac2; + ethernet0 = &gmac2; + ethernet1 = &gmac3; led-boot = &led_power_green; led-failsafe = &led_power_red; From 08622de7d66eb90038de54f34ab2fe2308424fd0 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 26 Sep 2021 17:58:59 -0400 Subject: [PATCH 52/65] scripts: fix various typos This only affects typos in comments or user-facing output. Signed-off-by: Josh Soref [only picks changes to scripts, drop "commandline" replacement, fix case for "arbitrary", improve commit message] Signed-off-by: Adrian Schmutzler --- scripts/checkpatch.pl | 2 +- scripts/dl_github_archive.py | 4 ++-- scripts/ext-toolchain.sh | 2 +- scripts/json_overview_image_info.py | 2 +- scripts/linksys-image.sh | 4 ++-- scripts/pad_image | 2 +- scripts/sign_images.sh | 4 ++-- scripts/size_compare.sh | 4 ++-- scripts/slugimage.pl | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 81b1ffcb56..2adc5efec5 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -4697,7 +4697,7 @@ sub process { ## $line !~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Type\s*$Ident.*/) { ## ## # Remove any bracketed sections to ensure we do not -## # falsly report the parameters of functions. +## # falsely report the parameters of functions. ## my $ln = $line; ## while ($ln =~ s/\([^\(\)]*\)//g) { ## } diff --git a/scripts/dl_github_archive.py b/scripts/dl_github_archive.py index 59fd7067be..b992227dc9 100755 --- a/scripts/dl_github_archive.py +++ b/scripts/dl_github_archive.py @@ -207,7 +207,7 @@ class GitHubCommitTsCache(object): class DownloadGitHubTarball(object): - """Download and repack archive tarabll from GitHub. + """Download and repack archive tarball from GitHub. Compared with the method of packing after cloning the whole repo, this method is more friendly to users with fragile internet connection. @@ -220,7 +220,7 @@ class DownloadGitHubTarball(object): - GitHub archives do not contain source codes for submodules. - - GitHub archives seem to respect .gitattributes and ignore pathes with + - GitHub archives seem to respect .gitattributes and ignore paths with export-ignore attributes. For the first two issues, the method will fail loudly to allow fallback to diff --git a/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh index ee7d9532f5..4da287591a 100755 --- a/scripts/ext-toolchain.sh +++ b/scripts/ext-toolchain.sh @@ -569,7 +569,7 @@ while [ -n "$1" ]; do echo -e " Most commands also take a --cflags parameter which " >&2 echo -e " is used to specify C flags to be passed to the " >&2 echo -e " cross compiler when performing tests." >&2 - echo -e " This paremter may be repeated multiple times." >&2 + echo -e " This parameter may be repeated multiple times." >&2 exit 1 ;; diff --git a/scripts/json_overview_image_info.py b/scripts/json_overview_image_info.py index db47fd9e42..89b7d4fe20 100755 --- a/scripts/json_overview_image_info.py +++ b/scripts/json_overview_image_info.py @@ -7,7 +7,7 @@ from sys import argv import json if len(argv) != 2: - print("JSON info files script requires ouput file as argument") + print("JSON info files script requires output file as argument") exit(1) output_path = Path(argv[1]) diff --git a/scripts/linksys-image.sh b/scripts/linksys-image.sh index 36a676d964..c3baf44844 100755 --- a/scripts/linksys-image.sh +++ b/scripts/linksys-image.sh @@ -11,11 +11,11 @@ # This is appended to the factory image and is tested by the Linksys Upgrader - as observed in civic. # The footer is 256 bytes. The format is: # .LINKSYS. This is detected by the Linksys upgrader before continuing with upgrade. (9 bytes) -# The version number of upgrade. Not checked so use arbitary value (8 bytes) +# The version number of upgrade. Not checked so use arbitrary value (8 bytes) # Model of target device, padded (0x20) to (15 bytes) # CRC checksum of the image to flash (8 byte) # Padding (0x20) (7 bytes) -# Signature of signer. Not checked so use Arbitary value (16 bytes) +# Signature of signer. Not checked so use arbitrary value (16 bytes) # Padding (0x00) (192 bytes) # 0x0A (1 byte) diff --git a/scripts/pad_image b/scripts/pad_image index b1941a28d8..871063af34 100755 --- a/scripts/pad_image +++ b/scripts/pad_image @@ -2,7 +2,7 @@ function usage { echo "Usage: prepare_image image_type kernel_image rootfs_image header_size" - echo "Padd root and kernel image to the correct size and append the jffs2 start marker as needed" + echo "Pad root and kernel image to the correct size and append the jffs2 start marker as needed" exit 1 } diff --git a/scripts/sign_images.sh b/scripts/sign_images.sh index c41b21e091..f37c2f5016 100755 --- a/scripts/sign_images.sh +++ b/scripts/sign_images.sh @@ -3,12 +3,12 @@ # directory where search for images TOP_DIR="${TOP_DIR:-./bin/targets}" # key to sign images -BUILD_KEY="${BUILD_KEY:-key-build}" # TODO unifiy naming? +BUILD_KEY="${BUILD_KEY:-key-build}" # TODO unify naming? # remove other signatures (added e.g. by buildbot) REMOVE_OTER_SIGNATURES="${REMOVE_OTER_SIGNATURES:-1}" # find all sysupgrade images in TOP_DIR -# factory images don't need signatures as non OpenWrt system doen't check them anyway +# factory images don't need signatures as non OpenWrt system doesn't check them anyway for image in $(find $TOP_DIR -type f -name "*-sysupgrade.bin"); do # check if image actually support metadata if fwtool -i /dev/null "$image"; then diff --git a/scripts/size_compare.sh b/scripts/size_compare.sh index 8b047a451e..a5cc3337c7 100755 --- a/scripts/size_compare.sh +++ b/scripts/size_compare.sh @@ -7,9 +7,9 @@ ### ### The script compares locally compiled package with the package indexes ### available upstream. This way the storage impact of optimizations or -### feature modifiactions is easy to see. +### feature modifications is easy to see. ### -### If no environmental variables are set the scritp reads the current +### If no environmental variables are set the script reads the current ### .config file. The evaluated env variables are the following: ### ### TARGET SUBTARGET ARCH PACKAGES BIN_DIR BASE_URL CHECK_INSTALLED diff --git a/scripts/slugimage.pl b/scripts/slugimage.pl index 8c0654d4f6..366b239e96 100755 --- a/scripts/slugimage.pl +++ b/scripts/slugimage.pl @@ -772,7 +772,7 @@ sub writeOutFirmware { $_->{'name'}, $filename); } - # If the next parition is before the end of the current image, then rewind. + # If the next partition is before the end of the current image, then rewind. elsif ($_->{'offset'} < $end_point) { $debug and printf("Rewound %s before <%s> in \"%s\"\n", (($end_point - $_->{'offset'}) >= $block_size ? @@ -971,7 +971,7 @@ if (!GetOptions("d|debug" => \$debug, print " [-b|--redboot] Input/Output RedBoot filename\n"; print " [-s|--sysconf] Input/Output SysConf filename\n"; print " [-L|--loader] Second stage boot loader filename\n"; - print " [-k|--kernel] Input/Ouptut Kernel filename\n"; + print " [-k|--kernel] Input/Output Kernel filename\n"; print " [-r|--ramdisk] Input/Output Ramdisk filename(s)\n"; print " [-f|--fisdir] Input/Output FIS directory filename\n"; print " [-m|--microcode] Input/Output Microcode filename\n"; From 323bd7b0f576bf83a5f72a97f2169d7e50ad046b Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Sun, 26 Sep 2021 17:58:59 -0400 Subject: [PATCH 53/65] build: fix various typos Fix typos in comment and user-facing help text. Signed-off-by: Josh Soref [split out config changes, adjust commit message] Signed-off-by: Adrian Schmutzler --- config/Config-build.in | 2 +- config/Config-kernel.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/Config-build.in b/config/Config-build.in index 92ec97aefa..a028ebfbc3 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -107,7 +107,7 @@ menu "Global build settings" default n help This makes file checksums part of package metadata. It increases size - but provides you with pkg_check command to check for flash coruptions. + but provides you with pkg_check command to check for flash corruptions. config INCLUDE_CONFIG bool "Include build configuration in firmware" if DEVEL diff --git a/config/Config-kernel.in b/config/Config-kernel.in index d4648a5064..dc249a6031 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -1112,7 +1112,7 @@ config KERNEL_SQUASHFS_XATTR bool "Squashfs XATTR support" # -# compile optimiziation setting +# compile optimization setting # choice prompt "Compiler optimization level" From a61a41d4aac6765544961aa9ea303af2a3a9634c Mon Sep 17 00:00:00 2001 From: Jihoon Han Date: Fri, 1 Oct 2021 14:52:19 +0900 Subject: [PATCH 54/65] kernel: add support for ESMT F25L16PA(2S) SPI-NOR This fixes support for Dongwon T&I DW02-412H which uses F25L16PA(2S) flash. Signed-off-by: Jihoon Han Reviewed-by: Sungbo Eo [refresh patches] Signed-off-by: Adrian Schmutzler --- ...00-unlock_mx25l6406e_with_4bit_block_protect.patch | 4 ++-- .../484-mtd-spi-nor-add-esmt-f25l16pa.patch | 11 +++++++++++ .../484-mtd-spi-nor-add-esmt-f25l16pa.patch | 10 ++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 target/linux/generic/pending-5.10/484-mtd-spi-nor-add-esmt-f25l16pa.patch create mode 100644 target/linux/generic/pending-5.4/484-mtd-spi-nor-add-esmt-f25l16pa.patch diff --git a/target/linux/generic/hack-5.4/400-unlock_mx25l6406e_with_4bit_block_protect.patch b/target/linux/generic/hack-5.4/400-unlock_mx25l6406e_with_4bit_block_protect.patch index af0a14948c..8112fa7e13 100644 --- a/target/linux/generic/hack-5.4/400-unlock_mx25l6406e_with_4bit_block_protect.patch +++ b/target/linux/generic/hack-5.4/400-unlock_mx25l6406e_with_4bit_block_protect.patch @@ -30,7 +30,7 @@ ret = read_sr(nor); if (ret < 0) { dev_err(nor->dev, "error while reading status register\n"); -@@ -2337,7 +2344,7 @@ static const struct flash_info spi_nor_i +@@ -2338,7 +2345,7 @@ static const struct flash_info spi_nor_i { "mx25l1606e", INFO(0xc22015, 0, 64 * 1024, 32, SECT_4K) }, { "mx25l3205d", INFO(0xc22016, 0, 64 * 1024, 64, SECT_4K) }, { "mx25l3255e", INFO(0xc29e16, 0, 64 * 1024, 64, SECT_4K) }, @@ -39,7 +39,7 @@ { "mx25u2033e", INFO(0xc22532, 0, 64 * 1024, 4, SECT_4K) }, { "mx25u3235f", INFO(0xc22536, 0, 64 * 1024, 64, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, -@@ -5025,6 +5032,9 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -5026,6 +5033,9 @@ int spi_nor_scan(struct spi_nor *nor, co if (info->flags & USE_CLSR) nor->flags |= SNOR_F_USE_CLSR; diff --git a/target/linux/generic/pending-5.10/484-mtd-spi-nor-add-esmt-f25l16pa.patch b/target/linux/generic/pending-5.10/484-mtd-spi-nor-add-esmt-f25l16pa.patch new file mode 100644 index 0000000000..ce3857d511 --- /dev/null +++ b/target/linux/generic/pending-5.10/484-mtd-spi-nor-add-esmt-f25l16pa.patch @@ -0,0 +1,11 @@ +--- a/drivers/mtd/spi-nor/esmt.c ++++ b/drivers/mtd/spi-nor/esmt.c +@@ -10,6 +10,8 @@ + + static const struct flash_info esmt_parts[] = { + /* ESMT */ ++ { "f25l16pa-2s", INFO(0x8c2115, 0, 64 * 1024, 32, ++ SECT_4K | SPI_NOR_HAS_LOCK) }, + { "f25l32pa", INFO(0x8c2016, 0, 64 * 1024, 64, + SECT_4K | SPI_NOR_HAS_LOCK) }, + { "f25l32qa", INFO(0x8c4116, 0, 64 * 1024, 64, diff --git a/target/linux/generic/pending-5.4/484-mtd-spi-nor-add-esmt-f25l16pa.patch b/target/linux/generic/pending-5.4/484-mtd-spi-nor-add-esmt-f25l16pa.patch new file mode 100644 index 0000000000..0a7d4f86d5 --- /dev/null +++ b/target/linux/generic/pending-5.4/484-mtd-spi-nor-add-esmt-f25l16pa.patch @@ -0,0 +1,10 @@ +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -2243,6 +2243,7 @@ static const struct flash_info spi_nor_i + { "en25s64", INFO(0x1c3817, 0, 64 * 1024, 128, SECT_4K) }, + + /* ESMT */ ++ { "f25l16pa-2s", INFO(0x8c2115, 0, 64 * 1024, 32, SECT_4K | SPI_NOR_HAS_LOCK) }, + { "f25l32pa", INFO(0x8c2016, 0, 64 * 1024, 64, SECT_4K | SPI_NOR_HAS_LOCK) }, + { "f25l32qa", INFO(0x8c4116, 0, 64 * 1024, 64, SECT_4K | SPI_NOR_HAS_LOCK) }, + { "f25l64qa", INFO(0x8c4117, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_HAS_LOCK) }, From 84451173f08e7af9e47c85c1a0cd8e041f4ec568 Mon Sep 17 00:00:00 2001 From: Jihoon Han Date: Fri, 1 Oct 2021 14:53:06 +0900 Subject: [PATCH 55/65] ath79: add support for Dongwon T&I DW02-412H Dongwon T&I DW02-412H is a 2.4/5GHz band 11ac (WiFi-5) router, based on Qualcomm Atheros QCA9557. Specifications -------------- - SoC: Qualcomm Atheros QCA9557-AT4A - RAM: DDR2 128MB - Flash: SPI NOR 2MB (Winbond W25Q16DVSSIG / ESMT F25L16PA(2S)) + NAND 64/128MB - WiFi: - 2.4GHz: QCA9557 WMAC - 5GHz: QCA9882-BR4A - Ethernet: 5x 10/100/1000Mbps - Switch: QCA8337N-AL3C - USB: 1x USB 2.0 - UART: - JP2: 3.3V, TX, RX, GND (3.3V is the square pad) / 115200 8N1 Installation -------------- 1. Connect a serial interface to UART header and interrupt the autostart of kernel. 2. Transfer the factory image via TFTP and write it to the NAND flash. 3. Update U-Boot environment variable. > tftpboot 0x81000000 -factory.img > nand erase 0x1000000 > nand write 0x81000000 0x1000000 ${filesize} > setenv bootpart 2 > saveenv Revert to stock firmware -------------- 1. Revert to stock U-Boot environment variable. > setenv bootpart 1 > saveenv MAC addresses as verified by OEM firmware -------------- WAN: *:XX (label) LAN: *:XX + 1 2.4G: *:XX + 3 5G: *:XX + 4 The label MAC address was found in art 0x0. Credits -------------- Credit goes to the @manatails who first developed how to port OpenWRT to this device and had a significant impact on this patch. And thanks to @adschm and @mans0n for guiding me to revise the code in many ways. Signed-off-by: Jihoon Han Reviewed-by: Sungbo Eo Tested-by: Sungbo Eo --- package/boot/uboot-envtools/files/ath79 | 8 +- .../dts/qca9557_dongwon_dw02-412h-128m.dts | 34 ++++ .../dts/qca9557_dongwon_dw02-412h-64m.dts | 34 ++++ .../ath79/dts/qca9557_dongwon_dw02-412h.dtsi | 175 ++++++++++++++++++ target/linux/ath79/image/nand.mk | 48 +++++ .../ath79/nand/base-files/etc/board.d/01_leds | 4 + .../nand/base-files/etc/board.d/02_network | 10 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 5 + 8 files changed, 315 insertions(+), 3 deletions(-) create mode 100644 target/linux/ath79/dts/qca9557_dongwon_dw02-412h-128m.dts create mode 100644 target/linux/ath79/dts/qca9557_dongwon_dw02-412h-64m.dts create mode 100644 target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 91ba587bf8..00339dcbcc 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -77,9 +77,8 @@ buffalo,wzr-hp-g300nh-s) domywifi,dw33d) ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x10000" "0x10000" ;; -glinet,gl-ar150) - ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000" - ;; +dongwon,dw02-412h-64m|\ +dongwon,dw02-412h-128m|\ glinet,gl-ar300m-lite|\ glinet,gl-ar300m-nand|\ glinet,gl-ar300m-nor|\ @@ -88,6 +87,9 @@ glinet,gl-ar300m16) [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" ;; +glinet,gl-ar150) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000" + ;; netgear,wndr3700|\ netgear,wndr3700-v2|\ netgear,wndrmac-v1) diff --git a/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-128m.dts b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-128m.dts new file mode 100644 index 0000000000..2308d82af9 --- /dev/null +++ b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-128m.dts @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9557_dongwon_dw02-412h.dtsi" + +/ { + model = "Dongwon T&I DW02-412H (128M)"; + compatible = "dongwon,dw02-412h-128m", "qca,qca9557"; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "current"; + reg = <0x0 0x1000000>; + read-only; + }; + + partition@1000000 { + label = "kernel"; + reg = <0x1000000 0x800000>; + }; + + partition@1800000 { + label = "ubi"; + reg = <0x1800000 0x6800000>; + }; + }; +}; diff --git a/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-64m.dts b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-64m.dts new file mode 100644 index 0000000000..2420dc11a9 --- /dev/null +++ b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h-64m.dts @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9557_dongwon_dw02-412h.dtsi" + +/ { + model = "Dongwon T&I DW02-412H (64M)"; + compatible = "dongwon,dw02-412h-64m", "qca,qca9557"; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "current"; + reg = <0x0 0x1000000>; + read-only; + }; + + partition@1000000 { + label = "kernel"; + reg = <0x1000000 0x800000>; + }; + + partition@1800000 { + label = "ubi"; + reg = <0x1800000 0x2800000>; + }; + }; +}; diff --git a/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi new file mode 100644 index 0000000000..fd56983432 --- /dev/null +++ b/target/linux/ath79/dts/qca9557_dongwon_dw02-412h.dtsi @@ -0,0 +1,175 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_wan; + led-failsafe = &led_wan; + led-upgrade = &led_wan; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "WPS button"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "Reset button"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_wan: wan { + label = "green:wan"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "green:wlan"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + label = "log"; + reg = <0x050000 0x010000>; + read-only; + }; + + partition@60000 { + label = "recoverk"; + reg = <0x060000 0x0e0000>; + read-only; + }; + + partition@140000 { + label = "recoverr"; + reg = <0x140000 0x090000>; + read-only; + }; + + partition@1d0000 { + label = "nvram"; + reg = <0x1d0000 0x010000>; + read-only; + }; + + partition@1e0000 { + label = "nvbackup"; + reg = <0x1e0000 0x010000>; + read-only; + }; + + art: partition@1f0000 { + label = "art"; + reg = <0x1f0000 0x010000>; + read-only; + }; + }; + }; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <3>; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + + qca,ar8327-initvals = < + 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ + 0x50 0xcf37cf37 /* LED Control Register 0 */ + 0x54 0x00000000 /* LED Control Register 1 */ + 0x58 0x00000000 /* LED Control Register 2 */ + 0x5c 0x0030c300 /* LED Control Register 3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; + phy-handle = <&phy0>; + pll-data = <0xa6000000 0x00000101 0x00001616>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + }; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; +}; diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index 8d3d2ce5b2..b34e796ac3 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -1,3 +1,16 @@ +define Build/dw-headers + head -c 4 $@ >> $@.tmp && \ + head -c 8 /dev/zero >> $@.tmp && \ + tail -c +9 $@ >> $@.tmp && \ + ( \ + header_crc="$$(head -c 68 $@.tmp | gzip -c | \ + tail -c 8 | od -An -N4 -tx4 --endian little | tr -d ' \n')"; \ + printf "$$(echo $$header_crc | sed 's/../\\x&/g')" | \ + dd of=$@.tmp bs=4 count=1 seek=1 conv=notrunc \ + ) + mv $@.tmp $@ +endef + # attention: only zlib compression is allowed for the boot fs define Build/zyxel-buildkerneljffs mkdir -p $@.tmp/boot @@ -76,6 +89,41 @@ define Device/domywifi_dw33d endef TARGET_DEVICES += domywifi_dw33d +define Device/dongwon_dw02-412h + SOC := qca9557 + DEVICE_VENDOR := Dongwon T&I + DEVICE_MODEL := DW02-412H + DEVICE_ALT0_VENDOR := KT + DEVICE_ALT0_MODEL := GiGA WiFi home + DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca988x-ct + KERNEL_SIZE := 8192k + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | dw-headers + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma | dw-headers + UBINIZE_OPTS := -E 5 + IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \ + check-size + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef + +define Device/dongwon_dw02-412h-64m + $(Device/dongwon_dw02-412h) + DEVICE_VARIANT := (64M) + DEVICE_ALT0_VARIANT := (64M) + IMAGE_SIZE := 49152k +endef +TARGET_DEVICES += dongwon_dw02-412h-64m + +define Device/dongwon_dw02-412h-128m + $(Device/dongwon_dw02-412h) + DEVICE_VARIANT := (128M) + DEVICE_ALT0_VARIANT := (128M) + IMAGE_SIZE := 114688k +endef +TARGET_DEVICES += dongwon_dw02-412h-128m + define Device/glinet_gl-ar300m-common-nand SOC := qca9531 DEVICE_VENDOR := GL.iNet diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds index fc74554763..f694d07e9c 100644 --- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds @@ -6,6 +6,10 @@ board_config_update board=$(board_name) case "$board" in +dongwon,dw02-412h-64m|\ +dongwon,dw02-412h-128m) + ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x02" + ;; glinet,gl-ar300m-nand|\ glinet,gl-ar300m-nor) ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0" diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network index 7402fc067a..dbb9e68150 100644 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -15,6 +15,11 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:wan" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" ;; + dongwon,dw02-412h-64m|\ + dongwon,dw02-412h-128m) + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:4" "3:lan:3" "4:lan:2" "5:lan:1" "1:wan" + ;; glinet,gl-ar750s-nor|\ glinet,gl-ar750s-nor-nand) ucidef_add_switch "switch0" \ @@ -47,6 +52,11 @@ ath79_setup_macs() local board="$1" case "$board" in + dongwon,dw02-412h-64m|\ + dongwon,dw02-412h-128m) + wan_mac=$(mtd_get_mac_binary art 0x0) + label_mac=$wan_mac + ;; netgear,wndr3700-v4|\ netgear,wndr4300|\ netgear,wndr4300sw|\ diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index f8cc8f1a2b..71dfb161e4 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -13,6 +13,11 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(mtd_get_mac_binary art 0x12) ;; + dongwon,dw02-412h-64m|\ + dongwon,dw02-412h-128m) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 4) + ;; glinet,gl-ar750s-nor|\ glinet,gl-ar750s-nor-nand) caldata_extract "art" 0x5000 0x844 From 184dc6e32a4d2e22d916b709fdea69e1512889a7 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Wed, 29 Sep 2021 00:25:01 +0800 Subject: [PATCH 56/65] ath79: add support for Letv LBA-047-CH Specifications: SOC: QCA9531 650 MHz ROM: 16 MiB Flash (Winbond W25Q128FV) RAM: 128 MiB DDR2 (Winbond W971GG6SB) LAN: 10/100M *2 WAN: 10/100M *1 LED: BGR color *1 Mac address: label C8:0E:77:xx:xx:68 art@0x0 lan C8:0E:77:xx:xx:62 art@0x6 wan C8:0E:77:xx:xx:68 art@0x0 (same as the label) wlan C8:0E:77:xx:xx:B2 art@0x1002 (load automatically) TFTP installation: * Set local IP to 192.168.67.100 and open tftpd64, link lan port to computer. Rename "xxxx-factory.bin" to "openwrt-ar71xx-generic-ap147-16M-rootfs-squashfs.bin". * Make sure firmware file is in the tftpd's directory, push reset button and plug in, hold it for 5 seconds, and then it will download firmware from tftp server automatically. More information: * This device boot from flash@0xe80000 so we need a okli loader to deal with small kernel partition issue. In order to make full use of the storage space, connect a part of the previous kernel partition to the firmware. Stock Modify 0x000000-0x040000(u-boot) 0x000000-0x040000(u-boot) 0x040000-0x050000(u-boot-env) 0x000000-0x050000(u-boot-env) 0x050000-0xe80000(rootfs) 0x050000-0xe80000(firmware part1) 0xe80000-0xff0000(kernel) 0xe80000-0xe90000(okli-loader) 0xe90000-0xff0000(firmware part2) 0xff0000-0x1000000(art) 0xff0000-0x1000000(art) Signed-off-by: Shiji Yang --- .../ath79/dts/qca9531_letv_lba-047-ch.dts | 158 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 5 + target/linux/ath79/image/generic.mk | 15 ++ 3 files changed, 178 insertions(+) create mode 100644 target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts diff --git a/target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts b/target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts new file mode 100644 index 0000000000..d65417c0d5 --- /dev/null +++ b/target/linux/ath79/dts/qca9531_letv_lba-047-ch.dts @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca953x.dtsi" + +#include +#include +#include + +/ { + model = "Letv LBA-047-CH"; + compatible = "letv,lba-047-ch", "qca,qca9531"; + + aliases { + led-boot = &led_status_red; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_red; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&led_wan_pin>; + + led_status_blue: status_blue { + label = "blue:status"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + led_status_red: status_red { + label = "red:status"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + devices = <&fwconcat0 &fwconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x0>; + label = "firmware"; + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,ih-magic = ; + }; + }; + }; +}; + +&pinmux { + /* GPIO 4: LED_LINK_5 (WAN) */ + led_wan_pin: pinmux_led_wan_pin { + pinctrl-single,bits = <0x04 0x0000002d 0x000000ff>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + read-only; + }; + + fwconcat0: partition@50000 { + label = "fwconcat0"; + reg = <0x50000 0xe30000>; + }; + + partition@e80000 { + label = "loader"; + reg = <0xe80000 0x10000>; + }; + + fwconcat1: partition@e90000 { + label = "fwconcat1"; + reg = <0xe90000 0x160000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + compatible = "qca,qca9530-eth", "syscon", "simple-mfd"; + + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index af4cf08ce0..01e364a8fe 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -306,6 +306,11 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" ;; + letv,lba-047-ch) + ucidef_set_interface_wan "eth0" + ucidef_add_switch "switch0" \ + "0@eth1" "3:lan:2" "4:lan:1" + ;; librerouter,librerouter-v1) ucidef_add_switch "switch0" \ "0@eth0" "5:wan" "6@eth1" "4:lan" diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index b170323394..fb393ba082 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1414,6 +1414,21 @@ define Device/joyit_jt-or750i endef TARGET_DEVICES += joyit_jt-or750i +define Device/letv_lba-047-ch + $(Device/loader-okli-uimage) + SOC := qca9531 + DEVICE_VENDOR := Letv + DEVICE_MODEL := LBA-047-CH + IMAGE_SIZE := 15936k + LOADER_FLASH_OFFS := 0x50000 + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | pad-to 14528k | \ + append-loader-okli-uimage $(1) | pad-to 64k +endef +TARGET_DEVICES += letv_lba-047-ch + define Device/librerouter_librerouter-v1 SOC := qca9558 DEVICE_VENDOR := Librerouter From 3f96743459617bb3f60bf7417f08fb8060f96a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Veronese?= Date: Sun, 17 Oct 2021 03:14:41 +0200 Subject: [PATCH 57/65] ath79: fix UBNT Aircube AC gpios MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GPIOs on the Aircube AC are wrong: - Reset GPIO moved from 17 to 12 - PoE Pass Through GPIO for Aircube AC is 3 Fixes: 491ae3357e10 ("ath79: add support for Ubiquiti airCube AC") Signed-off-by: Nicolò Veronese --- target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts | 2 +- .../ath79/generic/base-files/etc/board.d/03_gpio_switches | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts b/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts index 25adac4e8a..15e23f2421 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_aircube-ac.dts @@ -15,7 +15,7 @@ reset { label = "reset"; linux,code = ; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; debounce-interval = <60>; }; }; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches index 83f428c54a..ca7d8c633c 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches @@ -76,13 +76,13 @@ tplink,wbs510-v2) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20" ;; ubnt,aircube-ac|\ -ubnt,aircube-isp) - ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "11" - ;; ubnt,nanobeam-ac-gen2|\ ubnt,nanostation-ac) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "3" ;; +ubnt,aircube-isp) + ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "11" + ;; ubnt,nanostation-m) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "8" ;; From abb4083fa06841ef5b094aee24a3b1f58403516b Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Mon, 11 Feb 2019 17:30:07 +0100 Subject: [PATCH 58/65] apm821xx: MBL: MR24: fetch IP address over dhcp by default This patch changes the default network configuration to fetch the IP addresses over dhcp instead of being statically assigned. Signed-off-by: Christian Lamparter --- target/linux/apm821xx/base-files/etc/board.d/02_network | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/apm821xx/base-files/etc/board.d/02_network b/target/linux/apm821xx/base-files/etc/board.d/02_network index f289e4ec74..3a97c67f28 100644 --- a/target/linux/apm821xx/base-files/etc/board.d/02_network +++ b/target/linux/apm821xx/base-files/etc/board.d/02_network @@ -10,7 +10,7 @@ case "$board" in meraki,mr24|\ wd,mybooklive|\ wd,mybooklive-duo) - ucidef_set_interface_lan "eth0" + ucidef_set_interface_lan "eth0" "dhcp" ;; netgear,wndap620) ucidef_add_switch "switch0" "2:lan" "5@eth0" From 78be2741aa85abe39809ff3f3ce3e10942138831 Mon Sep 17 00:00:00 2001 From: Pavel Kubelun Date: Mon, 6 May 2019 20:59:40 +0300 Subject: [PATCH 59/65] ipq40xx: fix sleep clock It seems like sleep_clk was copied from ipq806x. Fix ipq40xx sleep_clk to the value QSDK defines. Signed-off-by: Pavel Kubelun Signed-off-by: Christian Lamparter [5.4+5.10] --- .../105-ipq40xx-fix-sleep-clock.patch | 29 +++++++++++++++++++ .../105-ipq40xx-fix-sleep-clock.patch | 29 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 target/linux/ipq40xx/patches-5.10/105-ipq40xx-fix-sleep-clock.patch create mode 100644 target/linux/ipq40xx/patches-5.4/105-ipq40xx-fix-sleep-clock.patch diff --git a/target/linux/ipq40xx/patches-5.10/105-ipq40xx-fix-sleep-clock.patch b/target/linux/ipq40xx/patches-5.10/105-ipq40xx-fix-sleep-clock.patch new file mode 100644 index 0000000000..97a36872e9 --- /dev/null +++ b/target/linux/ipq40xx/patches-5.10/105-ipq40xx-fix-sleep-clock.patch @@ -0,0 +1,29 @@ +From 4d44bb1031a68d7d5b604d3b340c059f41ca62af Mon Sep 17 00:00:00 2001 +From: dissent1 +Date: Mon, 6 May 2019 20:55:16 +0300 +Subject: [PATCH] ipq40xx: fix sleep clock + +It seems like sleep_clk was copied from ipq806x. +Fix ipq40xx sleep_clk to the value QSDK defines. + +Also rename the sleep clock node like the GCC driver names it. + +Signed-off-by: Pavel Kubelun +--- + arch/arm/boot/dts/qcom-ipq4019.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi +@@ -141,9 +141,9 @@ + }; + + clocks { +- sleep_clk: sleep_clk { ++ sleep_clk: gcc_sleep_clk_src { + compatible = "fixed-clock"; +- clock-frequency = <32768>; ++ clock-frequency = <32000>; + #clock-cells = <0>; + }; + diff --git a/target/linux/ipq40xx/patches-5.4/105-ipq40xx-fix-sleep-clock.patch b/target/linux/ipq40xx/patches-5.4/105-ipq40xx-fix-sleep-clock.patch new file mode 100644 index 0000000000..97a36872e9 --- /dev/null +++ b/target/linux/ipq40xx/patches-5.4/105-ipq40xx-fix-sleep-clock.patch @@ -0,0 +1,29 @@ +From 4d44bb1031a68d7d5b604d3b340c059f41ca62af Mon Sep 17 00:00:00 2001 +From: dissent1 +Date: Mon, 6 May 2019 20:55:16 +0300 +Subject: [PATCH] ipq40xx: fix sleep clock + +It seems like sleep_clk was copied from ipq806x. +Fix ipq40xx sleep_clk to the value QSDK defines. + +Also rename the sleep clock node like the GCC driver names it. + +Signed-off-by: Pavel Kubelun +--- + arch/arm/boot/dts/qcom-ipq4019.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi +@@ -141,9 +141,9 @@ + }; + + clocks { +- sleep_clk: sleep_clk { ++ sleep_clk: gcc_sleep_clk_src { + compatible = "fixed-clock"; +- clock-frequency = <32768>; ++ clock-frequency = <32000>; + #clock-cells = <0>; + }; + From 8550086c24e54b8d333045315e59947b9badf08e Mon Sep 17 00:00:00 2001 From: Lucian Cristian Date: Tue, 31 Aug 2021 10:04:36 +0300 Subject: [PATCH 60/65] elfutils: enable host build frr 8.0 needs host libelf dev add option for host build tested on x86, ramips, kirkwood Signed-off-by: Lucian Cristian [changed commit author's email] Signed-off-by: Christian Lamparter --- package/libs/elfutils/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile index d595e4caf2..b0c9b8bd8c 100644 --- a/package/libs/elfutils/Makefile +++ b/package/libs/elfutils/Makefile @@ -26,6 +26,7 @@ PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/nls.mk +include $(INCLUDE_DIR)/host-build.mk define Package/elfutils/Default SECTION:=libs @@ -60,6 +61,12 @@ else CONFIGURE_ARGS += --disable-nls endif +HOST_CONFIGURE_ARGS += \ + --disable-debuginfod \ + --disable-libdebuginfod \ + --without-lzma \ + --without-zstd + CONFIGURE_ARGS += \ --program-prefix=eu- \ --disable-debuginfod \ @@ -97,6 +104,7 @@ define Package/libelf/install endef # these lines need to be ordered by dependency because of ABI versioning +$(eval $(call HostBuild)) $(eval $(call BuildPackage,libelf)) $(eval $(call BuildPackage,libdw)) $(eval $(call BuildPackage,libasm)) From b69dfb0a99cf228d99ff4bc9a0848df85969ce7d Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Wed, 8 Sep 2021 14:14:27 +0200 Subject: [PATCH 61/65] kernel/modules: prevent bonding driver to create default bond0 interface When loading the bonding driver, bonding interface are automatically created on bonding module load. > ip a s bond0 > 14: bond0: mtu 1500 qdisc noop state DOWN > group default qlen 1000 > link/ether a6:f2:20:64:c1:b9 brd ff:ff:ff:ff:ff:ff This is not necessary in openwrt as we do not use this created interface. The netifd creates a bonding interface based on its network configuration name and configures this over the netifd bonding proto handler. In order to keep the overview of the interfaces clear, bonding interfaces should not be created automatically when loading this module, because they are not used anyway. Signed-off-by: Florian Eckert --- package/kernel/linux/modules/netsupport.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index 62d79db51e..166172dbf3 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -48,6 +48,7 @@ define KernelPackage/bonding KCONFIG:=CONFIG_BONDING FILES:=$(LINUX_DIR)/drivers/net/bonding/bonding.ko AUTOLOAD:=$(call AutoLoad,40,bonding) + MODPARAMS.bonding:=max_bonds=0 endef define KernelPackage/bonding/description From c735d2e2187ff13b305fc4b73ba047cc3d43f2d5 Mon Sep 17 00:00:00 2001 From: Sander Vanheule Date: Sun, 31 Oct 2021 14:41:54 +0100 Subject: [PATCH 62/65] realtek: backport GPIO IRQ index fix Backport the patch queued upstream for 5.16. The patch differs slightly from the upstream patch due to an upstream change that added a convenience function. Signed-off-by: Sander Vanheule --- ...ealtek-otto-fix-gpio-line-irq-offset.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 target/linux/realtek/patches-5.10/007-5.16-gpio-realtek-realtek-otto-fix-gpio-line-irq-offset.patch diff --git a/target/linux/realtek/patches-5.10/007-5.16-gpio-realtek-realtek-otto-fix-gpio-line-irq-offset.patch b/target/linux/realtek/patches-5.10/007-5.16-gpio-realtek-realtek-otto-fix-gpio-line-irq-offset.patch new file mode 100644 index 0000000000..f1f739d470 --- /dev/null +++ b/target/linux/realtek/patches-5.10/007-5.16-gpio-realtek-realtek-otto-fix-gpio-line-irq-offset.patch @@ -0,0 +1,21 @@ +gpio: realtek-otto: fix GPIO line IRQ offset + +The irqchip uses one domain for all GPIO lines, so th line offset should be +determined w.r.t. the first line of the first port, not the first line of the +triggered port. + +Fixes: 0d82fb1127fb ("gpio: Add Realtek Otto GPIO support") +Signed-off-by: Sander Vanheule +Link: https://lore.kernel.org/linux-gpio/20211028085243.34360-1-sander@svanheule.net/ + +--- a/drivers/gpio/gpio-realtek-otto.c ++++ b/drivers/gpio/gpio-realtek-otto.c +@@ -206,7 +206,7 @@ static void realtek_gpio_irq_handler(str + status = realtek_gpio_read_isr(ctrl, lines_done / 8); + port_pin_count = min(gc->ngpio - lines_done, 8U); + for_each_set_bit(offset, &status, port_pin_count) { +- irq = irq_find_mapping(gc->irq.domain, offset); ++ irq = irq_find_mapping(gc->irq.domain, offset + lines_done); + generic_handle_irq(irq); + } + } From 24efb49ff0ef41979e58e1fc5a88281088d999cd Mon Sep 17 00:00:00 2001 From: Davide Fioravanti Date: Wed, 2 Sep 2020 00:55:11 +0200 Subject: [PATCH 63/65] ipq40xx: enable CONFIG_CMDLINE_PARTITION and CONFIG_LEDS_TLC591XX CONFIG_CMDLINE_PARTITION: Some devices with mmc like the Netgear Orbi Pro SRS60 or Netgear Orbi RBR50 needs to hardcode the partitions layout in the cmdline boot correctly CONFIG_LEDS_TLC591XX: This is needed for the led driver found in the Netgear Orbi Pro SRS60 Signed-off-by: Davide Fioravanti Signed-off-by: Robert Marko Signed-off-by: Shang Jia [added 5.10 config] Signed-off-by: Christian Lamparter --- target/linux/ipq40xx/config-5.10 | 2 ++ target/linux/ipq40xx/config-5.4 | 2 ++ 2 files changed, 4 insertions(+) diff --git a/target/linux/ipq40xx/config-5.10 b/target/linux/ipq40xx/config-5.10 index 3a78123d52..16baa99f4d 100644 --- a/target/linux/ipq40xx/config-5.10 +++ b/target/linux/ipq40xx/config-5.10 @@ -54,6 +54,7 @@ CONFIG_BOUNCE=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_QCOM=y CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE_PARTITION=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_QCOM=y CONFIG_COMPAT_32BIT_TIME=y @@ -224,6 +225,7 @@ CONFIG_IRQ_WORK=y CONFIG_LEDS_LP5523=y CONFIG_LEDS_LP5562=y CONFIG_LEDS_LP55XX_COMMON=y +CONFIG_LEDS_TLC591XX=y CONFIG_LIBFDT=y CONFIG_LLD_VERSION=0 CONFIG_LOCK_DEBUGGING_SUPPORT=y diff --git a/target/linux/ipq40xx/config-5.4 b/target/linux/ipq40xx/config-5.4 index 79c6d6c6c2..b4251a7748 100644 --- a/target/linux/ipq40xx/config-5.4 +++ b/target/linux/ipq40xx/config-5.4 @@ -52,6 +52,7 @@ CONFIG_BOUNCE=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_QCOM=y CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE_PARTITION=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_QCOM=y CONFIG_COMPAT_32BIT_TIME=y @@ -222,6 +223,7 @@ CONFIG_IRQ_WORK=y CONFIG_LEDS_LP5523=y CONFIG_LEDS_LP5562=y CONFIG_LEDS_LP55XX_COMMON=y +CONFIG_LEDS_TLC591XX=y CONFIG_LIBFDT=y CONFIG_LOCK_DEBUGGING_SUPPORT=y CONFIG_LOCK_SPIN_ON_OWNER=y From 6e137943442fb0ab66c34462fa19e5a4260eddd5 Mon Sep 17 00:00:00 2001 From: Davide Fioravanti Date: Wed, 2 Sep 2020 01:18:16 +0200 Subject: [PATCH 64/65] base-files: add minimal mmc support Added minimal mmc support for helper functions: - find_mmc_part: Look for a given partition name. Returns the coresponding partition path - caldata_extract_mmc: Look for a given partition name and then extracts the calibration data - mmc_get_mac_binary: Returns the mac address from a given partition name and offset Signed-off-by: Davide Fioravanti Signed-off-by: Robert Marko [replace dd with caldata_dd, moved sysupgrade mmc to orbi] Signed-off-by: Christian Lamparter --- package/base-files/files/lib/functions.sh | 13 +++++++++++++ package/base-files/files/lib/functions/caldata.sh | 13 +++++++++++++ package/base-files/files/lib/functions/system.sh | 9 +++++++++ 3 files changed, 35 insertions(+) diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index a5b23eb135..e56e4637f0 100644 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -330,6 +330,19 @@ find_mtd_part() { echo "${INDEX:+$PREFIX$INDEX}" } +find_mmc_part() { + local DEVNAME PARTNAME + + if grep -q "$1" /proc/mtd; then + echo "" && return 0 + fi + + for DEVNAME in /sys/block/mmcblk*/mmcblk*p*; do + PARTNAME="$(grep PARTNAME ${DEVNAME}/uevent | cut -f2 -d'=')" + [ "$PARTNAME" = "$1" ] && echo "/dev/$(basename $DEVNAME)" && return 0 + done +} + group_add() { local name="$1" local gid="$2" diff --git a/package/base-files/files/lib/functions/caldata.sh b/package/base-files/files/lib/functions/caldata.sh index 2177cf8415..d7b88c7dce 100644 --- a/package/base-files/files/lib/functions/caldata.sh +++ b/package/base-files/files/lib/functions/caldata.sh @@ -48,6 +48,19 @@ caldata_extract_ubi() { caldata_die "failed to extract calibration data from $ubi" } +caldata_extract_mmc() { + local part=$1 + local offset=$(($2)) + local count=$(($3)) + local mmc_part + + mmc_part=$(find_mmc_part $part) + [ -n "$mmc_part" ] || caldata_die "no mmc partition found for partition $part" + + caldata_dd $mmc_part /lib/firmware/$FIRMWARE $count $offset || \ + caldata_die "failed to extract calibration data from $mmc_part" +} + caldata_extract_reverse() { local part=$1 local offset=$2 diff --git a/package/base-files/files/lib/functions/system.sh b/package/base-files/files/lib/functions/system.sh index 80e417182a..0ac2912014 100644 --- a/package/base-files/files/lib/functions/system.sh +++ b/package/base-files/files/lib/functions/system.sh @@ -135,6 +135,15 @@ mtd_get_part_size() { done < /proc/mtd } +mmc_get_mac_binary() { + local part_name="$1" + local offset="$2" + local part + + part=$(find_mmc_part "$part_name") + get_mac_binary "$part" "$offset" +} + macaddr_add() { local mac=$1 local val=$2 From 2cb24b3f3cd89692f3c0bd137f3f560ada359bfa Mon Sep 17 00:00:00 2001 From: Davide Fioravanti Date: Wed, 2 Sep 2020 02:10:16 +0200 Subject: [PATCH 65/65] ipq40xx: add support for Netgear SRR60/SRS60 and RBR50/RBS50 The Netgear SRS60 and SRR60 (sold together as SRK60) are two almost identical AC3000 routers. The SRR60 has one port labeled as wan while the SRS60 not. The RBR50 and RBS50 (sold together as RBK50) have a different external shape but they have an USB 2.0 port on the back. This patch has been tested only on SRS60 and RBR50, but should work on SRR60 and RBS50. Hardware -------- SoC: Qualcomm IPQ4019 (717 MHz, 4 cores 4 threads) RAM: 512MB DDR3 FLASH: 4GB EMMC ETH: - 3x 10/100/1000 Mbps Ethernet - 1x 10/100/1000 Mbps Ethernet (WAN) WIFI: - 2.4GHz: 1x IPQ4019 (2x2:2) - 5GHz: 1x IPQ4019 (2x2:2) - 5GHz: 1x QCA9984 (4x4:4) - 6 internal antennas BTN: - 1x Reset button - 1x Sync button - 1x ON/OFF button LEDS: - 8 leds controlled by TLC59208F (they can be switched on/off independendently but the color can by changed by GPIOs) - 1x Red led (Power) - 1x Green led (Power) UART: - 115200-8-N-1 Everything works correctly. Installation ------------ These routers have a dual partition system. However this firmware works only on boot partition 1 and the OEM web interface will always flash on the partition currently not booted. The following steps will use the SRS60 firmware, but you have to chose the right firmware for your router. There are 2 ways to install Openwrt the first time: 1) Using NMRPflash 1. Download nmrpflash (https://github.com/jclehner/nmrpflash) 2. Put the openwrt-ipq40xx-generic-netgear_srs60-squashfs-factory.img file in the same folder of the nmrpflash executable 3. Connect your pc to the router using the port near the power button. 4. Run "nmrpflash -i XXX -f openwrt-ipq40xx-generic-netgear_srs60-squashfs-factory.img". Replace XXX with your network interface (can be identified by running "nmrpflash -L") 5. Power on the router and wait for the flash to complete. After about a minute the router should boot directly to Openwrt. If nothing happens try to reboot the router. If you have problems flashing try to set "10.164.183.253" as your computer IP address 2) Without NMRPflash The OEM web interface will always flash on the partition currently not booted, so to flash OpenWrt for the first time you have to switch to boot partition 2 and then flash the factory image directly from the OEM web interface. To switch on partition 2 you have to enable telnet first: 1. Go to http://192.168.1.250/debug.htm and check "Enable Telnet". 2. Connect through telent ("telnet 192.168.1.250") and login using admin/password. To read the current boot_part: artmtd -r boot_part To write the new boot_part: artmtd -w boot_part 02 Then reboot the router and then check again the current booted partition Now that you are on boot partition 2 you can flash the factory Openwrt image directly from the OEM web interface. Restore OEM Firmware -------------------- 1. Download the stock firmware from official netgear support. 2. Follow the nmrpflash procedure like above, using the official Netgear firmware (for example SRS60-V2.2.1.210.img) nmrpflash -i XXX -f SRS60-V2.2.1.210.img Notes ----- 1) You can check and edit the boot partition in the Uboot shell using the UART connection. "boot_partition_show" shows the current boot partition "boot_partition_set 1" sets the current boot partition to 1 2) Router mac addresses: LAN XX:XX:XX:XX:XX:69 WAN XX:XX:XX:XX:XX:6a WIFI 2G XX:XX:XX:XX:XX:69 WIFI 5G XX:XX:XX:XX:XX:6b WIFI 5G (2nd) XX:XX:XX:XX:XX:6c LABEL XX:XX:XX:XX:XX:69 Signed-off-by: Davide Fioravanti Signed-off-by: Robert Marko [added 5.10 changes for 901-arm-boot-add-dts-files.patch, moved sysupgrade mmc.sh to here and renamed it, various dtsi changes] Signed-off-by: Christian Lamparter --- .../ipq40xx/base-files/etc/board.d/02_network | 8 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 21 ++ .../ipq40xx/base-files/lib/upgrade/netgear.sh | 76 ++++ .../base-files/lib/upgrade/platform.sh | 6 + .../arch/arm/boot/dts/qcom-ipq4019-orbi.dtsi | 325 ++++++++++++++++++ .../arch/arm/boot/dts/qcom-ipq4019-rbr50.dts | 30 ++ .../arch/arm/boot/dts/qcom-ipq4019-rbs50.dts | 30 ++ .../arch/arm/boot/dts/qcom-ipq4019-srr60.dts | 12 + .../arch/arm/boot/dts/qcom-ipq4019-srs60.dts | 12 + target/linux/ipq40xx/image/generic.mk | 58 ++++ .../901-arm-boot-add-dts-files.patch | 12 +- .../901-arm-boot-add-dts-files.patch | 6 +- 12 files changed, 591 insertions(+), 5 deletions(-) create mode 100644 target/linux/ipq40xx/base-files/lib/upgrade/netgear.sh create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-orbi.dtsi create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbr50.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbs50.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srr60.dts create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srs60.dts diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index a675acc8db..50b460e441 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -106,6 +106,14 @@ ipq40xx_setup_interfaces() "0u@eth0" "3:lan:2" "4:lan:1" ucidef_set_interface_wan "eth1" ;; + netgear,rbr50|\ + netgear,rbs50|\ + netgear,srr60|\ + netgear,srs60) + ucidef_add_switch "switch0" \ + "0u@eth0" "2:lan" "3:lan" "4:lan" + ucidef_set_interface_wan "eth1" + ;; qxwlan,e2600ac-c1 |\ qxwlan,e2600ac-c2) ucidef_set_interfaces_lan_wan "eth0" "eth1" diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 87876ad844..505182bb65 100644 --- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -46,6 +46,13 @@ case "$FIRMWARE" in # OEM assigns 4 sequential MACs ath10k_patch_mac $(macaddr_setbit_la $(macaddr_add "$(cat /sys/class/net/eth0/address)" 4)) ;; + netgear,rbr50|\ + netgear,rbs50|\ + netgear,srr60|\ + netgear,srs60) + caldata_extract_mmc "0:ART" 0x9000 0x2f20 + ath10k_patch_mac $(mmc_get_mac_binary ARTMTD 0x12) + ;; esac ;; "ath10k/pre-cal-ahb-a000000.wifi.bin") @@ -150,6 +157,13 @@ case "$FIRMWARE" in caldata_extract "ART" 0x1000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary dnidata 0x0) ;; + netgear,rbr50|\ + netgear,rbs50|\ + netgear,srr60|\ + netgear,srs60) + caldata_extract_mmc "0:ART" 0x1000 0x2f20 + ath10k_patch_mac $(mmc_get_mac_binary ARTMTD 0x0) + ;; netgear,wac510) caldata_extract "0:ART" 0x1000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary "0:MANUDATA" 0x6) @@ -264,6 +278,13 @@ case "$FIRMWARE" in caldata_extract "ART" 0x5000 0x2f20 ath10k_patch_mac $(mtd_get_mac_binary dnidata 0xc) ;; + netgear,rbr50|\ + netgear,rbs50|\ + netgear,srr60|\ + netgear,srs60) + caldata_extract_mmc "0:ART" 0x5000 0x2f20 + ath10k_patch_mac $(mmc_get_mac_binary ARTMTD 0xc) + ;; netgear,wac510) caldata_extract "0:ART" 0x5000 0x2f20 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary "0:MANUDATA" 0x6) 16) diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/netgear.sh b/target/linux/ipq40xx/base-files/lib/upgrade/netgear.sh new file mode 100644 index 0000000000..f3fb626d1f --- /dev/null +++ b/target/linux/ipq40xx/base-files/lib/upgrade/netgear.sh @@ -0,0 +1,76 @@ +# SPDX-License-Identifier: GPL-2.0-only +. /lib/functions.sh + +platform_do_upgrade_netgear_orbi_upgrade() { + command -v losetup >/dev/null || { + logger -s "Upgrade failed: 'losetup' not installed." + return 1 + } + + local tar_file=$1 + local kernel=$2 + local rootfs=$3 + + [ -z "$kernel" ] && kernel=$(find_mmc_part "kernel") + [ -z "$rootfs" ] && rootfs=$(find_mmc_part "rootfs") + + [ -z "$kernel" ] && echo "Upgrade failed: kernel partition not found! Rebooting..." && reboot -f + [ -z "$rootfs" ] && echo "Upgrade failed: rootfs partition not found! Rebooting..." && reboot -f + + netgear_orbi_do_flash $tar_file $kernel $rootfs + + echo "sysupgrade successful" + umount -a + reboot -f +} + +netgear_orbi_do_flash() { + local tar_file=$1 + local kernel=$2 + local rootfs=$3 + + # keep sure its unbound + losetup --detach-all || { + echo "Failed to detach all loop devices. Skip this try." + reboot -f + } + + # use the first found directory in the tar archive + local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} + + echo "flashing kernel to $kernel" + tar xf $tar_file ${board_dir}/kernel -O >$kernel + + echo "flashing rootfs to ${rootfs}" + tar xf $tar_file ${board_dir}/root -O >"${rootfs}" + + # a padded rootfs is needed for overlay fs creation + local offset=$(tar xf $tar_file ${board_dir}/root -O | wc -c) + [ $offset -lt 65536 ] && { + echo "Wrong size for rootfs: $offset" + sleep 10 + reboot -f + } + + # Mount loop for rootfs_data + local loopdev="$(losetup -f)" + losetup -o $offset $loopdev $rootfs || { + echo "Failed to mount looped rootfs_data." + sleep 10 + reboot -f + } + + echo "Format new rootfs_data at position ${offset}." + mkfs.ext4 -F -L rootfs_data $loopdev + mkdir /tmp/new_root + mount -t ext4 $loopdev /tmp/new_root && { + echo "Saving config to rootfs_data at position ${offset}." + cp -v "$UPGRADE_BACKUP" "/tmp/new_root/$BACKUP_FILE" + umount /tmp/new_root + } + + # Cleanup + losetup -d $loopdev >/dev/null 2>&1 + sync +} diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh index 68027be666..e391976606 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh @@ -117,6 +117,12 @@ platform_do_upgrade() { [ "$(rootfs_type)" = "tmpfs" ] && mtd erase firmware default_do_upgrade "$1" ;; + netgear,rbr50 |\ + netgear,rbs50 |\ + netgear,srr60 |\ + netgear,srs60) + platform_do_upgrade_netgear_orbi_upgrade "$1" + ;; openmesh,a42 |\ openmesh,a62 |\ plasmacloud,pa1200 |\ diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-orbi.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-orbi.dtsi new file mode 100644 index 0000000000..bdbee7f837 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-orbi.dtsi @@ -0,0 +1,325 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + aliases { + led-boot = &led_status_white; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_blue; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + status = "okay"; + + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + + switch_lan_bmp = <0x1c>; + switch_wan_bmp = <0x02>; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&tlmm 49 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + label = "green:power"; + gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + led-1 { + label = "red:power"; + gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>; + panic-indicator; + }; + + led_status_green: led-2 { + label = "green:status"; + gpios = <&tlmm 53 GPIO_ACTIVE_HIGH>; + }; + + led_status_red: led-3 { + label = "red:status"; + gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + }; + + led_status_blue: led-4 { + label = "blue:status"; + gpios = <&tlmm 57 GPIO_ACTIVE_HIGH>; + }; + + led_status_white: led-5 { + label = "white:status"; + gpios = <&tlmm 60 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&vqmmc { + status = "okay"; +}; + +&sdhci { + status = "okay"; + + pinctrl-0 = <&sd_pins>; + pinctrl-names = "default"; + cd-gpios = <&tlmm 22 GPIO_ACTIVE_LOW>; + vqmmc-supply = <&vqmmc>; +}; + +&qpic_bam { + status = "okay"; +}; + +&tlmm { + mdio_pins: mdio_pinmux { + mux_1 { + pins = "gpio6"; + function = "mdio"; + bias-pull-up; + }; + + mux_2 { + pins = "gpio7"; + function = "mdc"; + bias-pull-up; + }; + }; + + serial_pins: serial_pinmux { + mux { + pins = "gpio16", "gpio17"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + i2c_0_pins: i2c_0_pinmux { + pinmux { + function = "blsp_i2c0"; + pins = "gpio58", "gpio59"; + bias-disable; + }; + }; + + sd_pins: sd_pins { + pinmux { + function = "sdio"; + pins = "gpio23", "gpio24", "gpio25", "gpio26", + "gpio28", "gpio29", "gpio30", "gpio31"; + drive-strength = <10>; + }; + + pinmux_sd_clk { + function = "sdio"; + pins = "gpio27"; + drive-strength = <16>; + }; + + pinmux_sd7 { + function = "sdio"; + pins = "gpio32"; + drive-strength = <10>; + bias-disable; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_i2c3 { + pinctrl-0 = <&i2c_0_pins>; + pinctrl-names = "default"; + + status = "okay"; + + led-controller@27 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,tlc59108"; /* really is tlc59208f */ + reg = <0x27>; + + led0@0 { + label = "rgb:led0"; + reg = <0x0>; + linux,default-trigger = "default-on"; + }; + + led1@1 { + label = "rgb:led1"; + reg = <0x1>; + linux,default-trigger = "default-on"; + }; + + led2@2 { + label = "rgb:led2"; + reg = <0x2>; + linux,default-trigger = "default-on"; + }; + + led3@3 { + label = "rgb:led3"; + reg = <0x3>; + linux,default-trigger = "default-on"; + }; + + led4@4 { + label = "rgb:led4"; + reg = <0x4>; + linux,default-trigger = "default-on"; + }; + + led5@5 { + label = "rgb:led5"; + reg = <0x5>; + linux,default-trigger = "default-on"; + }; + + led6@6 { + label = "rgb:led6"; + reg = <0x6>; + linux,default-trigger = "default-on"; + }; + + led7@7 { + label = "rgb:led7"; + reg = <0x7>; + linux,default-trigger = "default-on"; + }; + }; +}; + +&blsp1_uart1 { + status = "okay"; + + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; +}; + +&cryptobam { + status = "okay"; +}; + +&gmac0 { + vlan_tag = <1 0x1c>; +}; + +&gmac1 { + qcom,phy_mdio_addr = <0>; + vlan_tag = <2 0x02>; +}; + +&pcie0 { + status = "okay"; + + perst-gpio = <&tlmm 38 GPIO_ACTIVE_LOW>; + wake-gpio = <&tlmm 50 GPIO_ACTIVE_LOW>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + compatible = "qcom,ath10k"; + status = "okay"; + reg = <0x00010000 0 0 0 0>; + ieee80211-freq-limit = <5470000 5875000>; + qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60"; + }; + }; +}; + +&wifi0 { + status = "okay"; + + qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60"; +}; + +&wifi1 { + status = "okay"; + + qcom,ath10k-calibration-variant = "Netgear-Orbi-Pro-SRK60"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbr50.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbr50.dts new file mode 100644 index 0000000000..a803999804 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbr50.dts @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-orbi.dtsi" + +/ { + model = "NETGEAR RBR50"; + compatible = "netgear,rbr50"; + + chosen { + bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K@17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_ALT)ro,256K(0:CDT)ro,256K(0:CDT_ALT)ro,256K(0:DDRPARAMS)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_ALT)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K@9233K(firmware),256K(mtdoops)ro,1457651200(reserved)ro,-(unallocated) rootfstype=squashfs,ext4 rootwait"; + }; + + soc { + usb2@60f8800 { + status = "okay"; + }; + + usb3@8af8800 { + status = "okay"; + }; + }; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb2_hs_phy { + status = "okay"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbs50.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbs50.dts new file mode 100644 index 0000000000..4d0a9132c6 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rbs50.dts @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-orbi.dtsi" + +/ { + model = "NETGEAR RBS50"; + compatible = "netgear,rbs50"; + + chosen { + bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K@17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_ALT)ro,256K(0:CDT)ro,256K(0:CDT_ALT)ro,256K(0:DDRPARAMS)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_ALT)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K@9233K(firmware),256K(mtdoops)ro,1457651200(reserved)ro,-(unallocated) rootfstype=squashfs,ext4 rootwait"; + }; + + soc { + usb2@60f8800 { + status = "okay"; + }; + + usb3@8af8800 { + status = "okay"; + }; + }; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&usb2_hs_phy { + status = "okay"; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srr60.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srr60.dts new file mode 100644 index 0000000000..80bcb2e204 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srr60.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-orbi.dtsi" + +/ { + model = "NETGEAR SRR60"; + compatible = "netgear,srr60"; + + chosen { + bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K@17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_1)ro,256K(0:CDT)ro,256K(0:CDT_1)ro,512K(0:BOOTCONFIG1)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_1)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K@9233K(firmware),256K(mtdoops)ro,64K(cert)ro,3840K(kernel-2)ro,31488K(rootfs-2)ro,35328K@44881K(firmware-2)ro,5M(device_table)ro,17M(cp_file)ro,102737K(reserved)ro,-(unallocated) rootfstype=squashfs,ext4 rootwait"; + }; +}; diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srs60.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srs60.dts new file mode 100644 index 0000000000..65bb7ac397 --- /dev/null +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-srs60.dts @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019-orbi.dtsi" + +/ { + model = "NETGEAR SRS60"; + compatible = "netgear,srs60"; + + chosen { + bootargs = "root=/dev/mmcblk0p20 blkdevparts=mmcblk0:512K@17K(0:SBL1)ro,512K(0:BOOTCONFIG)ro,512K(0:QSEE)ro,512K(0:QSEE_1)ro,256K(0:CDT)ro,256K(0:CDT_1)ro,512K(0:BOOTCONFIG1)ro,256K(0:APPSBLENV)ro,1M(0:APPSBL)ro,1M(0:APPSBL_1)ro,256K(0:ART)ro,256K(ARTMTD)ro,2M(language)ro,256K(config)ro,256K(pot)ro,256K(traffic_meter)ro,256K(pot_bak)ro,256K(traffic_meter.bak)ro,3840K(kernel),31488K(rootfs),35328K@9233K(firmware),256K(mtdoops)ro,64K(cert)ro,3840K(kernel-2)ro,31488K(rootfs-2)ro,35328K@44881K(firmware-2)ro,5M(device_table)ro,17M(cp_file)ro,102737K(reserved)ro,-(unallocated) rootfstype=squashfs,ext4 rootwait"; + }; +}; diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index e0cfa07541..dcfe3e027c 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -646,6 +646,64 @@ define Device/netgear_ex6150v2 endef TARGET_DEVICES += netgear_ex6150v2 +define Device/netgear_orbi + $(call Device/DniImage) + SOC := qcom-ipq4019 + DEVICE_VENDOR := NETGEAR + IMAGE/factory.img := append-kernel | pad-offset 128k 64 | \ + append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | \ + append-rootfs | pad-rootfs | netgear-dni + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | \ + sysupgrade-tar rootfs=$$$$@ | append-metadata + DEVICE_PACKAGES := ath10k-firmware-qca9984-ct e2fsprogs kmod-fs-ext4 losetup +endef + +define Device/netgear_rbx50 + $(call Device/netgear_orbi) + NETGEAR_HW_ID := 29765352+0+4000+512+2x2+2x2+4x4 + KERNEL_SIZE := 3932160 + ROOTFS_SIZE := 32243712 + IMAGE_SIZE := 36175872 +endef + +define Device/netgear_rbr50 + $(call Device/netgear_rbx50) + DEVICE_MODEL := RBR50 + DEVICE_VARIANT := v1 + NETGEAR_BOARD_ID := RBR50 +endef +TARGET_DEVICES += netgear_rbr50 + +define Device/netgear_rbs50 + $(call Device/netgear_rbx50) + DEVICE_MODEL := RBS50 + DEVICE_VARIANT := v1 + NETGEAR_BOARD_ID := RBS50 +endef +TARGET_DEVICES += netgear_rbs50 + +define Device/netgear_srx60 + $(call Device/netgear_orbi) + NETGEAR_HW_ID := 29765352+0+4096+512+2x2+2x2+4x4 + KERNEL_SIZE := 3932160 + ROOTFS_SIZE := 32243712 + IMAGE_SIZE := 36175872 +endef + +define Device/netgear_srr60 + $(call Device/netgear_srx60) + DEVICE_MODEL := SRR60 + NETGEAR_BOARD_ID := SRR60 +endef +TARGET_DEVICES += netgear_srr60 + +define Device/netgear_srs60 + $(call Device/netgear_srx60) + DEVICE_MODEL := SRS60 + NETGEAR_BOARD_ID := SRS60 +endef +TARGET_DEVICES += netgear_srs60 + define Device/netgear_wac510 $(call Device/FitImage) $(call Device/UbiFit) diff --git a/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch index aef58ee50e..471fcd6498 100644 --- a/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.10/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -902,11 +902,61 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -902,11 +902,65 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -47,18 +47,22 @@ Signed-off-by: John Crispin qcom-ipq4019-ap.dk07.1-c2.dtb \ + qcom-ipq4019-a62.dtb \ + qcom-ipq4019-cm520-79f.dtb \ ++ qcom-ipq4019-e2600ac-c1.dtb \ ++ qcom-ipq4019-e2600ac-c2.dtb \ + qcom-ipq4019-ea8300.dtb \ + qcom-ipq4019-eap2200.dtb \ + qcom-ipq4019-fritzbox-7530.dtb \ + qcom-ipq4019-fritzrepeater-1200.dtb \ + qcom-ipq4019-fritzrepeater-3000.dtb \ ++ qcom-ipq4019-habanero-dvk.dtb \ + qcom-ipq4019-map-ac2200.dtb \ + qcom-ipq4019-mr8300.dtb \ -+ qcom-ipq4019-e2600ac-c1.dtb \ -+ qcom-ipq4019-e2600ac-c2.dtb \ -+ qcom-ipq4019-habanero-dvk.dtb \ + qcom-ipq4019-pa2200.dtb \ ++ qcom-ipq4019-rbr50.dtb \ ++ qcom-ipq4019-rbs50.dtb \ + qcom-ipq4019-rtl30vw.dtb \ ++ qcom-ipq4019-srr60.dtb \ ++ qcom-ipq4019-srs60.dtb \ + qcom-ipq4019-u4019-32m.dtb \ + qcom-ipq4019-wpj419.dtb \ + qcom-ipq4019-wtr-m2133hp.dtb \ diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index 0447fb6012..bb63c1c4fb 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,61 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,65 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -58,7 +58,11 @@ Signed-off-by: John Crispin + qcom-ipq4019-e2600ac-c2.dtb \ + qcom-ipq4019-habanero-dvk.dtb \ + qcom-ipq4019-pa2200.dtb \ ++ qcom-ipq4019-rbr50.dtb \ ++ qcom-ipq4019-rbs50.dtb \ + qcom-ipq4019-rtl30vw.dtb \ ++ qcom-ipq4019-srr60.dtb \ ++ qcom-ipq4019-srs60.dtb \ + qcom-ipq4019-u4019-32m.dtb \ + qcom-ipq4019-wpj419.dtb \ + qcom-ipq4019-wtr-m2133hp.dtb \