mirror of
https://github.com/VIKINGYFY/immortalwrt.git
synced 2025-12-16 17:15:26 +00:00
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
b4a40e54e9
@ -1,8 +1,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_VERSION:=2025.04
|
||||
PKG_HASH:=439d3bef296effd54130be6a731c5b118be7fddd7fcc663ccbc5fb18294d8718
|
||||
PKG_VERSION:=2025.10
|
||||
PKG_HASH:=b4f032848e56cc8f213ad59f9132c084dbbb632bc29176d024e58220e0efdf4a
|
||||
|
||||
UBOOT_USE_INTREE_DTC:=1
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ Subject: [PATCH] ath79: add support for NEC AR9344 Aterm series
|
||||
|
||||
--- a/arch/mips/dts/Makefile
|
||||
+++ b/arch/mips/dts/Makefile
|
||||
@@ -24,6 +24,7 @@ dtb-$(CONFIG_BOARD_GARDENA_SMART_GATEWAY
|
||||
@@ -23,6 +23,7 @@ dtb-$(CONFIG_BOARD_GARDENA_SMART_GATEWAY
|
||||
dtb-$(CONFIG_BOARD_LINKIT_SMART_7688) += linkit-smart-7688.dtb
|
||||
dtb-$(CONFIG_TARGET_OCTEON_EBB7304) += mrvl,octeon-ebb7304.dtb
|
||||
dtb-$(CONFIG_TARGET_OCTEON_NIC23) += mrvl,octeon-nic23.dtb
|
||||
|
||||
@ -23,7 +23,7 @@ mips: ath79: cleanup defconfig for NEC QCA9558 Aterm series
|
||||
|
||||
--- a/arch/mips/dts/Makefile
|
||||
+++ b/arch/mips/dts/Makefile
|
||||
@@ -25,6 +25,7 @@ dtb-$(CONFIG_BOARD_LINKIT_SMART_7688) +=
|
||||
@@ -24,6 +24,7 @@ dtb-$(CONFIG_BOARD_LINKIT_SMART_7688) +=
|
||||
dtb-$(CONFIG_TARGET_OCTEON_EBB7304) += mrvl,octeon-ebb7304.dtb
|
||||
dtb-$(CONFIG_TARGET_OCTEON_NIC23) += mrvl,octeon-nic23.dtb
|
||||
dtb-$(CONFIG_BOARD_NEC_AR9344_ATERM) += nec,ar9344-aterm.dtb
|
||||
|
||||
@ -8,10 +8,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_VERSION:=2025.07
|
||||
PKG_VERSION:=2025.10
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_HASH:=0f933f6c5a426895bf306e93e6ac53c60870e4b54cda56d95211bec99e63bec7
|
||||
PKG_HASH:=b4f032848e56cc8f213ad59f9132c084dbbb632bc29176d024e58220e0efdf4a
|
||||
|
||||
include $(INCLUDE_DIR)/u-boot.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@ -18,7 +18,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
|
||||
--- a/drivers/net/mvpp2.c
|
||||
+++ b/drivers/net/mvpp2.c
|
||||
@@ -3254,6 +3254,76 @@ static int gop_gpcs_reset(struct mvpp2_p
|
||||
@@ -3253,6 +3253,76 @@ static int gop_gpcs_reset(struct mvpp2_p
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
static int gop_mpcs_mode(struct mvpp2_port *port)
|
||||
{
|
||||
u32 val;
|
||||
@@ -3396,7 +3466,10 @@ static int gop_port_init(struct mvpp2_po
|
||||
@@ -3395,7 +3465,10 @@ static int gop_port_init(struct mvpp2_po
|
||||
num_of_act_lanes = 2;
|
||||
mac_num = 0;
|
||||
/* configure PCS */
|
||||
|
||||
@ -31,7 +31,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
|
||||
--- a/arch/arm/dts/Makefile
|
||||
+++ b/arch/arm/dts/Makefile
|
||||
@@ -172,6 +172,7 @@ dtb-$(CONFIG_ARCH_MVEBU) += \
|
||||
@@ -177,6 +177,7 @@ dtb-$(CONFIG_ARCH_MVEBU) += \
|
||||
armada-3720-uDPU.dtb \
|
||||
armada-7040-db-nand.dtb \
|
||||
armada-7040-db.dtb \
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_DISTNAME:=u-boot
|
||||
PKG_VERSION:=2025.07
|
||||
PKG_VERSION:=2025.10
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
|
||||
@ -10,7 +10,7 @@ PKG_SOURCE_URL:= \
|
||||
https://mirror.cyberbits.eu/u-boot \
|
||||
ftp://ftp.denx.de/pub/u-boot
|
||||
PKG_URL:=http://www.denx.de/wiki/U-Boot
|
||||
PKG_HASH:=0f933f6c5a426895bf306e93e6ac53c60870e4b54cda56d95211bec99e63bec7
|
||||
PKG_HASH:=b4f032848e56cc8f213ad59f9132c084dbbb632bc29176d024e58220e0efdf4a
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_DISTNAME)-$(PKG_VERSION)
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/boot/bootm.c
|
||||
+++ b/boot/bootm.c
|
||||
@@ -1232,20 +1232,18 @@ static int bootm_host_load_image(const v
|
||||
@@ -1245,20 +1245,18 @@ static int bootm_host_load_image(const v
|
||||
|
||||
int bootm_host_load_images(const void *fit, int cfg_noffset)
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/boot/bootm.c
|
||||
+++ b/boot/bootm.c
|
||||
@@ -1191,10 +1191,6 @@ static int bootm_host_load_image(const v
|
||||
@@ -1204,10 +1204,6 @@ static int bootm_host_load_image(const v
|
||||
ulong data, len;
|
||||
struct bootm_headers images;
|
||||
int noffset;
|
||||
@ -11,7 +11,7 @@
|
||||
int ret;
|
||||
|
||||
fit_uname_config = fdt_get_name(fit, cfg_noffset, NULL);
|
||||
@@ -1206,26 +1202,6 @@ static int bootm_host_load_image(const v
|
||||
@@ -1219,26 +1215,6 @@ static int bootm_host_load_image(const v
|
||||
FIT_LOAD_IGNORED, &data, &len);
|
||||
if (noffset < 0)
|
||||
return noffset;
|
||||
|
||||
@ -6,9 +6,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
|
||||
PKG_SOURCE_DATE:=2025-09-16
|
||||
PKG_SOURCE_VERSION:=65d951610e0c32be4512275018490616cd9334b5
|
||||
PKG_MIRROR_HASH:=e6beb7648263ba70551adf302a5bf0108d281e16d87a94675e38f2a98b406b57
|
||||
PKG_SOURCE_DATE:=2025-10-09
|
||||
PKG_SOURCE_VERSION:=20e5a5a3265679c7367f2857214c3691bd75bea0
|
||||
PKG_MIRROR_HASH:=697ae289bbcff6d1c077c3086ce9bcca670728cfbc7da5b52ae1bcad838d0225
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@ -87,6 +87,7 @@ ALLWIFIBOARDS:= \
|
||||
xiaomi_ax9000 \
|
||||
yyets_le1 \
|
||||
yuncore_ax830 \
|
||||
yuncore_ax850 \
|
||||
yuncore_ax880 \
|
||||
yuncore_fap650 \
|
||||
zbtlink_zbt-z800ax \
|
||||
@ -258,6 +259,7 @@ $(eval $(call generate-ipq-wifi-package,xiaomi_ax6000,Xiaomi AX6000))
|
||||
$(eval $(call generate-ipq-wifi-package,xiaomi_ax9000,Xiaomi AX9000))
|
||||
$(eval $(call generate-ipq-wifi-package,yyets_le1,YYeTs LE1))
|
||||
$(eval $(call generate-ipq-wifi-package,yuncore_ax830,Yuncore AX830))
|
||||
$(eval $(call generate-ipq-wifi-package,yuncore_ax850,Yuncore AX850))
|
||||
$(eval $(call generate-ipq-wifi-package,yuncore_ax880,Yuncore AX880))
|
||||
$(eval $(call generate-ipq-wifi-package,yuncore_fap650,Yuncore FAP650))
|
||||
$(eval $(call generate-ipq-wifi-package,zbtlink_zbt-z800ax,Zbtlink ZBT-Z800AX))
|
||||
|
||||
@ -18,6 +18,7 @@ SCAN_DEPS=modules/*.mk $(SUBTARGET_MODULES) $(TOPDIR)/include/netfilter.mk
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
PKG_CPE_ID:=cpe:/o:linux:linux_kernel
|
||||
|
||||
export SHELL:=/bin/sh
|
||||
.ONESHELL:
|
||||
|
||||
@ -483,7 +483,8 @@ function generate(config) {
|
||||
append_vars(config, [ 'noscan' ]);
|
||||
|
||||
/* airtime */
|
||||
append_vars(config, [ 'airtime_mode' ]);
|
||||
if (config.airtime_mode)
|
||||
append_vars(config, [ 'airtime_mode' ]);
|
||||
|
||||
/* assoc/thresholds */
|
||||
append_vars(config, [ 'rssi_reject_assoc_rssi', 'rssi_ignore_probe_request', 'iface_max_num_sta', 'no_probe_resp_if_max_sta' ]);
|
||||
|
||||
@ -0,0 +1,107 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Thu, 9 Oct 2025 14:11:55 +0200
|
||||
Subject: [PATCH] fs: add mkdtemp() method for creating temporary directories
|
||||
|
||||
Returns the directory path as a string, following the same template
|
||||
handling pattern as mkstemp().
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/lib/fs.c
|
||||
+++ b/lib/fs.c
|
||||
@@ -2632,6 +2632,86 @@ uc_fs_mkstemp(uc_vm_t *vm, size_t nargs)
|
||||
}
|
||||
|
||||
/**
|
||||
+ * Creates a unique temporary directory based on the given template.
|
||||
+ *
|
||||
+ * If the template argument is given and contains a relative path, the created
|
||||
+ * directory will be placed relative to the current working directory.
|
||||
+ *
|
||||
+ * If the template argument is given and contains an absolute path, the created
|
||||
+ * directory will be placed relative to the given directory.
|
||||
+ *
|
||||
+ * If the template argument is given but does not contain a directory separator,
|
||||
+ * the directory will be placed in `/tmp/`.
|
||||
+ *
|
||||
+ * If no template argument is given, the default `/tmp/XXXXXX` is used.
|
||||
+ *
|
||||
+ * The template argument must end with six consecutive X characters (`XXXXXX`),
|
||||
+ * which will be replaced with a random string to create the unique directory name.
|
||||
+ * If the template does not end with `XXXXXX`, it will be automatically appended.
|
||||
+ *
|
||||
+ * Returns a string containing the path of the created directory on success.
|
||||
+ *
|
||||
+ * Returns `null` if an error occurred, e.g. on insufficient permissions or
|
||||
+ * inaccessible directory.
|
||||
+ *
|
||||
+ * @function module:fs#mkdtemp
|
||||
+ *
|
||||
+ * @param {string} [template="/tmp/XXXXXX"]
|
||||
+ * The path template to use when forming the temporary directory name.
|
||||
+ *
|
||||
+ * @returns {?string}
|
||||
+ *
|
||||
+ * @example
|
||||
+ * // Create a unique temporary directory in the current working directory
|
||||
+ * const tempDir = mkdtemp('./data-XXXXXX');
|
||||
+ */
|
||||
+static uc_value_t *
|
||||
+uc_fs_mkdtemp(uc_vm_t *vm, size_t nargs)
|
||||
+{
|
||||
+ uc_value_t *template = uc_fn_arg(0);
|
||||
+ bool ends_with_template = false;
|
||||
+ char *path, *t, *result;
|
||||
+ uc_value_t *rv;
|
||||
+ size_t l;
|
||||
+
|
||||
+ if (template && ucv_type(template) != UC_STRING)
|
||||
+ err_return(EINVAL);
|
||||
+
|
||||
+ t = ucv_string_get(template);
|
||||
+ l = ucv_string_length(template);
|
||||
+
|
||||
+ ends_with_template = (l >= 6 && strcmp(&t[l - 6], "XXXXXX") == 0);
|
||||
+
|
||||
+ if (t && strchr(t, '/')) {
|
||||
+ if (ends_with_template)
|
||||
+ xasprintf(&path, "%s", t);
|
||||
+ else
|
||||
+ xasprintf(&path, "%s.XXXXXX", t);
|
||||
+ }
|
||||
+ else if (t) {
|
||||
+ if (ends_with_template)
|
||||
+ xasprintf(&path, "/tmp/%s", t);
|
||||
+ else
|
||||
+ xasprintf(&path, "/tmp/%s.XXXXXX", t);
|
||||
+ }
|
||||
+ else {
|
||||
+ xasprintf(&path, "/tmp/XXXXXX");
|
||||
+ }
|
||||
+
|
||||
+ result = mkdtemp(path);
|
||||
+
|
||||
+ if (!result) {
|
||||
+ free(path);
|
||||
+ err_return(errno);
|
||||
+ }
|
||||
+
|
||||
+ rv = ucv_string_new(result);
|
||||
+ free(path);
|
||||
+
|
||||
+ return rv;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* Checks the accessibility of a file or directory.
|
||||
*
|
||||
* The optional modes argument specifies the access modes which should be
|
||||
@@ -3065,6 +3145,7 @@ static const uc_function_list_t global_f
|
||||
{ "basename", uc_fs_basename },
|
||||
{ "lsdir", uc_fs_lsdir },
|
||||
{ "mkstemp", uc_fs_mkstemp },
|
||||
+ { "mkdtemp", uc_fs_mkdtemp },
|
||||
{ "access", uc_fs_access },
|
||||
{ "readfile", uc_fs_readfile },
|
||||
{ "writefile", uc_fs_writefile },
|
||||
@ -198,7 +198,7 @@ my %update_method = (
|
||||
# src-git: pull broken
|
||||
# src-cpy: broken if `basename $src` != $name
|
||||
|
||||
sub update_feed_via($$$$$$$) {
|
||||
sub update_feed_via($$$$$$$$) {
|
||||
my $type = shift;
|
||||
my $name = shift;
|
||||
my $src = shift;
|
||||
@ -206,22 +206,32 @@ sub update_feed_via($$$$$$$) {
|
||||
my $force = shift;
|
||||
my $rebase = shift;
|
||||
my $stash = shift;
|
||||
my $flags = shift;
|
||||
|
||||
my $m = $update_method{$type};
|
||||
my $localpath = "./feeds/$name";
|
||||
my $safepath = $localpath;
|
||||
$safepath =~ s/'/'\\''/;
|
||||
my $safename = $name;
|
||||
$safename =~ s/'/'\\''/;
|
||||
my $localpath = "./feeds/$safename";
|
||||
my $localpath_orig;
|
||||
if (defined $flags->{'root'}) {
|
||||
$safename .= "_root";
|
||||
$localpath_orig = $localpath;
|
||||
$localpath .= "_root";
|
||||
}
|
||||
my ($base_branch, $branch) = split(/;/, $src, 2);
|
||||
my ($base_commit, $commit) = split(/\^/, $src, 2);
|
||||
|
||||
if( $relocate || !$m->{'update'} || !-d "$localpath/$m->{'controldir'}" ) {
|
||||
system("rm -rf '$safepath'");
|
||||
if (defined $flags->{'root'}) {
|
||||
system("rm -rf $localpath_orig; ln -s $safename/$flags->{'root'} $localpath_orig");
|
||||
}
|
||||
system("rm -rf '$localpath'");
|
||||
if ($m->{'init_branch'} and $branch) {
|
||||
system(sprintf($m->{'init_branch'}, $branch, $base_branch, $safepath)) == 0 or return 1;
|
||||
system(sprintf($m->{'init_branch'}, $branch, $base_branch, $localpath)) == 0 or return 1;
|
||||
} elsif ($m->{'init_commit'} and $commit) {
|
||||
system(sprintf($m->{'init_commit'}, $base_commit, $safepath, $safepath, $commit, $commit)) == 0 or return 1;
|
||||
system(sprintf($m->{'init_commit'}, $base_commit, $localpath, $localpath, $commit, $commit)) == 0 or return 1;
|
||||
} else {
|
||||
system(sprintf($m->{'init'}, $src, $safepath)) == 0 or return 1;
|
||||
system(sprintf($m->{'init'}, $src, $localpath)) == 0 or return 1;
|
||||
}
|
||||
} elsif ($m->{'init_commit'} and $commit) {
|
||||
# in case git hash has been provided don't update the feed
|
||||
@ -236,11 +246,11 @@ sub update_feed_via($$$$$$$) {
|
||||
if ($stash && exists $m->{'update_stash'}) {
|
||||
$update_cmd = $m->{'update_stash'};
|
||||
}
|
||||
system("cd '$safepath'; $update_cmd") == 0 or return 1;
|
||||
system("cd '$localpath'; $update_cmd") == 0 or return 1;
|
||||
}
|
||||
if ($m->{'post_update'}) {
|
||||
my $cmd = $m->{'post_update'};
|
||||
system("cd '$safepath'; $cmd") == 0 or return 1;
|
||||
system("cd '$localpath'; $cmd") == 0 or return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -793,7 +803,7 @@ sub uninstall {
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub update_feed($$$$$$)
|
||||
sub update_feed($$$$$$$)
|
||||
{
|
||||
my $type=shift;
|
||||
my $name=shift;
|
||||
@ -801,6 +811,7 @@ sub update_feed($$$$$$)
|
||||
my $force_update=shift;
|
||||
my $rebase_update=shift;
|
||||
my $stash_update=shift;
|
||||
my $flags=shift;
|
||||
my $force_relocate=update_location( $name, "@$src" );
|
||||
my $rv=0;
|
||||
|
||||
@ -815,7 +826,7 @@ sub update_feed($$$$$$)
|
||||
my $failed = 1;
|
||||
foreach my $feedsrc (@$src) {
|
||||
warn "Updating feed '$name' from '$feedsrc' ...\n";
|
||||
if (update_feed_via($type, $name, $feedsrc, $force_relocate, $force_update, $rebase_update, $stash_update) != 0) {
|
||||
if (update_feed_via($type, $name, $feedsrc, $force_relocate, $force_update, $rebase_update, $stash_update, $flags) != 0) {
|
||||
if ($force_update) {
|
||||
$rv=1;
|
||||
$failed=0;
|
||||
@ -860,10 +871,10 @@ sub update {
|
||||
|
||||
my @index_feeds;
|
||||
foreach my $feed (@feeds) {
|
||||
my ($type, $name, $src) = @$feed;
|
||||
my ($type, $name, $src, $flags) = @$feed;
|
||||
next unless $#ARGV == -1 or $opts{a} or $argv_feeds{$name};
|
||||
if (not $opts{i}) {
|
||||
update_feed($type, $name, $src, $opts{f}, $opts{r}, $opts{s}) == 0 or $failed=1;
|
||||
update_feed($type, $name, $src, $opts{f}, $opts{r}, $opts{s}, $flags) == 0 or $failed=1;
|
||||
}
|
||||
push @index_feeds, $name;
|
||||
}
|
||||
|
||||
@ -18,137 +18,171 @@ filter_port_list_reverse() {
|
||||
_filter_port_list_ordered "$1" "$2" "-r"
|
||||
}
|
||||
|
||||
realtek_setup_interfaces()
|
||||
{
|
||||
local board="$1"
|
||||
local lan_list="$2"
|
||||
|
||||
ucidef_set_bridge_device switch
|
||||
ucidef_set_interface_lan "$lan_list"
|
||||
}
|
||||
|
||||
realtek_setup_macs_lan()
|
||||
{
|
||||
local lan_list="$1"
|
||||
local lan_mac_start="$2"
|
||||
local lan_mac_end="$3"
|
||||
|
||||
for lan in $lan_list; do
|
||||
ucidef_set_network_device_mac $lan $lan_mac_start
|
||||
[ -z "$lan_mac_end" ] || [ "$lan_mac_start" == "$lan_mac_end" ] && lan_mac_start=$(macaddr_setbit_la $lan_mac_start)
|
||||
lan_mac_start=$(macaddr_add $lan_mac_start 1)
|
||||
done
|
||||
}
|
||||
|
||||
realtek_setup_macs()
|
||||
{
|
||||
local board="$1"
|
||||
local lan_list="$2"
|
||||
|
||||
local lan_mac=""
|
||||
local lan_mac_start=""
|
||||
local lan_mac_end=""
|
||||
local label_mac=""
|
||||
|
||||
case $board in
|
||||
hpe,1920-8g|\
|
||||
hpe,1920-8g-poe-65w|\
|
||||
hpe,1920-8g-poe-180w|\
|
||||
hpe,1920-16g|\
|
||||
hpe,1920-24g|\
|
||||
hpe,1920-24g-poe-180w|\
|
||||
hpe,1920-24g-poe-370w|\
|
||||
hpe,1920-48g|\
|
||||
hpe,1920-48g-poe)
|
||||
label_mac=$(mtd_get_mac_binary factory 0x68)
|
||||
lan_mac=$label_mac
|
||||
mac_count1=$(hexdump -v -n 4 -s 0x110 -e '4 "%d"' $(find_mtd_part factory) 2>/dev/null)
|
||||
mac_count2=$(hexdump -v -n 4 -s 0x114 -e '4 "%d"' $(find_mtd_part factory) 2>/dev/null)
|
||||
lan_mac_start=$(macaddr_add $lan_mac 2)
|
||||
lan_mac_end=$(macaddr_add $lan_mac $((mac_count2-mac_count1)))
|
||||
;;
|
||||
plasmacloud,esx28|\
|
||||
plasmacloud,psx8|\
|
||||
plasmacloud,psx10|\
|
||||
plasmacloud,psx28)
|
||||
lan_mac_start=skip
|
||||
lan_mac="$(get_mac_label)"
|
||||
;;
|
||||
tplink,sg2008p-v1|\
|
||||
tplink,sg2210p-v3|\
|
||||
tplink,sg2452p-v4|\
|
||||
tplink,t1600g-28ts-v3)
|
||||
label_mac=$(get_mac_label)
|
||||
lan_mac="$label_mac"
|
||||
;;
|
||||
tplink,tl-st1008f-v2)
|
||||
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
||||
[ -z "$lan_mac" ] || [ "$lan_mac" = "00:e0:4c:00:00:00" ] && lan_mac=$(macaddr_random)
|
||||
;;
|
||||
xikestor,sks8300-8x)
|
||||
lan_mac=$(mtd_get_mac_binary board-info 0x1f1)
|
||||
;;
|
||||
xikestor,sks8310-8x)
|
||||
lan_mac=$(mtd_get_mac_binary factory 0x80)
|
||||
label_mac="$lan_mac"
|
||||
;;
|
||||
*)
|
||||
lan_mac=$(mtd_get_mac_ascii u-boot-env2 mac_start)
|
||||
lan_mac_end=$(mtd_get_mac_ascii u-boot-env2 mac_end)
|
||||
label_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
||||
[ -z "$lan_mac" ] && lan_mac=$label_mac
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
|
||||
[ -n "$lan_mac" ] && ucidef_set_bridge_mac "$lan_mac"
|
||||
[ -n "$lan_mac" ] && ucidef_set_network_device_mac eth0 $lan_mac
|
||||
|
||||
[ -z "$lan_mac_start" -a -n "$lan_mac" ] && lan_mac_start=$lan_mac
|
||||
[ "$lan_mac_start" != "skip" ] && realtek_setup_macs_lan "$lan_list" "$lan_mac_start" "$lan_mac_end"
|
||||
|
||||
[ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
|
||||
}
|
||||
|
||||
realtek_setup_poe()
|
||||
{
|
||||
local board="$1"
|
||||
local lan_list="$2"
|
||||
|
||||
case $board in
|
||||
d-link,dgs-1210-10mp-f)
|
||||
ucidef_set_poe 130 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
d-link,dgs-1210-10p)
|
||||
ucidef_set_poe 65 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
d-link,dgs-1210-28mp-f)
|
||||
ucidef_set_poe 370 "lan8 lan7 lan6 lan5 lan4 lan3 lan2 lan1 lan16 lan15 lan14 lan13 lan12 lan11 lan10 lan9 lan24 lan23
|
||||
lan22 lan21 lan20 lan19 lan18 lan17"
|
||||
;;
|
||||
d-link,dgs-1210-28p-f)
|
||||
ucidef_set_poe 193 "lan8 lan7 lan6 lan5 lan4 lan3 lan2 lan1 lan16 lan15 lan14 lan13 lan12 lan11 lan10 lan9 lan24 lan23
|
||||
lan22 lan21 lan20 lan19 lan18 lan17"
|
||||
;;
|
||||
engenius,ews2910p-v1|\
|
||||
engenius,ews2910p-v3)
|
||||
ucidef_set_poe 60 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
hpe,1920-8g-poe-65w)
|
||||
ucidef_set_poe 65 "$(filter_port_list_reverse "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
hpe,1920-8g-poe-180w)
|
||||
ucidef_set_poe 180 "$(filter_port_list_reverse "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
hpe,1920-24g-poe-180w)
|
||||
ucidef_set_poe 180 "$(filter_port_list_reverse "$lan_list" "lan25 lan26 lan27 lan28")"
|
||||
;;
|
||||
hpe,1920-24g-poe-370w)
|
||||
ucidef_set_poe 370 "$(filter_port_list_reverse "$lan_list" "lan25 lan26 lan27 lan28")"
|
||||
;;
|
||||
hpe,1920-48g-poe)
|
||||
ucidef_set_poe 370 "lan8 lan7 lan6 lan5 lan4 lan3 lan2 lan1 lan16 lan15 lan14 lan13 lan12 lan11 lan10 lan9 lan24 lan23
|
||||
lan22 lan21 lan20 lan19 lan18 lan17 lan32 lan31 lan30 lan29 lan28 lan27 lan26 lan25 lan40 lan39 lan38 lan37
|
||||
lan36 lan35 lan34 lan33 lan48 lan47 lan46 lan45 lan44 lan43 lan42 lan41"
|
||||
;;
|
||||
netgear,gs110tpp-v1)
|
||||
ucidef_set_poe 130 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
netgear,gs110tup-v1)
|
||||
ucidef_set_poe 240 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
netgear,gs310tp-v1)
|
||||
ucidef_set_poe 55 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
zyxel,gs1900-10hp)
|
||||
ucidef_set_poe 77 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
zyxel,gs1900-8hp-v1|\
|
||||
zyxel,gs1900-8hp-v2)
|
||||
ucidef_set_poe 70 "$lan_list"
|
||||
;;
|
||||
zyxel,gs1900-24ep)
|
||||
ucidef_set_poe 130 "lan1 lan2 lan3 lan4 lan5 lan6 lan7 lan8 lan9 lan10 lan11 lan12"
|
||||
;;
|
||||
zyxel,gs1900-24hp-v1|\
|
||||
zyxel,gs1900-24hp-v2)
|
||||
ucidef_set_poe 170 "$(filter_port_list "$lan_list" "lan25 lan26")"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
board=$(board_name)
|
||||
board_config_update
|
||||
|
||||
lan_list=$(ls -1 -v -d /sys/class/net/lan* | xargs -n1 basename | xargs)
|
||||
|
||||
ucidef_set_bridge_device switch
|
||||
ucidef_set_interface_lan "$lan_list"
|
||||
|
||||
lan_mac=""
|
||||
lan_mac_start=""
|
||||
lan_mac_end=""
|
||||
label_mac=""
|
||||
case $board in
|
||||
hpe,1920-8g|\
|
||||
hpe,1920-8g-poe-65w|\
|
||||
hpe,1920-8g-poe-180w|\
|
||||
hpe,1920-16g|\
|
||||
hpe,1920-24g|\
|
||||
hpe,1920-24g-poe-180w|\
|
||||
hpe,1920-24g-poe-370w|\
|
||||
hpe,1920-48g|\
|
||||
hpe,1920-48g-poe)
|
||||
label_mac=$(mtd_get_mac_binary factory 0x68)
|
||||
lan_mac=$label_mac
|
||||
mac_count1=$(hexdump -v -n 4 -s 0x110 -e '4 "%d"' $(find_mtd_part factory) 2>/dev/null)
|
||||
mac_count2=$(hexdump -v -n 4 -s 0x114 -e '4 "%d"' $(find_mtd_part factory) 2>/dev/null)
|
||||
lan_mac_start=$(macaddr_add $lan_mac 2)
|
||||
lan_mac_end=$(macaddr_add $lan_mac $((mac_count2-mac_count1)))
|
||||
;;
|
||||
plasmacloud,esx28|\
|
||||
plasmacloud,psx8|\
|
||||
plasmacloud,psx10|\
|
||||
plasmacloud,psx28|\
|
||||
tplink,sg2008p-v1|\
|
||||
tplink,sg2210p-v3|\
|
||||
tplink,sg2452p-v4|\
|
||||
tplink,t1600g-28ts-v3)
|
||||
label_mac=$(get_mac_label)
|
||||
lan_mac="$label_mac"
|
||||
;;
|
||||
tplink,tl-st1008f-v2)
|
||||
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
||||
[ -z "$lan_mac" ] || [ "$lan_mac" = "00:e0:4c:00:00:00" ] && lan_mac=$(macaddr_random)
|
||||
;;
|
||||
xikestor,sks8300-8x)
|
||||
lan_mac=$(mtd_get_mac_binary board-info 0x1f1)
|
||||
;;
|
||||
xikestor,sks8310-8x)
|
||||
lan_mac=$(mtd_get_mac_binary factory 0x80)
|
||||
label_mac="$lan_mac"
|
||||
;;
|
||||
*)
|
||||
lan_mac=$(mtd_get_mac_ascii u-boot-env2 mac_start)
|
||||
lan_mac_end=$(mtd_get_mac_ascii u-boot-env2 mac_end)
|
||||
label_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
||||
[ -z "$lan_mac" ] && lan_mac=$label_mac
|
||||
;;
|
||||
esac
|
||||
|
||||
ucidef_set_interface_macaddr "lan" $lan_mac
|
||||
ucidef_set_bridge_mac "$lan_mac"
|
||||
ucidef_set_network_device_mac eth0 $lan_mac
|
||||
[ -z "$lan_mac_start" ] && lan_mac_start=$lan_mac
|
||||
for lan in $lan_list; do
|
||||
ucidef_set_network_device_mac $lan $lan_mac_start
|
||||
[ -z "$lan_mac_end" ] || [ "$lan_mac_start" == "$lan_mac_end" ] && lan_mac_start=$(macaddr_setbit_la $lan_mac_start)
|
||||
lan_mac_start=$(macaddr_add $lan_mac_start 1)
|
||||
done
|
||||
[ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
|
||||
|
||||
case $board in
|
||||
d-link,dgs-1210-10mp-f)
|
||||
ucidef_set_poe 130 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
d-link,dgs-1210-10p)
|
||||
ucidef_set_poe 65 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
d-link,dgs-1210-28mp-f)
|
||||
ucidef_set_poe 370 "lan8 lan7 lan6 lan5 lan4 lan3 lan2 lan1 lan16 lan15 lan14 lan13 lan12 lan11 lan10 lan9 lan24 lan23
|
||||
lan22 lan21 lan20 lan19 lan18 lan17"
|
||||
;;
|
||||
d-link,dgs-1210-28p-f)
|
||||
ucidef_set_poe 193 "lan8 lan7 lan6 lan5 lan4 lan3 lan2 lan1 lan16 lan15 lan14 lan13 lan12 lan11 lan10 lan9 lan24 lan23
|
||||
lan22 lan21 lan20 lan19 lan18 lan17"
|
||||
;;
|
||||
engenius,ews2910p-v1|\
|
||||
engenius,ews2910p-v3)
|
||||
ucidef_set_poe 60 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
hpe,1920-8g-poe-65w)
|
||||
ucidef_set_poe 65 "$(filter_port_list_reverse "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
hpe,1920-8g-poe-180w)
|
||||
ucidef_set_poe 180 "$(filter_port_list_reverse "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
hpe,1920-24g-poe-180w)
|
||||
ucidef_set_poe 180 "$(filter_port_list_reverse "$lan_list" "lan25 lan26 lan27 lan28")"
|
||||
;;
|
||||
hpe,1920-24g-poe-370w)
|
||||
ucidef_set_poe 370 "$(filter_port_list_reverse "$lan_list" "lan25 lan26 lan27 lan28")"
|
||||
;;
|
||||
hpe,1920-48g-poe)
|
||||
ucidef_set_poe 370 "lan8 lan7 lan6 lan5 lan4 lan3 lan2 lan1 lan16 lan15 lan14 lan13 lan12 lan11 lan10 lan9 lan24 lan23
|
||||
lan22 lan21 lan20 lan19 lan18 lan17 lan32 lan31 lan30 lan29 lan28 lan27 lan26 lan25 lan40 lan39 lan38 lan37
|
||||
lan36 lan35 lan34 lan33 lan48 lan47 lan46 lan45 lan44 lan43 lan42 lan41"
|
||||
;;
|
||||
netgear,gs110tpp-v1)
|
||||
ucidef_set_poe 130 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
netgear,gs110tup-v1)
|
||||
ucidef_set_poe 240 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
netgear,gs310tp-v1)
|
||||
ucidef_set_poe 55 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
zyxel,gs1900-10hp)
|
||||
ucidef_set_poe 77 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
zyxel,gs1900-8hp-v1|\
|
||||
zyxel,gs1900-8hp-v2)
|
||||
ucidef_set_poe 70 "$lan_list"
|
||||
;;
|
||||
zyxel,gs1900-24ep)
|
||||
ucidef_set_poe 130 "lan1 lan2 lan3 lan4 lan5 lan6 lan7 lan8 lan9 lan10 lan11 lan12"
|
||||
;;
|
||||
zyxel,gs1900-24hp-v1|\
|
||||
zyxel,gs1900-24hp-v2)
|
||||
ucidef_set_poe 170 "$(filter_port_list "$lan_list" "lan25 lan26")"
|
||||
;;
|
||||
esac
|
||||
|
||||
realtek_setup_interfaces "$board" "$lan_list"
|
||||
realtek_setup_macs "$board" "$lan_list"
|
||||
realtek_setup_poe "$board" "$lan_list"
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
|
||||
@ -24,7 +24,7 @@ extern const struct rtl838x_reg rtl930x_reg;
|
||||
extern const struct rtl838x_reg rtl931x_reg;
|
||||
|
||||
extern const struct dsa_switch_ops rtl83xx_switch_ops;
|
||||
extern const struct dsa_switch_ops rtl930x_switch_ops;
|
||||
extern const struct dsa_switch_ops rtl93xx_switch_ops;
|
||||
|
||||
extern struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int port);
|
||||
|
||||
@ -1591,7 +1591,7 @@ static int __init rtl83xx_sw_probe(struct platform_device *pdev)
|
||||
priv->n_counters = 1024;
|
||||
break;
|
||||
case RTL9300_FAMILY_ID:
|
||||
priv->ds->ops = &rtl930x_switch_ops;
|
||||
priv->ds->ops = &rtl93xx_switch_ops;
|
||||
priv->cpu_port = RTL930X_CPU_PORT;
|
||||
priv->port_mask = 0x1f;
|
||||
priv->port_width = 1;
|
||||
@ -1611,7 +1611,7 @@ static int __init rtl83xx_sw_probe(struct platform_device *pdev)
|
||||
priv->n_counters = 2048;
|
||||
break;
|
||||
case RTL9310_FAMILY_ID:
|
||||
priv->ds->ops = &rtl930x_switch_ops;
|
||||
priv->ds->ops = &rtl93xx_switch_ops;
|
||||
priv->cpu_port = RTL931X_CPU_PORT;
|
||||
priv->port_mask = 0x3f;
|
||||
priv->port_width = 2;
|
||||
|
||||
@ -613,25 +613,44 @@ static void rtl83xx_config_interface(int port, phy_interface_t interface)
|
||||
pr_debug("configured port %d for interface %s\n", port, phy_modes(interface));
|
||||
}
|
||||
|
||||
static void rtldsa_phylink_get_caps(struct dsa_switch *ds, int port,
|
||||
static void rtldsa_83xx_phylink_get_caps(struct dsa_switch *ds, int port,
|
||||
struct phylink_config *config)
|
||||
{
|
||||
/*
|
||||
* TODO: This capability check will need some love. Depending on the model and the
|
||||
* port different MAC features and link modes are supported. For now just enable all
|
||||
* required MAC and PHY capabilites so that we can make use of the ports.
|
||||
* TODO: This needs to take into account the MAC to SERDES mapping and the
|
||||
* specific SoC capabilities. Right now we just assume all RTL83xx ports
|
||||
* support up to 1G standalone and QSGMII as that covers most real-world
|
||||
* use cases.
|
||||
*/
|
||||
config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | MAC_10 | MAC_100 |
|
||||
MAC_1000FD;
|
||||
|
||||
__set_bit(PHY_INTERFACE_MODE_1000BASEX, config->supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_GMII, config->supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_INTERNAL, config->supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_SGMII, config->supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_QSGMII, config->supported_interfaces);
|
||||
}
|
||||
|
||||
static void rtldsa_93xx_phylink_get_caps(struct dsa_switch *ds, int port,
|
||||
struct phylink_config *config)
|
||||
{
|
||||
/*
|
||||
* TODO: This needs to take into account the MAC to SERDES mapping and the
|
||||
* specific SoC capabilities. Right now we just assume all RTL93xx ports
|
||||
* support up to 10G standalone and up to USXGMII as that covers most
|
||||
* real-world use cases.
|
||||
*/
|
||||
config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | MAC_10 | MAC_100 |
|
||||
MAC_1000FD | MAC_2500FD | MAC_5000FD | MAC_10000FD;
|
||||
|
||||
__set_bit(PHY_INTERFACE_MODE_1000BASEX, config->supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_10GBASER, config->supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_2500BASEX, config->supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_GMII, config->supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_INTERNAL, config->supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_QSGMII, config->supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_SGMII, config->supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_QSGMII, config->supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_10GBASER, config->supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_2500BASEX, config->supported_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_USXGMII, config->supported_interfaces);
|
||||
}
|
||||
|
||||
@ -1424,11 +1443,9 @@ static u64 rtl83xx_mc_group_del_port(struct rtl838x_switch_priv *priv, int mc_gr
|
||||
return portmask;
|
||||
}
|
||||
|
||||
static int rtl83xx_port_enable(struct dsa_switch *ds, int port,
|
||||
struct phy_device *phydev)
|
||||
static int rtldsa_port_enable(struct dsa_switch *ds, int port, struct phy_device *phydev)
|
||||
{
|
||||
struct rtl838x_switch_priv *priv = ds->priv;
|
||||
u64 v;
|
||||
|
||||
pr_debug("%s: %x %d", __func__, (u32) priv, port);
|
||||
priv->ports[port].enable = true;
|
||||
@ -1448,9 +1465,7 @@ static int rtl83xx_port_enable(struct dsa_switch *ds, int port,
|
||||
}
|
||||
|
||||
/* add all other ports in the same bridge to switch mask of port */
|
||||
v = priv->r->traffic_get(port);
|
||||
v |= priv->ports[port].pm;
|
||||
priv->r->traffic_set(port, v);
|
||||
priv->r->traffic_set(port, priv->ports[port].pm);
|
||||
|
||||
/* TODO: Figure out if this is necessary */
|
||||
if (priv->family_id == RTL9300_FAMILY_ID) {
|
||||
@ -1464,10 +1479,9 @@ static int rtl83xx_port_enable(struct dsa_switch *ds, int port,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rtl83xx_port_disable(struct dsa_switch *ds, int port)
|
||||
static void rtldsa_port_disable(struct dsa_switch *ds, int port)
|
||||
{
|
||||
struct rtl838x_switch_priv *priv = ds->priv;
|
||||
u64 v;
|
||||
|
||||
pr_debug("%s %x: %d", __func__, (u32)priv, port);
|
||||
/* you can only disable user ports */
|
||||
@ -1478,10 +1492,8 @@ static void rtl83xx_port_disable(struct dsa_switch *ds, int port)
|
||||
/* remove port from switch mask of CPU_PORT */
|
||||
priv->r->traffic_disable(priv->cpu_port, port);
|
||||
|
||||
/* remove all other ports in the same bridge from switch mask of port */
|
||||
v = priv->r->traffic_get(port);
|
||||
v &= ~priv->ports[port].pm;
|
||||
priv->r->traffic_set(port, v);
|
||||
/* remove all other ports from switch mask of port */
|
||||
priv->r->traffic_set(port, 0);
|
||||
|
||||
priv->ports[port].enable = false;
|
||||
}
|
||||
@ -1528,46 +1540,69 @@ static int rtl83xx_set_ageing_time(struct dsa_switch *ds, unsigned int msec)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtl83xx_port_bridge_join(struct dsa_switch *ds, int port,
|
||||
struct dsa_bridge bridge,
|
||||
bool *tx_fwd_offload,
|
||||
struct netlink_ext_ack *extack)
|
||||
static void rtldsa_update_port_member(struct rtl838x_switch_priv *priv, int port,
|
||||
const struct net_device *bridge_dev, bool join)
|
||||
__must_hold(&priv->reg_mutex)
|
||||
{
|
||||
struct dsa_port *dp = dsa_to_port(priv->ds, port);
|
||||
struct rtl838x_port *p = &priv->ports[port];
|
||||
struct dsa_port *cpu_dp = dp->cpu_dp;
|
||||
u64 port_mask = BIT_ULL(cpu_dp->index);
|
||||
struct rtl838x_port *other_p;
|
||||
struct dsa_port *other_dp;
|
||||
int other_port;
|
||||
bool isolated;
|
||||
|
||||
dsa_switch_for_each_user_port(other_dp, priv->ds) {
|
||||
other_port = other_dp->index;
|
||||
other_p = &priv->ports[other_port];
|
||||
|
||||
if (dp == other_dp)
|
||||
continue;
|
||||
|
||||
if (!dsa_port_offloads_bridge_dev(other_dp, bridge_dev))
|
||||
continue;
|
||||
|
||||
if (join && priv->is_lagmember[other_port])
|
||||
continue;
|
||||
|
||||
isolated = p->isolated && other_p->isolated;
|
||||
|
||||
if (join && !isolated) {
|
||||
port_mask |= BIT_ULL(other_port);
|
||||
other_p->pm |= BIT_ULL(port);
|
||||
} else {
|
||||
other_p->pm &= ~BIT_ULL(port);
|
||||
}
|
||||
|
||||
if (other_p->enable)
|
||||
priv->r->traffic_set(other_port, other_p->pm);
|
||||
}
|
||||
|
||||
p->pm = port_mask;
|
||||
|
||||
if (p->enable)
|
||||
priv->r->traffic_set(port, port_mask);
|
||||
}
|
||||
|
||||
static int rtldsa_port_bridge_join(struct dsa_switch *ds, int port, struct dsa_bridge bridge,
|
||||
bool *tx_fwd_offload, struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct rtl838x_switch_priv *priv = ds->priv;
|
||||
u64 port_bitmap = BIT_ULL(priv->cpu_port), v;
|
||||
|
||||
pr_debug("%s %x: %d %llx", __func__, (u32)priv, port, port_bitmap);
|
||||
pr_debug("%s %x: %d", __func__, (u32)priv, port);
|
||||
|
||||
if (priv->is_lagmember[port]) {
|
||||
pr_debug("%s: %d is lag slave. ignore\n", __func__, port);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* reset to default flags for new net_bridge_port */
|
||||
priv->ports[port].isolated = false;
|
||||
|
||||
mutex_lock(&priv->reg_mutex);
|
||||
for (int i = 0; i < ds->num_ports; i++) {
|
||||
/* Add this port to the port matrix of the other ports in the
|
||||
* same bridge. If the port is disabled, port matrix is kept
|
||||
* and not being setup until the port becomes enabled.
|
||||
*/
|
||||
if (dsa_is_user_port(ds, i) && !priv->is_lagmember[i] && i != port) {
|
||||
if (!dsa_port_offloads_bridge(dsa_to_port(ds, i), &bridge))
|
||||
continue;
|
||||
if (priv->ports[i].enable)
|
||||
priv->r->traffic_enable(i, port);
|
||||
|
||||
priv->ports[i].pm |= BIT_ULL(port);
|
||||
port_bitmap |= BIT_ULL(i);
|
||||
}
|
||||
}
|
||||
|
||||
/* Add all other ports to this port matrix. */
|
||||
if (priv->ports[port].enable) {
|
||||
priv->r->traffic_enable(priv->cpu_port, port);
|
||||
v = priv->r->traffic_get(port);
|
||||
v |= port_bitmap;
|
||||
priv->r->traffic_set(port, v);
|
||||
}
|
||||
priv->ports[port].pm |= port_bitmap;
|
||||
rtldsa_update_port_member(priv, port, bridge.dev, true);
|
||||
|
||||
if (priv->r->set_static_move_action)
|
||||
priv->r->set_static_move_action(port, false);
|
||||
@ -1577,39 +1612,15 @@ static int rtl83xx_port_bridge_join(struct dsa_switch *ds, int port,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rtl83xx_port_bridge_leave(struct dsa_switch *ds, int port,
|
||||
struct dsa_bridge bridge)
|
||||
static void rtldsa_port_bridge_leave(struct dsa_switch *ds, int port, struct dsa_bridge bridge)
|
||||
{
|
||||
struct rtl838x_switch_priv *priv = ds->priv;
|
||||
u64 port_bitmap = 0, v;
|
||||
|
||||
pr_debug("%s %x: %d", __func__, (u32)priv, port);
|
||||
|
||||
mutex_lock(&priv->reg_mutex);
|
||||
for (int i = 0; i < ds->num_ports; i++) {
|
||||
/* Remove this port from the port matrix of the other ports
|
||||
* in the same bridge. If the port is disabled, port matrix
|
||||
* is kept and not being setup until the port becomes enabled.
|
||||
* And the other port's port matrix cannot be broken when the
|
||||
* other port is still a VLAN-aware port.
|
||||
*/
|
||||
if (dsa_is_user_port(ds, i) && i != port) {
|
||||
if (!dsa_port_offloads_bridge(dsa_to_port(ds, i), &bridge))
|
||||
continue;
|
||||
if (priv->ports[i].enable)
|
||||
priv->r->traffic_disable(i, port);
|
||||
|
||||
priv->ports[i].pm &= ~BIT_ULL(port);
|
||||
port_bitmap |= BIT_ULL(i);
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove all other ports from this port matrix. */
|
||||
if (priv->ports[port].enable) {
|
||||
v = priv->r->traffic_get(port);
|
||||
v &= ~port_bitmap;
|
||||
priv->r->traffic_set(port, v);
|
||||
}
|
||||
priv->ports[port].pm &= ~port_bitmap;
|
||||
rtldsa_update_port_member(priv, port, bridge.dev, false);
|
||||
|
||||
if (priv->r->set_static_move_action)
|
||||
priv->r->set_static_move_action(port, true);
|
||||
@ -2382,10 +2393,12 @@ out_unlock:
|
||||
mutex_unlock(&priv->reg_mutex);
|
||||
}
|
||||
|
||||
static int rtl83xx_port_pre_bridge_flags(struct dsa_switch *ds, int port, struct switchdev_brport_flags flags, struct netlink_ext_ack *extack)
|
||||
static int rtldsa_port_pre_bridge_flags(struct dsa_switch *ds, int port,
|
||||
struct switchdev_brport_flags flags,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct rtl838x_switch_priv *priv = ds->priv;
|
||||
unsigned long features = 0;
|
||||
unsigned long features = BR_ISOLATED;
|
||||
pr_debug("%s: %d %lX\n", __func__, port, flags.val);
|
||||
if (priv->r->enable_learning)
|
||||
features |= BR_LEARNING;
|
||||
@ -2418,6 +2431,17 @@ static int rtl83xx_port_bridge_flags(struct dsa_switch *ds, int port, struct swi
|
||||
if (priv->r->enable_bcast_flood && (flags.mask & BR_BCAST_FLOOD))
|
||||
priv->r->enable_bcast_flood(port, !!(flags.val & BR_BCAST_FLOOD));
|
||||
|
||||
if (flags.mask & BR_ISOLATED) {
|
||||
struct dsa_port *dp = dsa_to_port(ds, port);
|
||||
struct net_device *bridge_dev = dsa_port_bridge_dev_get(dp);
|
||||
|
||||
priv->ports[port].isolated = !!(flags.val & BR_ISOLATED);
|
||||
|
||||
mutex_lock(&priv->reg_mutex);
|
||||
rtldsa_update_port_member(priv, port, bridge_dev, true);
|
||||
mutex_unlock(&priv->reg_mutex);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2557,7 +2581,7 @@ const struct dsa_switch_ops rtl83xx_switch_ops = {
|
||||
.phy_read = rtldsa_phy_read,
|
||||
.phy_write = rtldsa_phy_write,
|
||||
|
||||
.phylink_get_caps = rtldsa_phylink_get_caps,
|
||||
.phylink_get_caps = rtldsa_83xx_phylink_get_caps,
|
||||
.phylink_mac_config = rtl83xx_phylink_mac_config,
|
||||
.phylink_mac_link_down = rtl83xx_phylink_mac_link_down,
|
||||
.phylink_mac_link_up = rtl83xx_phylink_mac_link_up,
|
||||
@ -2573,15 +2597,15 @@ const struct dsa_switch_ops rtl83xx_switch_ops = {
|
||||
.get_stats64 = rtldsa_get_stats64,
|
||||
.get_pause_stats = rtldsa_get_pause_stats,
|
||||
|
||||
.port_enable = rtl83xx_port_enable,
|
||||
.port_disable = rtl83xx_port_disable,
|
||||
.port_enable = rtldsa_port_enable,
|
||||
.port_disable = rtldsa_port_disable,
|
||||
|
||||
.get_mac_eee = rtldsa_get_mac_eee,
|
||||
.set_mac_eee = rtldsa_set_mac_eee,
|
||||
|
||||
.set_ageing_time = rtl83xx_set_ageing_time,
|
||||
.port_bridge_join = rtl83xx_port_bridge_join,
|
||||
.port_bridge_leave = rtl83xx_port_bridge_leave,
|
||||
.port_bridge_join = rtldsa_port_bridge_join,
|
||||
.port_bridge_leave = rtldsa_port_bridge_leave,
|
||||
.port_stp_state_set = rtl83xx_port_stp_state_set,
|
||||
.port_fast_age = rtl83xx_fast_age,
|
||||
|
||||
@ -2603,18 +2627,18 @@ const struct dsa_switch_ops rtl83xx_switch_ops = {
|
||||
.port_lag_join = rtl83xx_port_lag_join,
|
||||
.port_lag_leave = rtl83xx_port_lag_leave,
|
||||
|
||||
.port_pre_bridge_flags = rtl83xx_port_pre_bridge_flags,
|
||||
.port_pre_bridge_flags = rtldsa_port_pre_bridge_flags,
|
||||
.port_bridge_flags = rtl83xx_port_bridge_flags,
|
||||
};
|
||||
|
||||
const struct dsa_switch_ops rtl930x_switch_ops = {
|
||||
const struct dsa_switch_ops rtl93xx_switch_ops = {
|
||||
.get_tag_protocol = rtl83xx_get_tag_protocol,
|
||||
.setup = rtl93xx_setup,
|
||||
|
||||
.phy_read = rtldsa_phy_read,
|
||||
.phy_write = rtldsa_phy_write,
|
||||
|
||||
.phylink_get_caps = rtldsa_phylink_get_caps,
|
||||
.phylink_get_caps = rtldsa_93xx_phylink_get_caps,
|
||||
.phylink_mac_config = rtl93xx_phylink_mac_config,
|
||||
.phylink_mac_link_down = rtl93xx_phylink_mac_link_down,
|
||||
.phylink_mac_link_up = rtl93xx_phylink_mac_link_up,
|
||||
@ -2630,15 +2654,15 @@ const struct dsa_switch_ops rtl930x_switch_ops = {
|
||||
.get_stats64 = rtldsa_get_stats64,
|
||||
.get_pause_stats = rtldsa_get_pause_stats,
|
||||
|
||||
.port_enable = rtl83xx_port_enable,
|
||||
.port_disable = rtl83xx_port_disable,
|
||||
.port_enable = rtldsa_port_enable,
|
||||
.port_disable = rtldsa_port_disable,
|
||||
|
||||
.get_mac_eee = rtldsa_get_mac_eee,
|
||||
.set_mac_eee = rtldsa_set_mac_eee,
|
||||
|
||||
.set_ageing_time = rtl83xx_set_ageing_time,
|
||||
.port_bridge_join = rtl83xx_port_bridge_join,
|
||||
.port_bridge_leave = rtl83xx_port_bridge_leave,
|
||||
.port_bridge_join = rtldsa_port_bridge_join,
|
||||
.port_bridge_leave = rtldsa_port_bridge_leave,
|
||||
.port_stp_state_set = rtl83xx_port_stp_state_set,
|
||||
.port_fast_age = rtl930x_fast_age,
|
||||
|
||||
@ -2660,6 +2684,6 @@ const struct dsa_switch_ops rtl930x_switch_ops = {
|
||||
.port_lag_join = rtl83xx_port_lag_join,
|
||||
.port_lag_leave = rtl83xx_port_lag_leave,
|
||||
|
||||
.port_pre_bridge_flags = rtl83xx_port_pre_bridge_flags,
|
||||
.port_pre_bridge_flags = rtldsa_port_pre_bridge_flags,
|
||||
.port_bridge_flags = rtl83xx_port_bridge_flags,
|
||||
};
|
||||
|
||||
@ -587,11 +587,6 @@ static void rtl838x_stp_set(struct rtl838x_switch_priv *priv, u16 msti, u32 port
|
||||
priv->r->exec_tbl0_cmd(cmd);
|
||||
}
|
||||
|
||||
static u64 rtl838x_traffic_get(int source)
|
||||
{
|
||||
return rtl838x_get_port_reg(rtl838x_port_iso_ctrl(source));
|
||||
}
|
||||
|
||||
static void rtl838x_traffic_set(int source, u64 dest_matrix)
|
||||
{
|
||||
rtl838x_set_port_reg(dest_matrix, rtl838x_port_iso_ctrl(source));
|
||||
@ -1681,7 +1676,6 @@ const struct rtl838x_reg rtl838x_reg = {
|
||||
.port_iso_ctrl = rtl838x_port_iso_ctrl,
|
||||
.traffic_enable = rtl838x_traffic_enable,
|
||||
.traffic_disable = rtl838x_traffic_disable,
|
||||
.traffic_get = rtl838x_traffic_get,
|
||||
.traffic_set = rtl838x_traffic_set,
|
||||
.l2_ctrl_0 = RTL838X_L2_CTRL_0,
|
||||
.l2_ctrl_1 = RTL838X_L2_CTRL_1,
|
||||
|
||||
@ -680,14 +680,15 @@ struct rtldsa_counter_state {
|
||||
};
|
||||
|
||||
struct rtl838x_port {
|
||||
bool enable;
|
||||
bool enable:1;
|
||||
bool phy_is_integrated:1;
|
||||
bool is10G:1;
|
||||
bool is2G5:1;
|
||||
bool isolated:1;
|
||||
u64 pm;
|
||||
u16 pvid;
|
||||
bool eee_enabled;
|
||||
enum phy_type phy;
|
||||
bool phy_is_integrated;
|
||||
bool is10G;
|
||||
bool is2G5;
|
||||
int sds_num;
|
||||
int led_set;
|
||||
int leds_on_this_port;
|
||||
@ -1040,7 +1041,6 @@ struct rtl838x_reg {
|
||||
void (*traffic_enable)(int source, int dest);
|
||||
void (*traffic_disable)(int source, int dest);
|
||||
void (*traffic_set)(int source, u64 dest_matrix);
|
||||
u64 (*traffic_get)(int source);
|
||||
int l2_ctrl_0;
|
||||
int l2_ctrl_1;
|
||||
int smi_poll_ctrl;
|
||||
|
||||
@ -537,11 +537,6 @@ static void rtl839x_vlan_profile_setup(int profile)
|
||||
rtl839x_write_mcast_pmask(UNKNOWN_MC_PMASK, 0x001fffffffffffff);
|
||||
}
|
||||
|
||||
static u64 rtl839x_traffic_get(int source)
|
||||
{
|
||||
return rtl839x_get_port_reg_be(rtl839x_port_iso_ctrl(source));
|
||||
}
|
||||
|
||||
static void rtl839x_traffic_set(int source, u64 dest_matrix)
|
||||
{
|
||||
rtl839x_set_port_reg_be(dest_matrix, rtl839x_port_iso_ctrl(source));
|
||||
@ -1654,7 +1649,6 @@ const struct rtl838x_reg rtl839x_reg = {
|
||||
.stat_port_std_mib = RTL839X_STAT_PORT_STD_MIB,
|
||||
.traffic_enable = rtl839x_traffic_enable,
|
||||
.traffic_disable = rtl839x_traffic_disable,
|
||||
.traffic_get = rtl839x_traffic_get,
|
||||
.traffic_set = rtl839x_traffic_set,
|
||||
.port_iso_ctrl = rtl839x_port_iso_ctrl,
|
||||
.l2_ctrl_0 = RTL839X_L2_CTRL_0,
|
||||
|
||||
@ -755,19 +755,6 @@ void rtldsa_930x_set_receive_management_action(int port, rma_ctrl_t type,
|
||||
}
|
||||
}
|
||||
|
||||
static u64 rtl930x_traffic_get(int source)
|
||||
{
|
||||
u32 v;
|
||||
struct table_reg *r = rtl_table_get(RTL9300_TBL_0, 6);
|
||||
|
||||
rtl_table_read(r, source);
|
||||
v = sw_r32(rtl_table_data(r, 0));
|
||||
rtl_table_release(r);
|
||||
v = v >> 3;
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
/* Enable traffic between a source port and a destination port matrix */
|
||||
static void rtl930x_traffic_set(int source, u64 dest_matrix)
|
||||
{
|
||||
@ -2470,7 +2457,6 @@ const struct rtl838x_reg rtl930x_reg = {
|
||||
.stat_port_prv_mib = RTL930X_STAT_PORT_PRVTE_CNTR,
|
||||
.traffic_enable = rtl930x_traffic_enable,
|
||||
.traffic_disable = rtl930x_traffic_disable,
|
||||
.traffic_get = rtl930x_traffic_get,
|
||||
.traffic_set = rtl930x_traffic_set,
|
||||
.l2_ctrl_0 = RTL930X_L2_CTRL,
|
||||
.l2_ctrl_1 = RTL930X_L2_AGE_CTRL,
|
||||
|
||||
@ -403,21 +403,6 @@ void rtldsa_931x_set_receive_management_action(int port, rma_ctrl_t type, action
|
||||
}
|
||||
}
|
||||
|
||||
static u64 rtl931x_traffic_get(int source)
|
||||
{
|
||||
u64 v;
|
||||
struct table_reg *r = rtl_table_get(RTL9310_TBL_2, 1);
|
||||
|
||||
rtl_table_read(r, source);
|
||||
v = sw_r32(rtl_table_data(r, 0));
|
||||
v <<= 32;
|
||||
v |= sw_r32(rtl_table_data(r, 1));
|
||||
v >>= 7;
|
||||
rtl_table_release(r);
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
/* Enable traffic between a source port and a destination port matrix */
|
||||
static void rtl931x_traffic_set(int source, u64 dest_matrix)
|
||||
{
|
||||
@ -1615,7 +1600,6 @@ const struct rtl838x_reg rtl931x_reg = {
|
||||
.stat_port_std_mib = 0, /* Not defined */
|
||||
.traffic_enable = rtl931x_traffic_enable,
|
||||
.traffic_disable = rtl931x_traffic_disable,
|
||||
.traffic_get = rtl931x_traffic_get,
|
||||
.traffic_set = rtl931x_traffic_set,
|
||||
.l2_ctrl_0 = RTL931X_L2_CTRL,
|
||||
.l2_ctrl_1 = RTL931X_L2_AGE_CTRL,
|
||||
|
||||
@ -44,10 +44,10 @@ GIT_COMMIT:=$(shell git rev-parse HEAD 2>/dev/null)
|
||||
GIT_BRANCH:=$(filter-out master HEAD,$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null))
|
||||
GIT_TAGNAME:=$(shell git show-ref --tags --dereference 2>/dev/null | sed -ne '/^$(GIT_COMMIT) / { s|^.*/||; s|\^.*||; p }')
|
||||
|
||||
BASE_FEED:=$(if $(GIT_URL),src-git-full base $(GIT_URL)$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME))))
|
||||
BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C git svn info 2>/dev/null | sed -ne 's/^URL: /src-gitsvn base /p'))
|
||||
BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C svn info 2>/dev/null | sed -ne 's/^URL: /src-svn base /p'))
|
||||
BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git-full base $(PROJECT_GIT)/openwrt/openwrt.git$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME))))
|
||||
BASE_FEED:=$(if $(GIT_URL),src-git-full --root=package base $(GIT_URL)$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME))))
|
||||
BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C git svn info 2>/dev/null | sed -ne 's/^URL: /src-gitsvn --root=package base /p'))
|
||||
BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C svn info 2>/dev/null | sed -ne 's/^URL: /src-svn --root=package base /p'))
|
||||
BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git-full --root=package base https://github.com/immortalwrt/immortalwrt.git$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME))))
|
||||
|
||||
KDIR_BASE = $(patsubst $(TOPDIR)/%,%,$(LINUX_DIR))
|
||||
KDIR_ARCHES = $(LINUX_KARCH)
|
||||
|
||||
@ -7,14 +7,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=mkimage
|
||||
PKG_VERSION:=2025.07
|
||||
PKG_VERSION:=2025.10
|
||||
|
||||
PKG_SOURCE:=u-boot-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:= \
|
||||
https://mirror.cyberbits.eu/u-boot \
|
||||
https://ftp.denx.de/pub/u-boot \
|
||||
ftp://ftp.denx.de/pub/u-boot
|
||||
PKG_HASH:=0f933f6c5a426895bf306e93e6ac53c60870e4b54cda56d95211bec99e63bec7
|
||||
PKG_HASH:=b4f032848e56cc8f213ad59f9132c084dbbb632bc29176d024e58220e0efdf4a
|
||||
|
||||
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/u-boot-$(PKG_VERSION)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user