kernel: bump to 4.14.193, 4.19.138, 5.4.59 (#5350)

kernel: bump to 4.14.193, 4.19.138, 5.4.59 (#5350)
  431fb8c mac80211: add AQL improvements
  6bdd4c9 mac80211: add missing backports for building with 4.14 kernels
  0106820 mac80211: add missing return code checks in AQL improvements
  e7f7101 mac80211: rework encapsulation offload support

[package]
  base-files: add function for generating random MAC
  dnsmasq: abort dhcp_check on interface state
  boot: sync upstream source code
  ath10k-ct-firmware/mt76/sch_cake: update to latest git HEAD

[script]
  download: add China Mirror Station

[target]
  Sync: arc770, ath79, bcm63xx, kirkwood, lantiq, layerscape,
        mediatek, mvebu, octeon, oxnas, pistachio, uml
  Sync most of the target patches.

Run-compiled-on: ipq40xx (4.19 & 5.4), ramips
This commit is contained in:
AmadeusGhost 2020-08-26 11:31:50 +08:00 committed by GitHub
parent 7dd173abbc
commit 404209f6c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
806 changed files with 21518 additions and 50657 deletions

View File

@ -6,13 +6,13 @@ ifdef CONFIG_TESTING_KERNEL
KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
endif
LINUX_VERSION-4.14 = .187
LINUX_VERSION-4.19 = .131
LINUX_VERSION-5.4 = .51
LINUX_VERSION-4.14 = .193
LINUX_VERSION-4.19 = .138
LINUX_VERSION-5.4 = .59
LINUX_KERNEL_HASH-4.14.187 = 5b223475eaeea196aa7e127d3f253bca5c35d8afdc72ca75230ce1ecdd1454bd
LINUX_KERNEL_HASH-4.19.131 = 19dfb9f6cc4ba30104b65dcce7d78240a4ae188cb366747d5f8eae35e98964ba
LINUX_KERNEL_HASH-5.4.51 = 9e8bea8b4cd636726b7e495a3b467c8ffe96f8eddc159a45fe4a7e6e07a2069d
LINUX_KERNEL_HASH-4.14.193 = 0b0fb41d4430e1a42738b341cbfd2f41951aa5cd02acabbd53f076119c8b9f03
LINUX_KERNEL_HASH-4.19.138 = d15c27d05f6c527269b75b30cc72972748e55720e7e00ad8abbaa4fe3b1d5e02
LINUX_KERNEL_HASH-5.4.59 = 9bcb9db2e4435f2e5948375862baf0973f1d7860ebe3d750383e5a6deac4b2fd
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))

View File

@ -62,7 +62,7 @@ endif
DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE))
filter_packages = $(filter-out -% $(patsubst -%,%,$(filter -%,$(1))),$(1))
extra_packages = $(if $(filter wpad-mini wpad-basic wpad nas,$(1)),iwinfo)
extra_packages = $(if $(filter wpad-mini wpad-basic wpad-basic-wolfssl wpad nas,$(1)),iwinfo)
define ProfileDefault
NAME:=

View File

@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
include $(INCLUDE_DIR)/feeds.mk
PKG_NAME:=base-files
PKG_RELEASE:=223
PKG_RELEASE:=224
PKG_FLAGS:=nonshared
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/

View File

@ -251,10 +251,10 @@ generate_static_system() {
set system.ntp='timeserver'
set system.ntp.enabled='1'
set system.ntp.enable_server='0'
add_list system.ntp.server='0.openwrt.pool.ntp.org'
add_list system.ntp.server='1.openwrt.pool.ntp.org'
add_list system.ntp.server='2.openwrt.pool.ntp.org'
add_list system.ntp.server='3.openwrt.pool.ntp.org'
add_list system.ntp.server='ntp1.aliyun.com'
add_list system.ntp.server='time1.cloud.tencent.com'
add_list system.ntp.server='time.ustc.edu.cn'
add_list system.ntp.server='cn.pool.ntp.org'
EOF
if json_is_a system object; then

View File

@ -158,6 +158,18 @@ macaddr_setbit_la() {
printf "%02x:%s" $((0x${mac%%:*} | 0x02)) ${mac#*:}
}
macaddr_unsetbit_mc() {
local mac=$1
printf "%02x:%s" $((0x${mac%%:*} & ~0x01)) ${mac#*:}
}
macaddr_random() {
local randsrc=$(get_mac_binary /dev/urandom 0)
echo "$(macaddr_unsetbit_mc "$(macaddr_setbit_la "${randsrc}")")"
}
macaddr_2bin() {
local mac=$1

View File

@ -0,0 +1,61 @@
#
# Copyright © 2020 David Woodhouse <dwmw2@infradead.org>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mt7623n-preloader
PKG_VERSION:=2020-03-11
PKG_RELEASE:=b27114e184449a33b5d875fda14198f5e6fee2bb
PKG_MAINTAINER:=David Woodhouse <dwmw2@infradead.org>
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_RELEASE)
PKG_FLAGS:=nonshared
include $(INCLUDE_DIR)/package.mk
BPI_PRELOADER_URL:=@GITHUB/BPI-SINOVOIP/BPI-files/$(PKG_RELEASE)/SD/100MB/
BPI_PRELOADER_PREFIX:=bpi-preloader-$(PKG_RELEASE)
define Download/BPI-R2-preloader-2k.img.gz
FILE:=$(BPI_PRELOADER_PREFIX)-BPI-R2-preloader-DDR1600-20191024-2k.img.gz
URL:=$(BPI_PRELOADER_URL)
URL_FILE:=BPI-R2-preloader-DDR1600-20191024-2k.img.gz
HASH:=c731cc166c912c84846e2ed5faf727504e4dec1463754baa6328e9908c84a373
endef
$(eval $(call Download,BPI-R2-preloader-2k.img.gz))
define Package/mt7623n-preloader
SECTION:=boot
CATEGORY:=Boot Loaders
DEPENDS:=@TARGET_mediatek_mt7623
TITLE:=mt7623n-preloader
DEFAULT:=y if TARGET_mediatek
endef
define Package/mt7623n-preloader/description
Preloader image for mt7623n based boards like Banana Pi R2.
endef
define Build/Prepare
rm -rf $(PKG_BUILD_DIR)
mkdir -p $(PKG_BUILD_DIR)
cp $(DL_DIR)/$(BPI_PRELOADER_PREFIX)-BPI-R2-preloader-DDR1600-20191024-2k.img.gz $(PKG_BUILD_DIR)/mt7623n_bpir2-preloader.bin.gz
endef
define Build/Compile
true
endef
define Build/InstallDev
mkdir -p $(STAGING_DIR_IMAGE)
gunzip -c $(PKG_BUILD_DIR)/mt7623n_bpir2-preloader.bin.gz > $(STAGING_DIR_IMAGE)/mt7623n_bpir2-preloader.bin
endef
$(eval $(call BuildPackage,mt7623n-preloader))

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=tfa-layerscape
PKG_VERSION:=LSDK-20.04
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/atf
@ -37,130 +37,115 @@ define Host/Install
$(INSTALL_BIN) $(HOST_BUILD_DIR)/plat/nxp/tools/byte_swap $(STAGING_DIR_HOST)/bin/tfa-byte-swap
endef
define Package/tfa-layerscape/ls1012afrdm
define Package/tfa-generic
SECTION:=boot
CATEGORY:=Boot Loaders
DEPENDS:=@TARGET_layerscape_armv8_64b +layerscape-rcw +u-boot-fsl_$(subst tfa-,,$(1))
VARIANT:=$(subst tfa-,,$(1))
endef
define Package/tfa-ls1012a-frdm
$(Package/tfa-generic)
TITLE:=NXP LS1012AFRDM Trusted Firmware
PLAT:=ls1012afrdm
BOOT_MODE:=qspi
BIN_BL2:=build/ls1012afrdm/release/bl2_qspi.pbl
BIN_FIP:=build/ls1012afrdm/release/fip.bin
endef
define Package/tfa-layerscape/ls1012ardb
define Package/tfa-ls1012a-rdb
$(Package/tfa-generic)
TITLE:=NXP LS1012ARDB Trusted Firmware
PLAT:=ls1012ardb
BOOT_MODE:=qspi
BIN_BL2:=build/ls1012ardb/release/bl2_qspi.pbl
BIN_FIP:=build/ls1012ardb/release/fip.bin
endef
define Package/tfa-layerscape/ls1012afrwy
define Package/tfa-ls1012a-frwy-sdboot
$(Package/tfa-generic)
TITLE:=NXP LS1012AFRWY Trusted Firmware
PLAT:=ls1012afrwy
BOOT_MODE:=qspi
BIN_BL2:=build/ls1012afrwy/release/bl2_qspi.pbl
BIN_FIP:=build/ls1012afrwy/release/fip.bin
endef
define Package/tfa-layerscape/ls1043ardb
define Package/tfa-ls1043a-rdb
$(Package/tfa-generic)
TITLE:=NXP LS1043ARDB Trusted Firmware
PLAT:=ls1043ardb
BOOT_MODE:=nor
BIN_BL2:=build/ls1043ardb/release/bl2_nor.pbl
BIN_FIP:=build/ls1043ardb/release/fip.bin
endef
define Package/tfa-layerscape/ls1043ardb-sdboot
define Package/tfa-ls1043a-rdb-sdboot
$(Package/tfa-generic)
TITLE:=NXP LS1043ARDB SD Boot Trusted Firmware
PLAT:=ls1043ardb
BOOT_MODE:=sd
BIN_BL2:=build/ls1043ardb/release/bl2_sd.pbl
BIN_FIP:=build/ls1043ardb/release/fip.bin
endef
define Package/tfa-layerscape/ls1046ardb
define Package/tfa-ls1046a-rdb
$(Package/tfa-generic)
TITLE:=NXP LS1046ARDB Trusted Firmware
PLAT:=ls1046ardb
BOOT_MODE:=qspi
BIN_BL2:=build/ls1046ardb/release/bl2_qspi.pbl
BIN_FIP:=build/ls1046ardb/release/fip.bin
endef
define Package/tfa-layerscape/ls1046ardb-sdboot
define Package/tfa-ls1046a-rdb-sdboot
$(Package/tfa-generic)
TITLE:=NXP LS1046ARDB SD Boot Trusted Firmware
PLAT:=ls1046ardb
BOOT_MODE:=sd
BIN_BL2:=build/ls1046ardb/release/bl2_sd.pbl
BIN_FIP:=build/ls1046ardb/release/fip.bin
endef
define Package/tfa-layerscape/ls1088ardb
define Package/tfa-ls1088a-rdb
$(Package/tfa-generic)
TITLE:=NXP LS1088ARDB Trusted Firmware
PLAT:=ls1088ardb
BOOT_MODE:=qspi
BIN_BL2:=build/ls1088ardb/release/bl2_qspi.pbl
BIN_FIP:=build/ls1088ardb/release/fip.bin
endef
define Package/tfa-layerscape/ls1088ardb-sdboot
define Package/tfa-ls1088a-rdb-sdboot
$(Package/tfa-generic)
TITLE:=NXP LS1088ARDB SD Boot Trusted Firmware
PLAT:=ls1088ardb
BOOT_MODE:=sd
BIN_BL2:=build/ls1088ardb/release/bl2_sd.pbl
BIN_FIP:=build/ls1088ardb/release/fip.bin
endef
define Package/tfa-layerscape/ls2088ardb
define Package/tfa-ls2088a-rdb
$(Package/tfa-generic)
TITLE:=NXP LS2088ARDB Trusted Firmware
PLAT:=ls2088ardb
BOOT_MODE:=nor
BIN_BL2:=build/ls2088ardb/release/bl2_nor.pbl
BIN_FIP:=build/ls2088ardb/release/fip.bin
endef
define Package/tfa-layerscape/Config
define Package/tfa-$(1)
SECTION:=boot
CATEGORY:=Boot Loaders
TITLE:=$(2)
DEPENDS:=@TARGET_layerscape_armv8_64b +layerscape-rcw +u-boot-$(1)
VARIANT:=$(1)
BIN_BL2:=$(3)
BIN_FIP:=$(4)
endef
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/$(BIN_BL2) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-bl2.pbl
$(CP) $(PKG_BUILD_DIR)/$(BIN_FIP) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-fip.bin
$(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/bl2_$(BOOT_MODE).pbl \
$(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-bl2.pbl
$(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/fip.bin \
$(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-fip.bin
endef
define Build/Compile
$(eval $(Package/tfa-layerscape/$(BUILD_VARIANT))) \
$(eval $(Package/tfa-$(BUILD_VARIANT))) \
$(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS) \
fip pbl PLAT=$(PLAT) BOOT_MODE=$(BOOT_MODE) \
RCW=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-rcw.bin \
BL33=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-uboot.bin \
RCW=$(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-rcw.bin \
BL33=$(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-uboot.bin \
FIPTOOL=$(STAGING_DIR_HOST)/bin/tfa-fiptool \
CREATE_PBL=$(STAGING_DIR_HOST)/bin/tfa-create-pbl \
BYTE_SWAP=$(STAGING_DIR_HOST)/bin/tfa-byte-swap
endef
TFAS := \
ls1012afrdm \
ls1012ardb \
ls1012afrwy \
ls1043ardb \
ls1043ardb-sdboot \
ls1046ardb \
ls1046ardb-sdboot \
ls1088ardb \
ls1088ardb-sdboot \
ls2088ardb
ls1012a-frdm \
ls1012a-rdb \
ls1012a-frwy-sdboot \
ls1043a-rdb \
ls1043a-rdb-sdboot \
ls1046a-rdb \
ls1046a-rdb-sdboot \
ls1088a-rdb \
ls1088a-rdb-sdboot \
ls2088a-rdb
$(eval $(call HostBuild))
$(foreach tfa,$(TFAS), \
$(eval $(Package/tfa-layerscape/$(tfa))) \
$(eval $(call Package/tfa-layerscape/Config,$(tfa),$(TITLE),$(BIN_BL2),$(BIN_FIP))) \
$(eval $(call BuildPackage,tfa-$(tfa))) \
)

View File

@ -47,6 +47,7 @@ mr600v2|\
mr900|\
mr900v2|\
n5q|\
nbg6616|\
nbg6716|\
om5p|\
om5p-ac|\

View File

@ -14,14 +14,12 @@ board=$(board_name)
case "$board" in
alfa-network,ap121f|\
allnet,all-wap02860ac|\
arduino,yun|\
buffalo,bhr-4grv2|\
devolo,magic-2-wifi|\
engenius,ecb1750|\
etactica,eg200|\
glinet,gl-ar300m-lite|\
glinet,gl-ar300m-nand|\
glinet,gl-ar300m-nor|\
glinet,gl-ar300m16|\
glinet,gl-ar750s-nor|\
glinet,gl-ar750s-nor-nand|\
librerouter,librerouter-v1|\
@ -37,9 +35,11 @@ netgear,wnr612-v2|\
ocedo,koala|\
ocedo,raccoon|\
openmesh,om5p-ac-v2|\
ubnt,nanostation-m|\
yuncore,a770|\
yuncore,a782|\
yuncore,xd4200)
yuncore,xd4200|\
zyxel,nbg6616)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
;;
buffalo,wzr-hp-ag300h)
@ -51,6 +51,14 @@ domywifi,dw33d)
glinet,gl-ar150)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000"
;;
glinet,gl-ar300m-lite|\
glinet,gl-ar300m-nand|\
glinet,gl-ar300m-nor|\
glinet,gl-ar300m16)
idx="$(find_mtd_index u-boot-env)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000"
;;
netgear,wndr3700|\
netgear,wndr3700-v2|\
netgear,wndrmac-v1)
@ -58,6 +66,7 @@ netgear,wndrmac-v1)
;;
netgear,wndr3700-v4|\
netgear,wndr4300|\
netgear,wndr4300tn|\
netgear,wndr4300sw)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
;;

View File

@ -14,10 +14,31 @@ touch /etc/config/ubootenv
board=$(board_name)
case "$board" in
apalis*)
ubootenv_add_uci_config $(bootdev_from_uuid)boot0 -0x2200 0x2000 0x200 10
;;
*gw5*)
gw,imx6dl-gw51xx |\
gw,imx6dl-gw52xx |\
gw,imx6dl-gw53xx |\
gw,imx6dl-gw54xx |\
gw,imx6dl-gw551x |\
gw,imx6dl-gw552x |\
gw,imx6dl-gw553x |\
gw,imx6dl-gw5904 |\
gw,imx6dl-gw5907 |\
gw,imx6dl-gw5910 |\
gw,imx6dl-gw5912 |\
gw,imx6dl-gw5913 |\
gw,imx6q-gw51xx |\
gw,imx6q-gw52xx |\
gw,imx6q-gw53xx |\
gw,imx6q-gw5400-a |\
gw,imx6q-gw54xx |\
gw,imx6q-gw551x |\
gw,imx6q-gw552x |\
gw,imx6q-gw553x |\
gw,imx6q-gw5904 |\
gw,imx6q-gw5907 |\
gw,imx6q-gw5910 |\
gw,imx6q-gw5912 |\
gw,imx6q-gw5913 )
if [ -c /dev/mtd1 ]; then
# board boots from NAND
ubootenv_add_uci_config /dev/mtd1 0x0 0x20000 0x40000
@ -28,7 +49,12 @@ apalis*)
ubootenv_add_uci_config /dev/mmcblk0 0xd1400 0x20000
fi
;;
wandboard)
toradex,apalis_imx6q-eval |\
toradex,apalis_imx6q-ixora |\
toradex,apalis_imx6q-ixora-v1.1 )
ubootenv_add_uci_config $(bootdev_from_uuid)boot0 -0x2200 0x2000 0x200 10
;;
wand,imx6dl-wandboard)
ubootenv_add_uci_config "/dev/mmcblk0" "0x60000" "0x2000" "0x2000"
;;
esac

View File

@ -31,6 +31,7 @@ ubootenv_mtdinfo () {
}
case "$board" in
linksys,ea7500-v1 |\
linksys,ea8500)
ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x20000" "0x20000"
;;

View File

@ -13,17 +13,20 @@ touch /etc/config/ubootenv
board=$(board_name)
case "$board" in
checkpoint,l-50|\
cloudengines,pogoe02|\
cloudengines,pogoplugv4|\
iom,ix2-200|\
linksys,viper|\
linksys,e4200-v2|\
linksys,ea4500|\
raidsonic,ib-nas62x0|\
seagate,dockstar|\
zyxel,nsa310b|\
zyxel,nsa310s|\
zyxel,nsa325)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
;;
linksys,audi)
linksys,ea3500)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000"
;;
esac

View File

@ -24,7 +24,8 @@ globalscale,espressobin|\
globalscale,espressobin-emmc|\
globalscale,espressobin-v7|\
globalscale,espressobin-v7-emmc|\
marvell,armada8040-mcbin)
marvell,armada8040-mcbin-doubleshot|\
marvell,armada8040-mcbin-singleshot)
ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
;;
linksys,wrt1200ac|\

View File

@ -33,6 +33,7 @@ xiaomi,miwifi-nano|\
zbtlink,zbt-wg2626)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
;;
linksys,ea7300-v1|\
linksys,ea7500-v2|\
xiaomi,mir3p|\
xiaomi,mir3g|\

View File

@ -54,11 +54,21 @@ define U-Boot/iconnect_second_stage
BUILD_DEVICES:=iom_iconnect-1.1
endef
define U-Boot/l-50
NAME:=CheckPoint L-50
BUILD_DEVICES:=checkpoint_l-50
endef
define U-Boot/nsa310
NAME:=Zyxel NSA310
BUILD_DEVICES:=zyxel_nsa310b
endef
define U-Boot/nsa310s
NAME:=Zyxel NSA310S
BUILD_DEVICES:=zyxel_nsa310s
endef
define U-Boot/nsa325
NAME:=Zyxel NSA325v1 and v2
BUILD_DEVICES:=zyxel_nsa325
@ -84,7 +94,9 @@ UBOOT_TARGETS := \
goflexhome \
ib62x0 ib62x0_second_stage \
iconnect iconnect_second_stage \
l-50 \
nsa310 \
nsa310s \
nsa325 \
pogo_e02 pogo_e02_second_stage \
pogoplugv4

View File

@ -0,0 +1,928 @@
From 742f780f62ace452b83e2463f1f1afdda4b724ea Mon Sep 17 00:00:00 2001
From: Pawel Dembicki <paweldembicki@gmail.com>
Date: Sun, 26 Jan 2020 07:27:24 +0100
Subject: [PATCH] arm: kirkwood: add CheckPoint L-50 device
This patch adds support for the Check Point L-50 from 600/1100 series
routers.
Specification:
-CPU: Marvell Kirkwood 88F6821 1200MHz
-RAM: 512MB
-Flash: NAND 512MB
-WiFi: mPCIe card based on Atheros AR9287 b/g/n
-WAN: 1 Gigabit Port (Marvell 88E1116R PHY)
-LAN: 9 Gigabit Ports (2x Marvell 88E6171(5+4))
-USB: 2x USB2.0
-Express card slot
-SD card slot
-Serial console: RJ-45 115200 8n1
-Unsupported DSL
Known limitations:
- In board is used two switches in chain. Second Marvell is not used
in u-Boot.
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
---
arch/arm/dts/Makefile | 1 +
arch/arm/dts/kirkwood-l-50.dts | 439 +++++++++++++++++++++++++++++
arch/arm/mach-kirkwood/Kconfig | 4 +
board/checkpoint/l-50/Kconfig | 12 +
board/checkpoint/l-50/MAINTAINERS | 6 +
board/checkpoint/l-50/Makefile | 11 +
board/checkpoint/l-50/kwbimage.cfg | 36 +++
board/checkpoint/l-50/l-50.c | 172 +++++++++++
board/checkpoint/l-50/l-50.h | 29 ++
configs/l-50_defconfig | 59 ++++
include/configs/l-50.h | 59 ++++
11 files changed, 828 insertions(+)
create mode 100644 arch/arm/dts/kirkwood-l-50.dts
create mode 100644 board/checkpoint/l-50/Kconfig
create mode 100644 board/checkpoint/l-50/MAINTAINERS
create mode 100644 board/checkpoint/l-50/Makefile
create mode 100644 board/checkpoint/l-50/kwbimage.cfg
create mode 100644 board/checkpoint/l-50/l-50.c
create mode 100644 board/checkpoint/l-50/l-50.h
create mode 100644 configs/l-50_defconfig
create mode 100644 include/configs/l-50.h
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -51,6 +51,7 @@ dtb-$(CONFIG_KIRKWOOD) += \
kirkwood-iconnect.dtb \
kirkwood-is2.dtb \
kirkwood-km_kirkwood.dtb \
+ kirkwood-l-50.dtb \
kirkwood-lsxhl.dtb \
kirkwood-lschlv2.dtb \
kirkwood-net2big.dtb \
--- /dev/null
+++ b/arch/arm/dts/kirkwood-l-50.dts
@@ -0,0 +1,439 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Check Point L-50 Board Description
+ * Copyright 2020 Pawel Dembicki <paweldembicki@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
+
+/ {
+ model = "Check Point L-50";
+ compatible = "checkpoint,l-50", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+ memory {
+ device_type = "memory";
+ reg = <0x00000000 0x20000000>;
+ };
+
+ chosen {
+ bootargs = "console=ttyS0,115200n8";
+ stdout-path = &uart0;
+ };
+
+ ocp@f1000000 {
+ pinctrl: pin-controller@10000 {
+ pinctrl-0 = <&pmx_led38 &pmx_sysrst &pmx_button29>;
+ pinctrl-names = "default";
+
+ pmx_sysrst: pmx-sysrst {
+ marvell,pins = "mpp6";
+ marvell,function = "sysrst";
+ };
+
+ pmx_button29: pmx_button29 {
+ marvell,pins = "mpp29";
+ marvell,function = "gpio";
+ };
+
+ pmx_led38: pmx_led38 {
+ marvell,pins = "mpp38";
+ marvell,function = "gpio";
+ };
+
+ pmx_sdio_cd: pmx-sdio-cd {
+ marvell,pins = "mpp46";
+ marvell,function = "gpio";
+ };
+ };
+
+ serial@12000 {
+ status = "okay";
+ };
+
+ mvsdio@90000 {
+ status = "okay";
+ cd-gpios = <&gpio1 14 9>;
+ };
+
+ i2c@11000 {
+ status = "okay";
+ clock-frequency = <400000>;
+
+ gpio2: gpio-expander@20{
+ #gpio-cells = <2>;
+ #interrupt-cells = <2>;
+ compatible = "semtech,sx1505q";
+ reg = <0x20>;
+
+ gpio-controller;
+ };
+
+ /* Three GPIOs from 0x21 exp. are undescribed in dts:
+ * 1: DSL module reset (active low)
+ * 5: mPCIE reset (active low)
+ * 6: Express card reset (active low)
+ */
+ gpio3: gpio-expander@21{
+ #gpio-cells = <2>;
+ #interrupt-cells = <2>;
+ compatible = "semtech,sx1505q";
+ reg = <0x21>;
+
+ gpio-controller;
+ };
+
+ rtc@30 {
+ compatible = "s35390a";
+ reg = <0x30>;
+ };
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ status_green {
+ label = "l-50:green:status";
+ gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
+ };
+
+ status_red {
+ label = "l-50:red:status";
+ gpios = <&gpio3 2 GPIO_ACTIVE_LOW>;
+ };
+
+ wifi {
+ label = "l-50:green:wifi";
+ gpios = <&gpio2 7 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "phy0tpt";
+ };
+
+ internet_green {
+ label = "l-50:green:internet";
+ gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
+ };
+
+ internet_red {
+ label = "l-50:red:internet";
+ gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
+ };
+
+ usb1_green {
+ label = "l-50:green:usb1";
+ gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "usbport";
+ trigger-sources = <&hub_port3>;
+ };
+
+ usb1_red {
+ label = "l-50:red:usb1";
+ gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
+ };
+
+ usb2_green {
+ label = "l-50:green:usb2";
+ gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
+ linux,default-trigger = "usbport";
+ trigger-sources = <&hub_port1>;
+ };
+
+ usb2_red {
+ label = "l-50:red:usb2";
+ gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ usb2_pwr {
+ compatible = "regulator-fixed";
+ regulator-name = "usb2_pwr";
+
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&gpio3 3 GPIO_ACTIVE_LOW>;
+ regulator-always-on;
+ };
+
+ usb1_pwr {
+ compatible = "regulator-fixed";
+ regulator-name = "usb1_pwr";
+
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&gpio3 4 GPIO_ACTIVE_LOW>;
+ regulator-always-on;
+ };
+
+ mpcie_pwr {
+ compatible = "regulator-fixed";
+ regulator-name = "mpcie_pwr";
+
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ gpio = <&gpio3 5 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ regulator-always-on;
+ };
+
+ express_card_pwr {
+ compatible = "regulator-fixed";
+ regulator-name = "express_card_pwr";
+
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ gpio = <&gpio3 7 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ regulator-always-on;
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ factory_defaults {
+ label = "factory_defaults";
+ gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RESTART>;
+ };
+ };
+};
+
+&mdio {
+ status = "okay";
+
+ ethphy8: ethernet-phy@8 {
+ reg = <0x08>;
+ };
+
+ switch0: switch@10 {
+ compatible = "marvell,mv88e6085";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0x10>;
+ dsa,member = <0 0>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ label = "lan5";
+ };
+
+ port@1 {
+ reg = <1>;
+ label = "lan1";
+ };
+
+ port@2 {
+ reg = <2>;
+ label = "lan6";
+ };
+
+ port@3 {
+ reg = <3>;
+ label = "lan2";
+ };
+
+ port@4 {
+ reg = <4>;
+ label = "lan7";
+ };
+
+ switch0port5: port@5 {
+ reg = <5>;
+ phy-mode = "rgmii-txid";
+ link = <&switch1port5>;
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+
+ port@6 {
+ reg = <6>;
+ label = "cpu";
+ phy-mode = "rgmii-id";
+ ethernet = <&eth1port>;
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+ };
+ };
+
+ switch@11 {
+ compatible = "marvell,mv88e6085";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0x11>;
+ dsa,member = <0 1>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ label = "lan3";
+ };
+
+ port@1 {
+ reg = <1>;
+ label = "lan8";
+ };
+
+ port@2 {
+ reg = <2>;
+ label = "lan4";
+ };
+
+ port@3 {
+ reg = <3>;
+ label = "dmz";
+ };
+
+ switch1port5: port@5 {
+ reg = <5>;
+ phy-mode = "rgmii-txid";
+ link = <&switch0port5>;
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+
+ port@6 {
+ reg = <6>;
+ label = "dsl";
+ fixed-link {
+ speed = <100>;
+ full-duplex;
+ };
+ };
+ };
+ };
+};
+
+&eth0 {
+ status = "okay";
+ ethernet0-port@0 {
+ phy-handle = <&ethphy8>;
+ };
+};
+
+&eth1 {
+ status = "okay";
+ ethernet1-port@0 {
+ speed = <1000>;
+ duplex = <1>;
+ phy-handle = <&switch0>;
+ };
+};
+
+&nand {
+ status = "okay";
+ pinctrl-0 = <&pmx_nand>;
+ pinctrl-names = "default";
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x00000000 0x000c0000>;
+ };
+
+ partition@a0000 {
+ label = "bootldr-env";
+ reg = <0x000c0000 0x00040000>;
+ };
+
+ partition@100000 {
+ label = "kernel-1";
+ reg = <0x00100000 0x00800000>;
+ };
+
+ partition@900000 {
+ label = "rootfs-1";
+ reg = <0x00900000 0x07100000>;
+ };
+
+ partition@7a00000 {
+ label = "kernel-2";
+ reg = <0x07a00000 0x00800000>;
+ };
+
+ partition@8200000 {
+ label = "rootfs-2";
+ reg = <0x08200000 0x07100000>;
+ };
+
+ partition@f300000 {
+ label = "default_sw";
+ reg = <0x0f300000 0x07900000>;
+ };
+
+ partition@16c00000 {
+ label = "logs";
+ reg = <0x16c00000 0x01800000>;
+ };
+
+ partition@18400000 {
+ label = "preset_cfg";
+ reg = <0x18400000 0x00100000>;
+ };
+
+ partition@18500000 {
+ label = "adsl";
+ reg = <0x18500000 0x00100000>;
+ };
+
+ partition@18600000 {
+ label = "storage";
+ reg = <0x18600000 0x07a00000>;
+ };
+};
+
+&rtc {
+ status = "disabled";
+};
+
+&pciec {
+ status = "okay";
+};
+
+&pcie0 {
+ status = "okay";
+};
+
+&sata_phy0 {
+ status = "disabled";
+};
+
+&sata_phy1 {
+ status = "disabled";
+};
+
+&usb0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ #trigger-source-cells = <0>;
+
+ hub_port1: port@1 {
+ reg = <1>;
+ #trigger-source-cells = <0>;
+ };
+
+ hub_port3: port@3 {
+ reg = <3>;
+ #trigger-source-cells = <0>;
+ };
+ };
+};
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -74,6 +74,9 @@ config TARGET_DB_88F6281_BP
config TARGET_NSA325
bool "Zyxel NSA325 board"
+config TARGET_L50
+ bool "Check Point L-50"
+
endchoice
config SYS_SOC
@@ -102,5 +105,6 @@ source "board/zyxel/nsa325/Kconfig"
source "board/alliedtelesis/SBx81LIFKW/Kconfig"
source "board/alliedtelesis/SBx81LIFXCAT/Kconfig"
source "board/Marvell/db-88f6281-bp/Kconfig"
+source "board/checkpoint/l-50/Kconfig"
endif
--- /dev/null
+++ b/board/checkpoint/l-50/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_L50
+
+config SYS_BOARD
+ default "l-50"
+
+config SYS_VENDOR
+ default "checkpoint"
+
+config SYS_CONFIG_NAME
+ default "l-50"
+
+endif
--- /dev/null
+++ b/board/checkpoint/l-50/MAINTAINERS
@@ -0,0 +1,6 @@
+L50 BOARD
+M: Pawel Dembicki <paweldembicki@gmail.com>
+S: Maintained
+F: board/checkpoint/l-50/
+F: include/configs/l-50.h
+F: configs/l-50_defconfig
--- /dev/null
+++ b/board/checkpoint/l-50/Makefile
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2020
+# Pawel Dembicki <paweldembicki@gmail.com>
+#
+# Based on Kirkwood support:
+# (C) Copyright 2009
+# Marvell Semiconductor <www.marvell.com>
+# Written-by: Prafulla Wadaskar <prafulla@marvell.com>
+
+obj-y := l-50.o
--- /dev/null
+++ b/board/checkpoint/l-50/kwbimage.cfg
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Values taken from original bootloader source.
+# Based on:
+# dramregs_seattle_400rd_A.txt from uboot_src_CP600_1100.
+
+# Boot Media configurations
+BOOT_FROM nand
+NAND_ECC_MODE default
+NAND_PAGE_SIZE 0x0800
+
+DATA 0xFFD100e0 0x1b1b1b9b
+DATA 0xFFD01400 0x43000c30
+DATA 0xFFD01404 0x39543000
+DATA 0xFFD01408 0x22125451
+DATA 0xFFD0140C 0x00000833
+DATA 0xFFD01410 0x000000cc
+DATA 0xFFD01414 0x00000000
+DATA 0xFFD01418 0x00000000
+DATA 0xFFD0141C 0x00000C52
+DATA 0xFFD01420 0x00000004
+DATA 0xFFD01424 0x0000F17F
+DATA 0xFFD01428 0x00085520
+DATA 0xFFD0147C 0x00008552
+DATA 0xFFD01504 0x0FFFFFF1
+DATA 0xFFD01508 0x10000000
+DATA 0xFFD0150C 0x0FFFFFF5
+DATA 0xFFD01514 0x00000000
+DATA 0xFFD0151C 0x00000000
+DATA 0xFFD01494 0x00120012
+DATA 0xFFD01498 0x00000000
+DATA 0xFFD0149C 0x0000E40F
+DATA 0xFFD01480 0x00000001
+DATA 0xFFD20134 0x66666666
+DATA 0xFFD20138 0x66666666
+DATA 0x0 0x0
--- /dev/null
+++ b/board/checkpoint/l-50/l-50.c
@@ -0,0 +1,172 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2020
+ * Pawel Dembicki <paweldembicki@gmail.com>
+ *
+ * Based on Kirkwood support:
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <i2c.h>
+#include <miiphy.h>
+#include <netdev.h>
+#include <asm/arch/cpu.h>
+#include <asm/arch/soc.h>
+#include <asm/arch/mpp.h>
+#include <asm/arch/gpio.h>
+#include "l-50.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_early_init_f(void)
+{
+ /* Gpio configuration */
+ mvebu_config_gpio(L50_OE_VAL_LOW, L50_OE_VAL_HIGH,
+ L50_OE_LOW, L50_OE_HIGH);
+
+ /* Multi-Purpose Pins Functionality configuration */
+ static const u32 kwmpp_config[] = {
+ MPP0_NF_IO2,
+ MPP1_NF_IO3,
+ MPP2_NF_IO4,
+ MPP3_NF_IO5,
+ MPP4_NF_IO6,
+ MPP5_NF_IO7,
+ MPP6_SYSRST_OUTn,
+ MPP7_SPI_SCn,
+ MPP8_TW_SDA,
+ MPP9_TW_SCK,
+ MPP10_UART0_TXD,
+ MPP11_UART0_RXD,
+ MPP12_SD_CLK,
+ MPP13_SD_CMD,
+ MPP14_SD_D0,
+ MPP15_SD_D1,
+ MPP16_SD_D2,
+ MPP17_SD_D3,
+ MPP18_NF_IO0,
+ MPP19_NF_IO1,
+ MPP20_GE1_0,
+ MPP21_GE1_1,
+ MPP22_GE1_2,
+ MPP23_GE1_3,
+ MPP24_GE1_4,
+ MPP25_GE1_5,
+ MPP26_GE1_6,
+ MPP27_GE1_7,
+ MPP28_GPIO,
+ MPP29_GPIO,
+ MPP30_GE1_10,
+ MPP31_GE1_11,
+ MPP32_GE1_12,
+ MPP33_GE1_13,
+ MPP34_GPIO,
+ MPP35_GPIO,
+ MPP36_AUDIO_SPDIFI, /* value from stock u-boot */
+ MPP37_GPIO,
+ MPP38_GPIO,
+ MPP39_TDM_SPI_CS0,
+ MPP40_GPIO,
+ MPP41_GPIO,
+ MPP42_TDM_SPI_MOSI,
+ MPP43_TDM_CODEC_INTn,
+ MPP44_GPIO,
+ MPP45_TDM_PCLK,
+ MPP46_GPIO,
+ MPP47_TDM_DRX,
+ MPP48_GPIO,
+ MPP49_GPIO,
+ 0
+ };
+ kirkwood_mpp_conf(kwmpp_config, NULL);
+
+ return 0;
+}
+
+void board_gpio_expander_init(void)
+{
+ struct udevice *dev0, *dev1;
+ uchar data_buffer;
+ int ret;
+
+ ret = i2c_get_chip_for_busnum(0, L50_GPIO0_I2C_ADDRESS, 1, &dev0);
+ if (ret) {
+ debug("%s: Cannot find I2C GPIO expander chip 0x02%X\n",
+ __func__, L50_GPIO0_I2C_ADDRESS);
+ return;
+ }
+
+ ret = i2c_get_chip_for_busnum(0, L50_GPIO1_I2C_ADDRESS, 1, &dev1);
+ if (ret) {
+ debug("%s: Cannot find I2C GPIO expander chip 0x02%X\n",
+ __func__, L50_GPIO1_I2C_ADDRESS);
+ return;
+ }
+
+ /* Set IO as output */
+ data_buffer = 0x0;
+ dm_i2c_write(dev0, 1, &data_buffer, 1);
+ dm_i2c_write(dev1, 1, &data_buffer, 1);
+
+ /* Set all leds off, reset asserted, pwr off */
+ data_buffer = 0xbf;
+ dm_i2c_write(dev0, 0, &data_buffer, 1);
+ data_buffer = 0x1c;
+ dm_i2c_write(dev1, 0, &data_buffer, 1);
+
+ mdelay(100);
+
+ /* Set pwr on */
+ data_buffer = 0xa5;
+ dm_i2c_write(dev1, 0, &data_buffer, 1);
+
+ mdelay(100);
+
+ /* Set reset deasserted, status red led enabled*/
+ data_buffer = 0xff;
+ dm_i2c_write(dev0, 0, &data_buffer, 1);
+ data_buffer = 0xe3;
+ dm_i2c_write(dev1, 0, &data_buffer, 1);
+}
+
+int board_init(void)
+{
+ /* Boot parameters address */
+ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
+
+ board_gpio_expander_init();
+
+ return 0;
+}
+
+#ifdef CONFIG_RESET_PHY_R
+/* Configure and initialize PHY */
+void reset_phy(void)
+{
+ u16 devadr;
+ char *name = "ethernet-controller@72000";
+
+ if (miiphy_set_current_dev(name))
+ return;
+
+ /* command to read PHY dev address */
+ if (miiphy_read(name, 0xEE, 0xEE, (u16 *)&devadr)) {
+ printf("Err..(%s) could not read PHY dev address\n", __func__);
+ return;
+ }
+
+ /*
+ * Fix PHY led configuration
+ */
+ miiphy_write(name, devadr, MV88E1116_PGADR_REG, 3);
+ miiphy_write(name, devadr, 0x10, 0x1177);
+ miiphy_write(name, devadr, 0x11, 0x4417);
+ miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0);
+
+ debug("88E1116 Initialized on %s\n", name);
+}
+#endif /* CONFIG_RESET_PHY_R */
--- /dev/null
+++ b/board/checkpoint/l-50/l-50.h
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2020
+ * Pawel Dembicki <paweldembicki@gmail.com>
+ *
+ * Based on Kirkwood support:
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
+ */
+
+#ifndef __L50_H
+#define __L50_H
+
+/* GPIO configuration */
+#define L50_OE_LOW 0x30000000
+#define L50_OE_HIGH 0x0000004c
+#define L50_OE_VAL_LOW 0x00000000
+#define L50_OE_VAL_HIGH 0x00000000
+
+/* Expander GPIO addresses */
+
+#define L50_GPIO0_I2C_ADDRESS 0x20
+#define L50_GPIO1_I2C_ADDRESS 0x21
+
+/* PHY register */
+#define MV88E1116_PGADR_REG 22
+
+#endif /* __L50_H */
--- /dev/null
+++ b/configs/l-50_defconfig
@@ -0,0 +1,59 @@
+CONFIG_ARM=y
+CONFIG_SYS_DCACHE_OFF=y
+CONFIG_ARCH_CPU_INIT=y
+CONFIG_KIRKWOOD=y
+CONFIG_SYS_TEXT_BASE=0x600000
+CONFIG_TARGET_L50=y
+CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0xC0000
+CONFIG_ENV_SECT_SIZE=0x20000
+CONFIG_ENV_ADDR=0xC0000
+CONFIG_IDENT_STRING="\nCheck Point L-50"
+CONFIG_NR_DRAM_BANKS=2
+# CONFIG_SYS_MALLOC_F is not set
+CONFIG_BOOTDELAY=1
+CONFIG_CONSOLE_MUX=y
+CONFIG_DISPLAY_BOARDINFO=y
+CONFIG_HUSH_PARSER=y
+# CONFIG_CMD_FLASH is not set
+#CONFIG_CMD_IDE=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_NAND=y
+CONFIG_CMD_USB=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_JFFS2=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_MTD=y
+CONFIG_MTD_RAW_NAND=y
+CONFIG_MTDIDS_DEFAULT="nand0=orion_nand"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xc0000@0x0(u-boot)ro,0x40000@0xc0000(bootldr-env),0x7900000@0x100000(ubi),0x800000@0x7a00000(kernel-2),0x7100000@0x8200000(rootfs-2),0x7900000@0xf300000(default_sw),0x1800000@0x16c00000(logs),0x100000@0x18400000(preset_cfg),0x100000@0x18500000(adsl),-@0x18600000(storage)"
+CONFIG_CMD_UBI=y
+CONFIG_ISO_PARTITION=y
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="kirkwood-l-50"
+CONFIG_ENV_IS_IN_NAND=y
+CONFIG_DM=y
+CONFIG_DM_ETH=y
+#CONFIG_MVSATA_IDE=y
+CONFIG_MMC=y
+CONFIG_MVGBE=y
+CONFIG_MII=y
+CONFIG_PHYLIB=y
+CONFIG_PHY_MARVELL=y
+CONFIG_MV88E61XX_SWITCH=y
+CONFIG_MV88E61XX_CPU_PORT=6
+CONFIG_MV88E61XX_PHY_PORTS=0x01f
+CONFIG_MV88E61XX_FIXED_PORTS=0
+#CONFIG_DM_RTC=y
+#CONFIG_RTC_MV=y
+CONFIG_SYS_NS16550=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_MVTWSI=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
--- /dev/null
+++ b/include/configs/l-50.h
@@ -0,0 +1,59 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2020
+ * Pawel Dembicki <paweldembicki@gmail.com>
+ *
+ * Based on Kirkwood support:
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
+ */
+
+#ifndef _CONFIG_L50_H
+#define _CONFIG_L50_H
+
+/*
+ * High Level Configuration Options (easy to change)
+ */
+#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */
+#define CONFIG_KW88F6281 /* SOC Name */
+#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */
+
+/*
+ * mv-common.h should be defined after CMD configs since it used them
+ * to enable certain macros
+ */
+#include "mv-common.h"
+
+/* Remove or override few declarations from mv-common.h */
+
+/*
+ * Ethernet Driver configuration
+ */
+#ifdef CONFIG_CMD_NET
+#define CONFIG_MVGBE_PORTS {1, 1} /* enable port 0 only */
+#define CONFIG_NETCONSOLE
+#endif
+
+#define CONFIG_MV88E61XX_CPU_PORT_RX_DELAY
+#define CONFIG_MV88E61XX_CPU_PORT_TX_DELAY
+
+/*
+ * Enable GPI0 support
+ */
+#define CONFIG_KIRKWOOD_GPIO
+
+/*
+ * Default environment variables
+ */
+#define CONFIG_BOOTCOMMAND \
+ "ubi part ubi; " \
+ "ubi read 0x800000 kernel; " \
+ "bootm 0x800000"
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "bootargs=console=ttyS0,115200\0" \
+ "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
+ "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
+ "bootargs_root=\0"
+#endif /* _CONFIG_L50_H */

View File

@ -0,0 +1,54 @@
--- a/configs/nsa310s_defconfig
+++ b/configs/nsa310s_defconfig
@@ -5,7 +5,7 @@ CONFIG_KIRKWOOD=y
CONFIG_SYS_TEXT_BASE=0x600000
CONFIG_TARGET_NSA310S=y
CONFIG_ENV_SIZE=0x20000
-CONFIG_ENV_OFFSET=0xE0000
+CONFIG_ENV_OFFSET=0xC0000
CONFIG_NR_DRAM_BANKS=2
CONFIG_BOOTDELAY=3
CONFIG_USE_PREBOOT=y
@@ -25,7 +25,7 @@ CONFIG_CMD_EXT2=y
CONFIG_CMD_FAT=y
CONFIG_CMD_JFFS2=y
CONFIG_CMD_MTDPARTS=y
-CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100000@0x100000(second_stage_uboot),-@0x200000(root)"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xc0000@0x0(uboot),0x80000@0xc0000(uboot_env),-@0x140000(ubi)"
CONFIG_CMD_UBI=y
CONFIG_ISO_PARTITION=y
CONFIG_ENV_IS_IN_NAND=y
--- a/include/configs/nsa310s.h
+++ b/include/configs/nsa310s.h
@@ -30,22 +30,17 @@
/* default environment variables */
#define CONFIG_BOOTCOMMAND \
- "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \
- "ubi part root; " \
- "ubifsmount ubi:rootfs; " \
- "ubifsload 0x800000 ${kernel}; " \
- "ubifsload 0x700000 ${fdt}; " \
- "ubifsumount; " \
- "fdt addr 0x700000; fdt resize; fdt chosen; " \
- "bootz 0x800000 - 0x700000"
+ "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \
+ "ubi part ubi; " \
+ "ubifsmount ubi:rootfs; " \
+ "ubi read 0x800000 kernel; " \
+ "bootm 0x800000"
#define CONFIG_EXTRA_ENV_SETTINGS \
- "console=console=ttyS0,115200\0" \
- "mtdids=nand0=orion_nand\0" \
- "mtdparts="CONFIG_MTDPARTS_DEFAULT \
- "kernel=/boot/zImage\0" \
- "fdt=/boot/nsa310s.dtb\0" \
- "bootargs_root=ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs rw\0"
+ "console=console=ttyS0,115200\0" \
+ "mtdids=nand0=orion_nand\0" \
+ "mtdparts="CONFIG_MTDPARTS_DEFAULT "\0" \
+ "bootargs_root=\0"
/* Ethernet driver configuration */
#ifdef CONFIG_CMD_NET

View File

@ -1,8 +1,8 @@
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -103,4 +103,7 @@ source "board/alliedtelesis/SBx81LIFKW/K
source "board/alliedtelesis/SBx81LIFXCAT/Kconfig"
@@ -107,4 +107,7 @@ source "board/alliedtelesis/SBx81LIFXCAT
source "board/Marvell/db-88f6281-bp/Kconfig"
source "board/checkpoint/l-50/Kconfig"
+config SECOND_STAGE
+ bool "OpenWrt second stage hack"
@ -35,6 +35,17 @@
+#include "openwrt-kirkwood-common.h"
+
#endif /* _CONFIG_ICONNECT_H */
--- a/include/configs/l-50.h
+++ b/include/configs/l-50.h
@@ -12,6 +12,8 @@
#ifndef _CONFIG_L50_H
#define _CONFIG_L50_H
+#include "openwrt-kirkwood-common.h"
+
/*
* High Level Configuration Options (easy to change)
*/
--- /dev/null
+++ b/include/configs/openwrt-kirkwood-common.h
@@ -0,0 +1,31 @@
@ -139,6 +150,17 @@
+CONFIG_FIT_VERBOSE=y
CONFIG_LZMA=y
+CONFIG_LZO=y
--- a/configs/l-50_defconfig
+++ b/configs/l-50_defconfig
@@ -57,3 +57,8 @@ CONFIG_SYS_I2C_MVTWSI=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_STORAGE=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_LZMA=y
+CONFIG_LZO=y
--- a/configs/nsa310_defconfig
+++ b/configs/nsa310_defconfig
@@ -43,6 +43,9 @@ CONFIG_CMD_UBI=y
@ -162,3 +184,23 @@
+CONFIG_FIT_VERBOSE=y
+CONFIG_LZMA=y
+CONFIG_LZO=y
--- a/configs/nsa310s_defconfig
+++ b/configs/nsa310s_defconfig
@@ -40,5 +40,8 @@ CONFIG_SYS_NS16550=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_STORAGE=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
CONFIG_LZMA=y
+CONFIG_LZO=y
CONFIG_OF_LIBFDT=y
--- a/include/configs/nsa310s.h
+++ b/include/configs/nsa310s.h
@@ -63,4 +63,6 @@
#define CONFIG_RTC_MV
#endif /* CONFIG_CMD_DATE */
+#include "openwrt-kirkwood-common.h"
+
#endif /* _CONFIG_NSA310S_H */

View File

@ -0,0 +1,53 @@
From 940e9a5828480e4185c9a276ad7f35a4069a2393 Mon Sep 17 00:00:00 2001
From: Pawel Dembicki <paweldembicki@gmail.com>
Date: Thu, 23 Jan 2020 22:04:15 +0100
Subject: [PATCH 1/2] phy: mv88e61xx: add support for RGMII TX/RX delay
Clock delay in RGMII is required for some boards.
This patch introduce CONFIG_MV88E61XX_CPU_PORT_TX_DELAY and
CONFIG_MV88E61XX_CPU_PORT_RX_DELAY defines, which are setting
proper bits in PORT_REG_PHYS_CTRL register.
Cc: Chris Packham <judge.packham@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
---
drivers/net/phy/mv88e61xx.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c
index 5aff7ed397..889327639d 100644
--- a/drivers/net/phy/mv88e61xx.c
+++ b/drivers/net/phy/mv88e61xx.c
@@ -94,6 +94,8 @@
#define PORT_REG_STATUS_CMODE_1000BASE_X 0x9
#define PORT_REG_STATUS_CMODE_SGMII 0xa
+#define PORT_REG_PHYS_CTRL_RGMII_RX_DELAY BIT(15)
+#define PORT_REG_PHYS_CTRL_RGMII_TX_DELAY BIT(14)
#define PORT_REG_PHYS_CTRL_PCS_AN_EN BIT(10)
#define PORT_REG_PHYS_CTRL_PCS_AN_RST BIT(9)
#define PORT_REG_PHYS_CTRL_FC_VALUE BIT(7)
@@ -747,9 +749,16 @@ static int mv88e61xx_fixed_port_setup(struct phy_device *phydev, u8 port)
PORT_REG_PHYS_CTRL_SPD1000;
}
- if (port == CONFIG_MV88E61XX_CPU_PORT)
+ if (port == CONFIG_MV88E61XX_CPU_PORT) {
val |= PORT_REG_PHYS_CTRL_LINK_VALUE |
PORT_REG_PHYS_CTRL_LINK_FORCE;
+#if defined(CONFIG_MV88E61XX_CPU_PORT_RX_DELAY)
+ val |= PORT_REG_PHYS_CTRL_RGMII_RX_DELAY;
+#endif
+#if defined(CONFIG_MV88E61XX_CPU_PORT_TX_DELAY)
+ val |= PORT_REG_PHYS_CTRL_RGMII_TX_DELAY;
+#endif
+ }
return mv88e61xx_port_write(phydev, port, PORT_REG_PHYS_CTRL,
val);
--
2.20.1

View File

@ -0,0 +1,67 @@
From 7ffab66a99831ce5e3037b608d73565c9d1abd20 Mon Sep 17 00:00:00 2001
From: Pawel Dembicki <paweldembicki@gmail.com>
Date: Thu, 23 Jan 2020 22:09:51 +0100
Subject: [PATCH 2/2] phy: mv88e61xx: add support for MV88E6171
This patch add MV88E6171 id to driver data.
Tested on Checkpoint L-50 board.
Cc: Chris Packham <judge.packham@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
---
drivers/net/phy/mv88e61xx.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c
index 889327639d..e0b648a54e 100644
--- a/drivers/net/phy/mv88e61xx.c
+++ b/drivers/net/phy/mv88e61xx.c
@@ -180,6 +180,7 @@
#define PORT_SWITCH_ID_6071 0x0710
#define PORT_SWITCH_ID_6096 0x0980
#define PORT_SWITCH_ID_6097 0x0990
+#define PORT_SWITCH_ID_6171 0x1710
#define PORT_SWITCH_ID_6172 0x1720
#define PORT_SWITCH_ID_6176 0x1760
#define PORT_SWITCH_ID_6220 0x2200
@@ -997,6 +998,7 @@ static int mv88e61xx_probe(struct phy_device *phydev)
switch (priv->id) {
case PORT_SWITCH_ID_6096:
case PORT_SWITCH_ID_6097:
+ case PORT_SWITCH_ID_6171:
case PORT_SWITCH_ID_6172:
case PORT_SWITCH_ID_6176:
case PORT_SWITCH_ID_6240:
@@ -1152,6 +1154,17 @@ static struct phy_driver mv88e61xx_driver = {
.shutdown = &genphy_shutdown,
};
+static struct phy_driver mv88e617x_driver = {
+ .name = "Marvell MV88E617x",
+ .uid = 0x01410e70,
+ .mask = 0xfffffff0,
+ .features = PHY_GBIT_FEATURES,
+ .probe = mv88e61xx_probe,
+ .config = mv88e61xx_phy_config,
+ .startup = mv88e61xx_phy_startup,
+ .shutdown = &genphy_shutdown,
+};
+
static struct phy_driver mv88e609x_driver = {
.name = "Marvell MV88E609x",
.uid = 0x1410c89,
@@ -1177,6 +1190,7 @@ static struct phy_driver mv88e6071_driver = {
int phy_mv88e61xx_init(void)
{
phy_register(&mv88e61xx_driver);
+ phy_register(&mv88e617x_driver);
phy_register(&mv88e609x_driver);
phy_register(&mv88e6071_driver);
--
2.20.1

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=uboot-layerscape
PKG_VERSION:=LSDK-20.04
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/u-boot
@ -27,67 +27,67 @@ define U-Boot/Default
ENV_SIZE:=0x2000
endef
define U-Boot/ls1012afrdm
define U-Boot/fsl_ls1012a-frdm
NAME:=NXP LS1012AFRDM
UBOOT_CONFIG:=ls1012afrdm_tfa
ENV_SIZE:=0x40000
endef
define U-Boot/ls1012ardb
define U-Boot/fsl_ls1012a-rdb
NAME:=NXP LS1012ARDB
UBOOT_CONFIG:=ls1012ardb_tfa
ENV_SIZE:=0x40000
endef
define U-Boot/ls1012afrwy
define U-Boot/fsl_ls1012a-frwy-sdboot
NAME:=NXP LS1012AFRWY
UBOOT_CONFIG:=ls1012afrwy_tfa
ENV_SIZE:=0x10000
endef
define U-Boot/ls1043ardb
define U-Boot/fsl_ls1043a-rdb
NAME:=NXP LS1043ARDB
UBOOT_CONFIG:=ls1043ardb_tfa
endef
define U-Boot/ls1043ardb-sdboot
define U-Boot/fsl_ls1043a-rdb-sdboot
NAME:=NXP LS1043ARDB SD Card Boot
UBOOT_CONFIG:=ls1043ardb_tfa
endef
define U-Boot/ls1046ardb
define U-Boot/fsl_ls1046a-rdb
NAME:=NXP LS1046ARDB
UBOOT_CONFIG:=ls1046ardb_tfa
endef
define U-Boot/ls1046ardb-sdboot
define U-Boot/fsl_ls1046a-rdb-sdboot
NAME:=NXP LS1046ARDB SD Card Boot
UBOOT_CONFIG:=ls1046ardb_tfa
endef
define U-Boot/ls1088ardb
define U-Boot/fsl_ls1088a-rdb
NAME:=NXP LS1088ARDB
UBOOT_CONFIG:=ls1088ardb_tfa
endef
define U-Boot/ls1088ardb-sdboot
define U-Boot/fsl_ls1088a-rdb-sdboot
NAME:=NXP LS1088ARDB SD Card Boot
UBOOT_CONFIG:=ls1088ardb_tfa
endef
define U-Boot/ls2088ardb
define U-Boot/fsl_ls2088a-rdb
NAME:=NXP LS2088ARDB
UBOOT_CONFIG:=ls2088ardb_tfa
endef
define U-Boot/ls1021atwr
define U-Boot/fsl_ls1021a-twr
NAME:=NXP LS1021ATWR
BUILD_SUBTARGET:=armv7
UBOOT_CONFIG:=ls1021atwr_nor
ENV_SIZE:=0x20000
endef
define U-Boot/ls1021atwr-sdboot
define U-Boot/fsl_ls1021a-twr-sdboot
NAME:=NXP LS1021ATWR SD Card Boot
BUILD_SUBTARGET:=armv7
UBOOT_CONFIG:=ls1021atwr_sdcard_ifc
@ -95,7 +95,7 @@ define U-Boot/ls1021atwr-sdboot
ENV_SIZE:=0x20000
endef
define U-Boot/ls1021aiot-sdboot
define U-Boot/fsl_ls1021a-iot-sdboot
NAME:=NXP LS1021AIOT SD Card Boot
BUILD_SUBTARGET:=armv7
UBOOT_CONFIG:=ls1021aiot_sdcard
@ -104,19 +104,19 @@ define U-Boot/ls1021aiot-sdboot
endef
UBOOT_TARGETS := \
ls1012afrdm \
ls1012ardb \
ls1012afrwy \
ls1043ardb \
ls1043ardb-sdboot \
ls1046ardb \
ls1046ardb-sdboot \
ls1088ardb \
ls1088ardb-sdboot \
ls2088ardb \
ls1021atwr \
ls1021atwr-sdboot \
ls1021aiot-sdboot
fsl_ls1012a-frdm \
fsl_ls1012a-rdb \
fsl_ls1012a-frwy-sdboot \
fsl_ls1043a-rdb \
fsl_ls1043a-rdb-sdboot \
fsl_ls1046a-rdb \
fsl_ls1046a-rdb-sdboot \
fsl_ls1088a-rdb \
fsl_ls1088a-rdb-sdboot \
fsl_ls2088a-rdb \
fsl_ls1021a-twr \
fsl_ls1021a-twr-sdboot \
fsl_ls1021a-iot-sdboot
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)

View File

@ -3,6 +3,6 @@ loadaddr=0x81000000
fdt_high=0xffffffffffffffff
initrd_high=0xffffffffffffffff
qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr
bootargs=ubi.mtd=8 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(ubifs)
bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware)
bootcmd=echo starting openwrt ...;pfe stop;run qspi_boot
bootdelay=3

View File

@ -3,6 +3,6 @@ loadaddr=0x81000000
fdt_high=0xffffffff
initrd_high=0xffffffff
nor_boot=cp.b 60f00000 $fdtaddr 100000;cp.b 61000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr
bootargs=root=/dev/mtdblock6 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(rcw),2m(u-boot),1m(u-boot-env),11m(reserved-1),1m(dtb),16m(kernel),32m(rootfs) cma=64M@0x0-0xb0000000
bootargs=root=/dev/mtdblock6 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(rcw),2m(u-boot),1m(u-boot-env),11m(reserved-1),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) cma=64M@0x0-0xb0000000
bootcmd=echo starting openwrt ...;run nor_boot
bootdelay=3

View File

@ -4,6 +4,6 @@ fdt_high=0xffffffffffffffff
initrd_high=0xffffffffffffffff
hwconfig=fsl_ddr:bank_intlv=auto
nor_boot=cp.b 60f00000 $fdtaddr 100000;cp.b 61000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr
bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs)
bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware)
bootcmd=echo starting openwrt ...;run nor_boot
bootdelay=3

View File

@ -4,6 +4,6 @@ fdt_high=0xffffffffffffffff
initrd_high=0xffffffffffffffff
hwconfig=fsl_ddr:bank_intlv=auto
qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr
bootargs=ubi.mtd=9 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(ubifs)
bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware)
bootcmd=echo starting openwrt ...;run qspi_boot
bootdelay=3

View File

@ -5,6 +5,6 @@ initrd_high=0xffffffffffffffff
hwconfig=fsl_ddr:bank_intlv=auto
mc_init=sf probe 0:0;sf read 80000000 a00000 300000;sf read 80300000 e00000 100000;fsl_mc start mc 80000000 80300000;sf read 80400000 d00000 100000;fsl_mc apply dpl 80400000
qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr
bootargs=ubi.mtd=10 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=20c0000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(ubifs)
bootargs=root=/dev/mtdblock10 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=20c0000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware)
bootcmd=echo starting openwrt ...;run mc_init;run qspi_boot
bootdelay=3

View File

@ -5,6 +5,6 @@ initrd_high=0xffffffffffffffff
hwconfig=fsl_ddr:bank_intlv=auto
mc_init=fsl_mc start mc 580a00000 580e00000;fsl_mc apply dpl 580d00000
nor_boot=cp.b 580f00000 $fdtaddr 100000;cp.b 581000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr
bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 mtdparts=580000000.nor:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs)
bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 mtdparts=580000000.nor:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware)
bootcmd=echo starting openwrt ...;run mc_init;run nor_boot
bootdelay=3

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_VERSION:=2020.04
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_HASH:=fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372
include $(INCLUDE_DIR)/u-boot.mk
@ -15,19 +15,32 @@ define U-Boot/Default
DEFAULT:=y
endef
define U-Boot/mt7629
NAME:=MT7629
BUILD_SUBTARGET:=mt7629
UBOOT_CONFIG:=mt7629_rfb
endef
define U-Boot/mt7622
NAME:=MT7622
BUILD_SUBTARGET:=mt7622
UBOOT_CONFIG:=mt7622_rfb
endef
UBOOT_TARGETS := mt7629 mt7622
define U-Boot/mt7623a_unielec_u7623
NAME:=UniElec U7623 (mt7623)
BUILD_SUBTARGET:=mt7623
UBOOT_CONFIG:=mt7623a_unielec_u7623_02
endef
define U-Boot/mt7623n_bpir2
NAME:=Banana Pi R2 (mt7623)
BUILD_SUBTARGET:=mt7623
UBOOT_IMAGE:=u-boot.bin
UBOOT_CONFIG:=mt7623n_bpir2
endef
define U-Boot/mt7629
NAME:=MT7629
BUILD_SUBTARGET:=mt7629
UBOOT_CONFIG:=mt7629_rfb
endef
UBOOT_TARGETS := mt7629 mt7622 mt7623n_bpir2 mt7623a_unielec_u7623
UBOOT_MAKE_FLAGS += $(UBOOT_IMAGE)

View File

@ -0,0 +1,18 @@
diff --git a/configs/mt7623n_bpir2_defconfig b/configs/mt7623n_bpir2_defconfig
index 6b9fbd7e22..fb2a004803 100644
--- a/configs/mt7623n_bpir2_defconfig
+++ b/configs/mt7623n_bpir2_defconfig
@@ -52,3 +52,13 @@ CONFIG_TIMER=y
CONFIG_WDT_MTK=y
CONFIG_LZMA=y
# CONFIG_EFI_LOADER is not set
+CONFIG_CMD_BOOTZ=y
+CONFIG_OF_LIBFDT_OVERLAY=y
+#enables savenenv-command
+CONFIG_ENV_IS_IN_FAT=y
+CONFIG_ENV_FAT_INTERFACE="mmc"
+CONFIG_ENV_FAT_DEVICE_AND_PART=":2"
+CONFIG_ENV_FAT_FILE="uboot.env"
+CONFIG_CMD_ASKENV=y
+CONFIG_ENV_SIZE=0x2000
+CONFIG_CMD_SETEXPR=y

View File

@ -0,0 +1,237 @@
From e05fdd93645dab2217bb5bfabcc04845415cf7ed Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw2@infradead.org>
Date: Fri, 19 Jun 2020 12:40:20 +0100
Subject: [PATCH] pinctrl: mediatek: add PUPD/R0/R1 support for MT7623
The pins for the MMC controller weren't being set up correctly because the
pinctrl driver only sets the GPIO pullup/pulldown config and doesn't
handle the special cases with PUPD/R0/R1 control.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Tested-by: Frank Wunderlich <frank-w@public-files.de>
---
drivers/pinctrl/mediatek/pinctrl-mt7623.c | 129 ++++++++++++++++++
drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 19 ++-
drivers/pinctrl/mediatek/pinctrl-mtk-common.h | 3 +
3 files changed, 146 insertions(+), 5 deletions(-)
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7623.c b/drivers/pinctrl/mediatek/pinctrl-mt7623.c
index d58d840e08..0f5dcb2c63 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mt7623.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt7623.c
@@ -262,6 +262,132 @@ static const struct mtk_pin_field_calc mt7623_pin_drv_range[] = {
PIN_FIELD16(278, 278, 0xf70, 0x10, 8, 4),
};
+static const struct mtk_pin_field_calc mt7623_pin_pupd_range[] = {
+ /* MSDC0 */
+ PIN_FIELD16(111, 111, 0xd00, 0x10, 12, 1),
+ PIN_FIELD16(112, 112, 0xd00, 0x10, 8, 1),
+ PIN_FIELD16(113, 113, 0xd00, 0x10, 4, 1),
+ PIN_FIELD16(114, 114, 0xd00, 0x10, 0, 1),
+ PIN_FIELD16(115, 115, 0xd10, 0x10, 0, 1),
+ PIN_FIELD16(116, 116, 0xcd0, 0x10, 8, 1),
+ PIN_FIELD16(117, 117, 0xcc0, 0x10, 8, 1),
+ PIN_FIELD16(118, 118, 0xcf0, 0x10, 12, 1),
+ PIN_FIELD16(119, 119, 0xcf0, 0x10, 8, 1),
+ PIN_FIELD16(120, 120, 0xcf0, 0x10, 4, 1),
+ PIN_FIELD16(121, 121, 0xcf0, 0x10, 0, 1),
+ /* MSDC1 */
+ PIN_FIELD16(105, 105, 0xd40, 0x10, 8, 1),
+ PIN_FIELD16(106, 106, 0xd30, 0x10, 8, 1),
+ PIN_FIELD16(107, 107, 0xd60, 0x10, 0, 1),
+ PIN_FIELD16(108, 108, 0xd60, 0x10, 10, 1),
+ PIN_FIELD16(109, 109, 0xd60, 0x10, 4, 1),
+ PIN_FIELD16(110, 110, 0xc60, 0x10, 12, 1),
+ /* MSDC1 */
+ PIN_FIELD16(85, 85, 0xda0, 0x10, 8, 1),
+ PIN_FIELD16(86, 86, 0xd90, 0x10, 8, 1),
+ PIN_FIELD16(87, 87, 0xdc0, 0x10, 0, 1),
+ PIN_FIELD16(88, 88, 0xdc0, 0x10, 10, 1),
+ PIN_FIELD16(89, 89, 0xdc0, 0x10, 4, 1),
+ PIN_FIELD16(90, 90, 0xdc0, 0x10, 12, 1),
+ /* MSDC0E */
+ PIN_FIELD16(249, 249, 0x140, 0x10, 0, 1),
+ PIN_FIELD16(250, 250, 0x130, 0x10, 12, 1),
+ PIN_FIELD16(251, 251, 0x130, 0x10, 8, 1),
+ PIN_FIELD16(252, 252, 0x130, 0x10, 4, 1),
+ PIN_FIELD16(253, 253, 0x130, 0x10, 0, 1),
+ PIN_FIELD16(254, 254, 0xf40, 0x10, 12, 1),
+ PIN_FIELD16(255, 255, 0xf40, 0x10, 8, 1),
+ PIN_FIELD16(256, 256, 0xf40, 0x10, 4, 1),
+ PIN_FIELD16(257, 257, 0xf40, 0x10, 0, 1),
+ PIN_FIELD16(258, 258, 0xcb0, 0x10, 8, 1),
+ PIN_FIELD16(259, 259, 0xc90, 0x10, 8, 1),
+ PIN_FIELD16(261, 261, 0x140, 0x10, 8, 1),
+};
+
+static const struct mtk_pin_field_calc mt7623_pin_r1_range[] = {
+ /* MSDC0 */
+ PIN_FIELD16(111, 111, 0xd00, 0x10, 13, 1),
+ PIN_FIELD16(112, 112, 0xd00, 0x10, 9, 1),
+ PIN_FIELD16(113, 113, 0xd00, 0x10, 5, 1),
+ PIN_FIELD16(114, 114, 0xd00, 0x10, 1, 1),
+ PIN_FIELD16(115, 115, 0xd10, 0x10, 1, 1),
+ PIN_FIELD16(116, 116, 0xcd0, 0x10, 9, 1),
+ PIN_FIELD16(117, 117, 0xcc0, 0x10, 9, 1),
+ PIN_FIELD16(118, 118, 0xcf0, 0x10, 13, 1),
+ PIN_FIELD16(119, 119, 0xcf0, 0x10, 9, 1),
+ PIN_FIELD16(120, 120, 0xcf0, 0x10, 5, 1),
+ PIN_FIELD16(121, 121, 0xcf0, 0x10, 1, 1),
+ /* MSDC1 */
+ PIN_FIELD16(105, 105, 0xd40, 0x10, 9, 1),
+ PIN_FIELD16(106, 106, 0xd30, 0x10, 9, 1),
+ PIN_FIELD16(107, 107, 0xd60, 0x10, 1, 1),
+ PIN_FIELD16(108, 108, 0xd60, 0x10, 9, 1),
+ PIN_FIELD16(109, 109, 0xd60, 0x10, 5, 1),
+ PIN_FIELD16(110, 110, 0xc60, 0x10, 13, 1),
+ /* MSDC2 */
+ PIN_FIELD16(85, 85, 0xda0, 0x10, 9, 1),
+ PIN_FIELD16(86, 86, 0xd90, 0x10, 9, 1),
+ PIN_FIELD16(87, 87, 0xdc0, 0x10, 1, 1),
+ PIN_FIELD16(88, 88, 0xdc0, 0x10, 9, 1),
+ PIN_FIELD16(89, 89, 0xdc0, 0x10, 5, 1),
+ PIN_FIELD16(90, 90, 0xdc0, 0x10, 13, 1),
+ /* MSDC0E */
+ PIN_FIELD16(249, 249, 0x140, 0x10, 1, 1),
+ PIN_FIELD16(250, 250, 0x130, 0x10, 13, 1),
+ PIN_FIELD16(251, 251, 0x130, 0x10, 9, 1),
+ PIN_FIELD16(252, 252, 0x130, 0x10, 5, 1),
+ PIN_FIELD16(253, 253, 0x130, 0x10, 1, 1),
+ PIN_FIELD16(254, 254, 0xf40, 0x10, 13, 1),
+ PIN_FIELD16(255, 255, 0xf40, 0x10, 9, 1),
+ PIN_FIELD16(256, 256, 0xf40, 0x10, 5, 1),
+ PIN_FIELD16(257, 257, 0xf40, 0x10, 1, 1),
+ PIN_FIELD16(258, 258, 0xcb0, 0x10, 9, 1),
+ PIN_FIELD16(259, 259, 0xc90, 0x10, 9, 1),
+ PIN_FIELD16(261, 261, 0x140, 0x10, 9, 1),
+};
+
+static const struct mtk_pin_field_calc mt7623_pin_r0_range[] = {
+ /* MSDC0 */
+ PIN_FIELD16(111, 111, 0xd00, 0x10, 14, 1),
+ PIN_FIELD16(112, 112, 0xd00, 0x10, 10, 1),
+ PIN_FIELD16(113, 113, 0xd00, 0x10, 6, 1),
+ PIN_FIELD16(114, 114, 0xd00, 0x10, 2, 1),
+ PIN_FIELD16(115, 115, 0xd10, 0x10, 2, 1),
+ PIN_FIELD16(116, 116, 0xcd0, 0x10, 10, 1),
+ PIN_FIELD16(117, 117, 0xcc0, 0x10, 10, 1),
+ PIN_FIELD16(118, 118, 0xcf0, 0x10, 14, 1),
+ PIN_FIELD16(119, 119, 0xcf0, 0x10, 10, 1),
+ PIN_FIELD16(120, 120, 0xcf0, 0x10, 6, 1),
+ PIN_FIELD16(121, 121, 0xcf0, 0x10, 2, 1),
+ /* MSDC1 */
+ PIN_FIELD16(105, 105, 0xd40, 0x10, 10, 1),
+ PIN_FIELD16(106, 106, 0xd30, 0x10, 10, 1),
+ PIN_FIELD16(107, 107, 0xd60, 0x10, 2, 1),
+ PIN_FIELD16(108, 108, 0xd60, 0x10, 8, 1),
+ PIN_FIELD16(109, 109, 0xd60, 0x10, 6, 1),
+ PIN_FIELD16(110, 110, 0xc60, 0x10, 14, 1),
+ /* MSDC2 */
+ PIN_FIELD16(85, 85, 0xda0, 0x10, 10, 1),
+ PIN_FIELD16(86, 86, 0xd90, 0x10, 10, 1),
+ PIN_FIELD16(87, 87, 0xdc0, 0x10, 2, 1),
+ PIN_FIELD16(88, 88, 0xdc0, 0x10, 8, 1),
+ PIN_FIELD16(89, 89, 0xdc0, 0x10, 6, 1),
+ PIN_FIELD16(90, 90, 0xdc0, 0x10, 14, 1),
+ /* MSDC0E */
+ PIN_FIELD16(249, 249, 0x140, 0x10, 2, 1),
+ PIN_FIELD16(250, 250, 0x130, 0x10, 14, 1),
+ PIN_FIELD16(251, 251, 0x130, 0x10, 10, 1),
+ PIN_FIELD16(252, 252, 0x130, 0x10, 6, 1),
+ PIN_FIELD16(253, 253, 0x130, 0x10, 2, 1),
+ PIN_FIELD16(254, 254, 0xf40, 0x10, 14, 1),
+ PIN_FIELD16(255, 255, 0xf40, 0x10, 10, 1),
+ PIN_FIELD16(256, 256, 0xf40, 0x10, 6, 1),
+ PIN_FIELD16(257, 257, 0xf40, 0x10, 5, 1),
+ PIN_FIELD16(258, 258, 0xcb0, 0x10, 10, 1),
+ PIN_FIELD16(259, 259, 0xc90, 0x10, 10, 1),
+ PIN_FIELD16(261, 261, 0x140, 0x10, 10, 1),
+};
+
static const struct mtk_pin_reg_calc mt7623_reg_cals[] = {
[PINCTRL_PIN_REG_MODE] = MTK_RANGE(mt7623_pin_mode_range),
[PINCTRL_PIN_REG_DIR] = MTK_RANGE(mt7623_pin_dir_range),
@@ -272,6 +398,9 @@ static const struct mtk_pin_reg_calc mt7623_reg_cals[] = {
[PINCTRL_PIN_REG_PULLSEL] = MTK_RANGE(mt7623_pin_pullsel_range),
[PINCTRL_PIN_REG_PULLEN] = MTK_RANGE(mt7623_pin_pullen_range),
[PINCTRL_PIN_REG_DRV] = MTK_RANGE(mt7623_pin_drv_range),
+ [PINCTRL_PIN_REG_PUPD] = MTK_RANGE(mt7623_pin_pupd_range),
+ [PINCTRL_PIN_REG_R0] = MTK_RANGE(mt7623_pin_r0_range),
+ [PINCTRL_PIN_REG_R1] = MTK_RANGE(mt7623_pin_r1_range),
};
static const struct mtk_pin_desc mt7623_pins[] = {
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index e8187a3780..6553dde45c 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -296,7 +296,7 @@ static const struct pinconf_param mtk_conf_params[] = {
};
-int mtk_pinconf_bias_set_v0(struct udevice *dev, u32 pin, u32 arg)
+int mtk_pinconf_bias_set_v0(struct udevice *dev, u32 pin, u32 arg, u32 val)
{
int err, disable, pullup;
@@ -323,12 +323,14 @@ int mtk_pinconf_bias_set_v0(struct udevice *dev, u32 pin, u32 arg)
return 0;
}
-int mtk_pinconf_bias_set_v1(struct udevice *dev, u32 pin, u32 arg)
+int mtk_pinconf_bias_set_v1(struct udevice *dev, u32 pin, u32 arg, u32 val)
{
- int err, disable, pullup;
+ int err, disable, pullup, r0, r1;
disable = (arg == PIN_CONFIG_BIAS_DISABLE);
pullup = (arg == PIN_CONFIG_BIAS_PULL_UP);
+ r0 = !!(val & 1);
+ r1 = !!(val & 2);
if (disable) {
err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PULLEN, 0);
@@ -344,6 +346,13 @@ int mtk_pinconf_bias_set_v1(struct udevice *dev, u32 pin, u32 arg)
return err;
}
+ /* Also set PUPD/R0/R1 if the pin has them */
+ err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PUPD, !pullup);
+ if (err != -EINVAL) {
+ mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_R0, r0);
+ mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_R1, r1);
+ }
+
return 0;
}
@@ -419,9 +428,9 @@ static int mtk_pinconf_set(struct udevice *dev, unsigned int pin,
case PIN_CONFIG_BIAS_PULL_UP:
case PIN_CONFIG_BIAS_PULL_DOWN:
if (rev == MTK_PINCTRL_V0)
- err = mtk_pinconf_bias_set_v0(dev, pin, param);
+ err = mtk_pinconf_bias_set_v0(dev, pin, param, arg);
else
- err = mtk_pinconf_bias_set_v1(dev, pin, param);
+ err = mtk_pinconf_bias_set_v1(dev, pin, param, arg);
if (err)
goto err;
break;
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.h b/drivers/pinctrl/mediatek/pinctrl-mtk-common.h
index e815761450..5e51a9a90c 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.h
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.h
@@ -51,6 +51,9 @@ enum {
PINCTRL_PIN_REG_PULLEN,
PINCTRL_PIN_REG_PULLSEL,
PINCTRL_PIN_REG_DRV,
+ PINCTRL_PIN_REG_PUPD,
+ PINCTRL_PIN_REG_R0,
+ PINCTRL_PIN_REG_R1,
PINCTRL_PIN_REG_MAX,
};
--
2.26.2

View File

@ -0,0 +1,97 @@
From 6731bef6966ea2b26cdcfe0109ff5a950003fd03 Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw2@infradead.org>
Date: Fri, 19 Jun 2020 23:07:17 +0100
Subject: [PATCH] env/fat.c: allow loading from a FAT partition on the MMC boot
device
I don't want to have to specify the device; only the partition.
This allows me to use the same image on internal eMMC or SD card for
Banana Pi R2, and it finds its own environment either way.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
[trini: Add #if/#else/#endif logic around CONFIG_SYS_MMC_ENV_DEV usage,
whitespace changes]
Signed-off-by: Tom Rini <trini@konsulko.com>
---
env/Kconfig | 4 ++++
env/fat.c | 32 ++++++++++++++++++++++++++++++--
2 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/env/Kconfig b/env/Kconfig
index 38e7fadbb9..5784136674 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -434,6 +434,10 @@ config ENV_FAT_DEVICE_AND_PART
If none, first valid partition in device D. If no
partition table then means device D.
+ If ENV_FAT_INTERFACE is set to "mmc" then device 'D' can be omitted,
+ leaving the string starting with a colon, and the boot device will
+ be used.
+
config ENV_FAT_FILE
string "Name of the FAT file to use for the environment"
depends on ENV_IS_IN_FAT
diff --git a/env/fat.c b/env/fat.c
index 35a1955e63..63aced9317 100644
--- a/env/fat.c
+++ b/env/fat.c
@@ -29,6 +29,36 @@
# endif
#endif
+#if defined(CMD_SAVEENV) || defined(CMD_LOADENV)
+__weak int mmc_get_env_dev(void)
+{
+#ifdef CONFIG_SYS_MMC_ENV_DEV
+ return CONFIG_SYS_MMC_ENV_DEV;
+#else
+ return 0;
+#endif
+}
+
+static char *env_fat_device_and_part(void)
+{
+#ifdef CONFIG_MMC
+ static char *part_str;
+
+ if (!part_str) {
+ part_str = CONFIG_ENV_FAT_DEVICE_AND_PART;
+ if (!strcmp(CONFIG_ENV_FAT_INTERFACE, "mmc") && part_str[0] == ':') {
+ part_str = "0" CONFIG_ENV_FAT_DEVICE_AND_PART;
+ part_str[0] += mmc_get_env_dev();
+ }
+ }
+
+ return part_str;
+#else
+ return CONFIG_ENV_FAT_DEVICE_AND_PART;
+#endif
+}
+#endif
+
#ifdef CMD_SAVEENV
static int env_fat_save(void)
{
@@ -43,7 +71,7 @@ static int env_fat_save(void)
return err;
part = blk_get_device_part_str(CONFIG_ENV_FAT_INTERFACE,
- CONFIG_ENV_FAT_DEVICE_AND_PART,
+ env_fat_device_and_part(),
&dev_desc, &info, 1);
if (part < 0)
return 1;
@@ -89,7 +117,7 @@ static int env_fat_load(void)
#endif
part = blk_get_device_part_str(CONFIG_ENV_FAT_INTERFACE,
- CONFIG_ENV_FAT_DEVICE_AND_PART,
+ env_fat_device_and_part(),
&dev_desc, &info, 1);
if (part < 0)
goto err_env_relocate;
--
2.26.2

View File

@ -0,0 +1,51 @@
From e3cc511eef5d99491e0c51324be499b688dde8de Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw2@infradead.org>
Date: Sun, 12 Jul 2020 23:33:01 +0100
Subject: [PATCH 1/3] board: mediatek: fix mmc_get_boot_dev() for platforms
without external SD
On the UniElec U7623 board there is no external SD slot and the preloader
doesn't fill in the magic field at 0x81dffff0 to indicate that it was
booted from eMMC.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
---
board/mediatek/mt7623/mt7623_rfb.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/board/mediatek/mt7623/mt7623_rfb.c b/board/mediatek/mt7623/mt7623_rfb.c
index 4ec2764976..984e75ccaf 100644
--- a/board/mediatek/mt7623/mt7623_rfb.c
+++ b/board/mediatek/mt7623/mt7623_rfb.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <mmc.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -15,10 +16,15 @@ int board_init(void)
return 0;
}
+#ifdef CONFIG_MMC
int mmc_get_boot_dev(void)
{
int g_mmc_devid = -1;
char *uflag = (char *)0x81DFFFF0;
+
+ if (!find_mmc_device(1))
+ return 0;
+
if (strncmp(uflag,"eMMC",4)==0) {
g_mmc_devid = 0;
printf("Boot From Emmc(id:%d)\n\n", g_mmc_devid);
@@ -33,3 +39,4 @@ int mmc_get_env_dev(void)
{
return mmc_get_boot_dev();
}
+#endif
--
2.26.2

View File

@ -0,0 +1,326 @@
From 3fad1ca28d4c87346d18b89438bf2084fb2c3896 Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw2@infradead.org>
Date: Sun, 12 Jul 2020 23:33:03 +0100
Subject: [PATCH 3/3] board: mediatek: Add support for UniElec U7623 board
This is an MT7623A-based board, very similar to the Banana Pi R2.
http://www.unielecinc.com/q/news/cn/p/product/detail.html?qd_guid=OjXwKCaRlN
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
---
arch/arm/dts/Makefile | 1 +
.../arm/dts/mt7623a-unielec-u7623-02-emmc.dts | 211 ++++++++++++++++++
board/mediatek/mt7623/MAINTAINERS | 7 +
configs/mt7623a_unielec_u7623_02_defconfig | 54 +++++
4 files changed, 273 insertions(+)
create mode 100644 arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts
create mode 100644 configs/mt7623a_unielec_u7623_02_defconfig
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index a3a1e3fbe4..caa7756c5d 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -949,6 +949,7 @@ dtb-$(CONFIG_SOC_K3_J721E) += k3-j721e-common-proc-board.dtb \
dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7622-rfb.dtb \
+ mt7623a-unielec-u7623-02-emmc.dtb \
mt7623n-bananapi-bpi-r2.dtb \
mt7629-rfb.dtb \
mt8512-bm1-emmc.dtb \
diff --git a/arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts b/arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts
new file mode 100644
index 0000000000..fdeec75b05
--- /dev/null
+++ b/arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2018 MediaTek Inc.
+ * Author: Ryder Lee <ryder.lee@mediatek.com>
+ *
+ * SPDX-License-Identifier: (GPL-2.0 OR MIT)
+ */
+
+/dts-v1/;
+#include "mt7623.dtsi"
+#include "mt7623-u-boot.dtsi"
+
+/ {
+ model = "UniElec U7623-02 eMMC";
+ compatible = "unielec,u7623-02-emmc", "mediatek,mt7623";
+
+ memory@80000000 {
+ device_type = "memory";
+ reg = <0 0x80000000 0 0x20000000>;
+ };
+
+ chosen {
+ stdout-path = &uart2;
+ tick-timer = &timer0;
+ };
+
+ reg_1p8v: regulator-1p8v {
+ compatible = "regulator-fixed";
+ regulator-name = "fixed-1.8V";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ reg_3p3v: regulator-3p3v {
+ compatible = "regulator-fixed";
+ regulator-name = "fixed-3.3V";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ reg_5v: regulator-5v {
+ compatible = "regulator-fixed";
+ regulator-name = "fixed-5V";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led3 {
+ label = "u7623-01:green:led3";
+ gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ };
+
+ led4 {
+ label = "u7623-01:green:led4";
+ gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ };
+ };
+};
+
+&eth {
+ status = "okay";
+ mediatek,gmac-id = <0>;
+ phy-mode = "rgmii";
+ mediatek,switch = "mt7530";
+ mediatek,mcm;
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+};
+
+&mmc0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc0_pins_default>;
+ status = "okay";
+ bus-width = <8>;
+ max-frequency = <50000000>;
+ cap-mmc-highspeed;
+ vmmc-supply = <&reg_3p3v>;
+ vqmmc-supply = <&reg_1p8v>;
+ non-removable;
+};
+
+&pinctrl {
+ ephy_default: ephy_default {
+ mux {
+ function = "eth";
+ groups = "mdc_mdio", "ephy";
+ };
+
+ conf {
+ pins = "G2_TXEN", "G2_TXD0", "G2_TXD1", "G2_TXD2",
+ "G2_TXD3", "G2_TXC", "G2_RXC", "G2_RXD0",
+ "G2_RXD1", "G2_RXD2", "G2_RXD3", "G2_RXDV",
+ "MDC", "MDIO";
+ drive-strength = <12>;
+ mediatek,tdsel = <5>;
+ };
+ };
+
+ mmc0_pins_default: mmc0default {
+ mux {
+ function = "msdc";
+ groups = "msdc0";
+ };
+
+ conf-cmd-data {
+ pins = "MSDC0_CMD", "MSDC0_DAT0", "MSDC0_DAT1",
+ "MSDC0_DAT2", "MSDC0_DAT3", "MSDC0_DAT4",
+ "MSDC0_DAT5", "MSDC0_DAT6", "MSDC0_DAT7";
+ input-enable;
+ bias-pull-up;
+ };
+
+ conf-clk {
+ pins = "MSDC0_CLK";
+ bias-pull-down;
+ };
+
+ conf-rst {
+ pins = "MSDC0_RSTB";
+ bias-pull-up;
+ };
+ };
+
+ pcie_default: pcie-default {
+ mux {
+ function = "pcie";
+ groups = "pcie0_0_perst", "pcie1_0_perst";
+ };
+ };
+
+ uart0_pins_a: uart0-default {
+ mux {
+ function = "uart";
+ groups = "uart0_0_txd_rxd";
+ };
+ };
+
+ uart1_pins_a: uart1-default {
+ mux {
+ function = "uart";
+ groups = "uart1_0_txd_rxd";
+ };
+ };
+
+ uart2_pins_a: uart2-default {
+ mux {
+ function = "uart";
+ groups = "uart2_0_txd_rxd";
+ };
+ };
+
+ uart2_pins_b: uart2-alt {
+ mux {
+ function = "uart";
+ groups = "uart2_1_txd_rxd";
+ };
+ };
+};
+
+&pcie {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pcie_default>;
+ status = "okay";
+
+ pcie@0,0 {
+ status = "okay";
+ };
+
+ pcie@1,0 {
+ status = "okay";
+ };
+};
+
+&pcie0_phy {
+ status = "okay";
+};
+
+&pcie1_phy {
+ status = "okay";
+};
+
+&uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
+ status = "okay";
+};
+
+&uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins_a>;
+ status = "okay";
+};
+
+&uart2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart2_pins_b>;
+ status = "okay";
+};
diff --git a/board/mediatek/mt7623/MAINTAINERS b/board/mediatek/mt7623/MAINTAINERS
index eeb0375d70..1a8d796bd3 100644
--- a/board/mediatek/mt7623/MAINTAINERS
+++ b/board/mediatek/mt7623/MAINTAINERS
@@ -5,3 +5,10 @@ S: Maintained
F: board/mediatek/mt7623
F: include/configs/mt7623.h
F: configs/mt7623n_bpir2_defconfig
+
+UNIELEC U7623
+M: Ryder Lee <ryder.lee@mediatek.com>
+M: David Woodhouse <dwmw2@infradead.org>
+S: Maintained
+F: arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts
+F: configs/mt7623a_unielec_u7623_02_defconfig
diff --git a/configs/mt7623a_unielec_u7623_02_defconfig b/configs/mt7623a_unielec_u7623_02_defconfig
new file mode 100644
index 0000000000..72b5f31092
--- /dev/null
+++ b/configs/mt7623a_unielec_u7623_02_defconfig
@@ -0,0 +1,54 @@
+CONFIG_ARM=y
+CONFIG_SYS_THUMB_BUILD=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_SYS_TEXT_BASE=0x81e00000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_ENV_SIZE=0x1000
+CONFIG_ENV_OFFSET=0x100000
+CONFIG_TARGET_MT7623=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_BOOTDELAY=3
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_DEFAULT_FDT_FILE="mt7623a-unielec-u7623-02-emmc.dtb"
+# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_SYS_PROMPT="U-Boot> "
+CONFIG_CMD_BOOTMENU=y
+# CONFIG_CMD_ELF is not set
+# CONFIG_CMD_XIMG is not set
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_READ=y
+# CONFIG_CMD_SETEXPR is not set
+# CONFIG_CMD_NFS is not set
+CONFIG_DEFAULT_DEVICE_TREE="mt7623a-unielec-u7623-02-emmc"
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_CLK=y
+CONFIG_DM_MMC=y
+# CONFIG_MMC_QUIRKS is not set
+CONFIG_SUPPORT_EMMC_BOOT=y
+CONFIG_MMC_HS400_SUPPORT=y
+CONFIG_MMC_MTK=y
+CONFIG_PHY_FIXED=y
+CONFIG_DM_ETH=y
+CONFIG_MEDIATEK_ETH=y
+CONFIG_PINCTRL=y
+CONFIG_PINCONF=y
+CONFIG_PINCTRL_MT7623=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_MTK_POWER_DOMAIN=y
+CONFIG_DM_SERIAL=y
+CONFIG_MTK_SERIAL=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
+CONFIG_TIMER=y
+CONFIG_MTK_TIMER=y
+CONFIG_WDT_MTK=y
+CONFIG_LZMA=y
--
2.26.2

View File

@ -0,0 +1,25 @@
--- a/Makefile
+++ b/Makefile
@@ -1667,8 +1667,10 @@ u-boot-elf.lds: arch/u-boot-elf.lds prepare FORCE
ifeq ($(CONFIG_SPL),y)
spl/u-boot-spl-mtk.bin: spl/u-boot-spl
-u-boot-mtk.bin: u-boot.dtb u-boot.img spl/u-boot-spl-mtk.bin FORCE
- $(call if_changed,binman)
+OBJCOPYFLAGS_u-boot-mtk.bin = -I binary -O binary \
+ --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
+u-boot-mtk.bin: u-boot.img spl/u-boot-spl-mtk.bin FORCE
+ $(call if_changed,pad_cat)
else
MKIMAGEFLAGS_u-boot-mtk.bin = -T mtk_image \
-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) \
--- a/arch/arm/mach-mediatek/Kconfig
+++ b/arch/arm/mach-mediatek/Kconfig
@@ -36,7 +36,6 @@ config TARGET_MT7629
bool "MediaTek MT7629 SoC"
select CPU_V7A
select SPL
- select BINMAN
help
The MediaTek MT7629 is a ARM-based SoC with a dual-core Cortex-A7
including DDR3, crypto engine, 3x3 11n/ac Wi-Fi, Gigabit Ethernet,

View File

@ -0,0 +1,17 @@
diff --git a/configs/mt7623n_bpir2_defconfig b/configs/mt7623n_bpir2_defconfig
index 6b9fbd7e22..fb2a004803 100644
--- a/configs/mt7623a_unielec_u7623_02_defconfig
+++ b/configs/mt7623a_unielec_u7623_02_defconfig
@@ -52,3 +52,12 @@ CONFIG_TIMER=y
CONFIG_MTK_TIMER=y
CONFIG_WDT_MTK=y
CONFIG_LZMA=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_OF_LIBFDT_OVERLAY=y
+#enables savenenv-command
+CONFIG_ENV_IS_IN_FAT=y
+CONFIG_ENV_FAT_INTERFACE="mmc"
+CONFIG_ENV_FAT_DEVICE_AND_PART="0:2"
+CONFIG_ENV_FAT_FILE="uboot.env"
+CONFIG_CMD_ASKENV=y
+CONFIG_CMD_SETEXPR=y

View File

@ -29,6 +29,13 @@ define U-Boot/clearfog
UBOOT_IMAGE:=u-boot-spl.kwb
endef
define U-Boot/helios4
NAME:=Kobol Helios 4
BUILD_DEVICES:=kobol_helios4
BUILD_SUBTARGET:=cortexa9
UBOOT_IMAGE:=u-boot-spl.kwb
endef
define U-Boot/uDPU
NAME:=Methode uDPU
BUILD_DEVICES:=methode_udpu
@ -37,6 +44,7 @@ endef
UBOOT_TARGETS:= \
clearfog \
helios4 \
uDPU
Build/Exports:=$(Host/Exports)

View File

@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ath10k-ct-firmware
PKG_VERSION:=2020-04-24
PKG_RELEASE:=2
PKG_VERSION:=2020-07-02
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
@ -95,14 +95,14 @@ define Download/ct-firmware-htt
URL_FILE:=$($(1)_FIRMWARE_FILE_CT_HTT)
endef
QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.018
QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.019
define Download/ath10k-firmware-qca988x-ct
$(call Download/ct-firmware,QCA988X,)
HASH:=8b4c99253aa309d35f2e060c190091b8db1b84dbda06a6a15c83ac0f9a938126
endef
$(eval $(call Download,ath10k-firmware-qca988x-ct))
QCA988X_FIRMWARE_FILE_CT_FULL_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.018
QCA988X_FIRMWARE_FILE_CT_FULL_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.019
define Download/ath10k-firmware-qca988x-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA988X,)
HASH:=a7168916d6aa5e4d7858f8b620c0c980c76d03f390929db6f4077685ce2051e7
@ -110,14 +110,14 @@ endef
$(eval $(call Download,ath10k-firmware-qca988x-ct-full-htt))
QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.018
QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.019
define Download/ath10k-firmware-qca9887-ct
$(call Download/ct-firmware,QCA9887,ath10k-9887)
HASH:=459692deb186a63ab8eeddb7ad5d54779266e68ca686e7c46062554db6dca12b
endef
$(eval $(call Download,ath10k-firmware-qca9887-ct))
QCA9887_FIRMWARE_FILE_CT_FULL_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.018
QCA9887_FIRMWARE_FILE_CT_FULL_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.019
define Download/ath10k-firmware-qca9887-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA9887,ath10k-9887)
HASH:=fd126a457d0927d0c8ea10d66ef5b67d5e1e0741f8692bb3016bb602d0af3098
@ -125,90 +125,90 @@ endef
$(eval $(call Download,ath10k-firmware-qca9887-ct-full-htt))
QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.018
QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.019
define Download/ath10k-firmware-qca99x0-ct
$(call Download/ct-firmware,QCA99X0,ath10k-10-4b)
HASH:=cf26eb37524de54af51fe9b2efffc85e0e70ab849e8607ef63ce5a8ecffeaa42
HASH:=7dc934f934bc4973c9273a4f22cfead8e26ec6f579647af31b718a860eca0a4b
endef
$(eval $(call Download,ath10k-firmware-qca99x0-ct))
QCA99X0_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.018
QCA99X0_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.019
define Download/ath10k-firmware-qca99x0-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA99X0,ath10k-10-4b)
HASH:=e9737538d7379e13ad4e4c8c519a63659b5e34a35455ed9ac4399ae8097caabc
HASH:=71a27b245a382fe009938d2826d5c97a90dceb10ddf638325268df91837ea302
endef
$(eval $(call Download,ath10k-firmware-qca99x0-ct-full-htt))
QCA99X0_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.018
QCA99X0_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.019
define Download/ath10k-firmware-qca99x0-ct-htt
$(call Download/ct-firmware-htt,QCA99X0,ath10k-10-4b)
HASH:=4d4f74afca487d452f244cd48304cf9710d8941eb97a6346a949ed6b6877d657
HASH:=9ed4fe41e5b0f30172f71ae0fe382dc0aab8aa4f8a898417af4f7ee936575ef6
endef
$(eval $(call Download,ath10k-firmware-qca99x0-ct-htt))
QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.018
QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.019
define Download/ath10k-firmware-qca9984-ct
$(call Download/ct-firmware,QCA9984,ath10k-9984-10-4b)
HASH:=a6b3d66efe640a430a837f238e91eddcd423eed6b887d3ae19716d87a71fd0b1
HASH:=32d13f432691fe759ded7d027052e925233adb436cd8f729f85ec3d19ccd1dfd
endef
$(eval $(call Download,ath10k-firmware-qca9984-ct))
QCA9984_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.018
QCA9984_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.019
define Download/ath10k-firmware-qca9984-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA9984,ath10k-9984-10-4b)
HASH:=96060227e372b3b210badccbe6b0bd75d9a35335a7a0f2966964e9e89f66b00f
HASH:=e8ab69777bd00b5fc6b1b7acccb55b903553a99932a5b0351602b5f690106588
endef
$(eval $(call Download,ath10k-firmware-qca9984-ct-full-htt))
QCA9984_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.018
QCA9984_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.019
define Download/ath10k-firmware-qca9984-ct-htt
$(call Download/ct-firmware-htt,QCA9984,ath10k-9984-10-4b)
HASH:=ee593fb5724d75c372de02ac7894e1630ee9f909fcb2e2bbf17aadef67cb9d43
HASH:=74449b303b626e0713b3fd4f2d6103d65859403b2dd7bdd8882aa772b69b59c7
endef
$(eval $(call Download,ath10k-firmware-qca9984-ct-htt))
QCA4019_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.018
QCA4019_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.019
define Download/ath10k-firmware-qca4019-ct
$(call Download/ct-firmware,QCA4019,ath10k-4019-10-4b)
HASH:=46d8f8f1e780813299dc8780eedcfceda103c6b4d8908589ad1adbef921714c0
HASH:=4b89763087c7ed9b56046c4e621b7f045e452436d8d9b430a5d171179e313592
endef
$(eval $(call Download,ath10k-firmware-qca4019-ct))
QCA4019_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.018
QCA4019_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.019
define Download/ath10k-firmware-qca4019-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA4019,ath10k-4019-10-4b)
HASH:=d884624fc34f4b5de7a3ec0534627c46cea25fca45657f3a2f6bb85f6c5893d7
HASH:=fba591e5777c53b82542ba16cae69d9bb4684837f2fa4cee1b9b26f648096748
endef
$(eval $(call Download,ath10k-firmware-qca4019-ct-full-htt))
QCA4019_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.018
QCA4019_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.019
define Download/ath10k-firmware-qca4019-ct-htt
$(call Download/ct-firmware-htt,QCA4019,ath10k-4019-10-4b)
HASH:=51fe06f66365771647d16039cca8b541de3d642c45271977a4cfd433c2c5d45b
HASH:=0d534c3c424184b8ec2773f15c8933bdab0d39b6f664d2578c6602b0eb7035d1
endef
$(eval $(call Download,ath10k-firmware-qca4019-ct-htt))
QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.018
QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.019
define Download/ath10k-firmware-qca9888-ct
$(call Download/ct-firmware,QCA9888,ath10k-9888-10-4b)
HASH:=d01f1429aaf0bfac07eee3547e5821d19136840b2f983e75e76979a5ac19b6f0
HASH:=048f4300725e6ebbf94a6bf4f3f4e4592c446fcdbe1d801aaac024b15e89e0c9
endef
$(eval $(call Download,ath10k-firmware-qca9888-ct))
QCA9888_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.018
QCA9888_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.019
define Download/ath10k-firmware-qca9888-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA9888,ath10k-9888-10-4b)
HASH:=68c42f8e0dcf77f18d4813ac93174bf06ff5cf5aa4f69befe7f35f9fae1de1e3
HASH:=d2a7e9fea6bd854721b3fc03a3a00d379d303b2bce339377ee87a1c14a60312d
endef
$(eval $(call Download,ath10k-firmware-qca9888-ct-full-htt))
QCA9888_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.018
QCA9888_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.019
define Download/ath10k-firmware-qca9888-ct-htt
$(call Download/ct-firmware-htt,QCA9888,ath10k-9888-10-4b)
HASH:=6c692141155f5bb74c0117553d5d48ff2aaba73bd4d5e90a5044a5e2ec0faab0
HASH:=e52a6db33347c641ee791fd9a3a57a2503cdda1adc6b8d943e336431528b9d2a
endef
$(eval $(call Download,ath10k-firmware-qca9888-ct-htt))

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=fman-ucode
PKG_VERSION:=LSDK-20.04
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/NXP/qoriq-fm-ucode.git
@ -31,9 +31,9 @@ endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/fsl_fman_ucode_ls1043_r1.1_106_4_18.bin \
$(STAGING_DIR_IMAGE)/ls1043ardb-fman.bin
$(STAGING_DIR_IMAGE)/fsl_ls1043a-rdb-fman.bin
$(CP) $(PKG_BUILD_DIR)/fsl_fman_ucode_ls1046_r1.0_106_4_18.bin \
$(STAGING_DIR_IMAGE)/ls1046ardb-fman.bin
$(STAGING_DIR_IMAGE)/fsl_ls1046a-rdb-fman.bin
endef
$(eval $(call BuildPackage,layerscape-fman))

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ls-dpl
PKG_VERSION:=LSDK-20.04
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/mc-utils
@ -33,13 +33,13 @@ MAKE_VARS+= \
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/config/ls1088a/RDB/dpl-eth.0x1D_0x0D.dtb \
$(STAGING_DIR_IMAGE)/ls1088ardb-dpl.dtb
$(STAGING_DIR_IMAGE)/fsl_ls1088a-rdb-dpl.dtb
$(CP) $(PKG_BUILD_DIR)/config/ls1088a/RDB/dpc.0x1D-0x0D.dtb \
$(STAGING_DIR_IMAGE)/ls1088ardb-dpc.dtb
$(STAGING_DIR_IMAGE)/fsl_ls1088a-rdb-dpc.dtb
$(CP) $(PKG_BUILD_DIR)/config/ls2088a/RDB/dpl-eth.0x2A_0x41.dtb \
$(STAGING_DIR_IMAGE)/ls2088ardb-dpl.dtb
$(STAGING_DIR_IMAGE)/fsl_ls2088a-rdb-dpl.dtb
$(CP) $(PKG_BUILD_DIR)/config/ls2088a/RDB/dpc.0x2A_0x41.dtb \
$(STAGING_DIR_IMAGE)/ls2088ardb-dpc.dtb
$(STAGING_DIR_IMAGE)/fsl_ls2088a-rdb-dpc.dtb
endef
$(eval $(call BuildPackage,layerscape-dpl))

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ls-mc
PKG_VERSION:=LSDK-20.04
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/NXP/qoriq-mc-binary.git
@ -31,9 +31,9 @@ endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/ls1088a/mc_10.20.4_ls1088a.itb \
$(STAGING_DIR_IMAGE)/ls1088ardb-mc.itb
$(STAGING_DIR_IMAGE)/fsl_ls1088a-rdb-mc.itb
$(CP) $(PKG_BUILD_DIR)/ls2088a/mc_10.20.4_ls2088a.itb \
$(STAGING_DIR_IMAGE)/ls2088ardb-mc.itb
$(STAGING_DIR_IMAGE)/fsl_ls2088a-rdb-mc.itb
endef
$(eval $(call BuildPackage,layerscape-mc))

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ls-rcw
PKG_VERSION:=LSDK-20.04
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/rcw
@ -26,34 +26,34 @@ define Package/layerscape-rcw
endef
BOARDS := \
ls1012ardb \
ls1012afrdm \
ls1012afrwy \
ls1043ardb \
ls1043ardb-sdboot \
ls1046ardb \
ls1046ardb-sdboot \
ls1088ardb \
ls1088ardb-sdboot \
ls2088ardb \
ls1021atwr
ls1012a-rdb \
ls1012a-frdm \
ls1012a-frwy-sdboot \
ls1043a-rdb \
ls1043a-rdb-sdboot \
ls1046a-rdb \
ls1046a-rdb-sdboot \
ls1088a-rdb \
ls1088a-rdb-sdboot \
ls2088a-rdb \
ls1021a-twr
RCW_ls1012ardb :=ls1012ardb/R_SPNH_3508/rcw_1000_default.bin
RCW_ls1012afrdm :=ls1012afrdm/N_SSNP_3305/rcw_800.bin
RCW_ls1012afrwy :=ls1012afrwy/N_SSNP_3305/rcw_1000_default.bin
RCW_ls1043ardb :=ls1043ardb/RR_FQPP_1455/rcw_1600.bin
RCW_ls1043ardb-sdboot :=ls1043ardb/RR_FQPP_1455/rcw_1600_sdboot.bin
RCW_ls1046ardb :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin
RCW_ls1046ardb-sdboot :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_sdboot.bin
RCW_ls1088ardb :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_qspi.bin
RCW_ls1088ardb-sdboot :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_sd.bin
RCW_ls2088ardb :=ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41/rcw_1800.bin
RCW_ls1021atwr :=ls1021atwr/SSR_PNS_30/rcw_1200.bin
RCW_ls1012a-rdb :=ls1012ardb/R_SPNH_3508/rcw_1000_default.bin
RCW_ls1012a-frdm :=ls1012afrdm/N_SSNP_3305/rcw_800.bin
RCW_ls1012a-frwy-sdboot :=ls1012afrwy/N_SSNP_3305/rcw_1000_default.bin
RCW_ls1043a-rdb :=ls1043ardb/RR_FQPP_1455/rcw_1600.bin
RCW_ls1043a-rdb-sdboot :=ls1043ardb/RR_FQPP_1455/rcw_1600_sdboot.bin
RCW_ls1046a-rdb :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin
RCW_ls1046a-rdb-sdboot :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_sdboot.bin
RCW_ls1088a-rdb :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_qspi.bin
RCW_ls1088a-rdb-sdboot :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_sd.bin
RCW_ls2088a-rdb :=ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41/rcw_1800.bin
RCW_ls1021a-twr :=ls1021atwr/SSR_PNS_30/rcw_1200.bin
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(foreach board,$(BOARDS), \
$(CP) $(PKG_BUILD_DIR)/$(RCW_$(board)) $(STAGING_DIR_IMAGE)/$(board)-rcw.bin;)
$(CP) $(PKG_BUILD_DIR)/$(RCW_$(board)) $(STAGING_DIR_IMAGE)/fsl_$(board)-rcw.bin;)
endef
$(eval $(call BuildPackage,layerscape-rcw))

View File

@ -0,0 +1,9 @@
Package/eip197-mini-firmware = $(call Package/firmware-default,Inside Secure EIP197 mini firmware)
define Package/eip197-mini-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/inside-secure/eip197_minifw
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/inside-secure/eip197_minifw/ifpp.bin \
$(PKG_BUILD_DIR)/inside-secure/eip197_minifw/ipue.bin \
$(1)/lib/firmware/inside-secure/eip197_minifw
endef
$(eval $(call BuildPackage,eip197-mini-firmware))

View File

@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=broadcom-wl
PKG_VERSION:=5.10.56.27.3
PKG_RELEASE:=9
PKG_RELEASE:=10
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(ARCH).tar.bz2
PKG_SOURCE_URL:=http://downloads.openwrt.org/sources

View File

@ -223,7 +223,7 @@ enable_broadcom() {
}
local _c=0
local nas="$(which nas)"
local nas="$(command -v nas)"
local if_pre_up if_up nas_cmd
local vif vif_pre_up vif_post_up vif_do_up vif_txpower
local bssmax=$(wlc ifname "$device" bssmax)

View File

@ -13,9 +13,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git
PKG_SOURCE_DATE:=2020-01-10
PKG_SOURCE_VERSION:=aeff7a3e61ffa3159a8a95384d33e47a006211f4
PKG_MIRROR_HASH:=5bf06a804824db36ae393fc174aeec7b12633176e05a765c0931b39df5bd34df
PKG_SOURCE_DATE:=2020-07-24
PKG_SOURCE_VERSION:=48979385757f3408c3427b3ebbf5963efdada5aa
PKG_MIRROR_HASH:=0e8ed53f55e28ad0c30f20293c16988876bae8d6f70f5629a43cf2ce1e49fc51
PKG_MAINTAINER:=Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
include $(INCLUDE_DIR)/package.mk

View File

@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=drv_vmmc
PKG_VERSION:=1.9.0
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_HASH:=707f515eb727c032418c4da67d7e86884bb56cdc2a606e8f6ded6057d8767e57
@ -170,7 +170,7 @@ endef
define KernelPackage/ltq-vmmc/install
$(INSTALL_DIR) $(1)/etc/init.d $(1)/$(FW_DIR)
$(INSTALL_BIN) ./files/vmmc.init $(1)/etc/init.d/vmmc
$(CP) $(PKG_BUILD_DIR)/firmware/$(FW_SOURCE) $(1)/$(FW_DIR)/$(FW_TARGET)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/firmware/$(FW_SOURCE) $(1)/$(FW_DIR)/$(FW_TARGET)
ln -s /$(FW_DIR)/$(FW_TARGET) $(1)/$(FW_DIR)/$(FW_TARGET_GENERIC)
$(CP) $(PKG_BUILD_DIR)/coef/$(COEF_SRC) $(1)/$(FW_DIR)/$(COEF_TARGET)
$(CP) $(PKG_BUILD_DIR)/coef/$(COEF_SRC_FXO) $(1)/$(FW_DIR)/$(COEF_TARGET_FXO)

View File

@ -5,15 +5,9 @@
START=31
start() {
[ ! -c /dev/vmmc10 ] && {
mknod /dev/vmmc10 c 122 10
mknod /dev/vmmc11 c 122 11
mknod /dev/vmmc12 c 122 12
mknod /dev/vmmc13 c 122 13
mknod /dev/vmmc14 c 122 14
mknod /dev/vmmc15 c 122 15
mknod /dev/vmmc16 c 122 16
mknod /dev/vmmc17 c 122 17
mknod /dev/vmmc18 c 122 18
}
for i in 10 11 12 13 14 15 16 17 18; do
if ! [ -e /dev/vmmc$i ]; then
mknod -m 664 /dev/vmmc$i c 122 $i
fi
done
}

View File

@ -270,6 +270,32 @@ endef
$(eval $(call KernelPackage,dm-raid))
define KernelPackage/iscsi-initiator
SUBMENU:=$(BLOCK_MENU)
TITLE:=iSCSI Initiator over TCP/IP
DEPENDS:=+kmod-scsi-core +kmod-crypto-hash
KCONFIG:= \
CONFIG_INET \
CONFIG_SCSI_LOWLEVEL=y \
CONFIG_ISCSI_TCP \
CONFIG_SCSI_ISCSI_ATTRS=y
FILES:= \
$(LINUX_DIR)/drivers/scsi/iscsi_tcp.ko \
$(LINUX_DIR)/drivers/scsi/libiscsi.ko \
$(LINUX_DIR)/drivers/scsi/libiscsi_tcp.ko \
$(LINUX_DIR)/drivers/scsi/scsi_transport_iscsi.ko
AUTOLOAD:=$(call AutoProbe,libiscsi libiscsi_tcp scsi_transport_iscsi iscsi_tcp)
endef
define KernelPackage/iscsi-initiator/description
The iSCSI Driver provides a host with the ability to access storage through an
IP network. The driver uses the iSCSI protocol to transport SCSI requests and
responses over a TCP/IP network between the host (the "initiator") and "targets".
endef
$(eval $(call KernelPackage,iscsi-initiator))
define KernelPackage/md-mod
SUBMENU:=$(BLOCK_MENU)
TITLE:=MD RAID
@ -539,3 +565,17 @@ define KernelPackage/scsi-tape
endef
$(eval $(call KernelPackage,scsi-tape))
define KernelPackage/iosched-bfq
SUBMENU:=$(BLOCK_MENU)
TITLE:=Kernel support for BFQ I/O scheduler
KCONFIG:= \
CONFIG_IOSCHED_BFQ \
CONFIG_BFQ_GROUP_IOSCHED=y \
CONFIG_BFQ_CGROUP_DEBUG=n
FILES:= \
$(LINUX_DIR)/block/bfq.ko
AUTOLOAD:=$(call AutoLoad,10,bfq)
endef
$(eval $(call KernelPackage,iosched-bfq))

View File

@ -377,7 +377,7 @@ $(eval $(call KernelPackage,crypto-hw-padlock))
define KernelPackage/crypto-hw-safexcel
TITLE:= MVEBU SafeXcel Crypto Engine module
DEPENDS:=@!LINUX_4_14 @(TARGET_mvebu_cortexa53||TARGET_mvebu_cortexa72) \
DEPENDS:=@!LINUX_4_14 @(TARGET_mvebu_cortexa53||TARGET_mvebu_cortexa72) +eip197-mini-firmware \
+kmod-crypto-authenc +kmod-crypto-md5 +kmod-crypto-hmac +kmod-crypto-sha256 +kmod-crypto-sha512
KCONFIG:= \
CONFIG_CRYPTO_HW=y \
@ -392,9 +392,11 @@ MVEBU's EIP97 and EIP197 Cryptographic Engine driver designed by
Inside Secure. This is found on Marvell Armada 37xx/7k/8k SoCs.
Particular version of these IP (EIP197B and EIP197D) require firmware.
Unfortunately it's not freely available and needs signed Non-Disclosure
Agreement (NDA) with Marvell. For those who have signed NDA the firmware can be
obtained at https://extranet.marvell.com.
The mini firmware package provides limited functionality, for most operations
a full-featured firmware is required. Unfortunately the "full" firmware is not
freely available and needs signed Non-Disclosure Agreement (NDA) with Marvell.
For those who have signed NDA the firmware can be obtained at
https://extranet.marvell.com.
endef
$(eval $(call KernelPackage,crypto-hw-safexcel))

View File

@ -147,7 +147,6 @@ define KernelPackage/lib-lz4
SUBMENU:=$(LIB_MENU)
TITLE:=LZ4 support
DEPENDS:=+kmod-crypto-acompress
HIDDEN:=1
KCONFIG:= \
CONFIG_CRYPTO_LZ4 \
CONFIG_LZ4_COMPRESS \

View File

@ -732,6 +732,23 @@ endef
$(eval $(call KernelPackage,rtc-rx8025))
define KernelPackage/rtc-s35390a
SUBMENU:=$(OTHER_MENU)
TITLE:=Seico S-35390A
DEFAULT:=m if ALL_KMODS && RTC_SUPPORT
DEPENDS:=+kmod-i2c-core
KCONFIG:=CONFIG_RTC_DRV_S35390A \
CONFIG_RTC_CLASS=y
FILES:=$(LINUX_DIR)/drivers/rtc/rtc-s35390a.ko
AUTOLOAD:=$(call AutoLoad,50,rtc-s35390a,1)
endef
define KernelPackage/rtc-s35390a/description
Kernel module for Seiko Instruments S-35390A I2C RTC chip
endef
$(eval $(call KernelPackage,rtc-s35390a))
define KernelPackage/mtdtests
SUBMENU:=$(OTHER_MENU)
@ -913,15 +930,14 @@ $(eval $(call KernelPackage,ikconfig))
define KernelPackage/zram
SUBMENU:=$(OTHER_MENU)
TITLE:=ZRAM
DEPENDS:=+kmod-lib-lzo +kmod-lib-lz4
DEPENDS:=+kmod-lib-lzo
KCONFIG:= \
CONFIG_ZSMALLOC \
CONFIG_ZRAM \
CONFIG_ZRAM_DEBUG=n \
CONFIG_PGTABLE_MAPPING=n \
CONFIG_ZRAM_WRITEBACK=n \
CONFIG_ZSMALLOC_STAT=n \
CONFIG_ZRAM_LZ4_COMPRESS=y
CONFIG_ZSMALLOC_STAT=n
FILES:= \
$(LINUX_DIR)/mm/zsmalloc.ko \
$(LINUX_DIR)/drivers/block/zram/zram.ko

View File

@ -1118,7 +1118,7 @@ $(eval $(call KernelPackage,usb-net))
define AddDepends/usb-net
SUBMENU:=$(USB_MENU)
DEPENDS+=kmod-usb-net $(1)
DEPENDS+=+kmod-usb-net $(1)
endef

View File

@ -88,6 +88,7 @@ define KernelPackage/at86rf230
CONFIG_SPI=y \
CONFIG_SPI_MASTER=y
FILES:=$(LINUX_DIR)/drivers/net/ieee802154/at86rf230.ko
AUTOLOAD:=$(call AutoProbe,at86rf230)
endef
$(eval $(call KernelPackage,at86rf230))
@ -100,6 +101,7 @@ define KernelPackage/mrf24j40
CONFIG_SPI=y \
CONFIG_SPI_MASTER=y
FILES:=$(LINUX_DIR)/drivers/net/ieee802154/mrf24j40.ko
AUTOLOAD:=$(call AutoProbe,mrf24j40)
endef
$(eval $(call KernelPackage,mrf24j40))
@ -112,10 +114,27 @@ define KernelPackage/cc2520
CONFIG_SPI=y \
CONFIG_SPI_MASTER=y
FILES:=$(LINUX_DIR)/drivers/net/ieee802154/cc2520.ko
AUTOLOAD:=$(call AutoProbe,cc2520)
endef
$(eval $(call KernelPackage,cc2520))
define KernelPackage/ca8210
SUBMENU:=$(WPAN_MENU)
TITLE:=CA8210 transceiver driver
DEPENDS:=+kmod-mac802154
KCONFIG:=CONFIG_IEEE802154_CA8210 \
CONFIG_SPI=y \
CONFIG_SPI_MASTER=y \
CONFIG_IEEE802154_CA8210_DEBUGFS=n
FILES:=$(LINUX_DIR)/drivers/net/ieee802154/ca8210.ko
AUTOLOAD:=$(call AutoProbe,ca8210)
endef
$(eval $(call KernelPackage,ca8210))
define KernelPackage/ieee802154-6lowpan
SUBMENU:=$(WPAN_MENU)
TITLE:= 6LoWPAN support over IEEE-802.15.4

View File

@ -0,0 +1,30 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 14 Aug 2020 16:13:45 +0200
Subject: [PATCH] backports: add netif_receive_skb_list
It will be needed by pending mac80211 changes
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/backport-include/linux/netdevice.h
+++ b/backport-include/linux/netdevice.h
@@ -372,6 +372,18 @@ static inline int _bp_netdev_upper_dev_l
macro_dispatcher(netdev_upper_dev_link, __VA_ARGS__)(__VA_ARGS__)
#endif
+#if LINUX_VERSION_IS_LESS(4,19,0)
+static inline void netif_receive_skb_list(struct list_head *head)
+{
+ struct sk_buff *skb, *next;
+
+ list_for_each_entry_safe(skb, next, head, list) {
+ skb_list_del_init(skb);
+ netif_receive_skb(skb);
+ }
+}
+#endif
+
#if LINUX_VERSION_IS_LESS(5,0,0)
static inline int backport_dev_open(struct net_device *dev, struct netlink_ext_ack *extack)
{

View File

@ -0,0 +1,24 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 14 Aug 2020 16:13:55 +0200
Subject: [PATCH] backports: add skb_list_del_init
It will be needed by pending mac80211 changes
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/backport-include/linux/skbuff.h
+++ b/backport-include/linux/skbuff.h
@@ -384,6 +384,12 @@ static inline void skb_mark_not_on_list(
{
skb->next = NULL;
}
+
+static inline void skb_list_del_init(struct sk_buff *skb)
+{
+ __list_del_entry(&skb->list);
+ skb_mark_not_on_list(skb);
+}
#endif /* 4.19.10 <= x < 4.20 */
#endif

View File

@ -0,0 +1,151 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Wed, 12 Aug 2020 17:04:22 +0200
Subject: [PATCH] mac80211: use rate provided via status->rate on
ieee80211_tx_status_ext for AQL
Since ieee80211_tx_info does not have enough room to encode HE rates, HE
drivers use status->rate to provide rate info.
Store it in struct sta_info and use it for AQL.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/airtime.c
+++ b/net/mac80211/airtime.c
@@ -487,14 +487,61 @@ u32 ieee80211_calc_rx_airtime(struct iee
}
EXPORT_SYMBOL_GPL(ieee80211_calc_rx_airtime);
+static bool ieee80211_fill_rate_info(struct ieee80211_hw *hw,
+ struct ieee80211_rx_status *stat, u8 band,
+ struct rate_info *ri)
+{
+ struct ieee80211_supported_band *sband = hw->wiphy->bands[band];
+ int i;
+
+ if (!ri || !sband)
+ return false;
+
+ stat->bw = ri->bw;
+ stat->nss = ri->nss;
+ stat->rate_idx = ri->mcs;
+
+ if (ri->flags & RATE_INFO_FLAGS_HE_MCS)
+ stat->encoding = RX_ENC_HE;
+ else if (ri->flags & RATE_INFO_FLAGS_VHT_MCS)
+ stat->encoding = RX_ENC_VHT;
+ else if (ri->flags & RATE_INFO_FLAGS_MCS)
+ stat->encoding = RX_ENC_HT;
+ else
+ stat->encoding = RX_ENC_LEGACY;
+
+ if (ri->flags & RATE_INFO_FLAGS_SHORT_GI)
+ stat->enc_flags |= RX_ENC_FLAG_SHORT_GI;
+
+ stat->he_gi = ri->he_gi;
+
+ if (stat->encoding != RX_ENC_LEGACY)
+ return true;
+
+ stat->rate_idx = 0;
+ for (i = 0; i < sband->n_bitrates; i++) {
+ if (ri->legacy != sband->bitrates[i].bitrate)
+ continue;
+
+ stat->rate_idx = i;
+ return true;
+ }
+
+ return false;
+}
+
static u32 ieee80211_calc_tx_airtime_rate(struct ieee80211_hw *hw,
struct ieee80211_tx_rate *rate,
+ struct rate_info *ri,
u8 band, int len)
{
struct ieee80211_rx_status stat = {
.band = band,
};
+ if (ieee80211_fill_rate_info(hw, &stat, band, ri))
+ goto out;
+
if (rate->idx < 0 || !rate->count)
return 0;
@@ -522,6 +569,7 @@ static u32 ieee80211_calc_tx_airtime_rat
stat.encoding = RX_ENC_LEGACY;
}
+out:
return ieee80211_calc_rx_airtime(hw, &stat, len);
}
@@ -536,7 +584,7 @@ u32 ieee80211_calc_tx_airtime(struct iee
struct ieee80211_tx_rate *rate = &info->status.rates[i];
u32 cur_duration;
- cur_duration = ieee80211_calc_tx_airtime_rate(hw, rate,
+ cur_duration = ieee80211_calc_tx_airtime_rate(hw, rate, NULL,
info->band, len);
if (!cur_duration)
break;
@@ -573,6 +621,7 @@ u32 ieee80211_calc_expected_tx_airtime(s
struct sta_info *sta = container_of(pubsta, struct sta_info,
sta);
struct ieee80211_tx_rate *rate = &sta->tx_stats.last_rate;
+ struct rate_info *ri = &sta->tx_stats.last_rate_info;
u32 airtime;
if (!(rate->flags & (IEEE80211_TX_RC_VHT_MCS |
@@ -586,7 +635,7 @@ u32 ieee80211_calc_expected_tx_airtime(s
* This will not be very accurate, but much better than simply
* assuming un-aggregated tx.
*/
- airtime = ieee80211_calc_tx_airtime_rate(hw, rate, band,
+ airtime = ieee80211_calc_tx_airtime_rate(hw, rate, ri, band,
ampdu ? len * 16 : len);
if (ampdu)
airtime /= 16;
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -609,6 +609,7 @@ struct sta_info {
u64 packets[IEEE80211_NUM_ACS];
u64 bytes[IEEE80211_NUM_ACS];
struct ieee80211_tx_rate last_rate;
+ struct rate_info last_rate_info;
u64 msdu[IEEE80211_NUM_TIDS + 1];
} tx_stats;
u16 tid_seq[IEEE80211_QOS_CTL_TID_MASK + 1];
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -1147,9 +1147,17 @@ void ieee80211_tx_status_ext(struct ieee
struct ieee80211_tx_info *info = status->info;
struct ieee80211_sta *pubsta = status->sta;
struct ieee80211_supported_band *sband;
+ struct sta_info *sta;
int retry_count;
bool acked, noack_success;
+ if (pubsta) {
+ sta = container_of(pubsta, struct sta_info, sta);
+
+ if (status->rate)
+ sta->tx_stats.last_rate_info = *status->rate;
+ }
+
if (status->skb)
return __ieee80211_tx_status(hw, status);
@@ -1164,10 +1172,6 @@ void ieee80211_tx_status_ext(struct ieee
noack_success = !!(info->flags & IEEE80211_TX_STAT_NOACK_TRANSMITTED);
if (pubsta) {
- struct sta_info *sta;
-
- sta = container_of(pubsta, struct sta_info, sta);
-
if (!acked && !noack_success)
sta->status_stats.retry_failed++;
sta->status_stats.retry_count += retry_count;

View File

@ -0,0 +1,187 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Wed, 12 Aug 2020 17:06:12 +0200
Subject: [PATCH] mac80211: factor out code to look up the average packet
length duration for a rate
This will be used to enhance AQL estimated aggregation length
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/airtime.c
+++ b/net/mac80211/airtime.c
@@ -405,18 +405,14 @@ ieee80211_calc_legacy_rate_duration(u16
return duration;
}
-u32 ieee80211_calc_rx_airtime(struct ieee80211_hw *hw,
- struct ieee80211_rx_status *status,
- int len)
+static u32 ieee80211_get_rate_duration(struct ieee80211_hw *hw,
+ struct ieee80211_rx_status *status,
+ u32 *overhead)
{
- struct ieee80211_supported_band *sband;
- const struct ieee80211_rate *rate;
bool sgi = status->enc_flags & RX_ENC_FLAG_SHORT_GI;
- bool sp = status->enc_flags & RX_ENC_FLAG_SHORTPRE;
int bw, streams;
int group, idx;
u32 duration;
- bool cck;
switch (status->bw) {
case RATE_INFO_BW_20:
@@ -437,20 +433,6 @@ u32 ieee80211_calc_rx_airtime(struct iee
}
switch (status->encoding) {
- case RX_ENC_LEGACY:
- if (WARN_ON_ONCE(status->band > NL80211_BAND_5GHZ))
- return 0;
-
- sband = hw->wiphy->bands[status->band];
- if (!sband || status->rate_idx >= sband->n_bitrates)
- return 0;
-
- rate = &sband->bitrates[status->rate_idx];
- cck = rate->flags & IEEE80211_RATE_MANDATORY_B;
-
- return ieee80211_calc_legacy_rate_duration(rate->bitrate, sp,
- cck, len);
-
case RX_ENC_VHT:
streams = status->nss;
idx = status->rate_idx;
@@ -477,13 +459,47 @@ u32 ieee80211_calc_rx_airtime(struct iee
duration = airtime_mcs_groups[group].duration[idx];
duration <<= airtime_mcs_groups[group].shift;
+ *overhead = 36 + (streams << 2);
+
+ return duration;
+}
+
+
+u32 ieee80211_calc_rx_airtime(struct ieee80211_hw *hw,
+ struct ieee80211_rx_status *status,
+ int len)
+{
+ struct ieee80211_supported_band *sband;
+ u32 duration, overhead = 0;
+
+ if (status->encoding == RX_ENC_LEGACY) {
+ const struct ieee80211_rate *rate;
+ bool sp = status->enc_flags & RX_ENC_FLAG_SHORTPRE;
+ bool cck;
+
+ if (WARN_ON_ONCE(status->band > NL80211_BAND_5GHZ))
+ return 0;
+
+ sband = hw->wiphy->bands[status->band];
+ if (!sband || status->rate_idx >= sband->n_bitrates)
+ return 0;
+
+ rate = &sband->bitrates[status->rate_idx];
+ cck = rate->flags & IEEE80211_RATE_MANDATORY_B;
+
+ return ieee80211_calc_legacy_rate_duration(rate->bitrate, sp,
+ cck, len);
+ }
+
+ duration = ieee80211_get_rate_duration(hw, status, &overhead);
+ if (!duration)
+ return 0;
+
duration *= len;
duration /= AVG_PKT_SIZE;
duration /= 1024;
- duration += 36 + (streams << 2);
-
- return duration;
+ return duration + overhead;
}
EXPORT_SYMBOL_GPL(ieee80211_calc_rx_airtime);
@@ -530,46 +546,57 @@ static bool ieee80211_fill_rate_info(str
return false;
}
-static u32 ieee80211_calc_tx_airtime_rate(struct ieee80211_hw *hw,
- struct ieee80211_tx_rate *rate,
- struct rate_info *ri,
- u8 band, int len)
+static int ieee80211_fill_rx_status(struct ieee80211_rx_status *stat,
+ struct ieee80211_hw *hw,
+ struct ieee80211_tx_rate *rate,
+ struct rate_info *ri, u8 band, int len)
{
- struct ieee80211_rx_status stat = {
- .band = band,
- };
+ memset(stat, 0, sizeof(*stat));
+ stat->band = band;
- if (ieee80211_fill_rate_info(hw, &stat, band, ri))
- goto out;
+ if (ieee80211_fill_rate_info(hw, stat, band, ri))
+ return 0;
if (rate->idx < 0 || !rate->count)
- return 0;
+ return -1;
if (rate->flags & IEEE80211_TX_RC_80_MHZ_WIDTH)
- stat.bw = RATE_INFO_BW_80;
+ stat->bw = RATE_INFO_BW_80;
else if (rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
- stat.bw = RATE_INFO_BW_40;
+ stat->bw = RATE_INFO_BW_40;
else
- stat.bw = RATE_INFO_BW_20;
+ stat->bw = RATE_INFO_BW_20;
- stat.enc_flags = 0;
+ stat->enc_flags = 0;
if (rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
- stat.enc_flags |= RX_ENC_FLAG_SHORTPRE;
+ stat->enc_flags |= RX_ENC_FLAG_SHORTPRE;
if (rate->flags & IEEE80211_TX_RC_SHORT_GI)
- stat.enc_flags |= RX_ENC_FLAG_SHORT_GI;
+ stat->enc_flags |= RX_ENC_FLAG_SHORT_GI;
- stat.rate_idx = rate->idx;
+ stat->rate_idx = rate->idx;
if (rate->flags & IEEE80211_TX_RC_VHT_MCS) {
- stat.encoding = RX_ENC_VHT;
- stat.rate_idx = ieee80211_rate_get_vht_mcs(rate);
- stat.nss = ieee80211_rate_get_vht_nss(rate);
+ stat->encoding = RX_ENC_VHT;
+ stat->rate_idx = ieee80211_rate_get_vht_mcs(rate);
+ stat->nss = ieee80211_rate_get_vht_nss(rate);
} else if (rate->flags & IEEE80211_TX_RC_MCS) {
- stat.encoding = RX_ENC_HT;
+ stat->encoding = RX_ENC_HT;
} else {
- stat.encoding = RX_ENC_LEGACY;
+ stat->encoding = RX_ENC_LEGACY;
}
-out:
+ return 0;
+}
+
+static u32 ieee80211_calc_tx_airtime_rate(struct ieee80211_hw *hw,
+ struct ieee80211_tx_rate *rate,
+ struct rate_info *ri,
+ u8 band, int len)
+{
+ struct ieee80211_rx_status stat;
+
+ if (ieee80211_fill_rx_status(&stat, hw, rate, ri, band, len))
+ return 0;
+
return ieee80211_calc_rx_airtime(hw, &stat, len);
}

View File

@ -0,0 +1,67 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Wed, 12 Aug 2020 17:07:10 +0200
Subject: [PATCH] mac80211: improve AQL aggregation estimation for low data
rates
Links with low data rates use much smaller aggregates and are much more
sensitive to latency added by bufferbloat.
Tune the assumed aggregation length based on the tx rate duration.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/airtime.c
+++ b/net/mac80211/airtime.c
@@ -647,27 +647,41 @@ u32 ieee80211_calc_expected_tx_airtime(s
if (pubsta) {
struct sta_info *sta = container_of(pubsta, struct sta_info,
sta);
+ struct ieee80211_rx_status stat;
struct ieee80211_tx_rate *rate = &sta->tx_stats.last_rate;
struct rate_info *ri = &sta->tx_stats.last_rate_info;
- u32 airtime;
+ u32 duration, overhead;
+ u8 agg_shift;
- if (!(rate->flags & (IEEE80211_TX_RC_VHT_MCS |
- IEEE80211_TX_RC_MCS)))
- ampdu = false;
+ if (ieee80211_fill_rx_status(&stat, hw, rate, ri, band, len))
+ return 0;
+ if (stat.encoding == RX_ENC_LEGACY || !ampdu)
+ return ieee80211_calc_rx_airtime(hw, &stat, len);
+
+ duration = ieee80211_get_rate_duration(hw, &stat, &overhead);
/*
* Assume that HT/VHT transmission on any AC except VO will
* use aggregation. Since we don't have reliable reporting
- * of aggregation length, assume an average of 16.
+ * of aggregation length, assume an average size based on the
+ * tx rate.
* This will not be very accurate, but much better than simply
- * assuming un-aggregated tx.
+ * assuming un-aggregated tx in all cases.
*/
- airtime = ieee80211_calc_tx_airtime_rate(hw, rate, ri, band,
- ampdu ? len * 16 : len);
- if (ampdu)
- airtime /= 16;
+ if (duration > 400) /* <= VHT20 MCS2 1S */
+ agg_shift = 1;
+ else if (duration > 250) /* <= VHT20 MCS3 1S or MCS1 2S */
+ agg_shift = 2;
+ else if (duration > 150) /* <= VHT20 MCS5 1S or MCS3 2S */
+ agg_shift = 3;
+ else
+ agg_shift = 4;
- return airtime;
+ duration *= len;
+ duration /= AVG_PKT_SIZE;
+ duration /= 1024;
+
+ return duration + (overhead >> agg_shift);
}
if (!conf)

View File

@ -0,0 +1,651 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Thu, 13 Aug 2020 15:37:11 +0200
Subject: [PATCH] mac80211: rework tx encapsulation offload API
The current API (which lets the driver turn on/off per vif directly) has a
number of limitations:
- it does not deal with AP_VLAN
- conditions for enabling (no tkip, no monitor) are only checked at
add_interface time
- no way to indicate 4-addr support
In order to address this, store offload flags in struct ieee80211_vif
(easy to extend for decap offload later). mac80211 initially sets the enable
flag, but gives the driver a chance to modify it before its settings are
applied. In addition to the .add_interface op, a .update_vif_offload op is
introduced, which can be used for runtime changes.
If a driver can't disable encap offload at runtime, or if it has some extra
limitations, it can simply override the flags within those ops.
Support for encap offload with 4-address mode interfaces can be enabled
by setting a flag from .add_interface or .update_vif_offload.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -4150,6 +4150,35 @@ static int ath11k_set_he_mu_sounding_mod
return ret;
}
+static void ath11k_mac_op_update_vif_offload(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif)
+{
+ struct ath11k *ar = hw->priv;
+ struct ath11k_base *ab = ar->ab;
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ u32 param_id, param_value;
+ int ret;
+
+ param_id = WMI_VDEV_PARAM_TX_ENCAP_TYPE;
+ if (ath11k_frame_mode != ATH11K_HW_TXRX_ETHERNET ||
+ (vif->type != NL80211_IFTYPE_STATION &&
+ vif->type != NL80211_IFTYPE_AP))
+ vif->offload_flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED;
+
+ if (vif->offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED)
+ param_value = ATH11K_HW_TXRX_ETHERNET;
+ else
+ param_value = ATH11K_HW_TXRX_NATIVE_WIFI;
+
+ ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
+ param_id, param_value);
+ if (ret) {
+ ath11k_warn(ab, "failed to set vdev %d tx encap mode: %d\n",
+ arvif->vdev_id, ret);
+ vif->offload_flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED;
+ }
+}
+
static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
@@ -4159,7 +4188,6 @@ static int ath11k_mac_op_add_interface(s
struct vdev_create_params vdev_param = {0};
struct peer_create_params peer_param;
u32 param_id, param_value;
- int hw_encap = 0;
u16 nss;
int i;
int ret;
@@ -4253,30 +4281,7 @@ static int ath11k_mac_op_add_interface(s
list_add(&arvif->list, &ar->arvifs);
spin_unlock_bh(&ar->data_lock);
- param_id = WMI_VDEV_PARAM_TX_ENCAP_TYPE;
- if (ath11k_frame_mode == ATH11K_HW_TXRX_ETHERNET)
- switch (vif->type) {
- case NL80211_IFTYPE_STATION:
- case NL80211_IFTYPE_AP_VLAN:
- case NL80211_IFTYPE_AP:
- hw_encap = 1;
- break;
- default:
- break;
- }
-
- if (ieee80211_set_hw_80211_encap(vif, hw_encap))
- param_value = ATH11K_HW_TXRX_ETHERNET;
- else
- param_value = ATH11K_HW_TXRX_NATIVE_WIFI;
-
- ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
- param_id, param_value);
- if (ret) {
- ath11k_warn(ab, "failed to set vdev %d tx encap mode: %d\n",
- arvif->vdev_id, ret);
- goto err_vdev_del;
- }
+ ath11k_mac_op_update_vif_offload(hw, vif);
nss = get_num_chains(ar->cfg_tx_chainmask) ? : 1;
ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
@@ -5599,6 +5604,7 @@ static const struct ieee80211_ops ath11k
.reconfig_complete = ath11k_mac_op_reconfig_complete,
.add_interface = ath11k_mac_op_add_interface,
.remove_interface = ath11k_mac_op_remove_interface,
+ .update_vif_offload = ath11k_mac_op_update_vif_offload,
.config = ath11k_mac_op_config,
.bss_info_changed = ath11k_mac_op_bss_info_changed,
.configure_filter = ath11k_mac_op_configure_filter,
@@ -5852,6 +5858,7 @@ static int __ath11k_mac_register(struct
ieee80211_hw_set(ar->hw, QUEUE_CONTROL);
ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG);
ieee80211_hw_set(ar->hw, REPORTS_LOW_ACK);
+ ieee80211_hw_set(ar->hw, SUPPORTS_TX_ENCAP_OFFLOAD);
if (ht_cap & WMI_HT_CAP_ENABLED) {
ieee80211_hw_set(ar->hw, AMPDU_AGGREGATION);
ieee80211_hw_set(ar->hw, TX_AMPDU_SETUP_IN_HW);
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1603,6 +1603,21 @@ enum ieee80211_vif_flags {
IEEE80211_VIF_GET_NOA_UPDATE = BIT(3),
};
+
+/**
+ * enum ieee80211_offload_flags - virtual interface offload flags
+ *
+ * @IEEE80211_OFFLOAD_ENCAP_ENABLED: tx encapsulation offload is enabled
+ * The driver supports sending frames passed as 802.3 frames by mac80211.
+ * It must also support sending 802.11 packets for the same interface.
+ * @IEEE80211_OFFLOAD_ENCAP_4ADDR: support 4-address mode encapsulation offload
+ */
+
+enum ieee80211_offload_flags {
+ IEEE80211_OFFLOAD_ENCAP_ENABLED = BIT(0),
+ IEEE80211_OFFLOAD_ENCAP_4ADDR = BIT(1),
+};
+
/**
* struct ieee80211_vif - per-interface data
*
@@ -1623,6 +1638,11 @@ enum ieee80211_vif_flags {
* these need to be set (or cleared) when the interface is added
* or, if supported by the driver, the interface type is changed
* at runtime, mac80211 will never touch this field
+ * @offloaad_flags: hardware offload capabilities/flags for this interface.
+ * These are initialized by mac80211 before calling .add_interface,
+ * .change_interface or .update_vif_offload and updated by the driver
+ * within these ops, based on supported features or runtime change
+ * restrictions.
* @hw_queue: hardware queue for each AC
* @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only
* @chanctx_conf: The channel context this interface is assigned to, or %NULL
@@ -1659,6 +1679,7 @@ struct ieee80211_vif {
struct ieee80211_chanctx_conf __rcu *chanctx_conf;
u32 driver_flags;
+ u32 offload_flags;
#ifdef CPTCFG_MAC80211_DEBUGFS
struct dentry *debugfs_dir;
@@ -2325,6 +2346,9 @@ struct ieee80211_txq {
* aggregating MPDUs with the same keyid, allowing mac80211 to keep Tx
* A-MPDU sessions active while rekeying with Extended Key ID.
*
+ * @IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD: Hardware supports tx encapsulation
+ * offload
+ *
* @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
*/
enum ieee80211_hw_flags {
@@ -2377,6 +2401,7 @@ enum ieee80211_hw_flags {
IEEE80211_HW_SUPPORTS_MULTI_BSSID,
IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID,
IEEE80211_HW_AMPDU_KEYBORDER_SUPPORT,
+ IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD,
/* keep last, obviously */
NUM_IEEE80211_HW_FLAGS
@@ -3811,6 +3836,8 @@ enum ieee80211_reconfig_type {
* @set_tid_config: Apply TID specific configurations. This callback may sleep.
* @reset_tid_config: Reset TID specific configuration for the peer.
* This callback may sleep.
+ * @update_vif_config: Update virtual interface offload flags
+ * This callback may sleep.
*/
struct ieee80211_ops {
void (*tx)(struct ieee80211_hw *hw,
@@ -4122,6 +4149,8 @@ struct ieee80211_ops {
int (*reset_tid_config)(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta, u8 tids);
+ void (*update_vif_offload)(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif);
};
/**
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -504,6 +504,7 @@ static int ieee80211_del_key(struct wiph
struct ieee80211_local *local = sdata->local;
struct sta_info *sta;
struct ieee80211_key *key = NULL;
+ bool recalc_offload = false;
int ret;
mutex_lock(&local->sta_mtx);
@@ -528,6 +529,7 @@ static int ieee80211_del_key(struct wiph
goto out_unlock;
}
+ recalc_offload = key->conf.cipher == WLAN_CIPHER_SUITE_TKIP;
ieee80211_key_free(key, sdata->vif.type == NL80211_IFTYPE_STATION);
ret = 0;
@@ -535,6 +537,9 @@ static int ieee80211_del_key(struct wiph
mutex_unlock(&local->key_mtx);
mutex_unlock(&local->sta_mtx);
+ if (recalc_offload)
+ ieee80211_recalc_offload(local);
+
return ret;
}
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -408,6 +408,7 @@ static const char *hw_flag_names[] = {
FLAG(SUPPORTS_MULTI_BSSID),
FLAG(SUPPORTS_ONLY_HE_MULTI_BSSID),
FLAG(AMPDU_KEYBORDER_SUPPORT),
+ FLAG(SUPPORTS_TX_ENCAP_OFFLOAD),
#undef FLAG
};
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1385,4 +1385,19 @@ static inline int drv_reset_tid_config(s
return ret;
}
+
+static inline void drv_update_vif_offload(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata)
+{
+ might_sleep();
+ check_sdata_in_driver(sdata);
+
+ if (!local->ops->update_vif_offload)
+ return;
+
+ trace_drv_update_vif_offload(local, sdata);
+ local->ops->update_vif_offload(&local->hw, &sdata->vif);
+ trace_drv_return_void(local);
+}
+
#endif /* __MAC80211_DRIVER_OPS */
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -990,8 +990,6 @@ struct ieee80211_sub_if_data {
} debugfs;
#endif
- bool hw_80211_encap;
-
/* must be last, dynamically sized area in this! */
struct ieee80211_vif vif;
};
@@ -1769,6 +1767,7 @@ void ieee80211_del_virtual_monitor(struc
bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata);
void ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata,
bool update_bss);
+void ieee80211_recalc_offload(struct ieee80211_local *local);
static inline bool ieee80211_sdata_running(struct ieee80211_sub_if_data *sdata)
{
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -43,6 +43,7 @@
*/
static void ieee80211_iface_work(struct work_struct *work);
+static void ieee80211_set_vif_encap_ops(struct ieee80211_sub_if_data *sdata);
bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata)
{
@@ -348,6 +349,99 @@ static int ieee80211_check_queues(struct
return 0;
}
+static bool ieee80211_iftype_supports_encap_offload(enum nl80211_iftype iftype)
+{
+ switch (iftype) {
+ case NL80211_IFTYPE_AP:
+ case NL80211_IFTYPE_P2P_GO:
+ case NL80211_IFTYPE_P2P_CLIENT:
+ case NL80211_IFTYPE_STATION:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static bool ieee80211_set_sdata_offload_flags(struct ieee80211_sub_if_data *sdata)
+{
+ struct ieee80211_local *local = sdata->local;
+ struct ieee80211_key *key;
+ u32 flags;
+
+ flags = sdata->vif.offload_flags;
+
+ if (ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD) &&
+ ieee80211_iftype_supports_encap_offload(sdata->vif.type)) {
+ flags |= IEEE80211_OFFLOAD_ENCAP_ENABLED;
+ mutex_lock(&local->key_mtx);
+ list_for_each_entry(key, &sdata->key_list, list) {
+ if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
+ key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
+ key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256 ||
+ key->conf.cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256)
+ continue;
+ if (key->conf.cipher == WLAN_CIPHER_SUITE_TKIP ||
+ !(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))
+ flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED;
+ }
+ mutex_unlock(&local->key_mtx);
+
+ if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_FRAG) &&
+ local->hw.wiphy->frag_threshold != (u32)-1)
+ flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED;
+
+ if (local->monitors)
+ flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED;
+ } else {
+ flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED;
+ }
+
+ if (sdata->vif.offload_flags == flags)
+ return false;
+
+ sdata->vif.offload_flags = flags;
+ return true;
+}
+
+
+static void ieee80211_recalc_sdata_offload(struct ieee80211_sub_if_data *sdata)
+{
+ struct ieee80211_local *local = sdata->local;
+ struct ieee80211_sub_if_data *vsdata;
+
+ if (ieee80211_set_sdata_offload_flags(sdata)) {
+ drv_update_vif_offload(local, sdata);
+ ieee80211_set_vif_encap_ops(sdata);
+ }
+
+ list_for_each_entry(vsdata, &local->interfaces, list) {
+ if (vsdata->vif.type != NL80211_IFTYPE_AP_VLAN ||
+ vsdata->bss != &sdata->u.ap)
+ continue;
+
+ ieee80211_set_vif_encap_ops(vsdata);
+ }
+}
+
+void ieee80211_recalc_offload(struct ieee80211_local *local)
+{
+ struct ieee80211_sub_if_data *sdata;
+
+ if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD))
+ return;
+
+ mutex_lock(&local->iflist_mtx);
+
+ list_for_each_entry(sdata, &local->interfaces, list) {
+ if (!ieee80211_sdata_running(sdata))
+ continue;
+
+ ieee80211_recalc_sdata_offload(sdata);
+ }
+
+ mutex_unlock(&local->iflist_mtx);
+}
+
void ieee80211_adjust_monitor_flags(struct ieee80211_sub_if_data *sdata,
const int offset)
{
@@ -587,6 +681,7 @@ int ieee80211_do_open(struct wireless_de
if (rtnl_dereference(sdata->bss->beacon)) {
ieee80211_vif_vlan_copy_chanctx(sdata);
netif_carrier_on(dev);
+ ieee80211_set_vif_encap_ops(sdata);
} else {
netif_carrier_off(dev);
}
@@ -616,6 +711,7 @@ int ieee80211_do_open(struct wireless_de
ieee80211_adjust_monitor_flags(sdata, 1);
ieee80211_configure_filter(local);
+ ieee80211_recalc_offload(local);
mutex_lock(&local->mtx);
ieee80211_recalc_idle(local);
mutex_unlock(&local->mtx);
@@ -625,10 +721,13 @@ int ieee80211_do_open(struct wireless_de
default:
if (coming_up) {
ieee80211_del_virtual_monitor(local);
+ ieee80211_set_sdata_offload_flags(sdata);
res = drv_add_interface(local, sdata);
if (res)
goto err_stop;
+
+ ieee80211_set_vif_encap_ops(sdata);
res = ieee80211_check_queues(sdata,
ieee80211_vif_type_p2p(&sdata->vif));
if (res)
@@ -1286,61 +1385,6 @@ static const struct net_device_ops ieee8
};
-static void __ieee80211_set_hw_80211_encap(struct ieee80211_sub_if_data *sdata,
- bool enable)
-{
- sdata->dev->netdev_ops = enable ? &ieee80211_dataif_8023_ops :
- &ieee80211_dataif_ops;
- sdata->hw_80211_encap = enable;
-}
-
-bool ieee80211_set_hw_80211_encap(struct ieee80211_vif *vif, bool enable)
-{
- struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
- struct ieee80211_local *local = sdata->local;
- struct ieee80211_sub_if_data *iter;
- struct ieee80211_key *key;
-
- mutex_lock(&local->iflist_mtx);
- list_for_each_entry(iter, &local->interfaces, list) {
- struct ieee80211_sub_if_data *disable = NULL;
-
- if (vif->type == NL80211_IFTYPE_MONITOR) {
- disable = iter;
- __ieee80211_set_hw_80211_encap(iter, false);
- } else if (iter->vif.type == NL80211_IFTYPE_MONITOR) {
- disable = sdata;
- enable = false;
- }
- if (disable)
- sdata_dbg(disable,
- "disable hw 80211 encap due to mon co-exist\n");
- }
- mutex_unlock(&local->iflist_mtx);
-
- if (enable == sdata->hw_80211_encap)
- return enable;
-
- if (!sdata->dev)
- return false;
-
- if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_FRAG) &&
- (local->hw.wiphy->frag_threshold != (u32)-1))
- enable = false;
-
- mutex_lock(&sdata->local->key_mtx);
- list_for_each_entry(key, &sdata->key_list, list) {
- if (key->conf.cipher == WLAN_CIPHER_SUITE_TKIP)
- enable = false;
- }
- mutex_unlock(&sdata->local->key_mtx);
-
- __ieee80211_set_hw_80211_encap(sdata, enable);
-
- return enable;
-}
-EXPORT_SYMBOL(ieee80211_set_hw_80211_encap);
-
static void ieee80211_if_free(struct net_device *dev)
{
free_percpu(netdev_tstats(dev));
@@ -1371,6 +1415,51 @@ static void ieee80211_if_setup_no_queue(
#endif
}
+static void ieee80211_set_vif_encap_ops(struct ieee80211_sub_if_data *sdata)
+{
+ struct ieee80211_local *local = sdata->local;
+ struct ieee80211_sub_if_data *bss = sdata;
+ struct ieee80211_key *key;
+ bool enabled;
+
+ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
+ if (!sdata->bss)
+ return;
+
+ bss = container_of(sdata->bss, struct ieee80211_sub_if_data, u.ap);
+ }
+
+ if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD) ||
+ !ieee80211_iftype_supports_encap_offload(bss->vif.type))
+ return;
+
+ enabled = bss->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED;
+ if (sdata->wdev.use_4addr &&
+ !(bss->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_4ADDR))
+ enabled = false;
+
+ /*
+ * Encapsulation offload cannot be used with software crypto, and a per-VLAN
+ * key may have been set
+ */
+ if (enabled && sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
+ mutex_lock(&local->key_mtx);
+ list_for_each_entry(key, &sdata->key_list, list) {
+ if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
+ key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
+ key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256 ||
+ key->conf.cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256)
+ continue;
+ if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))
+ enabled = false;
+ }
+ mutex_unlock(&local->key_mtx);
+ }
+
+ sdata->dev->netdev_ops = enabled ? &ieee80211_dataif_8023_ops :
+ &ieee80211_dataif_ops;
+}
+
static void ieee80211_iface_work(struct work_struct *work)
{
struct ieee80211_sub_if_data *sdata =
@@ -1553,7 +1642,6 @@ static void ieee80211_setup_sdata(struct
sdata->vif.bss_conf.txpower = INT_MIN; /* unset */
sdata->noack_map = 0;
- sdata->hw_80211_encap = false;
/* only monitor/p2p-device differ */
if (sdata->dev) {
@@ -1688,6 +1776,7 @@ static int ieee80211_runtime_change_ifty
ieee80211_teardown_sdata(sdata);
+ ieee80211_set_sdata_offload_flags(sdata);
ret = drv_change_interface(local, sdata, internal_type, p2p);
if (ret)
type = ieee80211_vif_type_p2p(&sdata->vif);
@@ -1700,6 +1789,7 @@ static int ieee80211_runtime_change_ifty
ieee80211_check_queues(sdata, type);
ieee80211_setup_sdata(sdata, type);
+ ieee80211_set_vif_encap_ops(sdata);
err = ieee80211_do_open(&sdata->wdev, false);
WARN(err, "type change: do_open returned %d", err);
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -177,13 +177,6 @@ static int ieee80211_key_enable_hw_accel
}
}
- /* TKIP countermeasures don't work in encap offload mode */
- if (key->conf.cipher == WLAN_CIPHER_SUITE_TKIP &&
- sdata->hw_80211_encap) {
- sdata_dbg(sdata, "TKIP is not allowed in hw 80211 encap mode\n");
- return -EINVAL;
- }
-
ret = drv_set_key(key->local, SET_KEY, sdata,
sta ? &sta->sta : NULL, &key->conf);
@@ -219,14 +212,6 @@ static int ieee80211_key_enable_hw_accel
case WLAN_CIPHER_SUITE_CCMP_256:
case WLAN_CIPHER_SUITE_GCMP:
case WLAN_CIPHER_SUITE_GCMP_256:
- /* We cannot do software crypto of data frames with
- * encapsulation offload enabled. However for 802.11w to
- * function properly we need cmac/gmac keys.
- */
- if (sdata->hw_80211_encap)
- return -EINVAL;
- /* Fall through */
-
case WLAN_CIPHER_SUITE_AES_CMAC:
case WLAN_CIPHER_SUITE_BIP_CMAC_256:
case WLAN_CIPHER_SUITE_BIP_GMAC_128:
@@ -824,6 +809,7 @@ int ieee80211_key_link(struct ieee80211_
*/
bool delay_tailroom = sdata->vif.type == NL80211_IFTYPE_STATION;
int ret = -EOPNOTSUPP;
+ bool recalc_offload = false;
mutex_lock(&sdata->local->key_mtx);
@@ -864,11 +850,15 @@ int ieee80211_key_link(struct ieee80211_
key->local = sdata->local;
key->sdata = sdata;
key->sta = sta;
+ recalc_offload = !old_key && key->conf.cipher == WLAN_CIPHER_SUITE_TKIP;
increment_tailroom_need_count(sdata);
ret = ieee80211_key_replace(sdata, sta, pairwise, old_key, key);
+ if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))
+ recalc_offload = true;
+
if (!ret) {
ieee80211_debugfs_key_add(key);
ieee80211_key_destroy(old_key, delay_tailroom);
@@ -879,6 +869,9 @@ int ieee80211_key_link(struct ieee80211_
out:
mutex_unlock(&sdata->local->key_mtx);
+ if (recalc_offload)
+ ieee80211_recalc_offload(sdata->local);
+
return ret;
}
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -2733,6 +2733,12 @@ TRACE_EVENT(drv_get_ftm_responder_stats,
)
);
+DEFINE_EVENT(local_sdata_addr_evt, drv_update_vif_offload,
+ TP_PROTO(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata),
+ TP_ARGS(local, sdata)
+);
+
#endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
#undef TRACE_INCLUDE_PATH
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -4270,11 +4270,6 @@ netdev_tx_t ieee80211_subif_start_xmit_8
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct sta_info *sta;
- if (WARN_ON(!sdata->hw_80211_encap)) {
- kfree_skb(skb);
- return NETDEV_TX_OK;
- }
-
if (unlikely(skb->len < ETH_HLEN)) {
kfree_skb(skb);
return NETDEV_TX_OK;

View File

@ -0,0 +1,197 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Mon, 17 Aug 2020 13:16:59 +0200
Subject: [PATCH] mac80211: reduce duplication in tx status functions
Move redundant functionality from __ieee80211_tx_status into
ieee80211_tx_status_ext. Preparation for unifying with the 802.3 tx status
codepath.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -184,18 +184,6 @@ static void ieee80211_frame_acked(struct
struct ieee80211_mgmt *mgmt = (void *) skb->data;
struct ieee80211_local *local = sta->local;
struct ieee80211_sub_if_data *sdata = sta->sdata;
- struct ieee80211_tx_info *txinfo = IEEE80211_SKB_CB(skb);
-
- if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) {
- sta->status_stats.last_ack = jiffies;
- if (txinfo->status.is_valid_ack_signal) {
- sta->status_stats.last_ack_signal =
- (s8)txinfo->status.ack_signal;
- sta->status_stats.ack_signal_filled = true;
- ewma_avg_signal_add(&sta->status_stats.avg_ack_signal,
- -txinfo->status.ack_signal);
- }
- }
if (ieee80211_is_data_qos(mgmt->frame_control)) {
struct ieee80211_hdr *hdr = (void *) skb->data;
@@ -899,7 +887,8 @@ void ieee80211_tx_monitor(struct ieee802
}
static void __ieee80211_tx_status(struct ieee80211_hw *hw,
- struct ieee80211_tx_status *status)
+ struct ieee80211_tx_status *status,
+ int rates_idx, int retry_count)
{
struct sk_buff *skb = status->skb;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
@@ -908,8 +897,6 @@ static void __ieee80211_tx_status(struct
struct sta_info *sta;
__le16 fc;
struct ieee80211_supported_band *sband;
- int retry_count;
- int rates_idx;
bool send_to_cooked;
bool acked;
bool noack_success;
@@ -918,8 +905,6 @@ static void __ieee80211_tx_status(struct
int tid = IEEE80211_NUM_TIDS;
u16 tx_time_est;
- rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count);
-
sband = local->hw.wiphy->bands[info->band];
fc = hdr->frame_control;
@@ -996,24 +981,14 @@ static void __ieee80211_tx_status(struct
if (info->flags & IEEE80211_TX_STAT_TX_FILTERED) {
ieee80211_handle_filtered_frame(local, sta, skb);
return;
- } else {
+ } else if (ieee80211_is_data_present(fc)) {
if (!acked && !noack_success)
- sta->status_stats.retry_failed++;
- sta->status_stats.retry_count += retry_count;
-
- if (ieee80211_is_data_present(fc)) {
- if (!acked && !noack_success)
- sta->status_stats.msdu_failed[tid]++;
+ sta->status_stats.msdu_failed[tid]++;
- sta->status_stats.msdu_retries[tid] +=
- retry_count;
- }
+ sta->status_stats.msdu_retries[tid] +=
+ retry_count;
}
- rate_control_tx_status(local, sband, status);
- if (ieee80211_vif_is_mesh(&sta->sdata->vif))
- ieee80211s_update_metric(local, sta, status);
-
if (!(info->flags & IEEE80211_TX_CTL_INJECTED) && acked)
ieee80211_frame_acked(sta, skb);
@@ -1038,20 +1013,6 @@ static void __ieee80211_tx_status(struct
true);
ieee80211_info_set_tx_time_est(info, 0);
}
-
- if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) {
- if (acked) {
- if (sta->status_stats.lost_packets)
- sta->status_stats.lost_packets = 0;
-
- /* Track when last TDLS packet was ACKed */
- sta->status_stats.last_pkt_time = jiffies;
- } else if (noack_success) {
- /* nothing to do here, do not account as lost */
- } else {
- ieee80211_lost_packet(sta, info);
- }
- }
}
/* SNMP counters
@@ -1135,7 +1096,7 @@ void ieee80211_tx_status(struct ieee8021
if (sta)
status.sta = &sta->sta;
- __ieee80211_tx_status(hw, &status);
+ ieee80211_tx_status_ext(hw, &status);
rcu_read_unlock();
}
EXPORT_SYMBOL(ieee80211_tx_status);
@@ -1148,7 +1109,7 @@ void ieee80211_tx_status_ext(struct ieee
struct ieee80211_sta *pubsta = status->sta;
struct ieee80211_supported_band *sband;
struct sta_info *sta;
- int retry_count;
+ int rates_idx, retry_count;
bool acked, noack_success;
if (pubsta) {
@@ -1158,13 +1119,7 @@ void ieee80211_tx_status_ext(struct ieee
sta->tx_stats.last_rate_info = *status->rate;
}
- if (status->skb)
- return __ieee80211_tx_status(hw, status);
-
- if (!status->sta)
- return;
-
- ieee80211_tx_get_rates(hw, info, &retry_count);
+ rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count);
sband = hw->wiphy->bands[info->band];
@@ -1176,20 +1131,30 @@ void ieee80211_tx_status_ext(struct ieee
sta->status_stats.retry_failed++;
sta->status_stats.retry_count += retry_count;
- if (acked) {
- sta->status_stats.last_ack = jiffies;
+ if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) {
+ if (acked) {
+ sta->status_stats.last_ack = jiffies;
- if (sta->status_stats.lost_packets)
- sta->status_stats.lost_packets = 0;
+ if (sta->status_stats.lost_packets)
+ sta->status_stats.lost_packets = 0;
- /* Track when last packet was ACKed */
- sta->status_stats.last_pkt_time = jiffies;
- } else if (test_sta_flag(sta, WLAN_STA_PS_STA)) {
- return;
- } else if (noack_success) {
- /* nothing to do here, do not account as lost */
- } else {
- ieee80211_lost_packet(sta, info);
+ /* Track when last packet was ACKed */
+ sta->status_stats.last_pkt_time = jiffies;
+
+ if (info->status.is_valid_ack_signal) {
+ sta->status_stats.last_ack_signal =
+ (s8)info->status.ack_signal;
+ sta->status_stats.ack_signal_filled = true;
+ ewma_avg_signal_add(&sta->status_stats.avg_ack_signal,
+ -info->status.ack_signal);
+ }
+ } else if (test_sta_flag(sta, WLAN_STA_PS_STA)) {
+ return;
+ } else if (noack_success) {
+ /* nothing to do here, do not account as lost */
+ } else {
+ ieee80211_lost_packet(sta, info);
+ }
}
rate_control_tx_status(local, sband, status);
@@ -1197,6 +1162,10 @@ void ieee80211_tx_status_ext(struct ieee
ieee80211s_update_metric(local, sta, status);
}
+ if (status->skb)
+ return __ieee80211_tx_status(hw, status, rates_idx,
+ retry_count);
+
if (acked || noack_success) {
I802_DEBUG_INC(local->dot11TransmittedFrameCount);
if (!pubsta)

View File

@ -0,0 +1,26 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Mon, 17 Aug 2020 13:29:12 +0200
Subject: [PATCH] mac80211: remove tx status call to
ieee80211_sta_register_airtime
All drivers using airtime fairness are calling ieee80211_sta_register_airtime
directly
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -997,12 +997,6 @@ static void __ieee80211_tx_status(struct
ieee80211_sta_tx_notify(sta->sdata, (void *) skb->data,
acked, info->status.tx_time);
- if (info->status.tx_time &&
- wiphy_ext_feature_isset(local->hw.wiphy,
- NL80211_EXT_FEATURE_AIRTIME_FAIRNESS))
- ieee80211_sta_register_airtime(&sta->sta, tid,
- info->status.tx_time, 0);
-
if ((tx_time_est = ieee80211_info_get_tx_time_est(info)) > 0) {
/* Do this here to avoid the expensive lookup of the sta
* in ieee80211_report_used_skb().

View File

@ -0,0 +1,174 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Mon, 17 Aug 2020 13:29:56 +0200
Subject: [PATCH] mac80211: optimize station connection monitor
Calling mod_timer for every rx/tx packet can be quite expensive.
Instead of constantly updating the timer, we can simply let it run out
and check the timestamp of the last ACK or rx packet to re-arm it.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2045,8 +2045,6 @@ void ieee80211_dynamic_ps_timer(struct t
void ieee80211_send_nullfunc(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
bool powersave);
-void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata,
- struct ieee80211_hdr *hdr);
void ieee80211_sta_tx_notify(struct ieee80211_sub_if_data *sdata,
struct ieee80211_hdr *hdr, bool ack, u16 tx_time);
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2432,23 +2432,6 @@ static void ieee80211_set_disassoc(struc
sdata->encrypt_headroom = IEEE80211_ENCRYPT_HEADROOM;
}
-void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata,
- struct ieee80211_hdr *hdr)
-{
- /*
- * We can postpone the mgd.timer whenever receiving unicast frames
- * from AP because we know that the connection is working both ways
- * at that time. But multicast frames (and hence also beacons) must
- * be ignored here, because we need to trigger the timer during
- * data idle periods for sending the periodic probe request to the
- * AP we're connected to.
- */
- if (is_multicast_ether_addr(hdr->addr1))
- return;
-
- ieee80211_sta_reset_conn_monitor(sdata);
-}
-
static void ieee80211_reset_ap_probe(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
@@ -2521,21 +2504,13 @@ void ieee80211_sta_tx_notify(struct ieee
{
ieee80211_sta_tx_wmm_ac_notify(sdata, hdr, tx_time);
- if (!ieee80211_is_data(hdr->frame_control))
- return;
-
- if (ieee80211_is_any_nullfunc(hdr->frame_control) &&
- sdata->u.mgd.probe_send_count > 0) {
- if (ack)
- ieee80211_sta_reset_conn_monitor(sdata);
- else
- sdata->u.mgd.nullfunc_failed = true;
- ieee80211_queue_work(&sdata->local->hw, &sdata->work);
+ if (!ieee80211_is_any_nullfunc(hdr->frame_control) ||
+ !sdata->u.mgd.probe_send_count)
return;
- }
- if (ack)
- ieee80211_sta_reset_conn_monitor(sdata);
+ if (!ack)
+ sdata->u.mgd.nullfunc_failed = true;
+ ieee80211_queue_work(&sdata->local->hw, &sdata->work);
}
static void ieee80211_mlme_send_probe_req(struct ieee80211_sub_if_data *sdata,
@@ -3600,8 +3575,8 @@ static bool ieee80211_assoc_success(stru
* Start timer to probe the connection to the AP now.
* Also start the timer that will detect beacon loss.
*/
- ieee80211_sta_rx_notify(sdata, (struct ieee80211_hdr *)mgmt);
ieee80211_sta_reset_beacon_monitor(sdata);
+ ieee80211_sta_reset_conn_monitor(sdata);
ret = true;
out:
@@ -4569,10 +4544,26 @@ static void ieee80211_sta_conn_mon_timer
from_timer(sdata, t, u.mgd.conn_mon_timer);
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
struct ieee80211_local *local = sdata->local;
+ struct sta_info *sta;
+ unsigned long timeout;
if (sdata->vif.csa_active && !ifmgd->csa_waiting_bcn)
return;
+ sta = sta_info_get(sdata, ifmgd->bssid);
+ if (!sta)
+ return;
+
+ timeout = sta->status_stats.last_ack;
+ if (time_before(sta->status_stats.last_ack, sta->rx_stats.last_rx))
+ timeout = sta->rx_stats.last_rx;
+ timeout += IEEE80211_CONNECTION_IDLE_TIME;
+
+ if (time_is_before_jiffies(timeout)) {
+ mod_timer(&ifmgd->conn_mon_timer, round_jiffies_up(timeout));
+ return;
+ }
+
ieee80211_queue_work(&local->hw, &ifmgd->monitor_work);
}
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1811,9 +1811,6 @@ ieee80211_rx_h_sta_process(struct ieee80
sta->rx_stats.last_rate = sta_stats_encode_rate(status);
}
- if (rx->sdata->vif.type == NL80211_IFTYPE_STATION)
- ieee80211_sta_rx_notify(rx->sdata, hdr);
-
sta->rx_stats.fragments++;
u64_stats_update_begin(&rx->sta->rx_stats.syncp);
@@ -4148,7 +4145,6 @@ void ieee80211_check_fast_rx(struct sta_
fastrx.sa_offs = offsetof(struct ieee80211_hdr, addr2);
fastrx.expected_ds_bits = 0;
} else {
- fastrx.sta_notify = sdata->u.mgd.probe_send_count > 0;
fastrx.da_offs = offsetof(struct ieee80211_hdr, addr1);
fastrx.sa_offs = offsetof(struct ieee80211_hdr, addr3);
fastrx.expected_ds_bits =
@@ -4378,11 +4374,6 @@ static bool ieee80211_invoke_fast_rx(str
pskb_trim(skb, skb->len - fast_rx->icv_len))
goto drop;
- if (unlikely(fast_rx->sta_notify)) {
- ieee80211_sta_rx_notify(rx->sdata, hdr);
- fast_rx->sta_notify = false;
- }
-
/* statistics part of ieee80211_rx_h_sta_process() */
if (!(status->flag & RX_FLAG_NO_SIGNAL_VAL)) {
stats->last_signal = status->signal;
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -336,7 +336,6 @@ struct ieee80211_fast_tx {
* @expected_ds_bits: from/to DS bits expected
* @icv_len: length of the MIC if present
* @key: bool indicating encryption is expected (key is set)
- * @sta_notify: notify the MLME code (once)
* @internal_forward: forward froms internally on AP/VLAN type interfaces
* @uses_rss: copy of USES_RSS hw flag
* @da_offs: offset of the DA in the header (for header conversion)
@@ -352,7 +351,6 @@ struct ieee80211_fast_rx {
__le16 expected_ds_bits;
u8 icv_len;
u8 key:1,
- sta_notify:1,
internal_forward:1,
uses_rss:1;
u8 da_offs, sa_offs;
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -1227,9 +1227,6 @@ void ieee80211_tx_status_8023(struct iee
sta->status_stats.retry_count += retry_count;
if (ieee80211_hw_check(hw, REPORTS_TX_ACK_STATUS)) {
- if (acked && vif->type == NL80211_IFTYPE_STATION)
- ieee80211_sta_reset_conn_monitor(sdata);
-
sta->status_stats.last_ack = jiffies;
if (info->flags & IEEE80211_TX_STAT_ACK) {
if (sta->status_stats.lost_packets)

View File

@ -0,0 +1,227 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Mon, 17 Aug 2020 13:35:32 +0200
Subject: [PATCH] mac80211: swap NEED_TXPROCESSING and HW_80211_ENCAP tx
flags
In order to unify the tx status path, the hw 802.11 encapsulation flag
needs to survive the trip to the tx status call.
Since we don't have any free bits in info->flags, we need to move one.
IEEE80211_TX_INTFL_NEED_TXPROCESSING is only used internally in mac80211,
and only before the call into the driver.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
@@ -14,7 +14,7 @@ ath11k_dp_tx_get_encap_type(struct ath11
{
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
- if (tx_info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP)
+ if (tx_info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)
return HAL_TCL_ENCAP_TYPE_ETHERNET;
return HAL_TCL_ENCAP_TYPE_NATIVE_WIFI;
@@ -93,7 +93,7 @@ int ath11k_dp_tx(struct ath11k *ar, stru
if (test_bit(ATH11K_FLAG_CRASH_FLUSH, &ar->ab->dev_flags))
return -ESHUTDOWN;
- if (!(info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) &&
+ if (!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) &&
!ieee80211_is_data(hdr->frame_control))
return -ENOTSUPP;
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -3749,7 +3749,7 @@ static int ath11k_mac_mgmt_tx_wmi(struct
return -ENOSPC;
info = IEEE80211_SKB_CB(skb);
- if (!(info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP)) {
+ if (!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)) {
if ((ieee80211_is_action(hdr->frame_control) ||
ieee80211_is_deauth(hdr->frame_control) ||
ieee80211_is_disassoc(hdr->frame_control)) &&
@@ -3876,7 +3876,7 @@ static void ath11k_mac_op_tx(struct ieee
bool is_prb_rsp;
int ret;
- if (info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) {
+ if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) {
skb_cb->flags |= ATH11K_SKB_HW_80211_ENCAP;
} else if (ieee80211_is_mgmt(hdr->frame_control)) {
is_prb_rsp = ieee80211_is_probe_resp(hdr->frame_control);
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -720,9 +720,8 @@ struct ieee80211_bss_conf {
* @IEEE80211_TX_INTFL_OFFCHAN_TX_OK: Internal to mac80211. Used to indicate
* that a frame can be transmitted while the queues are stopped for
* off-channel operation.
- * @IEEE80211_TX_INTFL_NEED_TXPROCESSING: completely internal to mac80211,
- * used to indicate that a pending frame requires TX processing before
- * it can be sent out.
+ * @IEEE80211_TX_CTL_HW_80211_ENCAP: This frame uses hardware encapsulation
+ * (header conversion)
* @IEEE80211_TX_INTFL_RETRIED: completely internal to mac80211,
* used to indicate that a frame was already retried due to PS
* @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211,
@@ -791,7 +790,7 @@ enum mac80211_tx_info_flags {
IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11),
IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12),
IEEE80211_TX_INTFL_OFFCHAN_TX_OK = BIT(13),
- IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14),
+ IEEE80211_TX_CTL_HW_80211_ENCAP = BIT(14),
IEEE80211_TX_INTFL_RETRIED = BIT(15),
IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16),
IEEE80211_TX_CTL_NO_PS_BUFFER = BIT(17),
@@ -823,8 +822,9 @@ enum mac80211_tx_info_flags {
* @IEEE80211_TX_CTRL_AMSDU: This frame is an A-MSDU frame
* @IEEE80211_TX_CTRL_FAST_XMIT: This frame is going through the fast_xmit path
* @IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP: This frame skips mesh path lookup
- * @IEEE80211_TX_CTRL_HW_80211_ENCAP: This frame uses hardware encapsulation
- * (header conversion)
+ * @IEEE80211_TX_INTCFL_NEED_TXPROCESSING: completely internal to mac80211,
+ * used to indicate that a pending frame requires TX processing before
+ * it can be sent out.
*
* These flags are used in tx_info->control.flags.
*/
@@ -835,7 +835,7 @@ enum mac80211_tx_control_flags {
IEEE80211_TX_CTRL_AMSDU = BIT(3),
IEEE80211_TX_CTRL_FAST_XMIT = BIT(4),
IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP = BIT(5),
- IEEE80211_TX_CTRL_HW_80211_ENCAP = BIT(6),
+ IEEE80211_TX_INTCFL_NEED_TXPROCESSING = BIT(6),
};
/*
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -212,7 +212,7 @@ static void prepare_frame_for_deferred_t
skb->priority = 7;
info->control.vif = &sdata->vif;
- info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
+ info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
ieee80211_set_qos_hdr(sdata, skb);
ieee80211_mps_set_frame_flags(sdata, NULL, hdr);
}
@@ -1163,7 +1163,7 @@ int mesh_nexthop_resolve(struct ieee8021
if (skb_queue_len(&mpath->frame_queue) >= MESH_FRAME_QUEUE_LEN)
skb_to_free = skb_dequeue(&mpath->frame_queue);
- info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
+ info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
ieee80211_set_qos_hdr(sdata, skb);
skb_queue_tail(&mpath->frame_queue, skb);
if (skb_to_free)
--- a/net/mac80211/mesh_ps.c
+++ b/net/mac80211/mesh_ps.c
@@ -432,7 +432,7 @@ static void mpsp_qos_null_append(struct
info = IEEE80211_SKB_CB(new_skb);
info->control.vif = &sdata->vif;
- info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
+ info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
__skb_queue_tail(frames, new_skb);
}
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2896,7 +2896,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
fwd_hdr->frame_control &= ~cpu_to_le16(IEEE80211_FCTL_RETRY);
info = IEEE80211_SKB_CB(fwd_skb);
memset(info, 0, sizeof(*info));
- info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
+ info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
info->control.vif = &rx->sdata->vif;
info->control.jiffies = jiffies;
if (is_multicast_ether_addr(fwd_hdr->addr1)) {
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -66,8 +66,8 @@ static void ieee80211_handle_filtered_fr
info->control.jiffies = jiffies;
info->control.vif = &sta->sdata->vif;
- info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING |
- IEEE80211_TX_INTFL_RETRANSMISSION;
+ info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
+ info->flags |= IEEE80211_TX_INTFL_RETRANSMISSION;
info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS;
sta->status_stats.filtered++;
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -530,7 +530,7 @@ ieee80211_tx_h_unicast_ps_buf(struct iee
info->control.jiffies = jiffies;
info->control.vif = &tx->sdata->vif;
- info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
+ info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS;
skb_queue_tail(&sta->ps_tx_buf[ac], tx->skb);
spin_unlock(&sta->ps_lock);
@@ -1132,7 +1132,7 @@ static bool ieee80211_tx_prep_agg(struct
tx->sta->sta.addr, tx->sta->sta.aid);
}
info->control.vif = &tx->sdata->vif;
- info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
+ info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS;
__skb_queue_tail(&tid_tx->pending, skb);
if (skb_queue_len(&tid_tx->pending) > STA_MAX_TX_BUFFER)
@@ -1177,7 +1177,7 @@ ieee80211_tx_prepare(struct ieee80211_su
* we are doing the needed processing, so remove the flag
* now.
*/
- info->flags &= ~IEEE80211_TX_INTFL_NEED_TXPROCESSING;
+ info->control.flags &= ~IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
hdr = (struct ieee80211_hdr *) skb->data;
@@ -1256,7 +1256,7 @@ static struct txq_info *ieee80211_get_tx
(info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE))
return NULL;
- if (!(info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) &&
+ if (!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) &&
unlikely(!ieee80211_is_data_present(hdr->frame_control))) {
if ((!ieee80211_is_mgmt(hdr->frame_control) ||
ieee80211_is_bufferable_mmpdu(hdr->frame_control) ||
@@ -3640,7 +3640,7 @@ begin:
else
info->flags &= ~IEEE80211_TX_CTL_AMPDU;
- if (info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP)
+ if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)
goto encap_out;
if (info->control.flags & IEEE80211_TX_CTRL_FAST_XMIT) {
@@ -4253,7 +4253,7 @@ static void ieee80211_8023_xmit(struct i
sdata = container_of(sdata->bss,
struct ieee80211_sub_if_data, u.ap);
- info->control.flags |= IEEE80211_TX_CTRL_HW_80211_ENCAP;
+ info->flags |= IEEE80211_TX_CTL_HW_80211_ENCAP;
info->control.vif = &sdata->vif;
ieee80211_tx_8023(sdata, skb, skb->len, sta, false);
@@ -4357,7 +4357,7 @@ static bool ieee80211_tx_pending_skb(str
sdata = vif_to_sdata(info->control.vif);
- if (info->flags & IEEE80211_TX_INTFL_NEED_TXPROCESSING) {
+ if (info->control.flags & IEEE80211_TX_INTCFL_NEED_TXPROCESSING) {
chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
if (unlikely(!chanctx_conf)) {
dev_kfree_skb(skb);
@@ -4365,7 +4365,7 @@ static bool ieee80211_tx_pending_skb(str
}
info->band = chanctx_conf->def.chan->band;
result = ieee80211_tx(sdata, NULL, skb, true, 0);
- } else if (info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) {
+ } else if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) {
if (ieee80211_lookup_ra_sta(sdata, skb, &sta)) {
dev_kfree_skb(skb);
return true;

View File

@ -0,0 +1,159 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Mon, 17 Aug 2020 13:54:19 +0200
Subject: [PATCH] mac80211: unify 802.3 (offload) and 802.11 tx status
codepath
Make ieee80211_tx_status_8023 call ieee80211_tx_status_ext, similar to
ieee80211_tx_status.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -903,7 +903,6 @@ static void __ieee80211_tx_status(struct
struct ieee80211_bar *bar;
int shift = 0;
int tid = IEEE80211_NUM_TIDS;
- u16 tx_time_est;
sband = local->hw.wiphy->bands[info->band];
fc = hdr->frame_control;
@@ -996,17 +995,6 @@ static void __ieee80211_tx_status(struct
ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS))
ieee80211_sta_tx_notify(sta->sdata, (void *) skb->data,
acked, info->status.tx_time);
-
- if ((tx_time_est = ieee80211_info_get_tx_time_est(info)) > 0) {
- /* Do this here to avoid the expensive lookup of the sta
- * in ieee80211_report_used_skb().
- */
- ieee80211_sta_update_pending_airtime(local, sta,
- skb_get_queue_mapping(skb),
- tx_time_est,
- true);
- ieee80211_info_set_tx_time_est(info, 0);
- }
}
/* SNMP counters
@@ -1102,9 +1090,11 @@ void ieee80211_tx_status_ext(struct ieee
struct ieee80211_tx_info *info = status->info;
struct ieee80211_sta *pubsta = status->sta;
struct ieee80211_supported_band *sband;
- struct sta_info *sta;
+ struct sk_buff *skb = status->skb;
+ struct sta_info *sta = NULL;
int rates_idx, retry_count;
bool acked, noack_success;
+ u16 tx_time_est;
if (pubsta) {
sta = container_of(pubsta, struct sta_info, sta);
@@ -1156,7 +1146,18 @@ void ieee80211_tx_status_ext(struct ieee
ieee80211s_update_metric(local, sta, status);
}
- if (status->skb)
+ if (skb && (tx_time_est = ieee80211_info_get_tx_time_est(info)) > 0) {
+ /* Do this here to avoid the expensive lookup of the sta
+ * in ieee80211_report_used_skb().
+ */
+ ieee80211_sta_update_pending_airtime(local, sta,
+ skb_get_queue_mapping(skb),
+ tx_time_est,
+ true);
+ ieee80211_info_set_tx_time_est(info, 0);
+ }
+
+ if (skb && !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP))
return __ieee80211_tx_status(hw, status, rates_idx,
retry_count);
@@ -1171,6 +1172,12 @@ void ieee80211_tx_status_ext(struct ieee
} else {
I802_DEBUG_INC(local->dot11FailedCount);
}
+
+ if (!skb)
+ return;
+
+ ieee80211_report_used_skb(local, skb, false);
+ dev_kfree_skb(skb);
}
EXPORT_SYMBOL(ieee80211_tx_status_ext);
@@ -1197,66 +1204,23 @@ void ieee80211_tx_status_8023(struct iee
struct ieee80211_vif *vif,
struct sk_buff *skb)
{
- struct ieee80211_local *local = hw_to_local(hw);
struct ieee80211_sub_if_data *sdata;
- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+ struct ieee80211_tx_status status = {
+ .skb = skb,
+ .info = IEEE80211_SKB_CB(skb),
+ };
struct sta_info *sta;
- int retry_count;
- int rates_idx;
- bool acked;
sdata = vif_to_sdata(vif);
- acked = info->flags & IEEE80211_TX_STAT_ACK;
- rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count);
-
rcu_read_lock();
- if (ieee80211_lookup_ra_sta(sdata, skb, &sta))
- goto counters_update;
-
- if (IS_ERR(sta))
- goto counters_update;
-
- if (!acked)
- sta->status_stats.retry_failed++;
-
- if (rates_idx != -1)
- sta->tx_stats.last_rate = info->status.rates[rates_idx];
-
- sta->status_stats.retry_count += retry_count;
-
- if (ieee80211_hw_check(hw, REPORTS_TX_ACK_STATUS)) {
- sta->status_stats.last_ack = jiffies;
- if (info->flags & IEEE80211_TX_STAT_ACK) {
- if (sta->status_stats.lost_packets)
- sta->status_stats.lost_packets = 0;
+ if (!ieee80211_lookup_ra_sta(sdata, skb, &sta) && !IS_ERR(sta))
+ status.sta = &sta->sta;
- sta->status_stats.last_pkt_time = jiffies;
- } else {
- ieee80211_lost_packet(sta, info);
- }
- }
+ ieee80211_tx_status_ext(hw, &status);
-counters_update:
rcu_read_unlock();
- ieee80211_led_tx(local);
-
- if (!(info->flags & IEEE80211_TX_STAT_ACK) &&
- !(info->flags & IEEE80211_TX_STAT_NOACK_TRANSMITTED))
- goto skip_stats_update;
-
- I802_DEBUG_INC(local->dot11TransmittedFrameCount);
- if (is_multicast_ether_addr(skb->data))
- I802_DEBUG_INC(local->dot11MulticastTransmittedFrameCount);
- if (retry_count > 0)
- I802_DEBUG_INC(local->dot11RetryCount);
- if (retry_count > 1)
- I802_DEBUG_INC(local->dot11MultipleRetryCount);
-
-skip_stats_update:
- ieee80211_report_used_skb(local, skb, false);
- dev_kfree_skb(skb);
}
EXPORT_SYMBOL(ieee80211_tx_status_8023);

View File

@ -0,0 +1,25 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Mon, 17 Aug 2020 13:55:56 +0200
Subject: [PATCH] mac80211: add missing queue/hash initialization to 802.3
xmit
Fixes AQL for encap-offloaded tx
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -4206,6 +4206,12 @@ static void ieee80211_8023_xmit(struct i
if (is_zero_ether_addr(ra))
goto out_free;
+ if (local->ops->wake_tx_queue) {
+ u16 queue = __ieee80211_select_queue(sdata, sta, skb);
+ skb_set_queue_mapping(skb, queue);
+ skb_get_hash(skb);
+ }
+
multicast = is_multicast_ether_addr(ra);
if (sta)

View File

@ -0,0 +1,45 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Mon, 17 Aug 2020 21:11:25 +0200
Subject: [PATCH] mac80211: check and refresh aggregation session in encap
offload tx
Update the last_tx timestamp to avoid tearing down the aggregation session
early. Fall back to the slow path if the session setup is still running
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -4195,6 +4195,8 @@ static void ieee80211_8023_xmit(struct i
bool authorized = false;
bool multicast;
unsigned char *ra = ehdr->h_dest;
+ struct tid_ampdu_tx *tid_tx;
+ u8 tid;
if (IS_ERR(sta) || (sta && !sta->uploaded))
sta = NULL;
@@ -4232,6 +4234,22 @@ static void ieee80211_8023_xmit(struct i
memset(info, 0, sizeof(*info));
+ if (sta) {
+ tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
+ tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
+ if (tid_tx) {
+ if (!test_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state)) {
+ /* fall back to non-offload slow path */
+ __ieee80211_subif_start_xmit(skb, dev, 0, 0, NULL);
+ return;
+ }
+
+ info->flags |= IEEE80211_TX_CTL_AMPDU;
+ if (tid_tx->timeout)
+ tid_tx->last_tx = jiffies;
+ }
+ }
+
if (unlikely(!multicast && skb->sk &&
skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS))
info->ack_frame_id = ieee80211_store_ack_skb(local, skb,

View File

@ -0,0 +1,63 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Thu, 20 Aug 2020 17:27:00 +0200
Subject: [PATCH] mac80211: support using ieee80211_tx_status_ext to free
skbs without status info
For encap-offloaded packets, ieee80211_free_txskb cannot be used, since it
does not have the vif pointer.
Using ieee80211_tx_status_ext for this purpose has the advantage of being able
avoid an extra station lookup for AQL
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -1103,6 +1103,21 @@ void ieee80211_tx_status_ext(struct ieee
sta->tx_stats.last_rate_info = *status->rate;
}
+ if (skb && (tx_time_est =
+ ieee80211_info_get_tx_time_est(IEEE80211_SKB_CB(skb))) > 0) {
+ /* Do this here to avoid the expensive lookup of the sta
+ * in ieee80211_report_used_skb().
+ */
+ ieee80211_sta_update_pending_airtime(local, sta,
+ skb_get_queue_mapping(skb),
+ tx_time_est,
+ true);
+ ieee80211_info_set_tx_time_est(IEEE80211_SKB_CB(skb), 0);
+ }
+
+ if (!status->info)
+ goto free;
+
rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count);
sband = hw->wiphy->bands[info->band];
@@ -1146,17 +1161,6 @@ void ieee80211_tx_status_ext(struct ieee
ieee80211s_update_metric(local, sta, status);
}
- if (skb && (tx_time_est = ieee80211_info_get_tx_time_est(info)) > 0) {
- /* Do this here to avoid the expensive lookup of the sta
- * in ieee80211_report_used_skb().
- */
- ieee80211_sta_update_pending_airtime(local, sta,
- skb_get_queue_mapping(skb),
- tx_time_est,
- true);
- ieee80211_info_set_tx_time_est(info, 0);
- }
-
if (skb && !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP))
return __ieee80211_tx_status(hw, status, rates_idx,
retry_count);
@@ -1173,6 +1177,7 @@ void ieee80211_tx_status_ext(struct ieee
I802_DEBUG_INC(local->dot11FailedCount);
}
+free:
if (!skb)
return;

View File

@ -0,0 +1,53 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 21 Aug 2020 05:49:07 +0200
Subject: [PATCH] mac80211: extend ieee80211_tx_status_ext to support bulk
free
Store processed skbs ready to be freed in a list so the driver bulk free them
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1092,12 +1092,14 @@ ieee80211_info_get_tx_time_est(struct ie
* @info: Basic tx status information
* @skb: Packet skb (can be NULL if not provided by the driver)
* @rate: The TX rate that was used when sending the packet
+ * @free_list: list where processed skbs are stored to be free'd by the driver
*/
struct ieee80211_tx_status {
struct ieee80211_sta *sta;
struct ieee80211_tx_info *info;
struct sk_buff *skb;
struct rate_info *rate;
+ struct list_head *free_list;
};
/**
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -1053,7 +1053,10 @@ static void __ieee80211_tx_status(struct
* with this test...
*/
if (!local->monitors && (!send_to_cooked || !local->cooked_mntrs)) {
- dev_kfree_skb(skb);
+ if (status->free_list)
+ list_add_tail(&skb->list, status->free_list);
+ else
+ dev_kfree_skb(skb);
return;
}
@@ -1182,7 +1185,10 @@ free:
return;
ieee80211_report_used_skb(local, skb, false);
- dev_kfree_skb(skb);
+ if (status->free_list)
+ list_add_tail(&skb->list, status->free_list);
+ else
+ dev_kfree_skb(skb);
}
EXPORT_SYMBOL(ieee80211_tx_status_ext);

View File

@ -0,0 +1,109 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 21 Aug 2020 05:51:58 +0200
Subject: [PATCH] mac80211: notify the driver when a sta uses 4-address
mode
This is needed for encapsulation offload of 4-address mode packets
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3840,6 +3840,8 @@ enum ieee80211_reconfig_type {
* This callback may sleep.
* @update_vif_config: Update virtual interface offload flags
* This callback may sleep.
+ * @sta_set_4addr: Called to notify the driver when a station starts/stops using
+ * 4-address mode
*/
struct ieee80211_ops {
void (*tx)(struct ieee80211_hw *hw,
@@ -4153,6 +4155,8 @@ struct ieee80211_ops {
struct ieee80211_sta *sta, u8 tids);
void (*update_vif_offload)(struct ieee80211_hw *hw,
struct ieee80211_vif *vif);
+ void (*sta_set_4addr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta, bool enabled);
};
/**
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1698,6 +1698,7 @@ static int ieee80211_change_station(stru
rcu_assign_pointer(vlansdata->u.vlan.sta, sta);
__ieee80211_check_fast_rx_iface(vlansdata);
+ drv_sta_set_4addr(local, sta->sdata, &sta->sta, true);
}
if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1400,4 +1400,18 @@ static inline void drv_update_vif_offloa
trace_drv_return_void(local);
}
+static inline void drv_sta_set_4addr(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata,
+ struct ieee80211_sta *sta, bool enabled)
+{
+ sdata = get_bss_sdata(sdata);
+ if (!check_sdata_in_driver(sdata))
+ return;
+
+ trace_drv_sta_set_4addr(local, sdata, sta, enabled);
+ if (local->ops->sta_set_4addr)
+ local->ops->sta_set_4addr(&local->hw, &sdata->vif, sta, enabled);
+ trace_drv_return_void(local);
+}
+
#endif /* __MAC80211_DRIVER_OPS */
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3518,6 +3518,9 @@ static bool ieee80211_assoc_success(stru
goto out;
}
+ if (sdata->wdev.use_4addr)
+ drv_sta_set_4addr(local, sdata, &sta->sta, true);
+
mutex_unlock(&sdata->local->sta_mtx);
/*
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -2739,6 +2739,33 @@ DEFINE_EVENT(local_sdata_addr_evt, drv_u
TP_ARGS(local, sdata)
);
+TRACE_EVENT(drv_sta_set_4addr,
+ TP_PROTO(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata,
+ struct ieee80211_sta *sta, bool enabled),
+
+ TP_ARGS(local, sdata, sta, enabled),
+
+ TP_STRUCT__entry(
+ LOCAL_ENTRY
+ VIF_ENTRY
+ STA_ENTRY
+ __field(bool, enabled)
+ ),
+
+ TP_fast_assign(
+ LOCAL_ASSIGN;
+ VIF_ASSIGN;
+ STA_ASSIGN;
+ __entry->enabled = enabled;
+ ),
+
+ TP_printk(
+ LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " enabled:%d",
+ LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->enabled
+ )
+);
+
#endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
#undef TRACE_INCLUDE_PATH

View File

@ -0,0 +1,158 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 21 Aug 2020 05:54:10 +0200
Subject: [PATCH] mac80211: skip encap offload for tx multicast/control
packets
This simplifies the checks in the encap offload tx handler and allows using
it in cases where software crypto is used for multicast packets, e.g. when
using an AP_VLAN.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -378,7 +378,8 @@ static bool ieee80211_set_sdata_offload_
if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256 ||
- key->conf.cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256)
+ key->conf.cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256 ||
+ !(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE))
continue;
if (key->conf.cipher == WLAN_CIPHER_SUITE_TKIP ||
!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))
@@ -1448,7 +1449,8 @@ static void ieee80211_set_vif_encap_ops(
if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256 ||
- key->conf.cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256)
+ key->conf.cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256 ||
+ !(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE))
continue;
if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))
enabled = false;
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -4190,88 +4190,47 @@ static void ieee80211_8023_xmit(struct i
struct sk_buff *skb)
{
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
- struct ethhdr *ehdr = (struct ethhdr *)skb->data;
struct ieee80211_local *local = sdata->local;
- bool authorized = false;
- bool multicast;
- unsigned char *ra = ehdr->h_dest;
struct tid_ampdu_tx *tid_tx;
u8 tid;
- if (IS_ERR(sta) || (sta && !sta->uploaded))
- sta = NULL;
-
- if (sdata->vif.type == NL80211_IFTYPE_STATION &&
- (!sta || !test_sta_flag(sta, WLAN_STA_TDLS_PEER)))
- ra = sdata->u.mgd.bssid;
-
- if (is_zero_ether_addr(ra))
- goto out_free;
-
if (local->ops->wake_tx_queue) {
u16 queue = __ieee80211_select_queue(sdata, sta, skb);
skb_set_queue_mapping(skb, queue);
skb_get_hash(skb);
}
- multicast = is_multicast_ether_addr(ra);
-
- if (sta)
- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED);
-
- if (!multicast && !authorized &&
- (ehdr->h_proto != sdata->control_port_protocol ||
- !ether_addr_equal(sdata->vif.addr, ehdr->h_source)))
- goto out_free;
-
- if (multicast && sdata->vif.type == NL80211_IFTYPE_AP &&
- !atomic_read(&sdata->u.ap.num_mcast_sta))
- goto out_free;
-
if (unlikely(test_bit(SCAN_SW_SCANNING, &local->scanning)) &&
test_bit(SDATA_STATE_OFFCHANNEL, &sdata->state))
goto out_free;
memset(info, 0, sizeof(*info));
- if (sta) {
- tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
- tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
- if (tid_tx) {
- if (!test_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state)) {
- /* fall back to non-offload slow path */
- __ieee80211_subif_start_xmit(skb, dev, 0, 0, NULL);
- return;
- }
-
- info->flags |= IEEE80211_TX_CTL_AMPDU;
- if (tid_tx->timeout)
- tid_tx->last_tx = jiffies;
+ tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
+ tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
+ if (tid_tx) {
+ if (!test_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state)) {
+ /* fall back to non-offload slow path */
+ __ieee80211_subif_start_xmit(skb, dev, 0, 0, NULL);
+ return;
}
+
+ info->flags |= IEEE80211_TX_CTL_AMPDU;
+ if (tid_tx->timeout)
+ tid_tx->last_tx = jiffies;
}
- if (unlikely(!multicast && skb->sk &&
+ if (unlikely(skb->sk &&
skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS))
info->ack_frame_id = ieee80211_store_ack_skb(local, skb,
&info->flags, NULL);
- if (unlikely(sdata->control_port_protocol == ehdr->h_proto)) {
- if (sdata->control_port_no_encrypt)
- info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
- info->control.flags |= IEEE80211_TX_CTRL_PORT_CTRL_PROTO;
- }
-
- if (multicast)
- info->flags |= IEEE80211_TX_CTL_NO_ACK;
-
info->hw_queue = sdata->vif.hw_queue[skb_get_queue_mapping(skb)];
ieee80211_tx_stats(dev, skb->len);
- if (sta) {
- sta->tx_stats.bytes[skb_get_queue_mapping(skb)] += skb->len;
- sta->tx_stats.packets[skb_get_queue_mapping(skb)]++;
- }
+ sta->tx_stats.bytes[skb_get_queue_mapping(skb)] += skb->len;
+ sta->tx_stats.packets[skb_get_queue_mapping(skb)]++;
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
sdata = container_of(sdata->bss,
@@ -4292,6 +4251,7 @@ netdev_tx_t ieee80211_subif_start_xmit_8
struct net_device *dev)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ struct ethhdr *ehdr = (struct ethhdr *)skb->data;
struct sta_info *sta;
if (unlikely(skb->len < ETH_HLEN)) {
@@ -4303,6 +4263,10 @@ netdev_tx_t ieee80211_subif_start_xmit_8
if (ieee80211_lookup_ra_sta(sdata, skb, &sta))
kfree_skb(skb);
+ else if (unlikely(IS_ERR_OR_NULL(sta) || !sta->uploaded ||
+ !test_sta_flag(sta, WLAN_STA_AUTHORIZED) ||
+ sdata->control_port_protocol == ehdr->h_proto))
+ ieee80211_subif_start_xmit(skb, dev);
else
ieee80211_8023_xmit(sdata, dev, sta, skb);

View File

@ -0,0 +1,31 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 21 Aug 2020 06:03:45 +0200
Subject: [PATCH] mac80211: set info->control.hw_key for encap offload
packets
This is needed for drivers that don't do the key lookup themselves
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -4191,6 +4191,7 @@ static void ieee80211_8023_xmit(struct i
{
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct ieee80211_local *local = sdata->local;
+ struct ieee80211_key *key;
struct tid_ampdu_tx *tid_tx;
u8 tid;
@@ -4239,6 +4240,10 @@ static void ieee80211_8023_xmit(struct i
info->flags |= IEEE80211_TX_CTL_HW_80211_ENCAP;
info->control.vif = &sdata->vif;
+ key = rcu_dereference(sta->ptk[sta->ptk_idx]);
+ if (key)
+ info->control.hw_key = &key->conf;
+
ieee80211_tx_8023(sdata, skb, skb->len, sta, false);
return;

View File

@ -57,7 +57,7 @@
__NL80211_ATTR_AFTER_LAST,
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2610,6 +2610,19 @@ static int ieee80211_get_tx_power(struct
@@ -2615,6 +2615,19 @@ static int ieee80211_get_tx_power(struct
return 0;
}
@ -77,7 +77,7 @@
static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev,
const u8 *addr)
{
@@ -4040,6 +4053,7 @@ const struct cfg80211_ops mac80211_confi
@@ -4045,6 +4058,7 @@ const struct cfg80211_ops mac80211_confi
.set_wiphy_params = ieee80211_set_wiphy_params,
.set_tx_power = ieee80211_set_tx_power,
.get_tx_power = ieee80211_get_tx_power,
@ -87,7 +87,7 @@
CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd)
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1385,6 +1385,7 @@ struct ieee80211_local {
@@ -1383,6 +1383,7 @@ struct ieee80211_local {
int dynamic_ps_forced_timeout;
int user_power_level; /* in dBm, for all interfaces */

View File

@ -1,30 +0,0 @@
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index bd5988e..df6bd18 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -4774,12 +4774,25 @@ void ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
rcu_read_unlock();
if (!napi) {
+#if LINUX_VERSION_IS_GEQ(4,19,0)
netif_receive_skb_list(&list);
+#else
+ list_for_each_entry_safe(skb, tmp, &list, list) {
+ __list_del_entry(&skb->list);
+ skb->next = NULL;
+ netif_receive_skb(skb);
+ }
+#endif
return;
}
list_for_each_entry_safe(skb, tmp, &list, list) {
+#if LINUX_VERSION_IS_GEQ(4,19,0)
skb_list_del_init(skb);
+#else
+ __list_del_entry(&skb->list);
+ skb->next = NULL;
+#endif
napi_gro_receive(napi, skb);
}
}

View File

@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2020-07-22
PKG_SOURCE_VERSION:=b5df0fbb1847a51f0a11f03a3fa8dc9d98d4df82
PKG_MIRROR_HASH:=70aca7f8912b89af975c7b63fdf25d41be831c434e0c991fcbdaa60127d4acd5
PKG_SOURCE_DATE:=2020-08-22
PKG_SOURCE_VERSION:=8c7c1a207d25cd880c7f54d3fe86e82f14d6ecda
PKG_MIRROR_HASH:=0411bc634cb4065f748754e02758c172a4c65298696667f198c41d580d165d69
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_BUILD_PARALLEL:=1

View File

@ -3,11 +3,11 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=nat46
PKG_MIRROR_HASH:=3f5ef0a56e9b02c3ec10ec95f3f81c0ed04b983b2d857c16304c379106d6beb6
PKG_MIRROR_HASH:=d0bc80038cadeb7e857118e8d6bae242670ab27377af49f74bad494e0e5da598
PKG_SOURCE_URL:=https://github.com/ayourtch/nat46.git
PKG_SOURCE_DATE:=2017-05-12
PKG_SOURCE_DATE:=2020-08-06
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=683fbd2b765506332a1af141545652bf58f03166
PKG_SOURCE_VERSION:=71e9f0941a666c7010bb6d31d45bb795439038fa
PKG_MAINTAINER:=Hans Dedecker <dedeckeh@gmail.com>
PKG_LICENSE:=GPL-2.0

View File

@ -1,34 +0,0 @@
--- a/nat46/modules/nat46-core.c
+++ b/nat46/modules/nat46-core.c
@@ -17,6 +17,7 @@
*/
#include <net/route.h>
+#include <linux/version.h>
#include "nat46-glue.h"
#include "nat46-core.h"
@@ -1598,7 +1599,11 @@ void nat46_ipv6_input(struct sk_buff *ol
/* Remove any debris in the socket control block */
memset(IPCB(new_skb), 0, sizeof(struct inet_skb_parm));
/* Remove netfilter references to IPv6 packet, new netfilter references will be created based on IPv4 packet */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
nf_reset(new_skb);
+#else
+ nf_reset_ct(new_skb);
+#endif
/* modify packet: actual IPv6->IPv4 transformation */
truncSize = v6packet_l3size - sizeof(struct iphdr); /* chop first 20 bytes */
@@ -1803,7 +1808,11 @@ void nat46_ipv4_input(struct sk_buff *ol
/* Remove any debris in the socket control block */
memset(IPCB(new_skb), 0, sizeof(struct inet_skb_parm));
/* Remove netfilter references to IPv4 packet, new netfilter references will be created based on IPv6 packet */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
nf_reset(new_skb);
+#else
+ nf_reset_ct(new_skb);
+#endif
/* expand header (add 20 extra bytes at the beginning of sk_buff) */
pskb_expand_head(new_skb, IPV6V4HDRDELTA + (add_frag_header?8:0), 0, GFP_ATOMIC);

View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=om-watchdog
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_VERSION:=1
include $(INCLUDE_DIR)/package.mk

View File

@ -47,7 +47,7 @@ get_gpio() {
return 17
;;
esac
elif [ "$board" = "teltonika_rut5xx" ]; then
elif [ "$board" = "teltonika,rut5xx" ]; then
# ramips
return 11
else

View File

@ -102,9 +102,9 @@ dhcp_check() {
[ -s "$stamp" ] && return $(cat "$stamp")
# If there's no carrier yet, skip this interface.
# If interface is down, skip it.
# The init script will be called again once the link is up
case "$(devstatus "$ifname" | jsonfilter -e @.carrier)" in
case "$(devstatus "$ifname" | jsonfilter -e @.up)" in
false) return 1;;
esac
@ -867,7 +867,7 @@ dnsmasq_start()
append_bool "$cfg" noping "--no-ping"
append_bool "$cfg" rapidcommit "--dhcp-rapid-commit"
append_bool "$cfg" scriptarp "--script-arp"
append_bool "$cfg" filter_aaaa "--filter-aaaa"
append_parm "$cfg" logfacility "--log-facility"

View File

@ -0,0 +1,32 @@
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ltq-dsl-base
PKG_RELEASE:=2
include $(INCLUDE_DIR)/package.mk
define Package/ltq-dsl-base
SECTION:=net
CATEGORY:=Network
TITLE:=DSL related files for Intel/Lantiq DSL Chipsets
URL:=http://openwrt.org/
DEPENDS:=@TARGET_lantiq +jshn
endef
define Package/ltq-dsl-base/description
This package contains DSL related files for Intel/Lantiq DSL Chipsets.
endef
define Build/Compile
endef
define Package/ltq-dsl-base/install
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,ltq-dsl-base))

View File

@ -19,10 +19,10 @@ dsl_cmd() {
)
}
dsl_val() {
echo $(expr "$1" : '.*'$2'=\([-\.[:alnum:]]*\).*')
expr "$1" : '.*'$2'=\([-\.[:alnum:]]*\).*'
}
dsl_string() {
echo $(expr "$1" : '.*'$2'=(\([A-Z0-9,]*\))')
expr "$1" : '.*'$2'=(\([A-Z0-9,]*\))'
}
#

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=zram-swap
PKG_VERSION:=1.1
PKG_RELEASE:=4
PKG_RELEASE:=6
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
@ -18,7 +18,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/zram-swap
SECTION:=utils
CATEGORY:=Base system
DEPENDS:=+kmod-zram +!(BUSYBOX_DEFAULT_MKSWAP||BUSYBOX_CONFIG_MKSWAP):swap-utils +!((BUSYBOX_DEFAULT_SWAPON||BUSYBOX_CONFIG_SWAPON)&&(BUSYBOX_DEFAULT_SWAPOFF||BUSYBOX_CONFIG_SWAPOFF)):block-mount
DEPENDS:=+kmod-zram +!(BUSYBOX_CONFIG_MKSWAP&&BUSYBOX_CONFIG_SWAPON&&BUSYBOX_CONFIG_SWAPOFF):swap-utils
TITLE:=ZRAM swap scripts
PKGARCH:=all
endef

View File

@ -35,17 +35,17 @@ zram_applicable()
return 1
}
which mkswap >/dev/null || {
command -v mkswap >/dev/null || {
logger -s -t zram_applicable -p daemon.err "[ERROR] 'mkswap' not installed"
return 1
}
which swapon >/dev/null || {
command -v swapon >/dev/null || {
logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapon' not installed"
return 1
}
which swapoff >/dev/null || {
command -v swapoff >/dev/null || {
logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapoff' not installed"
return 1
}
@ -182,7 +182,7 @@ start()
zram_comp_streams "$zram_dev"
echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize"
mkswap "$zram_dev"
swapon $zram_priority "$zram_dev"
swapon -d $zram_priority "$zram_dev"
}
stop()

View File

@ -24,7 +24,7 @@ config BUSYBOX_DEFAULT_FEATURE_VERBOSE_USAGE
default y
config BUSYBOX_DEFAULT_FEATURE_COMPRESS_USAGE
bool
default y
default n
config BUSYBOX_DEFAULT_LFS
bool
default y
@ -303,7 +303,7 @@ config BUSYBOX_DEFAULT_FEATURE_SKIP_ROOTFS
default n
config BUSYBOX_DEFAULT_MONOTONIC_SYSCALL
bool
default n
default y
config BUSYBOX_DEFAULT_IOCTL_HEX2STR_ERROR
bool
default y

View File

@ -1,13 +0,0 @@
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -31,6 +31,10 @@
#define SIGWINCH 28
#endif
+#ifndef SIGWINCH
+#define SIGWINCH 28
+#endif
+
#define LKC_DIRECT_LINK
#include "lkc.h"

View File

@ -1,6 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ravpower-mcu
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/blocktrron/ravpower-mcu.git
@ -16,7 +17,6 @@ define Package/ravpower-mcu
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Utility to control the RAVPower RP-WD009 PMIC
DEPENDS:=@TARGET_ramips_mt76x8
URL:=https://github.com/blocktrron/ravpower-mcu/
endef

View File

@ -194,6 +194,7 @@ foreach my $mirror (@ARGV) {
push @mirrors, "https://downloads.sourceforge.net/$1";
}
} elsif ($mirror =~ /^\@APACHE\/(.+)$/) {
push @mirrors, "https://mirrors.ustc.edu.cn/apache/$1";
push @mirrors, "https://mirror.netcologne.de/apache.org/$1";
push @mirrors, "https://mirror.aarnet.edu.au/pub/apache/$1";
push @mirrors, "https://mirror.csclub.uwaterloo.ca/apache/$1";
@ -213,6 +214,7 @@ foreach my $mirror (@ARGV) {
push @mirrors, "https://raw.githubusercontent.com/$dir";
}
} elsif ($mirror =~ /^\@GNU\/(.+)$/) {
push @mirrors, "https://mirrors.ustc.edu.cn/gnu/$1";
push @mirrors, "https://mirror.csclub.uwaterloo.ca/gnu/$1";
push @mirrors, "https://mirror.netcologne.de/gnu/$1";
push @mirrors, "http://ftp.kddilabs.jp/GNU/gnu/$1";
@ -238,7 +240,7 @@ foreach my $mirror (@ARGV) {
push @extra, "$extra[0]/longterm/v$1";
}
foreach my $dir (@extra) {
push @mirrors, "http://mirrors.ustc.edu.cn/kernel.org/$dir";
push @mirrors, "https://mirrors.ustc.edu.cn/kernel.org/$dir";
push @mirrors, "https://cdn.kernel.org/pub/$dir";
push @mirrors, "https://mirror.rackspace.com/kernel.org/pub/$dir";
push @mirrors, "https://download.xs4all.nl/ftp.kernel.org/pub/$dir";
@ -249,6 +251,7 @@ foreach my $mirror (@ARGV) {
push @mirrors, "ftp://www.mirrorservice.org/sites/ftp.kernel.org/pub/$dir";
}
} elsif ($mirror =~ /^\@GNOME\/(.+)$/) {
push @mirrors, "https://mirrors.ustc.edu.cn/gnome/sources/$1";
push @mirrors, "https://mirror.csclub.uwaterloo.ca/gnome/sources/$1";
push @mirrors, "http://ftp.acc.umu.se/pub/GNOME/sources/$1";
push @mirrors, "http://ftp.kaist.ac.kr/gnome/sources/$1";
@ -263,7 +266,7 @@ foreach my $mirror (@ARGV) {
}
}
unshift @mirrors, 'https://sources.cdn.openwrt.org';
push @mirrors, 'https://sources.cdn.openwrt.org';
#push @mirrors, 'https://mirror1.openwrt.org';
push @mirrors, 'https://sources.openwrt.org';
push @mirrors, 'https://mirror2.openwrt.org/sources';

View File

@ -1,10 +1,10 @@
#!/bin/ash
[ "$ACTION" == "add" ] || exit 0
[ "$ACTION" = "add" ] || exit 0
PHYNBR=${DEVPATH##*/phy}
[ -n $PHYNBR ] || exit 0
[ -n "$PHYNBR" ] || exit 0
. /lib/functions.sh
. /lib/functions/system.sh
@ -14,7 +14,7 @@ board=$(board_name)
case "$board" in
netgear,wndap620|\
netgear,wndap660)
echo $(macaddr_add $(mtd_get_mac_ascii u-boot-env baseMAC) $(($PHYNBR + 1)) ) > /sys${DEVPATH}/macaddress
macaddr_add $(mtd_get_mac_ascii u-boot-env baseMAC) $(($PHYNBR + 1)) > /sys${DEVPATH}/macaddress
;;
*)
;;

View File

@ -5,7 +5,7 @@ preinit_set_mac_address() {
meraki,mr24|\
meraki,mx60)
mac_lan=$(mtd_get_mac_binary_ubi board-config 0x66)
[ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan"
[ -n "$mac_lan" ] && ip link set eth0 address "$mac_lan"
;;
esac
}

View File

@ -87,6 +87,7 @@ define Device/Default
KERNEL_ENTRY := 0x00000000
KERNEL_LOADADDR := 0x00000000
DEVICE_DTS_DIR := ../dts
DEVICE_DTS = $(subst _,-,$(1))
SUPPORTED_DEVICES = $(subst _,$(comma),$(1))
endef

Some files were not shown because too many files have changed in this diff Show More