mirror of
git://git.openwrt.org/openwrt/openwrt.git
synced 2026-06-13 03:07:26 -04:00
Compare commits
128 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f7e6e554b | ||
|
|
d9c5716d1d | ||
|
|
e382fc552a | ||
|
|
0f52a05723 | ||
|
|
58a0211f82 | ||
|
|
7aa929881e | ||
|
|
b8d232d9dc | ||
|
|
3c97c4a44c | ||
|
|
30b7a5f27a | ||
|
|
8db7b6ff53 | ||
|
|
454fd69589 | ||
|
|
f415748ba8 | ||
|
|
9123a0c358 | ||
|
|
22391baf99 | ||
|
|
4a3409f628 | ||
|
|
a9858a9632 | ||
|
|
61408bb99a | ||
|
|
ce660d934f | ||
|
|
237b1c29e1 | ||
|
|
8498118893 | ||
|
|
6a92e68c51 | ||
|
|
581050ce4e | ||
|
|
c0b10f7442 | ||
|
|
9fa8e7e9a3 | ||
|
|
0ed59099ee | ||
|
|
d0c2c30e50 | ||
|
|
9c23ecf31c | ||
|
|
96a67d2f2e | ||
|
|
15601a545e | ||
|
|
b1528735da | ||
|
|
13226471ef | ||
|
|
e781816fe1 | ||
|
|
913e26b20f | ||
|
|
c6e59d06af | ||
|
|
9f8c60c2c8 | ||
|
|
ea96f50747 | ||
|
|
51108508f1 | ||
|
|
414f196a96 | ||
|
|
9c25d39d3e | ||
|
|
fbaf5271d2 | ||
|
|
c795a91579 | ||
|
|
e35f37791f | ||
|
|
804a2e6c51 | ||
|
|
6ff763e78c | ||
|
|
648fa1b6d3 | ||
|
|
443fc11576 | ||
|
|
444299d70c | ||
|
|
6c5c8598ab | ||
|
|
59b4c9e114 | ||
|
|
2b3f8c0d4c | ||
|
|
84927ebac6 | ||
|
|
dbc2b142ce | ||
|
|
4d1c1d7754 | ||
|
|
58cde9ec22 | ||
|
|
dddeea5e7f | ||
|
|
d804c3110b | ||
|
|
b01c68ddbd | ||
|
|
42ca1612a2 | ||
|
|
ae51d0098e | ||
|
|
2d05923d2e | ||
|
|
81929a31af | ||
|
|
b3e90139ce | ||
|
|
dcced671e2 | ||
|
|
9d218f0853 | ||
|
|
e905c45b05 | ||
|
|
b5a66740c2 | ||
|
|
64ad16e3ed | ||
|
|
9aeda89c05 | ||
|
|
9097d73cbb | ||
|
|
7af48fdcd3 | ||
|
|
518f3c6171 | ||
|
|
9babe16bd2 | ||
|
|
fda425adf4 | ||
|
|
1f7de3311c | ||
|
|
4391bf8729 | ||
|
|
ed8ba06ced | ||
|
|
89cee1bf3f | ||
|
|
4d4fd4d125 | ||
|
|
262b537f48 | ||
|
|
c56fbe156e | ||
|
|
84944c0311 | ||
|
|
0272d79e34 | ||
|
|
1181c031a0 | ||
|
|
48ec8469fd | ||
|
|
8c5ad273b4 | ||
|
|
f364fe5e09 | ||
|
|
dc11868486 | ||
|
|
6a7b16e616 | ||
|
|
671f4d53ac | ||
|
|
bac7ee02f9 | ||
|
|
3b1fc6661a | ||
|
|
a6e8cbdf53 | ||
|
|
a167e68c76 | ||
|
|
d414ed185e | ||
|
|
c3b4e8e531 | ||
|
|
32a2193a48 | ||
|
|
a902c0d020 | ||
|
|
43c1a0440f | ||
|
|
0be05cdf72 | ||
|
|
0ed371472c | ||
|
|
550fa37533 | ||
|
|
9837ae4002 | ||
|
|
597598baa9 | ||
|
|
aa03dfeb96 | ||
|
|
a38b0c94dd | ||
|
|
99e62c21c6 | ||
|
|
984a219781 | ||
|
|
8d90e178b1 | ||
|
|
5902917588 | ||
|
|
630354031a | ||
|
|
2d758300e3 | ||
|
|
dbf2c101ed | ||
|
|
ef3b14e06c | ||
|
|
bdb89ee6df | ||
|
|
debc420622 | ||
|
|
c5d7ef41f8 | ||
|
|
be73a7f033 | ||
|
|
d4eb33990b | ||
|
|
fa3632f332 | ||
|
|
5c6e95c5b4 | ||
|
|
c39bc0375f | ||
|
|
9f630a4141 | ||
|
|
ebcda1d7da | ||
|
|
975552ea14 | ||
|
|
4108db2bd8 | ||
|
|
4b7728ba8b | ||
|
|
4ead11296a | ||
|
|
859ff7a978 |
6
.github/workflows/formal.yml
vendored
6
.github/workflows/formal.yml
vendored
@@ -5,8 +5,14 @@ on:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Test Formalities
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/formal.yml@main
|
||||
# with:
|
||||
# # Post formality check summaries to the PR.
|
||||
# # Repo's permissions need to be updated for actions to modify PRs:
|
||||
# # https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#create-an-issue-comment
|
||||
# post_comment: true
|
||||
|
||||
@@ -176,6 +176,7 @@ menu "Global build settings"
|
||||
config MOLD
|
||||
depends on (aarch64 || arm || i386 || i686 || m68k || powerpc || powerpc64 || sh4 || x86_64)
|
||||
depends on !GCC_USE_VERSION_11
|
||||
depends on !HOST_OS_MACOS
|
||||
def_bool $(shell, ./config/check-hostcxx.sh 10 2 12)
|
||||
|
||||
config USE_MOLD
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
src-git packages https://git.openwrt.org/feed/packages.git^f1470815f41fe199bfdafe9a91ad115bc2e91203
|
||||
src-git luci https://git.openwrt.org/project/luci.git^75e41cba5160281b2d1dca922719efef29f7ffd8
|
||||
src-git routing https://git.openwrt.org/feed/routing.git^3eb59e9471858c83891979793f1dd29cca156919
|
||||
src-git telephony https://git.openwrt.org/feed/telephony.git^2a4541d46199ac96fac214d02c908402831c4dc6
|
||||
src-git packages https://git.openwrt.org/feed/packages.git^953b6d47b4e9f0ad3c39547c6d3f9a828f10e206
|
||||
src-git luci https://git.openwrt.org/project/luci.git^d88390be4ec9722cb427fee03368fc8c8582627d
|
||||
src-git routing https://git.openwrt.org/feed/routing.git^178a40d321d6c11f18528f34777f4e24ce62b19a
|
||||
src-git telephony https://git.openwrt.org/feed/telephony.git^92892fa285360b8981f62bf4e0a097e6449e7e33
|
||||
|
||||
@@ -391,8 +391,9 @@ define Build/fit
|
||||
$(if $(DEVICE_DTS_OVERLAY),$(foreach dtso,$(DEVICE_DTS_OVERLAY), -O $(dtso):$(KERNEL_BUILD_DIR)/image-$(dtso).dtbo)) \
|
||||
-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config-1") \
|
||||
-A $(LINUX_KARCH) -v $(LINUX_VERSION), gen-cpio$(if $(TARGET_PER_DEVICE_ROOTFS),.$(ROOTFS_ID/$(DEVICE_NAME))))
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage $(if $(findstring external,$(word 3,$(1))),\
|
||||
-E -B 0x1000 $(if $(findstring static,$(word 3,$(1))),-p 0x1000)) -f $@.its $@.new
|
||||
$(call locked,PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage $(if $(findstring external,$(word 3,$(1))),\
|
||||
-E -B 0x1000 $(if $(findstring static,$(word 3,$(1))),-p 0x1000)) -f $@.its $@.new, \
|
||||
gen-cpio$(if $(TARGET_PER_DEVICE_ROOTFS),.$(ROOTFS_ID/$(DEVICE_NAME))))
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-6.6 = .110
|
||||
LINUX_KERNEL_HASH-6.6.110 = 1bf20daf5543b8759f325e55fb0da4913715e68741627a13380e66aaf219fb1d
|
||||
LINUX_VERSION-6.6 = .119
|
||||
LINUX_KERNEL_HASH-6.6.119 = 3da09b980bb404cc28793479bb2d6c636522679215ffa65a04c893575253e5e8
|
||||
|
||||
@@ -248,7 +248,7 @@ endif
|
||||
)
|
||||
endif
|
||||
|
||||
$(INSTALL_DIR) $$(PDIR_$(1))/tmp
|
||||
$(INSTALL_DIR) $$(PDIR_$(1))
|
||||
|
||||
ifeq ($(CONFIG_USE_APK),)
|
||||
mkdir -p $$(IDIR_$(1))/CONTROL
|
||||
|
||||
@@ -201,7 +201,7 @@ else
|
||||
DOWNLOAD_DIRS = package/download
|
||||
endif
|
||||
|
||||
download: .config FORCE $(if $(wildcard $(STAGING_DIR_HOST)/bin/flock),,tools/flock/compile)
|
||||
download: .config FORCE $(if $(wildcard $(STAGING_DIR_HOST)/bin/flock),,tools/flock/compile) $(if $(wildcard $(STAGING_DIR_HOST)/bin/zstd),,tools/zstd/compile)
|
||||
@+$(foreach dir,$(DOWNLOAD_DIRS),$(SUBMAKE) $(dir);)
|
||||
|
||||
clean dirclean: .config
|
||||
|
||||
@@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \
|
||||
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
|
||||
|
||||
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10.4)
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10.5)
|
||||
|
||||
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r28959-29397011cc)
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r29087-d9c5716d1d)
|
||||
|
||||
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10.4)
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10.5)
|
||||
|
||||
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
|
||||
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
|
||||
|
||||
@@ -315,3 +315,10 @@ macaddr_canonicalize() {
|
||||
dt_is_enabled() {
|
||||
grep -q okay "/proc/device-tree/$1/status"
|
||||
}
|
||||
|
||||
get_linux_version() {
|
||||
local ver=$(uname -r)
|
||||
local minor=${ver%\.*}
|
||||
|
||||
printf "%d%02d%03d" ${ver%%\.*} ${minor#*\.} ${ver##*\.} 2>/dev/null
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ if VERSIONOPT
|
||||
config VERSION_REPO
|
||||
string
|
||||
prompt "Release repository"
|
||||
default "https://downloads.openwrt.org/releases/24.10.4"
|
||||
default "https://downloads.openwrt.org/releases/24.10.5"
|
||||
help
|
||||
This is the repository address embedded in the image, it defaults
|
||||
to the trunk snapshot repo; the url may contain the following placeholders:
|
||||
|
||||
@@ -201,4 +201,9 @@ define Build/Compile
|
||||
CROSS_COMPILE=$(TARGET_CROSS)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(BINARIES_DIR)/at91bootstrap.bin $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-at91bootstrap.bin
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage/AT91Bootstrap))
|
||||
|
||||
@@ -43,6 +43,7 @@ endef
|
||||
define Trusted-Firmware-A/Default
|
||||
BUILD_TARGET:=layerscape
|
||||
BUILD_SUBTARGET:=armv8_64b
|
||||
BUILD_DEVICES:=fsl_$(1)
|
||||
DEPENDS:=+layerscape-rcw +u-boot-fsl_$(1)
|
||||
endef
|
||||
|
||||
|
||||
@@ -179,4 +179,9 @@ define Build/Compile
|
||||
$(UBOOT_MAKE_FLAGS)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage/U-Boot))
|
||||
|
||||
@@ -38,6 +38,7 @@ cmcc,a10-ubootmod|\
|
||||
cudy,tr3000-v1-ubootmod|\
|
||||
h3c,magic-nx30-pro|\
|
||||
jcg,q30-pro|\
|
||||
konka,komi-a31|\
|
||||
mercusys,mr90x-v1-ubi|\
|
||||
netcore,n60|\
|
||||
netis,nx31|\
|
||||
|
||||
@@ -326,6 +326,18 @@ define U-Boot/mt7981_jcg_q30-pro
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_konka_komi-a31
|
||||
NAME:=Konka KOMI A31
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=konka_komi-a31
|
||||
UBOOT_CONFIG:=mt7981_konka_komi-a31
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=spim-nand
|
||||
BL2_SOC:=mt7981
|
||||
BL2_DDRTYPE:=ddr3
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_netis_nx31
|
||||
NAME:=netis NX31
|
||||
BUILD_SUBTARGET:=filogic
|
||||
@@ -876,6 +888,7 @@ UBOOT_TARGETS := \
|
||||
mt7981_glinet_gl-xe3000 \
|
||||
mt7981_h3c_magic-nx30-pro \
|
||||
mt7981_jcg_q30-pro \
|
||||
mt7981_konka_komi-a31 \
|
||||
mt7981_netis_nx31 \
|
||||
mt7981_nokia_ea0326gmp \
|
||||
mt7981_openwrt_one-snand \
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
Subject: [PATCH] mtd: spinand: esmt: add support for F50L1G41LC
|
||||
|
||||
This adds support for ESMT F50L1G41LC, which appears to be an updated
|
||||
version of the already supported F50L1G41LB.
|
||||
Add esmt_8c SPI_NAND manufacturer to account for the newly used vendor
|
||||
ID with support for the ESMT F50L1G41LC chip.
|
||||
|
||||
--- a/drivers/mtd/nand/spi/core.c
|
||||
+++ b/drivers/mtd/nand/spi/core.c
|
||||
@@ -834,6 +834,7 @@ static const struct spinand_manufacturer
|
||||
&toshiba_spinand_manufacturer,
|
||||
&winbond_spinand_manufacturer,
|
||||
&esmt_c8_spinand_manufacturer,
|
||||
+ &esmt_8c_spinand_manufacturer,
|
||||
&xtx_spinand_manufacturer,
|
||||
};
|
||||
|
||||
--- a/drivers/mtd/nand/spi/esmt.c
|
||||
+++ b/drivers/mtd/nand/spi/esmt.c
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
/* ESMT uses GigaDevice 0xc8 JECDEC ID on some SPI NANDs */
|
||||
#define SPINAND_MFR_ESMT_C8 0xc8
|
||||
+#define SPINAND_MFR_ESMT_8C 0x8c
|
||||
|
||||
static SPINAND_OP_VARIANTS(read_cache_variants,
|
||||
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
|
||||
@@ -104,6 +105,18 @@ static const struct mtd_ooblayout_ops f5
|
||||
.rfree = f50l1g41lb_ooblayout_free,
|
||||
};
|
||||
|
||||
+static const struct spinand_info esmt_8c_spinand_table[] = {
|
||||
+ SPINAND_INFO("F50L1G41LC",
|
||||
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x2C),
|
||||
+ NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
|
||||
+ NAND_ECCREQ(1, 512),
|
||||
+ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
|
||||
+ &write_cache_variants,
|
||||
+ &update_cache_variants),
|
||||
+ 0,
|
||||
+ SPINAND_ECCINFO(&f50l1g41lb_ooblayout, NULL)),
|
||||
+};
|
||||
+
|
||||
static const struct spinand_info esmt_c8_spinand_table[] = {
|
||||
SPINAND_INFO("F50L1G41LB",
|
||||
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x01),
|
||||
@@ -135,3 +148,11 @@ const struct spinand_manufacturer esmt_c
|
||||
.nchips = ARRAY_SIZE(esmt_c8_spinand_table),
|
||||
.ops = &esmt_spinand_manuf_ops,
|
||||
};
|
||||
+
|
||||
+const struct spinand_manufacturer esmt_8c_spinand_manufacturer = {
|
||||
+ .id = SPINAND_MFR_ESMT_8C,
|
||||
+ .name = "ESMT",
|
||||
+ .chips = esmt_8c_spinand_table,
|
||||
+ .nchips = ARRAY_SIZE(esmt_8c_spinand_table),
|
||||
+ .ops = &esmt_spinand_manuf_ops,
|
||||
+};
|
||||
--- a/include/linux/mtd/spinand.h
|
||||
+++ b/include/linux/mtd/spinand.h
|
||||
@@ -252,6 +252,7 @@ extern const struct spinand_manufacturer
|
||||
extern const struct spinand_manufacturer toshiba_spinand_manufacturer;
|
||||
extern const struct spinand_manufacturer winbond_spinand_manufacturer;
|
||||
extern const struct spinand_manufacturer esmt_c8_spinand_manufacturer;
|
||||
+extern const struct spinand_manufacturer esmt_8c_spinand_manufacturer;
|
||||
extern const struct spinand_manufacturer xtx_spinand_manufacturer;
|
||||
|
||||
/**
|
||||
328
package/boot/uboot-mediatek/patches/447-add-konka_komi-a31.patch
Normal file
328
package/boot/uboot-mediatek/patches/447-add-konka_komi-a31.patch
Normal file
@@ -0,0 +1,328 @@
|
||||
--- /dev/null
|
||||
+++ b/configs/mt7981_konka_komi-a31_defconfig
|
||||
@@ -0,0 +1,107 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
|
||||
+CONFIG_POSITION_INDEPENDENT=y
|
||||
+CONFIG_ARCH_MEDIATEK=y
|
||||
+CONFIG_TEXT_BASE=0x41e00000
|
||||
+CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
+CONFIG_NR_DRAM_BANKS=1
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="mt7981-konka-komi-a31"
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_TARGET_MT7981=y
|
||||
+CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
|
||||
+CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
+CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
+CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_BOOTDELAY=30
|
||||
+CONFIG_AUTOBOOT_KEYED=y
|
||||
+CONFIG_AUTOBOOT_MENU_SHOW=y
|
||||
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-konka-komi-a31.dtb"
|
||||
+CONFIG_LOGLEVEL=7
|
||||
+CONFIG_PRE_CONSOLE_BUFFER=y
|
||||
+CONFIG_LOG=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_SYS_PROMPT="MT7981> "
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_GPT=y
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_PART=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_UUID=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_UBI=y
|
||||
+CONFIG_CMD_UBI_RENAME=y
|
||||
+CONFIG_OF_EMBED=y
|
||||
+CONFIG_ENV_OVERWRITE=y
|
||||
+CONFIG_ENV_IS_IN_UBI=y
|
||||
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
||||
+CONFIG_ENV_UBI_PART="ubi"
|
||||
+CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
+CONFIG_USE_DEFAULT_ENV_FILE=y
|
||||
+CONFIG_DEFAULT_ENV_FILE="konka_komi-a31_env"
|
||||
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
+CONFIG_VERSION_VARIABLE=y
|
||||
+CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_NETCONSOLE=y
|
||||
+CONFIG_USE_IPADDR=y
|
||||
+CONFIG_IPADDR="192.168.1.1"
|
||||
+CONFIG_USE_SERVERIP=y
|
||||
+CONFIG_SERVERIP="192.168.1.254"
|
||||
+CONFIG_REGMAP=y
|
||||
+CONFIG_SYSCON=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_CLK=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+# CONFIG_MMC is not set
|
||||
+CONFIG_MTD=y
|
||||
+CONFIG_DM_MTD=y
|
||||
+CONFIG_MTD_SPI_NAND=y
|
||||
+CONFIG_MTD_UBI_FASTMAP=y
|
||||
+CONFIG_PHY_FIXED=y
|
||||
+CONFIG_MEDIATEK_ETH=y
|
||||
+CONFIG_PHY=y
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_MT7981=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_MTK_POWER_DOMAIN=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
+CONFIG_DM_REGULATOR_GPIO=y
|
||||
+CONFIG_RAM=y
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_SPI=y
|
||||
+CONFIG_DM_SPI=y
|
||||
+CONFIG_MTK_SPIM=y
|
||||
+CONFIG_ZSTD=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
+CONFIG_LMB_MAX_REGIONS=64
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/mt7981-konka-komi-a31.dts
|
||||
@@ -0,0 +1,158 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "mt7981.dtsi"
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/linux-event-codes.h>
|
||||
+
|
||||
+/ {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ model = "Konka KOMI A31";
|
||||
+ compatible = "mediatek,mt7981", "mediatek,mt7981-rfb";
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = &uart0;
|
||||
+ tick-timer = &timer0;
|
||||
+ };
|
||||
+
|
||||
+ memory@40000000 {
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x40000000 0x10000000>;
|
||||
+ };
|
||||
+
|
||||
+ gpio-keys {
|
||||
+ compatible = "gpio-keys";
|
||||
+
|
||||
+ button-mesh {
|
||||
+ label = "mesh";
|
||||
+ linux,code = <BTN_9>;
|
||||
+ linux,input-type = <EV_SW>;
|
||||
+ gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ button-reset {
|
||||
+ label = "reset";
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
+ gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio-leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ green_led: led-0 {
|
||||
+ label = "green:status";
|
||||
+ gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
|
||||
+ default-state = "off";
|
||||
+ };
|
||||
+
|
||||
+ led-1 {
|
||||
+ label = "blue:status";
|
||||
+ gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
|
||||
+ default-state = "off";
|
||||
+ };
|
||||
+
|
||||
+ red_led: led-2 {
|
||||
+ label = "red:status";
|
||||
+ gpios = <&gpio 34 GPIO_ACTIVE_HIGH>;
|
||||
+ default-state = "on";
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+ð {
|
||||
+ status = "okay";
|
||||
+ mediatek,gmac-id = <0>;
|
||||
+ phy-mode = "2500base-x";
|
||||
+ mediatek,switch = "mt7531";
|
||||
+ reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
|
||||
+
|
||||
+ fixed-link {
|
||||
+ speed = <2500>;
|
||||
+ full-duplex;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ spi_flash_pins: spi0-pins-func-1 {
|
||||
+ mux {
|
||||
+ function = "flash";
|
||||
+ groups = "spi0", "spi0_wp_hold";
|
||||
+ };
|
||||
+
|
||||
+ conf-pu {
|
||||
+ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
|
||||
+ };
|
||||
+
|
||||
+ conf-pd {
|
||||
+ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&spi0 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&spi_flash_pins>;
|
||||
+ status = "okay";
|
||||
+ must_tx;
|
||||
+ enhance_timing;
|
||||
+ dma_ext;
|
||||
+ ipm_design;
|
||||
+ support_quad;
|
||||
+ tick_dly = <2>;
|
||||
+ sample_sel = <0>;
|
||||
+
|
||||
+ spi_nand@0 {
|
||||
+ compatible = "spi-nand";
|
||||
+ reg = <0>;
|
||||
+ spi-max-frequency = <52000000>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ label = "bl2";
|
||||
+ reg = <0x0 0x100000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@100000 {
|
||||
+ label = "u-boot-env";
|
||||
+ reg = <0x100000 0x80000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@180000 {
|
||||
+ label = "factory";
|
||||
+ reg = <0x180000 0x200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@380000 {
|
||||
+ label = "fip";
|
||||
+ reg = <0x380000 0x200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@580000 {
|
||||
+ label = "ubi";
|
||||
+ reg = <0x580000 0x7a80000>;
|
||||
+ compatible = "linux,ubi";
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ mediatek,force-highspeed;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&watchdog {
|
||||
+ status = "disabled";
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/konka_komi-a31_env
|
||||
@@ -0,0 +1,54 @@
|
||||
+ipaddr=192.168.1.1
|
||||
+serverip=192.168.1.254
|
||||
+loadaddr=0x46000000
|
||||
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
|
||||
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
|
||||
+bootconf=config-1
|
||||
+bootdelay=0
|
||||
+bootfile=openwrt-mediatek-filogic-konka_komi-a31-initramfs-recovery.itb
|
||||
+bootfile_bl2=openwrt-mediatek-filogic-konka_komi-a31-preloader.bin
|
||||
+bootfile_fip=openwrt-mediatek-filogic-konka_komi-a31-bl31-uboot.fip
|
||||
+bootfile_upg=openwrt-mediatek-filogic-konka_komi-a31-squashfs-sysupgrade.itb
|
||||
+bootled_pwr=red:status
|
||||
+bootled_rec=blue:status
|
||||
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
|
||||
+bootmenu_default=0
|
||||
+bootmenu_delay=0
|
||||
+bootmenu_title= [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) )
|
||||
+bootmenu_0=Initialize environment.=run _firstboot
|
||||
+bootmenu_0d=Run default boot command.=run boot_default
|
||||
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
|
||||
+bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
|
||||
+bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
|
||||
+bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to NAND.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
|
||||
+bootmenu_7=[31mLoad BL2 preloader via TFTP then write to NAND.[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
|
||||
+bootmenu_8=Reboot.=reset
|
||||
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
|
||||
+boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
|
||||
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
|
||||
+boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
|
||||
+boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off
|
||||
+boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever
|
||||
+boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
|
||||
+boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
|
||||
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory
|
||||
+boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2
|
||||
+reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800
|
||||
+mtd_write_fip=mtd erase fip && mtd write fip $loadaddr
|
||||
+mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr
|
||||
+ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic || run ubi_format
|
||||
+ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset
|
||||
+ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi
|
||||
+ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs
|
||||
+ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery
|
||||
+ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data
|
||||
+ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize
|
||||
+ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize
|
||||
+_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
|
||||
+_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
|
||||
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
|
||||
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title [33m$ver[0m"
|
||||
@@ -13,7 +13,7 @@ Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
|
||||
|
||||
--- a/common/board_r.c
|
||||
+++ b/common/board_r.c
|
||||
@@ -663,19 +663,13 @@ static init_fnc_t init_sequence_r[] = {
|
||||
@@ -651,19 +651,13 @@ static init_fnc_t init_sequence_r[] = {
|
||||
serial_initialize,
|
||||
initr_announce,
|
||||
dm_announce,
|
||||
@@ -33,7 +33,7 @@ Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
|
||||
#if defined(CONFIG_PCI_INIT_R) && defined(CONFIG_SYS_EARLY_PCI_INIT)
|
||||
/*
|
||||
* Do early PCI configuration _before_ the flash gets initialised,
|
||||
@@ -690,7 +684,6 @@ static init_fnc_t init_sequence_r[] = {
|
||||
@@ -678,7 +672,6 @@ static init_fnc_t init_sequence_r[] = {
|
||||
#ifdef CONFIG_MTD_NOR_FLASH
|
||||
initr_flash,
|
||||
#endif
|
||||
@@ -41,7 +41,7 @@ Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
|
||||
#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_X86)
|
||||
/* initialize higher level parts of CPU like time base and timers */
|
||||
cpu_init_r,
|
||||
@@ -719,6 +712,10 @@ static init_fnc_t init_sequence_r[] = {
|
||||
@@ -707,6 +700,10 @@ static init_fnc_t init_sequence_r[] = {
|
||||
#ifdef CONFIG_PVBLOCK
|
||||
initr_pvblock,
|
||||
#endif
|
||||
|
||||
@@ -219,6 +219,20 @@ define U-Boot/bpi-r2-pro-rk3568
|
||||
sinovoip_bpi-r2-pro
|
||||
endef
|
||||
|
||||
define U-Boot/easepi-r1-rk3568
|
||||
$(U-Boot/rk3568/Default)
|
||||
NAME:=LinkEase EasePi R1
|
||||
BUILD_DEVICES:= \
|
||||
linkease_easepi-r1
|
||||
endef
|
||||
|
||||
define U-Boot/fastrhino-r66s-rk3568
|
||||
$(U-Boot/rk3568/Default)
|
||||
NAME:=FastRhino R66S
|
||||
BUILD_DEVICES:= \
|
||||
lunzn_fastrhino-r66s
|
||||
endef
|
||||
|
||||
define U-Boot/nanopi-r5c-rk3568
|
||||
$(U-Boot/rk3568/Default)
|
||||
NAME:=NanoPi R5C
|
||||
@@ -333,6 +347,8 @@ UBOOT_TARGETS := \
|
||||
radxa-zero-3-rk3566 \
|
||||
rock-3c-rk3566 \
|
||||
bpi-r2-pro-rk3568 \
|
||||
easepi-r1-rk3568 \
|
||||
fastrhino-r66s-rk3568 \
|
||||
nanopi-r5c-rk3568 \
|
||||
nanopi-r5s-rk3568 \
|
||||
radxa-e25-rk3568 \
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
From 37a5383059d0c3d8a72394cbffef775042a40acd Mon Sep 17 00:00:00 2001
|
||||
From: Tianling Shen <cnsztl@gmail.com>
|
||||
Date: Mon, 8 Sep 2025 19:32:18 +0800
|
||||
Subject: [PATCH] board: rockchip: add Lunzn FastRhino R66S
|
||||
|
||||
Lunzn Fastrhino R66S is a high-performance mini router.
|
||||
|
||||
Specification:
|
||||
- Rockchip RK3568
|
||||
- 1/2GB LPDDR4 RAM
|
||||
- SD card slot
|
||||
- 2x USB 3.0 Port
|
||||
- 2x 2500 Base-T (PCIe, r8125b)
|
||||
- 12v DC Jack
|
||||
|
||||
Signed-off-by: Tianling Shen <cnsztl@gmail.com>
|
||||
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
|
||||
---
|
||||
.../arm/dts/rk3568-fastrhino-r66s-u-boot.dtsi | 3 +
|
||||
board/rockchip/evb_rk3568/MAINTAINERS | 7 ++
|
||||
configs/fastrhino-r66s-rk3568_defconfig | 64 +++++++++++++++++++
|
||||
doc/board/rockchip/rockchip.rst | 1 +
|
||||
4 files changed, 75 insertions(+)
|
||||
create mode 100644 arch/arm/dts/rk3568-fastrhino-r66s-u-boot.dtsi
|
||||
create mode 100644 configs/fastrhino-r66s-rk3568_defconfig
|
||||
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/rk3568-fastrhino-r66s-u-boot.dtsi
|
||||
@@ -0,0 +1,9 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
+
|
||||
+#include "rk356x-u-boot.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ chosen {
|
||||
+ stdout-path = &uart2;
|
||||
+ };
|
||||
+};
|
||||
--- a/board/rockchip/evb_rk3568/MAINTAINERS
|
||||
+++ b/board/rockchip/evb_rk3568/MAINTAINERS
|
||||
@@ -14,6 +14,13 @@ F: configs/evb-rk3568_defconfig
|
||||
F: arch/arm/dts/rk3568-evb-u-boot.dtsi
|
||||
F: arch/arm/dts/rk3568-evb.dts
|
||||
|
||||
+FASTRHINO-R66S-RK3568
|
||||
+M: Tianling Shen <cnsztl@gmail.com>
|
||||
+R: Jonas Karlman <jonas@kwiboo.se>
|
||||
+S: Maintained
|
||||
+F: configs/fastrhino-r66s-rk3568_defconfig
|
||||
+F: arch/arm/dts/rk3568-fastrhino-r66s-u-boot.dtsi
|
||||
+
|
||||
GENERIC-RK3568
|
||||
M: Jonas Karlman <jonas@kwiboo.se>
|
||||
S: Maintained
|
||||
--- /dev/null
|
||||
+++ b/configs/fastrhino-r66s-rk3568_defconfig
|
||||
@@ -0,0 +1,65 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_SKIP_LOWLEVEL_INIT=y
|
||||
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
|
||||
+CONFIG_COUNTER_FREQUENCY=24000000
|
||||
+CONFIG_ARCH_ROCKCHIP=y
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3568-fastrhino-r66s"
|
||||
+CONFIG_ROCKCHIP_RK3568=y
|
||||
+CONFIG_SPL_SERIAL=y
|
||||
+CONFIG_DEBUG_UART_BASE=0xFE660000
|
||||
+CONFIG_DEBUG_UART_CLOCK=24000000
|
||||
+CONFIG_SYS_LOAD_ADDR=0xc00800
|
||||
+CONFIG_PCI=y
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_VERBOSE=y
|
||||
+CONFIG_SPL_FIT_SIGNATURE=y
|
||||
+CONFIG_SPL_LOAD_FIT=y
|
||||
+CONFIG_LEGACY_IMAGE_FORMAT=y
|
||||
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-fastrhino-r66s.dtb"
|
||||
+# CONFIG_DISPLAY_CPUINFO is not set
|
||||
+CONFIG_DISPLAY_BOARDINFO_LATE=y
|
||||
+CONFIG_SPL_MAX_SIZE=0x40000
|
||||
+CONFIG_SPL_PAD_TO=0x7f8000
|
||||
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
|
||||
+CONFIG_SPL_ATF=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_GPT=y
|
||||
+CONFIG_CMD_I2C=y
|
||||
+CONFIG_CMD_MMC=y
|
||||
+CONFIG_CMD_PCI=y
|
||||
+CONFIG_CMD_USB=y
|
||||
+CONFIG_CMD_PMIC=y
|
||||
+CONFIG_CMD_REGULATOR=y
|
||||
+# CONFIG_SPL_DOS_PARTITION is not set
|
||||
+CONFIG_SPL_OF_CONTROL=y
|
||||
+CONFIG_OF_LIVE=y
|
||||
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
|
||||
+CONFIG_SPL_DM_SEQ_ALIAS=y
|
||||
+CONFIG_SPL_REGMAP=y
|
||||
+CONFIG_SPL_SYSCON=y
|
||||
+CONFIG_SPL_CLK=y
|
||||
+CONFIG_ROCKCHIP_GPIO=y
|
||||
+CONFIG_SYS_I2C_ROCKCHIP=y
|
||||
+CONFIG_MISC=y
|
||||
+CONFIG_MMC_DW=y
|
||||
+CONFIG_MMC_DW_ROCKCHIP=y
|
||||
+CONFIG_RTL8169=y
|
||||
+CONFIG_PCIE_DW_ROCKCHIP=y
|
||||
+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
|
||||
+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
|
||||
+CONFIG_SPL_PINCTRL=y
|
||||
+CONFIG_DM_PMIC=y
|
||||
+CONFIG_PMIC_RK8XX=y
|
||||
+CONFIG_REGULATOR_RK8XX=y
|
||||
+CONFIG_PWM_ROCKCHIP=y
|
||||
+CONFIG_SPL_RAM=y
|
||||
+CONFIG_BAUDRATE=1500000
|
||||
+CONFIG_DEBUG_UART_SHIFT=2
|
||||
+CONFIG_SYS_NS16550_MEM32=y
|
||||
+CONFIG_SYSRESET=y
|
||||
+CONFIG_USB=y
|
||||
+CONFIG_USB_XHCI_HCD=y
|
||||
+CONFIG_USB_DWC3=y
|
||||
+CONFIG_USB_DWC3_GENERIC=y
|
||||
+CONFIG_ERRNO_STR=y
|
||||
--- a/doc/board/rockchip/rockchip.rst
|
||||
+++ b/doc/board/rockchip/rockchip.rst
|
||||
@@ -118,6 +118,7 @@ List of mainline supported Rockchip boar
|
||||
- FriendlyElec NanoPi R5S (nanopi-r5s-rk3568)
|
||||
- Generic RK3566/RK3568 (generic-rk3568)
|
||||
- Hardkernel ODROID-M1 (odroid-m1-rk3568)
|
||||
+ - Lunzn FastRhino R66S (fastrhino-r66s-rk3568)
|
||||
- Radxa E25 Carrier Board (radxa-e25-rk3568)
|
||||
- Radxa ROCK 3A (rock-3a-rk3568)
|
||||
- Radxa ROCK 3B (rock-3b-rk3568)
|
||||
@@ -0,0 +1,662 @@
|
||||
From 63d60b21fd4933080ff22bdc21652f7c2a14bc52 Mon Sep 17 00:00:00 2001
|
||||
From: Liangbin Lian <jjm2473@gmail.com>
|
||||
Date: Tue, 14 Oct 2025 13:12:26 +0800
|
||||
Subject: [PATCH 1/2] arm64: dts: rockchip: add LinkEase EasePi R1
|
||||
|
||||
LinkEase EasePi R1 [1] is a high-performance mini router.
|
||||
|
||||
Specification:
|
||||
- Rockchip RK3568
|
||||
- 2GB/4GB LPDDR4 RAM
|
||||
- 16GB on-board eMMC
|
||||
- 1x M.2 key for 2280 NVMe (PCIe 3.0)
|
||||
- 1x USB 3.0 Type-A
|
||||
- 1x USB 2.0 Type-C (for USB flashing)
|
||||
- 2x 1000 Base-T (native, RTL8211F)
|
||||
- 2x 2500 Base-T (PCIe, RTL8125B)
|
||||
- 1x HDMI 2.0 Output
|
||||
- 12v DC Jack
|
||||
- 1x Power key connected to PMIC
|
||||
- 2x LEDs (one static power supplied, one GPIO controlled)
|
||||
|
||||
[1] https://doc.linkease.com/zh/guide/easepi-r1/hardware.html
|
||||
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
|
||||
Link: https://patch.msgid.link/20251014051226.64255-4-jjm2473@gmail.com
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
[ upstream commit: deaefeaf3df433d50935b9a85076041040f06d74 ]
|
||||
|
||||
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
|
||||
---
|
||||
.../src/arm64/rockchip/rk3568-easepi-r1.dts | 623 ++++++++++++++++++
|
||||
1 file changed, 623 insertions(+)
|
||||
create mode 100644 dts/upstream/src/arm64/rockchip/rk3568-easepi-r1.dts
|
||||
|
||||
--- /dev/null
|
||||
+++ b/dts/upstream/src/arm64/rockchip/rk3568-easepi-r1.dts
|
||||
@@ -0,0 +1,623 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
+
|
||||
+/dts-v1/;
|
||||
+
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/input.h>
|
||||
+#include <dt-bindings/leds/common.h>
|
||||
+#include <dt-bindings/pinctrl/rockchip.h>
|
||||
+#include <dt-bindings/soc/rockchip,vop2.h>
|
||||
+#include "rk3568.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ model = "LinkEase EasePi R1";
|
||||
+ compatible = "linkease,easepi-r1", "rockchip,rk3568";
|
||||
+
|
||||
+ aliases {
|
||||
+ ethernet0 = &gmac0;
|
||||
+ ethernet1 = &gmac1;
|
||||
+ mmc0 = &sdhci;
|
||||
+ };
|
||||
+
|
||||
+ chosen: chosen {
|
||||
+ stdout-path = "serial2:1500000n8";
|
||||
+ };
|
||||
+
|
||||
+ adc-keys {
|
||||
+ compatible = "adc-keys";
|
||||
+ io-channels = <&saradc 0>;
|
||||
+ io-channel-names = "buttons";
|
||||
+ keyup-threshold-microvolt = <1800000>;
|
||||
+
|
||||
+ button-recovery {
|
||||
+ label = "Recovery";
|
||||
+ linux,code = <KEY_VENDOR>;
|
||||
+ press-threshold-microvolt = <1750>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio-leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&status_led_pin>;
|
||||
+
|
||||
+ status_led: led-status {
|
||||
+ color = <LED_COLOR_ID_GREEN>;
|
||||
+ function = LED_FUNCTION_STATUS;
|
||||
+ gpios = <&gpio2 RK_PD7 GPIO_ACTIVE_HIGH>;
|
||||
+ linux,default-trigger = "heartbeat";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ hdmi-con {
|
||||
+ compatible = "hdmi-connector";
|
||||
+ type = "a";
|
||||
+
|
||||
+ port {
|
||||
+ hdmi_con_in: endpoint {
|
||||
+ remote-endpoint = <&hdmi_out_con>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ dc_12v: regulator-dc-12v {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "dc_12v";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <12000000>;
|
||||
+ regulator-max-microvolt = <12000000>;
|
||||
+ };
|
||||
+
|
||||
+ vcc5v0_sys: regulator-vcc5v0-sys {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "vcc5v0_sys";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ vin-supply = <&dc_12v>;
|
||||
+ };
|
||||
+
|
||||
+ vcc3v3_sys: regulator-vcc3v3-sys {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "vcc3v3_sys";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ vin-supply = <&dc_12v>;
|
||||
+ };
|
||||
+
|
||||
+ pcie30_avdd0v9: regulator-pcie30-avdd0v9 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "pcie30_avdd0v9";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <900000>;
|
||||
+ regulator-max-microvolt = <900000>;
|
||||
+ vin-supply = <&vcc3v3_sys>;
|
||||
+ };
|
||||
+
|
||||
+ pcie30_avdd1v8: regulator-pcie30-avdd1v8 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "pcie30_avdd1v8";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+ vin-supply = <&vcc3v3_sys>;
|
||||
+ };
|
||||
+
|
||||
+ regulator-vdd0v95-25glan {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ enable-active-high;
|
||||
+ gpio = <&gpio3 RK_PB1 GPIO_ACTIVE_HIGH>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&vdd0v95_25glan_en>;
|
||||
+ regulator-name = "vdd0v95_25glan";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <950000>;
|
||||
+ regulator-max-microvolt = <950000>;
|
||||
+ vin-supply = <&vcc3v3_sys>;
|
||||
+ };
|
||||
+
|
||||
+ vcc3v3_nvme: regulator-vcc3v3-nvme {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ enable-active-high;
|
||||
+ gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&vcc3v3_nvme_en>;
|
||||
+ regulator-name = "vcc3v3_nvme";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ vin-supply = <&dc_12v>;
|
||||
+ };
|
||||
+
|
||||
+};
|
||||
+
|
||||
+&combphy1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&combphy2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&cpu0 {
|
||||
+ cpu-supply = <&vdd_cpu>;
|
||||
+};
|
||||
+
|
||||
+&cpu1 {
|
||||
+ cpu-supply = <&vdd_cpu>;
|
||||
+};
|
||||
+
|
||||
+&cpu2 {
|
||||
+ cpu-supply = <&vdd_cpu>;
|
||||
+};
|
||||
+
|
||||
+&cpu3 {
|
||||
+ cpu-supply = <&vdd_cpu>;
|
||||
+};
|
||||
+
|
||||
+&gmac0 {
|
||||
+ assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
|
||||
+ assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>;
|
||||
+ assigned-clock-rates = <0>, <125000000>;
|
||||
+ phy-handle = <&rgmii_phy0>;
|
||||
+ phy-mode = "rgmii-id";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&gmac0_miim
|
||||
+ &gmac0_tx_bus2
|
||||
+ &gmac0_rx_bus2
|
||||
+ &gmac0_rgmii_clk
|
||||
+ &gmac0_rgmii_bus>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&gmac1 {
|
||||
+ assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
|
||||
+ assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>;
|
||||
+ assigned-clock-rates = <0>, <125000000>;
|
||||
+ phy-handle = <&rgmii_phy1>;
|
||||
+ phy-mode = "rgmii-id";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&gmac1m1_miim
|
||||
+ &gmac1m1_tx_bus2
|
||||
+ &gmac1m1_rx_bus2
|
||||
+ &gmac1m1_rgmii_clk
|
||||
+ &gmac1m1_rgmii_bus>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&gpu {
|
||||
+ mali-supply = <&vdd_gpu>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi {
|
||||
+ avdd-0v9-supply = <&vdda0v9_image>;
|
||||
+ avdd-1v8-supply = <&vcca1v8_image>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi_in {
|
||||
+ hdmi_in_vp0: endpoint {
|
||||
+ remote-endpoint = <&vp0_out_hdmi>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&hdmi_out {
|
||||
+ hdmi_out_con: endpoint {
|
||||
+ remote-endpoint = <&hdmi_con_in>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&hdmi_sound {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2c0 {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ vdd_cpu: regulator@1c {
|
||||
+ compatible = "tcs,tcs4525";
|
||||
+ reg = <0x1c>;
|
||||
+ fcs,suspend-voltage-selector = <1>;
|
||||
+ regulator-name = "vdd_cpu";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <800000>;
|
||||
+ regulator-max-microvolt = <1150000>;
|
||||
+ regulator-ramp-delay = <2300>;
|
||||
+ vin-supply = <&vcc5v0_sys>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ rk809: pmic@20 {
|
||||
+ compatible = "rockchip,rk809";
|
||||
+ reg = <0x20>;
|
||||
+ interrupt-parent = <&gpio0>;
|
||||
+ interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
|
||||
+ #clock-cells = <1>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&pmic_int>;
|
||||
+ system-power-controller;
|
||||
+ vcc1-supply = <&vcc3v3_sys>;
|
||||
+ vcc2-supply = <&vcc3v3_sys>;
|
||||
+ vcc3-supply = <&vcc3v3_sys>;
|
||||
+ vcc4-supply = <&vcc3v3_sys>;
|
||||
+ vcc5-supply = <&vcc3v3_sys>;
|
||||
+ vcc6-supply = <&vcc3v3_sys>;
|
||||
+ vcc7-supply = <&vcc3v3_sys>;
|
||||
+ vcc8-supply = <&vcc3v3_sys>;
|
||||
+ vcc9-supply = <&vcc3v3_sys>;
|
||||
+ wakeup-source;
|
||||
+
|
||||
+ regulators {
|
||||
+ vdd_logic: DCDC_REG1 {
|
||||
+ regulator-name = "vdd_logic";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-initial-mode = <0x2>;
|
||||
+ regulator-min-microvolt = <500000>;
|
||||
+ regulator-max-microvolt = <1350000>;
|
||||
+ regulator-ramp-delay = <6001>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdd_gpu: DCDC_REG2 {
|
||||
+ regulator-name = "vdd_gpu";
|
||||
+ regulator-always-on;
|
||||
+ regulator-initial-mode = <0x2>;
|
||||
+ regulator-min-microvolt = <500000>;
|
||||
+ regulator-max-microvolt = <1350000>;
|
||||
+ regulator-ramp-delay = <6001>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc_ddr: DCDC_REG3 {
|
||||
+ regulator-name = "vcc_ddr";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-initial-mode = <0x2>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdd_npu: DCDC_REG4 {
|
||||
+ regulator-name = "vdd_npu";
|
||||
+ regulator-initial-mode = <0x2>;
|
||||
+ regulator-min-microvolt = <500000>;
|
||||
+ regulator-max-microvolt = <1350000>;
|
||||
+ regulator-ramp-delay = <6001>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc_1v8: DCDC_REG5 {
|
||||
+ regulator-name = "vcc_1v8";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdda0v9_image: LDO_REG1 {
|
||||
+ regulator-name = "vdda0v9_image";
|
||||
+ regulator-min-microvolt = <950000>;
|
||||
+ regulator-max-microvolt = <950000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdda_0v9: LDO_REG2 {
|
||||
+ regulator-name = "vdda_0v9";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <900000>;
|
||||
+ regulator-max-microvolt = <900000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vdda0v9_pmu: LDO_REG3 {
|
||||
+ regulator-name = "vdda0v9_pmu";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <900000>;
|
||||
+ regulator-max-microvolt = <900000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ regulator-suspend-microvolt = <900000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vccio_acodec: LDO_REG4 {
|
||||
+ regulator-name = "vccio_acodec";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vccio_sd: LDO_REG5 {
|
||||
+ regulator-name = "vccio_sd";
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc3v3_pmu: LDO_REG6 {
|
||||
+ regulator-name = "vcc3v3_pmu";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ regulator-suspend-microvolt = <3300000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcca_1v8: LDO_REG7 {
|
||||
+ regulator-name = "vcca_1v8";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcca1v8_pmu: LDO_REG8 {
|
||||
+ regulator-name = "vcca1v8_pmu";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-on-in-suspend;
|
||||
+ regulator-suspend-microvolt = <1800000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcca1v8_image: LDO_REG9 {
|
||||
+ regulator-name = "vcca1v8_image";
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc_3v3: SWITCH_REG1 {
|
||||
+ regulator-name = "vcc_3v3";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ vcc3v3_sd: SWITCH_REG2 {
|
||||
+ regulator-name = "vcc3v3_sd";
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+
|
||||
+ regulator-state-mem {
|
||||
+ regulator-off-in-suspend;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2s0_8ch {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mdio0 {
|
||||
+ rgmii_phy0: ethernet-phy@1 {
|
||||
+ compatible = "ethernet-phy-ieee802.3-c22";
|
||||
+ reg = <0x1>;
|
||||
+ pinctrl-0 = <ð_phy0_reset_pin>;
|
||||
+ pinctrl-names = "default";
|
||||
+ reset-assert-us = <20000>;
|
||||
+ reset-deassert-us = <100000>;
|
||||
+ reset-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mdio1 {
|
||||
+ rgmii_phy1: ethernet-phy@1 {
|
||||
+ compatible = "ethernet-phy-ieee802.3-c22";
|
||||
+ reg = <0x1>;
|
||||
+ pinctrl-0 = <ð_phy1_reset_pin>;
|
||||
+ pinctrl-names = "default";
|
||||
+ reset-assert-us = <20000>;
|
||||
+ reset-deassert-us = <100000>;
|
||||
+ reset-gpios = <&gpio2 RK_PD1 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+/* ETH3 */
|
||||
+&pcie2x1 {
|
||||
+ reset-gpios = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>;
|
||||
+ vpcie3v3-supply = <&vcc3v3_sys>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&pcie30phy {
|
||||
+ data-lanes = <1 2>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+/* ETH2 */
|
||||
+&pcie3x1 {
|
||||
+ num-lanes = <1>;
|
||||
+ reset-gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_HIGH>;
|
||||
+ vpcie3v3-supply = <&vcc3v3_sys>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+/* M.2 Key for 2280 NVMe */
|
||||
+&pcie3x2 {
|
||||
+ num-lanes = <1>;
|
||||
+ reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>;
|
||||
+ vpcie3v3-supply = <&vcc3v3_nvme>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ gmac0 {
|
||||
+ eth_phy0_reset_pin: eth-phy0-reset-pin {
|
||||
+ rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gmac1 {
|
||||
+ eth_phy1_reset_pin: eth-phy1-reset-pin {
|
||||
+ rockchip,pins = <2 RK_PD1 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio-leds {
|
||||
+ status_led_pin: status-led-pin {
|
||||
+ rockchip,pins = <2 RK_PD7 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ nvme {
|
||||
+ vcc3v3_nvme_en: vcc3v3-nvme-en {
|
||||
+ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ pcie-nic {
|
||||
+ vdd0v95_25glan_en: vdd0v95-25glan-en {
|
||||
+ rockchip,pins = <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ pmic {
|
||||
+ pmic_int: pmic-int {
|
||||
+ rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+};
|
||||
+
|
||||
+&pmu_io_domains {
|
||||
+ pmuio1-supply = <&vcc3v3_pmu>;
|
||||
+ pmuio2-supply = <&vcc3v3_pmu>;
|
||||
+ vccio1-supply = <&vccio_acodec>;
|
||||
+ vccio3-supply = <&vccio_sd>;
|
||||
+ vccio4-supply = <&vcc_1v8>;
|
||||
+ vccio5-supply = <&vcc_3v3>;
|
||||
+ vccio6-supply = <&vcc_1v8>;
|
||||
+ vccio7-supply = <&vcc_3v3>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&saradc {
|
||||
+ vref-supply = <&vcca_1v8>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&sdhci {
|
||||
+ bus-width = <8>;
|
||||
+ max-frequency = <200000000>;
|
||||
+ non-removable;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&tsadc {
|
||||
+ rockchip,hw-tshut-mode = <1>;
|
||||
+ rockchip,hw-tshut-polarity = <0>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&uart2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+/* OTG Only USB2.0, Only device mode */
|
||||
+&usb_host0_xhci {
|
||||
+ dr_mode = "peripheral";
|
||||
+ extcon = <&usb2phy0>;
|
||||
+ maximum-speed = "high-speed";
|
||||
+ phys = <&usb2phy0_otg>;
|
||||
+ phy-names = "usb2-phy";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_host1_xhci {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb2phy0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb2phy0_host {
|
||||
+ phy-supply = <&vcc5v0_sys>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb2phy0_otg {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&vop {
|
||||
+ assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
|
||||
+ assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&vop_mmu {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&vp0 {
|
||||
+ vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
|
||||
+ reg = <ROCKCHIP_VOP2_EP_HDMI0>;
|
||||
+ remote-endpoint = <&hdmi_in_vp0>;
|
||||
+ };
|
||||
+};
|
||||
@@ -0,0 +1,124 @@
|
||||
From bb1996b423b81b94b1468fffe5eb9949434b941e Mon Sep 17 00:00:00 2001
|
||||
From: Liangbin Lian <jjm2473@gmail.com>
|
||||
Date: Thu, 13 Nov 2025 14:51:21 +0800
|
||||
Subject: [PATCH 2/2] board: rockchip: add LinkEase EasePi R1
|
||||
|
||||
LinkEase EasePi R1 [1] is a high-performance mini router.
|
||||
|
||||
Specification:
|
||||
- Rockchip RK3568
|
||||
- 2GB/4GB LPDDR4 RAM
|
||||
- 16GB on-board eMMC
|
||||
- 1x M.2 key for 2280 NVMe (PCIe 3.0)
|
||||
- 1x USB 3.0 Type-A
|
||||
- 1x USB 2.0 Type-C (for USB flashing)
|
||||
- 2x 1000 Base-T (native, RTL8211F)
|
||||
- 2x 2500 Base-T (PCIe, RTL8125B)
|
||||
- 1x HDMI 2.0 Output
|
||||
- 12v DC Jack
|
||||
- 1x Power key connected to PMIC
|
||||
- 2x LEDs (one static power supplied, one GPIO controlled)
|
||||
|
||||
[1] https://doc.linkease.com/zh/guide/easepi-r1/hardware.html
|
||||
|
||||
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
|
||||
---
|
||||
arch/arm/dts/rk3568-easepi-r1-u-boot.dtsi | 3 +
|
||||
configs/easepi-r1-rk3568_defconfig | 84 +++++++++++++++++++++++
|
||||
2 files changed, 87 insertions(+)
|
||||
create mode 100644 arch/arm/dts/rk3568-easepi-r1-u-boot.dtsi
|
||||
create mode 100644 configs/easepi-r1-rk3568_defconfig
|
||||
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/rk3568-easepi-r1-u-boot.dtsi
|
||||
@@ -0,0 +1,3 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
+
|
||||
+#include "rk356x-u-boot.dtsi"
|
||||
--- /dev/null
|
||||
+++ b/configs/easepi-r1-rk3568_defconfig
|
||||
@@ -0,0 +1,84 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_SKIP_LOWLEVEL_INIT=y
|
||||
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
|
||||
+CONFIG_COUNTER_FREQUENCY=24000000
|
||||
+CONFIG_ARCH_ROCKCHIP=y
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3568-easepi-r1"
|
||||
+CONFIG_ROCKCHIP_RK3568=y
|
||||
+CONFIG_SPL_SERIAL=y
|
||||
+CONFIG_SYS_LOAD_ADDR=0xc00800
|
||||
+CONFIG_DEBUG_UART_BASE=0xFE660000
|
||||
+CONFIG_DEBUG_UART_CLOCK=24000000
|
||||
+CONFIG_PCI=y
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_VERBOSE=y
|
||||
+CONFIG_SPL_FIT_SIGNATURE=y
|
||||
+CONFIG_SPL_LOAD_FIT=y
|
||||
+CONFIG_LEGACY_IMAGE_FORMAT=y
|
||||
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-easepi-r1.dtb"
|
||||
+# CONFIG_DISPLAY_CPUINFO is not set
|
||||
+CONFIG_DISPLAY_BOARDINFO_LATE=y
|
||||
+CONFIG_SPL_MAX_SIZE=0x40000
|
||||
+CONFIG_SPL_PAD_TO=0x7f8000
|
||||
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
|
||||
+CONFIG_SPL_ATF=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_GPT=y
|
||||
+CONFIG_CMD_I2C=y
|
||||
+CONFIG_CMD_MMC=y
|
||||
+CONFIG_CMD_PCI=y
|
||||
+CONFIG_CMD_USB=y
|
||||
+CONFIG_CMD_ROCKUSB=y
|
||||
+CONFIG_CMD_USB_MASS_STORAGE=y
|
||||
+CONFIG_CMD_PMIC=y
|
||||
+CONFIG_CMD_REGULATOR=y
|
||||
+# CONFIG_SPL_DOS_PARTITION is not set
|
||||
+CONFIG_SPL_OF_CONTROL=y
|
||||
+CONFIG_OF_LIVE=y
|
||||
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
|
||||
+CONFIG_SPL_DM_SEQ_ALIAS=y
|
||||
+CONFIG_SPL_REGMAP=y
|
||||
+CONFIG_SPL_SYSCON=y
|
||||
+CONFIG_SPL_CLK=y
|
||||
+# CONFIG_USB_FUNCTION_FASTBOOT is not set
|
||||
+CONFIG_ROCKCHIP_GPIO=y
|
||||
+CONFIG_SYS_I2C_ROCKCHIP=y
|
||||
+CONFIG_MISC=y
|
||||
+CONFIG_SUPPORT_EMMC_RPMB=y
|
||||
+CONFIG_MMC_DW=y
|
||||
+CONFIG_MMC_DW_ROCKCHIP=y
|
||||
+CONFIG_MMC_SDHCI=y
|
||||
+CONFIG_MMC_SDHCI_SDMA=y
|
||||
+CONFIG_MMC_SDHCI_ROCKCHIP=y
|
||||
+CONFIG_PHY_REALTEK=y
|
||||
+CONFIG_DWC_ETH_QOS=y
|
||||
+CONFIG_DWC_ETH_QOS_ROCKCHIP=y
|
||||
+CONFIG_RTL8169=y
|
||||
+CONFIG_NVME_PCI=y
|
||||
+CONFIG_PCIE_DW_ROCKCHIP=y
|
||||
+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
|
||||
+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
|
||||
+CONFIG_SPL_PINCTRL=y
|
||||
+CONFIG_DM_PMIC=y
|
||||
+CONFIG_PMIC_RK8XX=y
|
||||
+CONFIG_REGULATOR_RK8XX=y
|
||||
+CONFIG_PWM_ROCKCHIP=y
|
||||
+CONFIG_SPL_RAM=y
|
||||
+CONFIG_BAUDRATE=1500000
|
||||
+CONFIG_DEBUG_UART_SHIFT=2
|
||||
+CONFIG_SYS_NS16550_MEM32=y
|
||||
+CONFIG_SYSRESET=y
|
||||
+CONFIG_USB=y
|
||||
+CONFIG_USB_XHCI_HCD=y
|
||||
+CONFIG_USB_EHCI_HCD=y
|
||||
+CONFIG_USB_EHCI_GENERIC=y
|
||||
+CONFIG_USB_OHCI_HCD=y
|
||||
+CONFIG_USB_OHCI_GENERIC=y
|
||||
+CONFIG_USB_DWC3=y
|
||||
+CONFIG_USB_DWC3_GENERIC=y
|
||||
+CONFIG_SPL_USB_DWC3_GENERIC=y
|
||||
+CONFIG_USB_GADGET=y
|
||||
+CONFIG_USB_GADGET_DOWNLOAD=y
|
||||
+CONFIG_USB_FUNCTION_ROCKUSB=y
|
||||
+CONFIG_ERRNO_STR=y
|
||||
@@ -6,9 +6,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
|
||||
PKG_SOURCE_DATE:=2025-10-17
|
||||
PKG_SOURCE_VERSION:=a1529e183333e38bdc95dc8d9317b7af2bec0dcd
|
||||
PKG_MIRROR_HASH:=30ce8f808424602cba556e106cb16080ef29d6d45a9d9018e04664598460eb2f
|
||||
PKG_SOURCE_DATE:=2025-10-22
|
||||
PKG_SOURCE_VERSION:=ec6831a43ff066c9873e7c41fd6f68354bb67b4a
|
||||
PKG_MIRROR_HASH:=33a26f90fd450e9dc2b2d5ae9c137ffcd57ef62dac277d63c5d5f6f5a1262a2f
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@@ -58,6 +58,7 @@ ALLWIFIBOARDS:= \
|
||||
tplink_archer-c59-v1 \
|
||||
tplink_archer-c6-v2 \
|
||||
tplink_archer-c60-v1 \
|
||||
tplink_archer-c60-v2 \
|
||||
wallys_dr40x9 \
|
||||
xiaomi_aiot-ac2350 \
|
||||
xiaomi_ax3600 \
|
||||
@@ -192,6 +193,7 @@ $(eval $(call generate-ipq-wifi-package,tplink_eap660hd-v1,TP-Link EAP660 HD v1)
|
||||
$(eval $(call generate-ipq-wifi-package,tplink_archer-c59-v1,TP-Link Archer C59 V1))
|
||||
$(eval $(call generate-ipq-wifi-package,tplink_archer-c6-v2,TP-Link Archer C6 V2))
|
||||
$(eval $(call generate-ipq-wifi-package,tplink_archer-c60-v1,TP-Link Archer C60 V1))
|
||||
$(eval $(call generate-ipq-wifi-package,tplink_archer-c60-v2,TP-Link Archer C60 V2))
|
||||
$(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9))
|
||||
$(eval $(call generate-ipq-wifi-package,xiaomi_aiot-ac2350,Xiaomi AIoT AC2350))
|
||||
$(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600))
|
||||
|
||||
@@ -25,6 +25,8 @@ define Package/layerscape-fman
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=NXP FMan ucode
|
||||
DEPENDS:=@TARGET_layerscape
|
||||
DEFAULT:=y if TARGET_layerscape_armv8_64b
|
||||
HIDDEN:=1
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
|
||||
@@ -27,6 +27,8 @@ define Package/layerscape-ddr-phy
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=NXP Layerscape DDR PHY firmware
|
||||
DEPENDS:=@TARGET_layerscape
|
||||
DEFAULT:=y if TARGET_layerscape_armv8_64b
|
||||
HIDDEN:=1
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
|
||||
@@ -26,6 +26,8 @@ define Package/layerscape-dpl
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=NXP DPL firmware
|
||||
DEPENDS:=@TARGET_layerscape
|
||||
DEFAULT:=y if TARGET_layerscape_armv8_64b
|
||||
HIDDEN:=1
|
||||
endef
|
||||
|
||||
MAKE_PATH:=config
|
||||
|
||||
@@ -25,6 +25,8 @@ define Package/layerscape-mc
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=NXP MC firmware
|
||||
DEPENDS:=@TARGET_layerscape
|
||||
DEFAULT:=y if TARGET_layerscape_armv8_64b
|
||||
HIDDEN:=1
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
|
||||
@@ -25,6 +25,8 @@ define Package/layerscape-rcw
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=NXP Layerscape RCW binaries
|
||||
DEPENDS:=@TARGET_layerscape
|
||||
DEFAULT:=y if TARGET_layerscape_armv7
|
||||
HIDDEN:=1
|
||||
endef
|
||||
|
||||
BOARDS := \
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wireless-regdb
|
||||
PKG_VERSION:=2025.07.10
|
||||
PKG_VERSION:=2025.10.07
|
||||
PKG_RELEASE:=1
|
||||
PKG_LICENSE:=ISC
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/software/network/wireless-regdb/
|
||||
PKG_HASH:=a8340bcdcd1b5db6c79149879d122b170f3bb075381718d4f429ad831a6fa28d
|
||||
PKG_HASH:=d4c872a44154604c869f5851f7d21d818d492835d370af7f58de8847973801c3
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ define Package/bcm63xx-cfe/install
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
rm -rf $(KERNEL_BUILD_DIR)/$(PKG_NAME)
|
||||
mkdir -p $(KERNEL_BUILD_DIR)/$(PKG_NAME)
|
||||
$(CP) -r $(PKG_BUILD_DIR)/* $(KERNEL_BUILD_DIR)/$(PKG_NAME)
|
||||
rm -rf $(STAGING_DIR_IMAGE)/$(PKG_NAME)
|
||||
mkdir -p $(STAGING_DIR_IMAGE)/$(PKG_NAME)
|
||||
$(CP) -r $(PKG_BUILD_DIR)/* $(STAGING_DIR_IMAGE)/$(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,bcm63xx-cfe))
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
Fixes leaking the ethernet FCS into the frame payload on the RX
|
||||
path.
|
||||
|
||||
--- a/dcdp/ptm_tc.c
|
||||
+++ b/dcdp/ptm_tc.c
|
||||
@@ -923,7 +923,7 @@ static void ptm_fw_init(struct ptm_ep_pr
|
||||
rx_gitf_cfg.rx_inserted_bytes_1h = 0;
|
||||
rx_gitf_cfg.rx_inserted_bytes_2l = 0;
|
||||
rx_gitf_cfg.rx_inserted_bytes_2h = 0;
|
||||
- rx_gitf_cfg.rx_len_adj = -2;
|
||||
+ rx_gitf_cfg.rx_len_adj = is_bonding ? -2 : -6;
|
||||
for (i = 0; i < 4; i++) {
|
||||
dst_addr = __RX_GIF0_CFG_STATS_CFG +
|
||||
(i * DW_SZ(rx_gitf_cfg));
|
||||
@@ -10,13 +10,13 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=mac80211
|
||||
|
||||
PKG_VERSION:=6.12.52
|
||||
PKG_VERSION:=6.12.61
|
||||
PKG_RELEASE:=1
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
|
||||
PKG_HASH:=ed6ef4c67e08b294ed1101c7cc5ae584a5f338c99ef95362fa3921eb6d207f5d
|
||||
PKG_HASH:=9db2f836dba7f38ad68f8798720ad4360bce6a3557bde02b88b3a4f068c77118
|
||||
|
||||
PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)backports-$(PKG_VERSION)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ath/ath10k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/mac.c
|
||||
@@ -9924,6 +9924,21 @@ static int ath10k_mac_init_rd(struct ath
|
||||
@@ -9932,6 +9932,21 @@ static int ath10k_mac_init_rd(struct ath
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
int ath10k_mac_register(struct ath10k *ar)
|
||||
{
|
||||
static const u32 cipher_suites[] = {
|
||||
@@ -10286,6 +10301,12 @@ int ath10k_mac_register(struct ath10k *a
|
||||
@@ -10294,6 +10309,12 @@ int ath10k_mac_register(struct ath10k *a
|
||||
|
||||
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ Signed-off-by: Mathias Kresin <dev@kresin.me>
|
||||
if (ret)
|
||||
--- a/drivers/net/wireless/ath/ath10k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/mac.c
|
||||
@@ -10302,7 +10302,7 @@ int ath10k_mac_register(struct ath10k *a
|
||||
@@ -10310,7 +10310,7 @@ int ath10k_mac_register(struct ath10k *a
|
||||
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
|
||||
|
||||
#ifdef CPTCFG_MAC80211_LEDS
|
||||
|
||||
@@ -28,7 +28,7 @@ Forwarded: no
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath10k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/mac.c
|
||||
@@ -1022,6 +1022,40 @@ static inline int ath10k_vdev_setup_sync
|
||||
@@ -1030,6 +1030,40 @@ static inline int ath10k_vdev_setup_sync
|
||||
return ar->last_wmi_vdev_start_status;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ Forwarded: no
|
||||
static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id)
|
||||
{
|
||||
struct cfg80211_chan_def *chandef = NULL;
|
||||
@@ -1054,7 +1088,8 @@ static int ath10k_monitor_vdev_start(str
|
||||
@@ -1062,7 +1096,8 @@ static int ath10k_monitor_vdev_start(str
|
||||
arg.channel.min_power = 0;
|
||||
arg.channel.max_power = channel->max_power * 2;
|
||||
arg.channel.max_reg_power = channel->max_reg_power * 2;
|
||||
@@ -79,7 +79,7 @@ Forwarded: no
|
||||
|
||||
reinit_completion(&ar->vdev_setup_done);
|
||||
reinit_completion(&ar->vdev_delete_done);
|
||||
@@ -1500,7 +1535,8 @@ static int ath10k_vdev_start_restart(str
|
||||
@@ -1508,7 +1543,8 @@ static int ath10k_vdev_start_restart(str
|
||||
arg.channel.min_power = 0;
|
||||
arg.channel.max_power = chandef->chan->max_power * 2;
|
||||
arg.channel.max_reg_power = chandef->chan->max_reg_power * 2;
|
||||
@@ -89,7 +89,7 @@ Forwarded: no
|
||||
|
||||
if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
|
||||
arg.ssid = arvif->u.ap.ssid;
|
||||
@@ -3431,7 +3467,8 @@ static int ath10k_update_channel_list(st
|
||||
@@ -3439,7 +3475,8 @@ static int ath10k_update_channel_list(st
|
||||
ch->min_power = 0;
|
||||
ch->max_power = channel->max_power * 2;
|
||||
ch->max_reg_power = channel->max_reg_power * 2;
|
||||
|
||||
@@ -18,7 +18,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath10k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/mac.c
|
||||
@@ -10094,7 +10094,6 @@ int ath10k_mac_register(struct ath10k *a
|
||||
@@ -10102,7 +10102,6 @@ int ath10k_mac_register(struct ath10k *a
|
||||
ieee80211_hw_set(ar->hw, CHANCTX_STA_CSA);
|
||||
ieee80211_hw_set(ar->hw, QUEUE_CONTROL);
|
||||
ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG);
|
||||
|
||||
@@ -29,7 +29,7 @@ Tested-by: Florian Maurer <maurer@fh-aachen.de>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath10k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/mac.c
|
||||
@@ -8135,6 +8135,20 @@ static void ath10k_flush(struct ieee8021
|
||||
@@ -8143,6 +8143,20 @@ static void ath10k_flush(struct ieee8021
|
||||
mutex_unlock(&ar->conf_mutex);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ Tested-by: Florian Maurer <maurer@fh-aachen.de>
|
||||
/* TODO: Implement this function properly
|
||||
* For now it is needed to reply to Probe Requests in IBSS mode.
|
||||
* Probably we need this information from FW.
|
||||
@@ -9486,6 +9500,7 @@ static const struct ieee80211_ops ath10k
|
||||
@@ -9494,6 +9508,7 @@ static const struct ieee80211_ops ath10k
|
||||
.set_rts_threshold = ath10k_set_rts_threshold,
|
||||
.set_frag_threshold = ath10k_mac_op_set_frag_threshold,
|
||||
.flush = ath10k_flush,
|
||||
@@ -58,7 +58,7 @@ Tested-by: Florian Maurer <maurer@fh-aachen.de>
|
||||
.tx_last_beacon = ath10k_tx_last_beacon,
|
||||
.set_antenna = ath10k_set_antenna,
|
||||
.get_antenna = ath10k_get_antenna,
|
||||
@@ -10307,6 +10322,9 @@ int ath10k_mac_register(struct ath10k *a
|
||||
@@ -10315,6 +10330,9 @@ int ath10k_mac_register(struct ath10k *a
|
||||
if (!ar->hw_params.hw_ops->set_coverage_class)
|
||||
ar->ops->set_coverage_class = NULL;
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
From b5ade0e0e1c1622a85fbfd2c93b41caff479f305 Mon Sep 17 00:00:00 2001
|
||||
From: Florian Maurer <f.maurer@outlook.de>
|
||||
Date: Fri, 3 Oct 2025 12:56:13 +0200
|
||||
Subject: [PATCH] ath11k: add ath11k_mac_op_flush_sta to properly flush pending
|
||||
packets
|
||||
|
||||
When a STA is marked as no longer authorized, if the driver doesn't
|
||||
implement flush_sta(), mac80211 calls ieee80211_flush_queues() to
|
||||
flush hardware queues to avoid sending unencrypted frames.
|
||||
|
||||
This has became a problem for ath11k because ieee80211_flush_queues()
|
||||
will stop all traffic and call ath11k_flush, which waits until the
|
||||
whole HW queue is empty. In a busy environment this will trigger a
|
||||
timeout warning and stalls other STAs.
|
||||
|
||||
Fix this by implementing flush_sta method using WMI command to flush
|
||||
frames of a specific STA.
|
||||
Flushed frames will be marked as discard in tx complete indication.
|
||||
|
||||
warning print "ath11k c000000.wifi: failed to flush transmit queue 0"
|
||||
was observed on various openwrt devices, and is fixed through this patch.
|
||||
|
||||
Tested-by: Florian Maurer <f.maurer@outlook.de>
|
||||
Tested-by: Flole <flole@flole.de>
|
||||
Co-developed-by: Benjamin Berg <benjamin@sipsolutions.net>
|
||||
Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
|
||||
Signed-off-by: Florian Maurer <f.maurer@outlook.de>
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -8327,6 +8327,23 @@ static void ath11k_mac_op_flush(struct i
|
||||
ath11k_mac_flush_tx_complete(ar);
|
||||
}
|
||||
|
||||
+static void ath11k_mac_op_flush_sta(struct ieee80211_hw *hw,
|
||||
+ struct ieee80211_vif *vif,
|
||||
+ struct ieee80211_sta *sta)
|
||||
+{
|
||||
+ struct ath11k_vif *arvif = (void *)vif->drv_priv;
|
||||
+ struct ath11k *ar = hw->priv;
|
||||
+ struct peer_flush_params params = {
|
||||
+ .peer_tid_bitmap = 0xFF,
|
||||
+ .vdev_id = arvif->vdev_id,
|
||||
+ };
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = ath11k_wmi_send_peer_flush_tids_cmd(ar, sta->addr, ¶ms);
|
||||
+ if (ret)
|
||||
+ ath11k_warn(ar->ab, "failed to flush sta %pM: %d\n", sta->addr, ret);
|
||||
+}
|
||||
+
|
||||
static bool
|
||||
ath11k_mac_has_single_legacy_rate(struct ath11k *ar,
|
||||
enum nl80211_band band,
|
||||
@@ -9959,6 +9976,7 @@ static const struct ieee80211_ops ath11k
|
||||
.set_bitrate_mask = ath11k_mac_op_set_bitrate_mask,
|
||||
.get_survey = ath11k_mac_op_get_survey,
|
||||
.flush = ath11k_mac_op_flush,
|
||||
+ .flush_sta = ath11k_mac_op_flush_sta,
|
||||
.sta_statistics = ath11k_mac_op_sta_statistics,
|
||||
CFG80211_TESTMODE_CMD(ath11k_tm_cmd)
|
||||
|
||||
@@ -31,7 +31,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
{
|
||||
.hw_rev = ATH11K_HW_IPQ8074,
|
||||
.name = "ipq8074 hw2.0",
|
||||
@@ -2201,7 +2201,8 @@ static void ath11k_core_reset(struct wor
|
||||
@@ -2239,7 +2239,8 @@ static void ath11k_core_reset(struct wor
|
||||
static int ath11k_init_hw_params(struct ath11k_base *ab)
|
||||
{
|
||||
const struct ath11k_hw_params *hw_params = NULL;
|
||||
@@ -41,7 +41,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(ath11k_hw_params); i++) {
|
||||
hw_params = &ath11k_hw_params[i];
|
||||
@@ -2217,7 +2218,31 @@ static int ath11k_init_hw_params(struct
|
||||
@@ -2255,7 +2256,31 @@ static int ath11k_init_hw_params(struct
|
||||
|
||||
ab->hw_params = *hw_params;
|
||||
|
||||
|
||||
@@ -532,7 +532,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -5998,7 +6013,7 @@ static int ath12k_mac_start(struct ath12
|
||||
@@ -6000,7 +6015,7 @@ static int ath12k_mac_start(struct ath12
|
||||
|
||||
/* TODO: Do we need to enable ANI? */
|
||||
|
||||
@@ -541,7 +541,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
|
||||
ar->num_started_vdevs = 0;
|
||||
ar->num_created_vdevs = 0;
|
||||
@@ -6178,6 +6193,9 @@ static void ath12k_mac_stop(struct ath12
|
||||
@@ -6180,6 +6195,9 @@ static void ath12k_mac_stop(struct ath12
|
||||
cancel_delayed_work_sync(&ar->scan.timeout);
|
||||
cancel_work_sync(&ar->regd_update_work);
|
||||
cancel_work_sync(&ar->ab->rfkill_work);
|
||||
@@ -551,7 +551,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
|
||||
spin_lock_bh(&ar->data_lock);
|
||||
list_for_each_entry_safe(ppdu_stats, tmp, &ar->ppdu_stats_info, list) {
|
||||
@@ -6424,6 +6442,117 @@ static void ath12k_mac_op_update_vif_off
|
||||
@@ -6426,6 +6444,117 @@ static void ath12k_mac_op_update_vif_off
|
||||
ath12k_mac_update_vif_offload(arvif);
|
||||
}
|
||||
|
||||
@@ -669,7 +669,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif)
|
||||
{
|
||||
struct ath12k_hw *ah = ar->ah;
|
||||
@@ -6538,6 +6667,7 @@ static int ath12k_mac_vdev_create(struct
|
||||
@@ -6540,6 +6669,7 @@ static int ath12k_mac_vdev_create(struct
|
||||
arvif->vdev_id, ret);
|
||||
goto err_peer_del;
|
||||
}
|
||||
@@ -677,7 +677,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
break;
|
||||
case WMI_VDEV_TYPE_STA:
|
||||
param_id = WMI_STA_PS_PARAM_RX_WAKE_POLICY;
|
||||
@@ -6576,6 +6706,13 @@ static int ath12k_mac_vdev_create(struct
|
||||
@@ -6578,6 +6708,13 @@ static int ath12k_mac_vdev_create(struct
|
||||
arvif->vdev_id, ret);
|
||||
goto err_peer_del;
|
||||
}
|
||||
@@ -691,7 +691,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -6916,6 +7053,11 @@ static void ath12k_mac_op_remove_interfa
|
||||
@@ -6918,6 +7055,11 @@ static void ath12k_mac_op_remove_interfa
|
||||
ath12k_dbg(ab, ATH12K_DBG_MAC, "mac remove interface (vdev %d)\n",
|
||||
arvif->vdev_id);
|
||||
|
||||
@@ -703,7 +703,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
|
||||
ret = ath12k_peer_delete(ar, arvif->vdev_id, vif->addr);
|
||||
if (ret)
|
||||
@@ -7756,6 +7898,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
|
||||
@@ -7758,6 +7900,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
|
||||
ar->num_started_vdevs == 1 && ar->monitor_vdev_created)
|
||||
ath12k_mac_monitor_stop(ar);
|
||||
|
||||
@@ -718,7 +718,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
mutex_unlock(&ar->conf_mutex);
|
||||
}
|
||||
|
||||
@@ -8294,6 +8444,14 @@ ath12k_mac_op_reconfig_complete(struct i
|
||||
@@ -8296,6 +8446,14 @@ ath12k_mac_op_reconfig_complete(struct i
|
||||
ath12k_warn(ar->ab, "pdev %d successfully recovered\n",
|
||||
ar->pdev->pdev_id);
|
||||
|
||||
@@ -733,7 +733,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
if (ab->is_reset) {
|
||||
recovery_count = atomic_inc_return(&ab->recovery_count);
|
||||
|
||||
@@ -9344,6 +9502,9 @@ static void ath12k_mac_setup(struct ath1
|
||||
@@ -9346,6 +9504,9 @@ static void ath12k_mac_setup(struct ath1
|
||||
|
||||
INIT_WORK(&ar->wmi_mgmt_tx_work, ath12k_mgmt_over_wmi_tx_work);
|
||||
skb_queue_head_init(&ar->wmi_mgmt_tx_queue);
|
||||
|
||||
@@ -22,7 +22,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
#include <net/cfg80211.h>
|
||||
#include <net/netlink.h>
|
||||
#include <uapi/linux/if_arp.h>
|
||||
@@ -8212,31 +8213,45 @@ static void brcmf_cfg80211_reg_notifier(
|
||||
@@ -8211,31 +8212,45 @@ static void brcmf_cfg80211_reg_notifier(
|
||||
struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
|
||||
struct brcmf_pub *drvr = cfg->pub;
|
||||
struct brcmf_fil_country_le ccreq;
|
||||
|
||||
@@ -119,7 +119,7 @@ Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
|
||||
err = brcmf_fil_bsscfg_data_set(vif->ifp, "actframe_abort", &int_val,
|
||||
sizeof(s32));
|
||||
if (err)
|
||||
@@ -1826,6 +1830,7 @@ bool brcmf_p2p_send_action_frame(struct
|
||||
@@ -1817,6 +1821,7 @@ bool brcmf_p2p_send_action_frame(struct
|
||||
/* validate channel and p2p ies */
|
||||
if (config_af_params.search_channel &&
|
||||
IS_P2P_SOCIAL_CHANNEL(le32_to_cpu(af_params->channel)) &&
|
||||
|
||||
@@ -9,7 +9,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -7991,6 +7991,7 @@ static s32 brcmf_translate_country_code(
|
||||
@@ -7990,6 +7990,7 @@ static s32 brcmf_translate_country_code(
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
static int
|
||||
brcmf_parse_dump_obss(char *buf, struct brcmf_dump_survey *survey)
|
||||
{
|
||||
@@ -8213,6 +8214,7 @@ exit:
|
||||
@@ -8212,6 +8213,7 @@ exit:
|
||||
brcmf_set_mpc(ifp, 1);
|
||||
return err;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
|
||||
static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy,
|
||||
struct regulatory_request *req)
|
||||
@@ -8379,8 +8381,10 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
@@ -8378,8 +8380,10 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL_GTK))
|
||||
ops->set_rekey_data = brcmf_cfg80211_set_rekey_data;
|
||||
#endif
|
||||
|
||||
@@ -530,7 +530,7 @@
|
||||
|
||||
--- a/net/wireless/trace.h
|
||||
+++ b/net/wireless/trace.h
|
||||
@@ -446,7 +446,7 @@ TRACE_EVENT(rdev_add_virtual_intf,
|
||||
@@ -467,7 +467,7 @@ TRACE_EVENT(rdev_add_virtual_intf,
|
||||
),
|
||||
TP_fast_assign(
|
||||
WIPHY_ASSIGN;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/virtual/mac80211_hwsim.c
|
||||
+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
|
||||
@@ -6636,6 +6636,7 @@ static void hwsim_virtio_rx_done(struct
|
||||
@@ -6637,6 +6637,7 @@ static void hwsim_virtio_rx_done(struct
|
||||
|
||||
static int init_vqs(struct virtio_device *vdev)
|
||||
{
|
||||
@@ -8,7 +8,7 @@
|
||||
struct virtqueue_info vqs_info[HWSIM_NUM_VQS] = {
|
||||
[HWSIM_VQ_TX] = { "tx", hwsim_virtio_tx_done },
|
||||
[HWSIM_VQ_RX] = { "rx", hwsim_virtio_rx_done },
|
||||
@@ -6643,6 +6644,19 @@ static int init_vqs(struct virtio_device
|
||||
@@ -6644,6 +6645,19 @@ static int init_vqs(struct virtio_device
|
||||
|
||||
return virtio_find_vqs(vdev, HWSIM_NUM_VQS,
|
||||
hwsim_vqs, vqs_info, NULL);
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
From f4e661a75cdfa7eb88ac0fa832edd4a90775805d Mon Sep 17 00:00:00 2001
|
||||
From: Pawel Dembicki <paweldembicki@gmail.com>
|
||||
Date: Fri, 7 Nov 2025 23:05:56 +0100
|
||||
Subject: [PATCH] mwl8k: inject DS Params IE into beacons if missing
|
||||
|
||||
Some Marvell AP firmware used with mwl8k misbehaves when beacon frames
|
||||
do not contain a WLAN_EID_DS_PARAMS information element with the current
|
||||
channel. It was reported on OpenWrt Github issues [0].
|
||||
|
||||
When hostapd/mac80211 omits DS Params from the beacon (which is valid on
|
||||
some bands), the firmware stops transmitting sane frames and RX status
|
||||
starts reporting bogus channel information. This makes AP mode unusable.
|
||||
|
||||
Newer Marvell drivers (mwlwifi [1]) hard-code DS Params IE into AP beacons
|
||||
for all chips, which suggests this is a firmware requirement rather than
|
||||
a mwl8k-specific quirk.
|
||||
|
||||
Mirror that behaviour in mwl8k: when setting the beacon, check if
|
||||
WLAN_EID_DS_PARAMS is present, and if not, extend the beacon and inject
|
||||
a DS Params IE at the beginning of the IE list, using the current
|
||||
channel from hw->conf.chandef.chan.
|
||||
|
||||
Tested on Linksys EA4500 (88W8366).
|
||||
|
||||
[0] https://github.com/openwrt/openwrt/issues/19088
|
||||
[1] https://github.com/kaloz/mwlwifi/blob/db97edf20fadea2617805006f5230665fadc6a8c/hif/fwcmd.c#L675
|
||||
|
||||
Tested-by: Antony Kolitsos <zeusomighty@hotmail.com>
|
||||
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
|
||||
---
|
||||
drivers/net/wireless/marvell/mwl8k.c | 61 +++++++++++++++++++++++++---
|
||||
1 file changed, 56 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/marvell/mwl8k.c
|
||||
+++ b/drivers/net/wireless/marvell/mwl8k.c
|
||||
@@ -2966,6 +2966,42 @@ mwl8k_cmd_rf_antenna(struct ieee80211_hw
|
||||
/*
|
||||
* CMD_SET_BEACON.
|
||||
*/
|
||||
+
|
||||
+static bool mwl8k_beacon_has_ds_params(const u8 *buf, int len)
|
||||
+{
|
||||
+ const struct ieee80211_mgmt *mgmt = (const void *)buf;
|
||||
+ int ies_len;
|
||||
+
|
||||
+ if (len <= offsetof(struct ieee80211_mgmt, u.beacon.variable))
|
||||
+ return false;
|
||||
+
|
||||
+ ies_len = len - offsetof(struct ieee80211_mgmt, u.beacon.variable);
|
||||
+
|
||||
+ return cfg80211_find_ie(WLAN_EID_DS_PARAMS, mgmt->u.beacon.variable,
|
||||
+ ies_len) != NULL;
|
||||
+}
|
||||
+
|
||||
+static void mwl8k_beacon_copy_inject_ds_params(struct ieee80211_hw *hw,
|
||||
+ u8 *buf_dst, const u8 *buf_src,
|
||||
+ int src_len)
|
||||
+{
|
||||
+ const struct ieee80211_mgmt *mgmt = (const void *)buf_src;
|
||||
+ const u8 *ies;
|
||||
+ int hdr_len, left;
|
||||
+
|
||||
+ ies = mgmt->u.beacon.variable;
|
||||
+ hdr_len = ies - buf_src;
|
||||
+ left = src_len - hdr_len;
|
||||
+
|
||||
+ memcpy(buf_dst, buf_src, hdr_len);
|
||||
+
|
||||
+ /* Inject a DS Params IE at the beginning of the IE list */
|
||||
+ buf_dst[hdr_len + 0] = WLAN_EID_DS_PARAMS;
|
||||
+ buf_dst[hdr_len + 1] = 1;
|
||||
+ buf_dst[hdr_len + 2] = hw->conf.chandef.chan->hw_value;
|
||||
+
|
||||
+ memcpy(buf_dst + hdr_len + 3, buf_src + hdr_len, left);
|
||||
+}
|
||||
struct mwl8k_cmd_set_beacon {
|
||||
struct mwl8k_cmd_pkt_hdr header;
|
||||
__le16 beacon_len;
|
||||
@@ -2975,17 +3011,32 @@ struct mwl8k_cmd_set_beacon {
|
||||
static int mwl8k_cmd_set_beacon(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif, u8 *beacon, int len)
|
||||
{
|
||||
+ bool ds_params_present = mwl8k_beacon_has_ds_params(beacon, len);
|
||||
struct mwl8k_cmd_set_beacon *cmd;
|
||||
- int rc;
|
||||
+ int rc, final_len = len;
|
||||
+
|
||||
+ if (!ds_params_present)
|
||||
+ /*
|
||||
+ * mwl8k firmware requires a DS Params IE with the current
|
||||
+ * channel in AP beacons. If mac80211/hostapd does not
|
||||
+ * include it, inject one here. IE ID + length + channel
|
||||
+ * number = 3 bytes.
|
||||
+ */
|
||||
+ final_len += 3;
|
||||
|
||||
- cmd = kzalloc(sizeof(*cmd) + len, GFP_KERNEL);
|
||||
+ cmd = kzalloc(sizeof(*cmd) + final_len, GFP_KERNEL);
|
||||
if (cmd == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
cmd->header.code = cpu_to_le16(MWL8K_CMD_SET_BEACON);
|
||||
- cmd->header.length = cpu_to_le16(sizeof(*cmd) + len);
|
||||
- cmd->beacon_len = cpu_to_le16(len);
|
||||
- memcpy(cmd->beacon, beacon, len);
|
||||
+ cmd->header.length = cpu_to_le16(sizeof(*cmd) + final_len);
|
||||
+ cmd->beacon_len = cpu_to_le16(final_len);
|
||||
+
|
||||
+ if (ds_params_present)
|
||||
+ memcpy(cmd->beacon, beacon, len);
|
||||
+ else
|
||||
+ mwl8k_beacon_copy_inject_ds_params(hw, cmd->beacon, beacon,
|
||||
+ len);
|
||||
|
||||
rc = mwl8k_post_pervif_cmd(hw, vif, &cmd->header);
|
||||
kfree(cmd);
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/marvell/mwl8k.c
|
||||
+++ b/drivers/net/wireless/marvell/mwl8k.c
|
||||
@@ -5716,6 +5716,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
|
||||
@@ -5767,6 +5767,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
|
||||
MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API));
|
||||
|
||||
static const struct pci_device_id mwl8k_pci_id_table[] = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/marvell/mwl8k.c
|
||||
+++ b/drivers/net/wireless/marvell/mwl8k.c
|
||||
@@ -6302,6 +6302,8 @@ static int mwl8k_probe(struct pci_dev *p
|
||||
@@ -6353,6 +6353,8 @@ static int mwl8k_probe(struct pci_dev *p
|
||||
|
||||
priv->running_bsses = 0;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
return rc;
|
||||
|
||||
err_stop_firmware:
|
||||
@@ -6335,8 +6337,6 @@ static void mwl8k_remove(struct pci_dev
|
||||
@@ -6386,8 +6388,6 @@ static void mwl8k_remove(struct pci_dev
|
||||
return;
|
||||
priv = hw->priv;
|
||||
|
||||
|
||||
@@ -535,7 +535,7 @@ Link: https://patch.msgid.link/913f1747-38fc-4409-85a4-57bb9cee506b@gmail.com
|
||||
struct rtw_rx_pkt_stat *pkt_stat);
|
||||
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
|
||||
@@ -979,8 +979,7 @@ static void rtw_sdio_rxfifo_recv(struct
|
||||
@@ -983,8 +983,7 @@ static void rtw_sdio_rxfifo_recv(struct
|
||||
|
||||
while (true) {
|
||||
rx_desc = skb->data;
|
||||
|
||||
@@ -121,7 +121,7 @@ Link: https://patch.msgid.link/2b3e3e6f-541b-4a3b-8ca3-65b267e6a95a@gmail.com
|
||||
.ht_supported = true,
|
||||
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
|
||||
@@ -862,7 +862,7 @@ static void rtw_sdio_tx_skb_prepare(stru
|
||||
@@ -866,7 +866,7 @@ static void rtw_sdio_tx_skb_prepare(stru
|
||||
|
||||
pkt_info->qsel = rtw_sdio_get_tx_qsel(rtwdev, skb, queue);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Used for AP+STA support in OpenWrt - preserve AP mode keys across STA reconnect
|
||||
|
||||
--- a/net/mac80211/cfg.c
|
||||
+++ b/net/mac80211/cfg.c
|
||||
@@ -1649,12 +1649,6 @@ static int ieee80211_stop_ap(struct wiph
|
||||
@@ -1663,12 +1663,6 @@ static int ieee80211_stop_ap(struct wiph
|
||||
|
||||
__sta_info_flush(sdata, true, link_id);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH] mac80211: allow scans in access point mode (for site survey)
|
||||
|
||||
--- a/net/mac80211/cfg.c
|
||||
+++ b/net/mac80211/cfg.c
|
||||
@@ -2863,6 +2863,8 @@ static int ieee80211_scan(struct wiphy *
|
||||
@@ -2877,6 +2877,8 @@ static int ieee80211_scan(struct wiphy *
|
||||
*/
|
||||
fallthrough;
|
||||
case NL80211_IFTYPE_AP:
|
||||
|
||||
@@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -1360,10 +1360,12 @@ struct ieee80211_local {
|
||||
@@ -1362,10 +1362,12 @@ struct ieee80211_local {
|
||||
spinlock_t handle_wake_tx_queue_lock;
|
||||
|
||||
u16 airtime_flags;
|
||||
|
||||
@@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/include/net/cfg80211.h
|
||||
+++ b/include/net/cfg80211.h
|
||||
@@ -6274,6 +6274,7 @@ enum ieee80211_ap_reg_power {
|
||||
@@ -6352,6 +6352,7 @@ enum ieee80211_ap_reg_power {
|
||||
* entered.
|
||||
* @links.cac_time_ms: CAC time in ms
|
||||
* @valid_links: bitmap describing what elements of @links are valid
|
||||
@@ -31,7 +31,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
*/
|
||||
struct wireless_dev {
|
||||
struct wiphy *wiphy;
|
||||
@@ -6386,6 +6387,8 @@ struct wireless_dev {
|
||||
@@ -6464,6 +6465,8 @@ struct wireless_dev {
|
||||
unsigned int cac_time_ms;
|
||||
} links[IEEE80211_MLD_MAX_NUM_LINKS];
|
||||
u16 valid_links;
|
||||
@@ -40,7 +40,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
};
|
||||
|
||||
static inline const u8 *wdev_address(struct wireless_dev *wdev)
|
||||
@@ -6572,6 +6575,17 @@ bool cfg80211_radio_chandef_valid(const
|
||||
@@ -6650,6 +6653,17 @@ bool cfg80211_radio_chandef_valid(const
|
||||
const struct cfg80211_chan_def *chandef);
|
||||
|
||||
/**
|
||||
|
||||
@@ -59,7 +59,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
int (*scan)(struct wiphy *wiphy,
|
||||
--- a/net/mac80211/cfg.c
|
||||
+++ b/net/mac80211/cfg.c
|
||||
@@ -879,6 +879,7 @@ static int ieee80211_get_station(struct
|
||||
@@ -893,6 +893,7 @@ static int ieee80211_get_station(struct
|
||||
}
|
||||
|
||||
static int ieee80211_set_monitor_channel(struct wiphy *wiphy,
|
||||
@@ -126,7 +126,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
}
|
||||
--- a/net/wireless/trace.h
|
||||
+++ b/net/wireless/trace.h
|
||||
@@ -1318,19 +1318,21 @@ TRACE_EVENT(rdev_libertas_set_mesh_chann
|
||||
@@ -1339,19 +1339,21 @@ TRACE_EVENT(rdev_libertas_set_mesh_chann
|
||||
);
|
||||
|
||||
TRACE_EVENT(rdev_set_monitor_channel,
|
||||
|
||||
@@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
ieee80211_set_mu_mimo_follow(monitor_sdata, params);
|
||||
|
||||
if (params->flags) {
|
||||
@@ -889,22 +894,25 @@ static int ieee80211_set_monitor_channel
|
||||
@@ -903,22 +908,25 @@ static int ieee80211_set_monitor_channel
|
||||
|
||||
lockdep_assert_wiphy(local->hw.wiphy);
|
||||
|
||||
@@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (ret)
|
||||
return ret;
|
||||
done:
|
||||
@@ -3050,7 +3058,8 @@ static int ieee80211_set_tx_power(struct
|
||||
@@ -3064,7 +3072,8 @@ static int ieee80211_set_tx_power(struct
|
||||
if (wdev) {
|
||||
sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
|
||||
|
||||
@@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
if (!ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
@@ -3098,7 +3107,8 @@ static int ieee80211_set_tx_power(struct
|
||||
@@ -3112,7 +3121,8 @@ static int ieee80211_set_tx_power(struct
|
||||
}
|
||||
|
||||
list_for_each_entry(sdata, &local->interfaces, list) {
|
||||
@@ -115,7 +115,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
has_monitor = true;
|
||||
continue;
|
||||
}
|
||||
@@ -3108,7 +3118,8 @@ static int ieee80211_set_tx_power(struct
|
||||
@@ -3122,7 +3132,8 @@ static int ieee80211_set_tx_power(struct
|
||||
sdata->vif.bss_conf.txpower_type = txp_type;
|
||||
}
|
||||
list_for_each_entry(sdata, &local->interfaces, list) {
|
||||
@@ -125,7 +125,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
continue;
|
||||
ieee80211_recalc_txpower(sdata, update_txp_type);
|
||||
}
|
||||
@@ -4303,7 +4314,8 @@ static int ieee80211_cfg_get_channel(str
|
||||
@@ -4317,7 +4328,8 @@ static int ieee80211_cfg_get_channel(str
|
||||
if (chanctx_conf) {
|
||||
*chandef = link->conf->chanreq.oper;
|
||||
ret = 0;
|
||||
@@ -201,7 +201,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/mac80211/iface.c
|
||||
+++ b/net/mac80211/iface.c
|
||||
@@ -279,8 +279,13 @@ static int _ieee80211_change_mac(struct
|
||||
@@ -296,8 +296,13 @@ static int _ieee80211_change_mac(struct
|
||||
ret = eth_mac_addr(sdata->dev, sa);
|
||||
|
||||
if (ret == 0) {
|
||||
@@ -217,7 +217,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
}
|
||||
|
||||
/* Regardless of eth_mac_addr() return we still want to add the
|
||||
@@ -705,9 +710,11 @@ static void ieee80211_do_stop(struct iee
|
||||
@@ -722,9 +727,11 @@ static void ieee80211_do_stop(struct iee
|
||||
ieee80211_recalc_idle(local);
|
||||
ieee80211_recalc_offload(local);
|
||||
|
||||
@@ -230,7 +230,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
fallthrough;
|
||||
default:
|
||||
if (!going_down)
|
||||
@@ -1140,7 +1147,8 @@ int ieee80211_add_virtual_monitor(struct
|
||||
@@ -1157,7 +1164,8 @@ int ieee80211_add_virtual_monitor(struct
|
||||
ASSERT_RTNL();
|
||||
lockdep_assert_wiphy(local->hw.wiphy);
|
||||
|
||||
@@ -240,7 +240,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
return 0;
|
||||
|
||||
sdata = kzalloc(sizeof(*sdata) + local->hw.vif_data_size, GFP_KERNEL);
|
||||
@@ -1202,6 +1210,9 @@ void ieee80211_del_virtual_monitor(struc
|
||||
@@ -1219,6 +1227,9 @@ void ieee80211_del_virtual_monitor(struc
|
||||
{
|
||||
struct ieee80211_sub_if_data *sdata;
|
||||
|
||||
@@ -250,7 +250,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
ASSERT_RTNL();
|
||||
lockdep_assert_wiphy(local->hw.wiphy);
|
||||
|
||||
@@ -1345,7 +1356,8 @@ int ieee80211_do_open(struct wireless_de
|
||||
@@ -1362,7 +1373,8 @@ int ieee80211_do_open(struct wireless_de
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -1382,7 +1382,7 @@ struct ieee80211_local {
|
||||
@@ -1384,7 +1384,7 @@ struct ieee80211_local {
|
||||
spinlock_t queue_stop_reason_lock;
|
||||
|
||||
int open_count;
|
||||
@@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
fif_probe_req;
|
||||
--- a/net/mac80211/iface.c
|
||||
+++ b/net/mac80211/iface.c
|
||||
@@ -1103,6 +1103,8 @@ void ieee80211_adjust_monitor_flags(stru
|
||||
@@ -1120,6 +1120,8 @@ void ieee80211_adjust_monitor_flags(stru
|
||||
ADJUST(CONTROL, control);
|
||||
ADJUST(CONTROL, pspoll);
|
||||
ADJUST(OTHER_BSS, other_bss);
|
||||
|
||||
@@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
u8 cab_queue;
|
||||
--- a/net/mac80211/iface.c
|
||||
+++ b/net/mac80211/iface.c
|
||||
@@ -279,13 +279,8 @@ static int _ieee80211_change_mac(struct
|
||||
@@ -296,13 +296,8 @@ static int _ieee80211_change_mac(struct
|
||||
ret = eth_mac_addr(sdata->dev, sa);
|
||||
|
||||
if (ret == 0) {
|
||||
@@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
}
|
||||
|
||||
/* Regardless of eth_mac_addr() return we still want to add the
|
||||
@@ -1336,6 +1331,8 @@ int ieee80211_do_open(struct wireless_de
|
||||
@@ -1353,6 +1348,8 @@ int ieee80211_do_open(struct wireless_de
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
sta->ampdu_mlme.tid_rx_manage_offl))
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -2131,14 +2131,19 @@ int ieee80211_send_smps_action(struct ie
|
||||
@@ -2133,14 +2133,19 @@ int ieee80211_send_smps_action(struct ie
|
||||
const u8 *bssid, int link_id);
|
||||
bool ieee80211_smps_is_restrictive(enum ieee80211_smps_mode smps_mode_old,
|
||||
enum ieee80211_smps_mode smps_mode_new);
|
||||
|
||||
@@ -25,7 +25,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -1220,6 +1220,19 @@ struct ieee80211_sub_if_data *vif_to_sda
|
||||
@@ -1222,6 +1222,19 @@ struct ieee80211_sub_if_data *vif_to_sda
|
||||
((__link) = sdata_dereference((__sdata)->link[__link_id], \
|
||||
(__sdata))))
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
|
||||
--- a/net/mac80211/mlme.c
|
||||
+++ b/net/mac80211/mlme.c
|
||||
@@ -2167,6 +2167,21 @@ static void ieee80211_csa_switch_work(st
|
||||
@@ -2168,6 +2168,21 @@ static void ieee80211_csa_switch_work(st
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
ieee80211_sta_reset_beacon_monitor(sdata);
|
||||
ieee80211_sta_reset_conn_monitor(sdata);
|
||||
}
|
||||
@@ -7892,6 +7907,29 @@ void ieee80211_sta_work(struct ieee80211
|
||||
@@ -7893,6 +7908,29 @@ void ieee80211_sta_work(struct ieee80211
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
|
||||
--- a/net/mac80211/mlme.c
|
||||
+++ b/net/mac80211/mlme.c
|
||||
@@ -3841,9 +3841,6 @@ static void ieee80211_mgd_probe_ap_send(
|
||||
@@ -3842,9 +3842,6 @@ static void ieee80211_mgd_probe_ap_send(
|
||||
|
||||
lockdep_assert_wiphy(sdata->local->hw.wiphy);
|
||||
|
||||
@@ -35,7 +35,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
/*
|
||||
* Try sending broadcast probe requests for the last three
|
||||
* probe requests after the first ones failed since some
|
||||
@@ -3889,9 +3886,6 @@ static void ieee80211_mgd_probe_ap(struc
|
||||
@@ -3890,9 +3887,6 @@ static void ieee80211_mgd_probe_ap(struc
|
||||
|
||||
lockdep_assert_wiphy(sdata->local->hw.wiphy);
|
||||
|
||||
@@ -45,7 +45,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
if (!ieee80211_sdata_running(sdata))
|
||||
return;
|
||||
|
||||
@@ -7950,36 +7944,73 @@ static void ieee80211_sta_bcn_mon_timer(
|
||||
@@ -7951,36 +7945,73 @@ static void ieee80211_sta_bcn_mon_timer(
|
||||
&sdata->u.mgd.beacon_connection_loss_work);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=mt76
|
||||
PKG_RELEASE=1
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE:=BSD-3-Clause-Clear
|
||||
PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2025-09-15
|
||||
PKG_SOURCE_VERSION:=6467af3bcf1154c2ceb032c903d533f0c718bbc2
|
||||
PKG_MIRROR_HASH:=98781ea57cdc97bc63ecb2c1d4004964f2a10663987887445f1c71b76610cd96
|
||||
PKG_SOURCE_DATE:=2025-11-06
|
||||
PKG_SOURCE_VERSION:=eb567bc7f9b692bbf1ddfe31dd740861c58ec85b
|
||||
PKG_MIRROR_HASH:=7cfe242a5494cdf5d8e8eea86633778a525717528bcce70aedef96eee5594383
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_USE_NINJA:=0
|
||||
@@ -494,6 +494,12 @@ ifdef CONFIG_PACKAGE_kmod-mt7921e
|
||||
endif
|
||||
ifdef CONFIG_PACKAGE_kmod-mt7996e
|
||||
PKG_MAKE_FLAGS += CONFIG_MT7996E=m
|
||||
ifdef CONFIG_TARGET_airoha_an7581
|
||||
PKG_MAKE_FLAGS += CONFIG_MT76_NPU=y
|
||||
PKG_MAKE_FLAGS += CONFIG_MT7996_NPU=y
|
||||
NOSTDINC_FLAGS += -DCONFIG_MT76_NPU
|
||||
NOSTDINC_FLAGS += -DCONFIG_MT7996_NPU
|
||||
endif
|
||||
endif
|
||||
ifdef CONFIG_PACKAGE_kmod-mt7925-common
|
||||
PKG_MAKE_FLAGS += CONFIG_MT7925_COMMON=m
|
||||
|
||||
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dropbear
|
||||
PKG_VERSION:=2024.86
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:= \
|
||||
|
||||
@@ -5,3 +5,5 @@ config dropbear main
|
||||
option RootPasswordAuth 'on'
|
||||
option Port '22'
|
||||
# option BannerFile '/etc/banner'
|
||||
# option LocalPortForward 'off'
|
||||
# option RemotePortForward 'off'
|
||||
|
||||
@@ -179,6 +179,8 @@ validate_section_dropbear()
|
||||
'IdleTimeout:uinteger:0' \
|
||||
'MaxAuthTries:uinteger:3' \
|
||||
'RecvWindowSize:uinteger:262144' \
|
||||
'LocalPortForward:bool:1' \
|
||||
'RemotePortForward:bool:1' \
|
||||
'mdns:bool:1'
|
||||
}
|
||||
|
||||
@@ -319,6 +321,8 @@ dropbear_instance()
|
||||
fi
|
||||
[ "${PasswordAuth}" -eq 0 ] && procd_append_param command -s
|
||||
[ "${GatewayPorts}" -eq 1 ] && procd_append_param command -a
|
||||
[ "${LocalPortForward}" -eq 0 ] && procd_append_param command -j
|
||||
[ "${RemotePortForward}" -eq 0 ] && procd_append_param command -k
|
||||
[ -n "${ForceCommand}" ] && procd_append_param command -c "${ForceCommand}"
|
||||
[ "${RootPasswordAuth}" -eq 0 ] && procd_append_param command -g
|
||||
[ "${RootLogin}" -eq 0 ] && procd_append_param command -w
|
||||
|
||||
@@ -0,0 +1,262 @@
|
||||
From 61cfbc66aefcb047534210713f3aac097100e5f5 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Johnston <matt@ucc.asn.au>
|
||||
Date: Tue, 9 Dec 2025 15:08:06 +0900
|
||||
Subject: Drop privileges after user authentication
|
||||
|
||||
Instead of switching user privileges after forking to a shell, switch
|
||||
to the user immediately upon successful authentication.
|
||||
|
||||
This will require further commits to fix utmp and hostkey handling.
|
||||
|
||||
The DROPBEAR_SVR_DROP_PRIVS configuration option controls this
|
||||
behaviour. This should generally be enabled, but can be set to 0 for
|
||||
incompatible platforms. In future it may become non-optional, those
|
||||
platforms should be investigated.
|
||||
|
||||
Most uses of DROPBEAR_SVR_MULTIUSER have been replaced by
|
||||
!DROPBEAR_SVR_DROP_PRIVS.
|
||||
|
||||
(cherry picked from commit e0251be2354e1a5c6eccfc2cf4b64243625dafcc)
|
||||
---
|
||||
.github/workflows/build.yml | 2 ++
|
||||
src/auth.h | 1 +
|
||||
src/default_options.h | 6 +++++
|
||||
src/svr-agentfwd.c | 14 ++++++++----
|
||||
src/svr-auth.c | 45 +++++++++++++++++++++++++++++++++++++
|
||||
src/svr-authpubkey.c | 6 +++--
|
||||
src/svr-chansession.c | 26 ++-------------------
|
||||
src/sysoptions.h | 3 +++
|
||||
8 files changed, 73 insertions(+), 30 deletions(-)
|
||||
|
||||
--- a/.github/workflows/build.yml
|
||||
+++ b/.github/workflows/build.yml
|
||||
@@ -217,6 +217,8 @@ jobs:
|
||||
echo "#define DROPBEAR_SVR_PASSWORD_AUTH 0" >> localoptions.h
|
||||
# 1 second timeout is too short
|
||||
sed -i "s/DEFAULT_IDLE_TIMEOUT 1/DEFAULT_IDLE_TIMEOUT 99/" localoptions.h
|
||||
+ # DROPBEAR_SVR_DROP_PRIVS is on by default, turn it off
|
||||
+ echo "#define DROPBEAR_SVR_DROP_PRIVS 0" >> localoptions.h
|
||||
|
||||
- name: make
|
||||
run: |
|
||||
--- a/src/auth.h
|
||||
+++ b/src/auth.h
|
||||
@@ -40,6 +40,7 @@ void send_msg_userauth_banner(const buff
|
||||
void svr_auth_password(int valid_user);
|
||||
void svr_auth_pubkey(int valid_user);
|
||||
void svr_auth_pam(int valid_user);
|
||||
+void svr_switch_user(void);
|
||||
|
||||
#if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT
|
||||
int svr_pubkey_allows_agentfwd(void);
|
||||
--- a/src/default_options.h
|
||||
+++ b/src/default_options.h
|
||||
@@ -297,6 +297,12 @@ group1 in Dropbear server too */
|
||||
/* -T server option overrides */
|
||||
#define MAX_AUTH_TRIES 10
|
||||
|
||||
+/* Change server process to user privileges after authentication. */
|
||||
+#ifndef DROPBEAR_SVR_DROP_PRIVS
|
||||
+/* Default is enabled. Should only be disabled if platforms are incompatible */
|
||||
+#define DROPBEAR_SVR_DROP_PRIVS DROPBEAR_SVR_MULTIUSER
|
||||
+#endif
|
||||
+
|
||||
/* Delay introduced before closing an unauthenticated session (seconds).
|
||||
Disabled by default, can be set to say 30 seconds to reduce the speed
|
||||
of password brute forcing. Note that there is a risk of denial of
|
||||
--- a/src/svr-agentfwd.c
|
||||
+++ b/src/svr-agentfwd.c
|
||||
@@ -151,7 +151,7 @@ void svr_agentcleanup(struct ChanSess *
|
||||
|
||||
if (chansess->agentfile != NULL && chansess->agentdir != NULL) {
|
||||
|
||||
-#if DROPBEAR_SVR_MULTIUSER
|
||||
+#if !DROPBEAR_SVR_DROP_PRIVS
|
||||
/* Remove the dir as the user. That way they can't cause problems except
|
||||
* for themselves */
|
||||
uid = getuid();
|
||||
@@ -160,6 +160,9 @@ void svr_agentcleanup(struct ChanSess *
|
||||
(seteuid(ses.authstate.pw_uid)) < 0) {
|
||||
dropbear_exit("Failed to set euid");
|
||||
}
|
||||
+#else
|
||||
+ (void)uid;
|
||||
+ (void)gid;
|
||||
#endif
|
||||
|
||||
/* 2 for "/" and "\0" */
|
||||
@@ -172,7 +175,7 @@ void svr_agentcleanup(struct ChanSess *
|
||||
|
||||
rmdir(chansess->agentdir);
|
||||
|
||||
-#if DROPBEAR_SVR_MULTIUSER
|
||||
+#if !DROPBEAR_SVR_DROP_PRIVS
|
||||
if ((seteuid(uid)) < 0 ||
|
||||
(setegid(gid)) < 0) {
|
||||
dropbear_exit("Failed to revert euid");
|
||||
@@ -219,7 +222,7 @@ static int bindagent(int fd, struct Chan
|
||||
gid_t gid;
|
||||
int ret = DROPBEAR_FAILURE;
|
||||
|
||||
-#if DROPBEAR_SVR_MULTIUSER
|
||||
+#if !DROPBEAR_SVR_DROP_PRIVS
|
||||
/* drop to user privs to make the dir/file */
|
||||
uid = getuid();
|
||||
gid = getgid();
|
||||
@@ -227,6 +230,9 @@ static int bindagent(int fd, struct Chan
|
||||
(seteuid(ses.authstate.pw_uid)) < 0) {
|
||||
dropbear_exit("Failed to set euid");
|
||||
}
|
||||
+#else
|
||||
+ (void)uid;
|
||||
+ (void)gid;
|
||||
#endif
|
||||
|
||||
memset((void*)&addr, 0x0, sizeof(addr));
|
||||
@@ -267,7 +273,7 @@ bindsocket:
|
||||
|
||||
|
||||
out:
|
||||
-#if DROPBEAR_SVR_MULTIUSER
|
||||
+#if !DROPBEAR_SVR_DROP_PRIVS
|
||||
if ((seteuid(uid)) < 0 ||
|
||||
(setegid(gid)) < 0) {
|
||||
dropbear_exit("Failed to revert euid");
|
||||
--- a/src/svr-auth.c
|
||||
+++ b/src/svr-auth.c
|
||||
@@ -456,12 +456,22 @@ void send_msg_userauth_success() {
|
||||
/* authdone must be set after encrypt_packet() for
|
||||
* delayed-zlib mode */
|
||||
ses.authstate.authdone = 1;
|
||||
+
|
||||
+#if DROPBEAR_DROP_PRIVS
|
||||
+ svr_switch_user();
|
||||
+#endif
|
||||
ses.connect_time = 0;
|
||||
|
||||
|
||||
+#if DROPBEAR_DROP_PRIVS
|
||||
+ /* If running as the user, we can rely on the OS
|
||||
+ * to limit allowed ports */
|
||||
+ ses.allowprivport = 1;
|
||||
+#else
|
||||
if (ses.authstate.pw_uid == 0) {
|
||||
ses.allowprivport = 1;
|
||||
}
|
||||
+#endif
|
||||
|
||||
/* Remove from the list of pre-auth sockets. Should be m_close(), since if
|
||||
* we fail, we might end up leaking connection slots, and disallow new
|
||||
@@ -471,3 +481,38 @@ void send_msg_userauth_success() {
|
||||
TRACE(("leave send_msg_userauth_success"))
|
||||
|
||||
}
|
||||
+
|
||||
+/* Switch to the ses.authstate user.
|
||||
+ * Fails if not running as root and the user differs.
|
||||
+ *
|
||||
+ * This may be called either after authentication, or
|
||||
+ * after shell/command fork if DROPBEAR_SVR_DROP_PRIVS is unset.
|
||||
+ */
|
||||
+void svr_switch_user(void) {
|
||||
+ assert(ses.authstate.authdone);
|
||||
+
|
||||
+ /* We can only change uid/gid as root ... */
|
||||
+ if (getuid() == 0) {
|
||||
+
|
||||
+ if ((setgid(ses.authstate.pw_gid) < 0) ||
|
||||
+ (initgroups(ses.authstate.pw_name,
|
||||
+ ses.authstate.pw_gid) < 0)) {
|
||||
+ dropbear_exit("Error changing user group");
|
||||
+ }
|
||||
+ if (setuid(ses.authstate.pw_uid) < 0) {
|
||||
+ dropbear_exit("Error changing user");
|
||||
+ }
|
||||
+ } else {
|
||||
+ /* ... but if the daemon is the same uid as the requested uid, we don't
|
||||
+ * need to */
|
||||
+
|
||||
+ /* XXX - there is a minor issue here, in that if there are multiple
|
||||
+ * usernames with the same uid, but differing groups, then the
|
||||
+ * differing groups won't be set (as with initgroups()). The solution
|
||||
+ * is for the sysadmin not to give out the UID twice */
|
||||
+ if (getuid() != ses.authstate.pw_uid) {
|
||||
+ dropbear_exit("Couldn't change user as non-root");
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
--- a/src/svr-authpubkey.c
|
||||
+++ b/src/svr-authpubkey.c
|
||||
@@ -444,12 +444,14 @@ static int checkpubkey(const char* keyal
|
||||
buffer * line = NULL;
|
||||
unsigned int len;
|
||||
int line_num;
|
||||
+#if !DROPBEAR_SVR_DROP_PRIVS
|
||||
uid_t origuid;
|
||||
gid_t origgid;
|
||||
+#endif
|
||||
|
||||
TRACE(("enter checkpubkey"))
|
||||
|
||||
-#if DROPBEAR_SVR_MULTIUSER
|
||||
+#if !DROPBEAR_SVR_DROP_PRIVS
|
||||
/* access the file as the authenticating user. */
|
||||
origuid = getuid();
|
||||
origgid = getgid();
|
||||
@@ -476,7 +478,7 @@ static int checkpubkey(const char* keyal
|
||||
TRACE(("checkpubkey: failed opening %s: %s", filename, strerror(errno)))
|
||||
}
|
||||
}
|
||||
-#if DROPBEAR_SVR_MULTIUSER
|
||||
+#if !DROPBEAR_SVR_DROP_PRIVS
|
||||
if ((seteuid(origuid)) < 0 ||
|
||||
(setegid(origgid)) < 0) {
|
||||
dropbear_exit("Failed to revert euid");
|
||||
--- a/src/svr-chansession.c
|
||||
+++ b/src/svr-chansession.c
|
||||
@@ -980,30 +980,8 @@ static void execchild(const void *user_d
|
||||
#endif /* DEBUG_VALGRIND */
|
||||
}
|
||||
|
||||
-#if DROPBEAR_SVR_MULTIUSER
|
||||
- /* We can only change uid/gid as root ... */
|
||||
- if (getuid() == 0) {
|
||||
-
|
||||
- if ((setgid(ses.authstate.pw_gid) < 0) ||
|
||||
- (initgroups(ses.authstate.pw_name,
|
||||
- ses.authstate.pw_gid) < 0)) {
|
||||
- dropbear_exit("Error changing user group");
|
||||
- }
|
||||
- if (setuid(ses.authstate.pw_uid) < 0) {
|
||||
- dropbear_exit("Error changing user");
|
||||
- }
|
||||
- } else {
|
||||
- /* ... but if the daemon is the same uid as the requested uid, we don't
|
||||
- * need to */
|
||||
-
|
||||
- /* XXX - there is a minor issue here, in that if there are multiple
|
||||
- * usernames with the same uid, but differing groups, then the
|
||||
- * differing groups won't be set (as with initgroups()). The solution
|
||||
- * is for the sysadmin not to give out the UID twice */
|
||||
- if (getuid() != ses.authstate.pw_uid) {
|
||||
- dropbear_exit("Couldn't change user as non-root");
|
||||
- }
|
||||
- }
|
||||
+#if !DROPBEAR_SVR_DROP_PRIVS
|
||||
+ svr_switch_user();
|
||||
#endif
|
||||
|
||||
/* set env vars */
|
||||
--- a/src/sysoptions.h
|
||||
+++ b/src/sysoptions.h
|
||||
@@ -403,6 +403,9 @@
|
||||
#define DROPBEAR_MULTI 0
|
||||
#endif
|
||||
|
||||
+#if !DROPBEAR_SVR_MULTIUSER && DROPBEAR_SVR_DROP_PRIVS
|
||||
+#error DROPBEAR_SVR_DROP_PRIVS needs DROPBEAR_SVR_MULTIUSER
|
||||
+#endif
|
||||
/* Fuzzing expects all key types to be enabled */
|
||||
#if DROPBEAR_FUZZ
|
||||
#if defined(DROPBEAR_DSS)
|
||||
@@ -0,0 +1,91 @@
|
||||
From febe8493782965b05025b016091a8bffa5d03563 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Johnston <matt@ucc.asn.au>
|
||||
Date: Tue, 9 Dec 2025 09:04:04 +0900
|
||||
Subject: Remove return code from login_login
|
||||
|
||||
Previously this was always 0, so not useful.
|
||||
|
||||
(cherry picked from commit b47fe5df58f0b459bb49accdd8cb961d969209fb)
|
||||
---
|
||||
src/loginrec.c | 19 +++++--------------
|
||||
src/loginrec.h | 6 +++---
|
||||
2 files changed, 8 insertions(+), 17 deletions(-)
|
||||
|
||||
--- a/src/loginrec.c
|
||||
+++ b/src/loginrec.c
|
||||
@@ -193,32 +193,24 @@ int wtmpx_get_entry(struct logininfo *li
|
||||
*
|
||||
* Call with a pointer to a struct logininfo initialised with
|
||||
* login_init_entry() or login_alloc_entry()
|
||||
- *
|
||||
- * Returns:
|
||||
- * >0 if successful
|
||||
- * 0 on failure (will use OpenSSH's logging facilities for diagnostics)
|
||||
*/
|
||||
-int
|
||||
+void
|
||||
login_login (struct logininfo *li)
|
||||
{
|
||||
li->type = LTYPE_LOGIN;
|
||||
- return login_write(li);
|
||||
+ login_write(li);
|
||||
}
|
||||
|
||||
|
||||
/* login_logout(struct logininfo *) - Record a logout
|
||||
*
|
||||
* Call as with login_login()
|
||||
- *
|
||||
- * Returns:
|
||||
- * >0 if successful
|
||||
- * 0 on failure (will use OpenSSH's logging facilities for diagnostics)
|
||||
*/
|
||||
-int
|
||||
+void
|
||||
login_logout(struct logininfo *li)
|
||||
{
|
||||
li->type = LTYPE_LOGOUT;
|
||||
- return login_write(li);
|
||||
+ login_write(li);
|
||||
}
|
||||
|
||||
|
||||
@@ -309,7 +301,7 @@ login_set_current_time(struct logininfo
|
||||
** login_write: Call low-level recording functions based on autoconf
|
||||
** results
|
||||
**/
|
||||
-int
|
||||
+void
|
||||
login_write (struct logininfo *li)
|
||||
{
|
||||
#ifndef HAVE_CYGWIN
|
||||
@@ -340,7 +332,6 @@ login_write (struct logininfo *li)
|
||||
#ifdef USE_WTMPX
|
||||
wtmpx_write_entry(li);
|
||||
#endif
|
||||
- return 0;
|
||||
}
|
||||
|
||||
#ifdef LOGIN_NEEDS_UTMPX
|
||||
--- a/src/loginrec.h
|
||||
+++ b/src/loginrec.h
|
||||
@@ -161,8 +161,8 @@ int login_init_entry(struct logininfo *l
|
||||
void login_set_current_time(struct logininfo *li);
|
||||
|
||||
/* record the entry */
|
||||
-int login_login (struct logininfo *li);
|
||||
-int login_logout(struct logininfo *li);
|
||||
+void login_login (struct logininfo *li);
|
||||
+void login_logout(struct logininfo *li);
|
||||
#ifdef LOGIN_NEEDS_UTMPX
|
||||
int login_utmp_only(struct logininfo *li);
|
||||
#endif
|
||||
@@ -170,7 +170,7 @@ int login_utmp_only(struct logininfo *li
|
||||
/** End of public functions */
|
||||
|
||||
/* record the entry */
|
||||
-int login_write (struct logininfo *li);
|
||||
+void login_write (struct logininfo *li);
|
||||
int login_log_entry(struct logininfo *li);
|
||||
|
||||
/* produce various forms of the line filename */
|
||||
@@ -0,0 +1,260 @@
|
||||
From b20e7823a0c6a4480aa473e0a46d3ccab4b9b102 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Johnston <matt@ucc.asn.au>
|
||||
Date: Tue, 9 Dec 2025 09:05:30 +0900
|
||||
Subject: Retain utmp saved group when dropping privileges
|
||||
|
||||
utmp is required to record logout. The saved group
|
||||
is reset by the OS for the executed user shell.
|
||||
|
||||
This requires setresgid() function which is not available on all
|
||||
platforms. Notable platforms are netbsd and macos. Those platforms will
|
||||
have to set DROPBEAR_SVR_DROP_PRIVS 0 unless an alternative approach is
|
||||
found.
|
||||
|
||||
(cherry picked from commit 73e4e70ea8e6b890c3918b52bb2e647313a09faa)
|
||||
---
|
||||
.github/workflows/build.yml | 6 ++++
|
||||
configure | 7 +++++
|
||||
configure.ac | 1 +
|
||||
src/auth.h | 2 ++
|
||||
src/config.h.in | 3 ++
|
||||
src/loginrec.c | 6 ----
|
||||
src/session.h | 6 ++++
|
||||
src/svr-auth.c | 61 +++++++++++++++++++++++++++++++++++--
|
||||
src/svr-chansession.c | 8 +++++
|
||||
src/sysoptions.h | 4 +++
|
||||
10 files changed, 96 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/.github/workflows/build.yml
|
||||
+++ b/.github/workflows/build.yml
|
||||
@@ -72,6 +72,9 @@ jobs:
|
||||
# fails with:
|
||||
# .../ranlib: file: libtomcrypt.a(cbc_setiv.o) has no symbols
|
||||
ranlib: ranlib -no_warning_for_no_symbols
|
||||
+ # macos doesn't have setresgid
|
||||
+ localoptions: |
|
||||
+ #define DROPBEAR_SVR_DROP_PRIVS 0
|
||||
|
||||
- name: macos 15
|
||||
os: macos-15
|
||||
@@ -84,6 +87,9 @@ jobs:
|
||||
# fails with:
|
||||
# .../ranlib: file: libtomcrypt.a(cbc_setiv.o) has no symbols
|
||||
ranlib: ranlib -no_warning_for_no_symbols
|
||||
+ # macos doesn't have setresgid
|
||||
+ localoptions: |
|
||||
+ #define DROPBEAR_SVR_DROP_PRIVS 0
|
||||
|
||||
# Check that debug code doesn't bitrot
|
||||
- name: DEBUG_TRACE
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -7597,6 +7597,13 @@ then :
|
||||
|
||||
fi
|
||||
|
||||
+ac_fn_c_check_func "$LINENO" "setresgid" "ac_cv_func_setresgid"
|
||||
+if test "x$ac_cv_func_setresgid" = xyes
|
||||
+then :
|
||||
+ printf "%s\n" "#define HAVE_SETRESGID 1" >>confdefs.h
|
||||
+
|
||||
+fi
|
||||
+
|
||||
|
||||
# POSIX monotonic time
|
||||
ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime"
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -545,6 +545,7 @@ AC_CHECK_FUNCS(utmpname)
|
||||
AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
|
||||
AC_CHECK_FUNCS(setutxent utmpxname)
|
||||
AC_CHECK_FUNCS(logout updwtmp logwtmp)
|
||||
+AC_CHECK_FUNCS(setresgid)
|
||||
|
||||
# POSIX monotonic time
|
||||
AC_CHECK_FUNCS(clock_gettime)
|
||||
--- a/src/auth.h
|
||||
+++ b/src/auth.h
|
||||
@@ -41,6 +41,8 @@ void svr_auth_password(int valid_user);
|
||||
void svr_auth_pubkey(int valid_user);
|
||||
void svr_auth_pam(int valid_user);
|
||||
void svr_switch_user(void);
|
||||
+void svr_raise_gid_utmp(void);
|
||||
+void svr_restore_gid(void);
|
||||
|
||||
#if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT
|
||||
int svr_pubkey_allows_agentfwd(void);
|
||||
--- a/src/config.h.in
|
||||
+++ b/src/config.h.in
|
||||
@@ -222,6 +222,9 @@
|
||||
/* Define to 1 if you have the <security/pam_appl.h> header file. */
|
||||
#undef HAVE_SECURITY_PAM_APPL_H
|
||||
|
||||
+/* Define to 1 if you have the `setresgid' function. */
|
||||
+#undef HAVE_SETRESGID
|
||||
+
|
||||
/* Define to 1 if you have the `setutent' function. */
|
||||
#undef HAVE_SETUTENT
|
||||
|
||||
--- a/src/loginrec.c
|
||||
+++ b/src/loginrec.c
|
||||
@@ -304,12 +304,6 @@ login_set_current_time(struct logininfo
|
||||
void
|
||||
login_write (struct logininfo *li)
|
||||
{
|
||||
-#ifndef HAVE_CYGWIN
|
||||
- if ((int)geteuid() != 0) {
|
||||
- return 1;
|
||||
- }
|
||||
-#endif
|
||||
-
|
||||
/* set the timestamp */
|
||||
login_set_current_time(li);
|
||||
#ifdef USE_LOGIN
|
||||
--- a/src/session.h
|
||||
+++ b/src/session.h
|
||||
@@ -271,6 +271,12 @@ struct serversession {
|
||||
/* The instance created by the plugin_new function */
|
||||
struct PluginInstance *plugin_instance;
|
||||
#endif
|
||||
+
|
||||
+#if DROPBEAR_SVR_DROP_PRIVS
|
||||
+ /* Set to 1 when utmp_gid is valid */
|
||||
+ int have_utmp_gid;
|
||||
+ gid_t utmp_gid;
|
||||
+#endif
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
--- a/src/svr-auth.c
|
||||
+++ b/src/svr-auth.c
|
||||
@@ -457,13 +457,14 @@ void send_msg_userauth_success() {
|
||||
* delayed-zlib mode */
|
||||
ses.authstate.authdone = 1;
|
||||
|
||||
-#if DROPBEAR_DROP_PRIVS
|
||||
+#if DROPBEAR_SVR_DROP_PRIVS
|
||||
+ /* Drop privileges as soon as authentication has happened. */
|
||||
svr_switch_user();
|
||||
#endif
|
||||
ses.connect_time = 0;
|
||||
|
||||
|
||||
-#if DROPBEAR_DROP_PRIVS
|
||||
+#if DROPBEAR_SVR_DROP_PRIVS
|
||||
/* If running as the user, we can rely on the OS
|
||||
* to limit allowed ports */
|
||||
ses.allowprivport = 1;
|
||||
@@ -482,6 +483,20 @@ void send_msg_userauth_success() {
|
||||
|
||||
}
|
||||
|
||||
+#if DROPBEAR_SVR_DROP_PRIVS
|
||||
+/* Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */
|
||||
+static int utmp_gid(gid_t *ret_gid) {
|
||||
+ struct group *utmp_gr = getgrnam("utmp");
|
||||
+ if (!utmp_gr) {
|
||||
+ TRACE(("No utmp group"));
|
||||
+ return DROPBEAR_FAILURE;
|
||||
+ }
|
||||
+
|
||||
+ *ret_gid = utmp_gr->gr_gid;
|
||||
+ return DROPBEAR_SUCCESS;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
/* Switch to the ses.authstate user.
|
||||
* Fails if not running as root and the user differs.
|
||||
*
|
||||
@@ -499,6 +514,25 @@ void svr_switch_user(void) {
|
||||
ses.authstate.pw_gid) < 0)) {
|
||||
dropbear_exit("Error changing user group");
|
||||
}
|
||||
+
|
||||
+#if DROPBEAR_SVR_DROP_PRIVS
|
||||
+ /* Retain utmp saved group so that wtmp/utmp can be written */
|
||||
+ int ret = utmp_gid(&svr_ses.utmp_gid);
|
||||
+ if (ret == DROPBEAR_SUCCESS) {
|
||||
+ /* Set saved gid to utmp so that it can be
|
||||
+ * restored for login_logout() etc. This saved
|
||||
+ * group is cleared by the OS on execve() */
|
||||
+ int rc = setresgid(-1, -1, svr_ses.utmp_gid);
|
||||
+ if (rc == 0) {
|
||||
+ svr_ses.have_utmp_gid = 1;
|
||||
+ } else {
|
||||
+ /* Will not attempt to switch to utmp gid.
|
||||
+ * login() etc may fail. */
|
||||
+ TRACE(("utmp setresgid failed"));
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
if (setuid(ses.authstate.pw_uid) < 0) {
|
||||
dropbear_exit("Error changing user");
|
||||
}
|
||||
@@ -516,3 +550,26 @@ void svr_switch_user(void) {
|
||||
}
|
||||
}
|
||||
|
||||
+void svr_raise_gid_utmp(void) {
|
||||
+#if DROPBEAR_SVR_DROP_PRIVS
|
||||
+ if (!svr_ses.have_utmp_gid) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (setegid(svr_ses.utmp_gid) != 0) {
|
||||
+ dropbear_log(LOG_WARNING, "failed setegid");
|
||||
+ }
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+void svr_restore_gid(void) {
|
||||
+#if DROPBEAR_SVR_DROP_PRIVS
|
||||
+ if (!svr_ses.have_utmp_gid) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (setegid(getgid()) != 0) {
|
||||
+ dropbear_log(LOG_WARNING, "failed setegid");
|
||||
+ }
|
||||
+#endif
|
||||
+}
|
||||
--- a/src/svr-chansession.c
|
||||
+++ b/src/svr-chansession.c
|
||||
@@ -326,7 +326,11 @@ static void cleanupchansess(const struct
|
||||
if (chansess->tty) {
|
||||
/* write the utmp/wtmp login record */
|
||||
li = chansess_login_alloc(chansess);
|
||||
+
|
||||
+ svr_raise_gid_utmp();
|
||||
login_logout(li);
|
||||
+ svr_restore_gid();
|
||||
+
|
||||
login_free_entry(li);
|
||||
|
||||
pty_release(chansess->tty);
|
||||
@@ -847,7 +851,11 @@ static int ptycommand(struct Channel *ch
|
||||
* terminal used for stdout with the dup2 above, otherwise
|
||||
* the wtmp login will not be recorded */
|
||||
li = chansess_login_alloc(chansess);
|
||||
+
|
||||
+ svr_raise_gid_utmp();
|
||||
login_login(li);
|
||||
+ svr_restore_gid();
|
||||
+
|
||||
login_free_entry(li);
|
||||
|
||||
/* Can now dup2 stderr. Messages from login_login() have gone
|
||||
--- a/src/sysoptions.h
|
||||
+++ b/src/sysoptions.h
|
||||
@@ -318,6 +318,10 @@
|
||||
#error "At least one hostkey or public-key algorithm must be enabled; RSA is recommended."
|
||||
#endif
|
||||
|
||||
+#if DROPBEAR_SVR_DROP_PRIVS && !defined(HAVE_SETRESGID)
|
||||
+ #error "DROPBEAR_SVR_DROP_PRIVS requires setresgid()."
|
||||
+#endif
|
||||
+
|
||||
/* Source for randomness. This must be able to provide hundreds of bytes per SSH
|
||||
* connection without blocking. */
|
||||
#ifndef DROPBEAR_URANDOM_DEV
|
||||
@@ -0,0 +1,64 @@
|
||||
From ae7f99902161237542f2c71089ff68b8f694006b Mon Sep 17 00:00:00 2001
|
||||
From: Matt Johnston <matt@ucc.asn.au>
|
||||
Date: Tue, 9 Dec 2025 09:08:37 +0900
|
||||
Subject: Limit rekey to current hostkey type
|
||||
|
||||
During rekey dropbear process may be running with user privileges, that
|
||||
can't write a new hostkey when auto-generating keys.
|
||||
Only offer the original hostkey when rekeying, also for non-autogenerate
|
||||
case.
|
||||
|
||||
(cherry picked from commit a4043dac4e0e0237255200603672ddb0122017a4)
|
||||
---
|
||||
src/runopts.h | 1 +
|
||||
src/svr-kex.c | 8 ++++++++
|
||||
src/svr-runopts.c | 11 +++++++++++
|
||||
3 files changed, 20 insertions(+)
|
||||
|
||||
--- a/src/runopts.h
|
||||
+++ b/src/runopts.h
|
||||
@@ -66,6 +66,7 @@ extern runopts opts;
|
||||
int readhostkey(const char * filename, sign_key * hostkey,
|
||||
enum signkey_type *type);
|
||||
void load_all_hostkeys(void);
|
||||
+void disable_sig_except(enum signature_type sig_type);
|
||||
|
||||
typedef struct svr_runopts {
|
||||
|
||||
--- a/src/svr-kex.c
|
||||
+++ b/src/svr-kex.c
|
||||
@@ -96,6 +96,14 @@ void recv_msg_kexdh_init() {
|
||||
}
|
||||
#endif
|
||||
|
||||
+ if (!ses.kexstate.donesecondkex) {
|
||||
+ /* Disable other signature types.
|
||||
+ * During future rekeying, privileges may have been dropped
|
||||
+ * so other keys won't be loadable.
|
||||
+ * This must occur after send_msg_ext_info() which uses the hostkey list */
|
||||
+ disable_sig_except(ses.newkeys->algo_signature);
|
||||
+ }
|
||||
+
|
||||
ses.requirenext = SSH_MSG_NEWKEYS;
|
||||
TRACE(("leave recv_msg_kexdh_init"))
|
||||
}
|
||||
--- a/src/svr-runopts.c
|
||||
+++ b/src/svr-runopts.c
|
||||
@@ -502,6 +502,17 @@ static void disablekey(enum signature_ty
|
||||
}
|
||||
}
|
||||
|
||||
+void disable_sig_except(enum signature_type allow_type) {
|
||||
+ int i;
|
||||
+ TRACE(("Disabling other sigs except %d", allow_type));
|
||||
+ for (i = 0; sigalgs[i].name != NULL; i++) {
|
||||
+ enum signature_type sig_type = sigalgs[i].val;
|
||||
+ if (sig_type != allow_type) {
|
||||
+ sigalgs[i].usable = 0;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void loadhostkey_helper(const char *name, void** src, void** dst, int fatal_duplicate) {
|
||||
if (*dst) {
|
||||
if (fatal_duplicate) {
|
||||
@@ -0,0 +1,41 @@
|
||||
From 3e487854fcf09a5ef57a620ebe606f586a6efdc3 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Johnston <matt@ucc.asn.au>
|
||||
Date: Fri, 12 Dec 2025 12:31:40 +0900
|
||||
Subject: Restore seteuid for authorized_keys
|
||||
|
||||
Authorized_keys reading is pre-authentication so should not be
|
||||
modified in the post-auth drop-privilege change.
|
||||
|
||||
Fixes: e0251be2354e ("Drop privileges after user authentication")
|
||||
(cherry picked from commit d193731630a62482855b450daa1d5a5e13a90125)
|
||||
---
|
||||
src/svr-authpubkey.c | 6 ++----
|
||||
1 file changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/src/svr-authpubkey.c
|
||||
+++ b/src/svr-authpubkey.c
|
||||
@@ -444,14 +444,12 @@ static int checkpubkey(const char* keyal
|
||||
buffer * line = NULL;
|
||||
unsigned int len;
|
||||
int line_num;
|
||||
-#if !DROPBEAR_SVR_DROP_PRIVS
|
||||
uid_t origuid;
|
||||
gid_t origgid;
|
||||
-#endif
|
||||
|
||||
TRACE(("enter checkpubkey"))
|
||||
|
||||
-#if !DROPBEAR_SVR_DROP_PRIVS
|
||||
+#if DROPBEAR_SVR_MULTIUSER
|
||||
/* access the file as the authenticating user. */
|
||||
origuid = getuid();
|
||||
origgid = getgid();
|
||||
@@ -478,7 +476,7 @@ static int checkpubkey(const char* keyal
|
||||
TRACE(("checkpubkey: failed opening %s: %s", filename, strerror(errno)))
|
||||
}
|
||||
}
|
||||
-#if !DROPBEAR_SVR_DROP_PRIVS
|
||||
+#if DROPBEAR_SVR_MULTIUSER
|
||||
if ((seteuid(origuid)) < 0 ||
|
||||
(setegid(origgid)) < 0) {
|
||||
dropbear_exit("Failed to revert euid");
|
||||
@@ -0,0 +1,153 @@
|
||||
From 5938a084b0aad887c0f7fa62bf3644d029e4d47d Mon Sep 17 00:00:00 2001
|
||||
From: Matt Johnston <matt@ucc.asn.au>
|
||||
Date: Tue, 9 Dec 2025 22:59:19 +0900
|
||||
Subject: scp CVE-2019-6111 fix
|
||||
|
||||
Cherry-pick from OpenSSH portable
|
||||
|
||||
391ffc4b9d31 ("upstream: check in scp client that filenames sent during")
|
||||
|
||||
upstream: check in scp client that filenames sent during
|
||||
|
||||
remote->local directory copies satisfy the wildcard specified by the user.
|
||||
|
||||
This checking provides some protection against a malicious server
|
||||
sending unexpected filenames, but it comes at a risk of rejecting wanted
|
||||
files due to differences between client and server wildcard expansion rules.
|
||||
|
||||
For this reason, this also adds a new -T flag to disable the check.
|
||||
|
||||
reported by Harry Sintonen
|
||||
fix approach suggested by markus@;
|
||||
has been in snaps for ~1wk courtesy deraadt@
|
||||
|
||||
(cherry picked from commit 48a17cff6aa104b8e806ddb2191f83f1024060f1)
|
||||
---
|
||||
src/scp.c | 38 +++++++++++++++++++++++++++++---------
|
||||
1 file changed, 29 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/src/scp.c
|
||||
+++ b/src/scp.c
|
||||
@@ -76,6 +76,8 @@
|
||||
#include "includes.h"
|
||||
/*RCSID("$OpenBSD: scp.c,v 1.130 2006/01/31 10:35:43 djm Exp $");*/
|
||||
|
||||
+#include <fnmatch.h>
|
||||
+
|
||||
#include "atomicio.h"
|
||||
#include "compat.h"
|
||||
#include "scpmisc.h"
|
||||
@@ -291,14 +293,14 @@ void verifydir(char *);
|
||||
|
||||
uid_t userid;
|
||||
int errs, remin, remout;
|
||||
-int pflag, iamremote, iamrecursive, targetshouldbedirectory;
|
||||
+int Tflag, pflag, iamremote, iamrecursive, targetshouldbedirectory;
|
||||
|
||||
#define CMDNEEDS 64
|
||||
char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */
|
||||
|
||||
int response(void);
|
||||
void rsource(char *, struct stat *);
|
||||
-void sink(int, char *[]);
|
||||
+void sink(int, char *[], const char *);
|
||||
void source(int, char *[]);
|
||||
void tolocal(int, char *[]);
|
||||
void toremote(char *, int, char *[]);
|
||||
@@ -325,8 +327,8 @@ main(int argc, char **argv)
|
||||
args.list = NULL;
|
||||
addargs(&args, "%s", ssh_program);
|
||||
|
||||
- fflag = tflag = 0;
|
||||
- while ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q1246S:o:F:")) != -1)
|
||||
+ fflag = Tflag = tflag = 0;
|
||||
+ while ((ch = getopt(argc, argv, "dfl:prtTvBCc:i:P:q1246S:o:F:")) != -1)
|
||||
switch (ch) {
|
||||
/* User-visible flags. */
|
||||
case '1':
|
||||
@@ -389,9 +391,12 @@ main(int argc, char **argv)
|
||||
setmode(0, O_BINARY);
|
||||
#endif
|
||||
break;
|
||||
+ case 'T':
|
||||
+ Tflag = 1;
|
||||
+ break;
|
||||
default:
|
||||
usage();
|
||||
- }
|
||||
+ }
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
@@ -409,7 +414,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
if (tflag) {
|
||||
/* Receive data. */
|
||||
- sink(argc, argv);
|
||||
+ sink(argc, argv, NULL);
|
||||
exit(errs != 0);
|
||||
}
|
||||
if (argc < 2)
|
||||
@@ -589,7 +594,7 @@ tolocal(int argc, char **argv)
|
||||
continue;
|
||||
}
|
||||
xfree(bp);
|
||||
- sink(1, argv + argc - 1);
|
||||
+ sink(1, argv + argc - 1, src);
|
||||
(void) close(remin);
|
||||
remin = remout = -1;
|
||||
}
|
||||
@@ -822,7 +827,7 @@ bwlimit(int amount)
|
||||
}
|
||||
|
||||
void
|
||||
-sink(int argc, char **argv)
|
||||
+sink(int argc, char **argv, const char *src)
|
||||
{
|
||||
static BUF buffer;
|
||||
struct stat stb;
|
||||
@@ -836,6 +841,7 @@ sink(int argc, char **argv)
|
||||
off_t size, statbytes;
|
||||
int setimes, targisdir, wrerrno = 0;
|
||||
char ch, *cp, *np, *targ, *why, *vect[1], buf[2048];
|
||||
+ char *src_copy = NULL, *restrict_pattern = NULL;
|
||||
struct timeval tv[2];
|
||||
|
||||
#define atime tv[0]
|
||||
@@ -857,6 +863,17 @@ sink(int argc, char **argv)
|
||||
(void) atomicio(vwrite, remout, "", 1);
|
||||
if (stat(targ, &stb) == 0 && S_ISDIR(stb.st_mode))
|
||||
targisdir = 1;
|
||||
+ if (src != NULL && !iamrecursive && !Tflag) {
|
||||
+ /*
|
||||
+ * Prepare to try to restrict incoming filenames to match
|
||||
+ * the requested destination file glob.
|
||||
+ */
|
||||
+ if ((src_copy = strdup(src)) == NULL)
|
||||
+ fatal("strdup failed");
|
||||
+ if ((restrict_pattern = strrchr(src_copy, '/')) != NULL) {
|
||||
+ *restrict_pattern++ = '\0';
|
||||
+ }
|
||||
+ }
|
||||
for (first = 1;; first = 0) {
|
||||
cp = buf;
|
||||
if (atomicio(read, remin, cp, 1) != 1)
|
||||
@@ -939,6 +956,9 @@ sink(int argc, char **argv)
|
||||
run_err("error: unexpected filename: %s", cp);
|
||||
exit(1);
|
||||
}
|
||||
+ if (restrict_pattern != NULL &&
|
||||
+ fnmatch(restrict_pattern, cp, 0) != 0)
|
||||
+ SCREWUP("filename does not match request");
|
||||
if (targisdir) {
|
||||
static char *namebuf = NULL;
|
||||
static size_t cursize = 0;
|
||||
@@ -977,7 +997,7 @@ sink(int argc, char **argv)
|
||||
goto bad;
|
||||
}
|
||||
vect[0] = xstrdup(np);
|
||||
- sink(1, vect);
|
||||
+ sink(1, vect, src);
|
||||
if (setimes) {
|
||||
setimes = 0;
|
||||
if (utimes(vect[0], tv) < 0)
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/svr-chansession.c
|
||||
+++ b/src/svr-chansession.c
|
||||
@@ -984,12 +984,12 @@ static void execchild(const void *user_d
|
||||
--- a/src/svr-auth.c
|
||||
+++ b/src/svr-auth.c
|
||||
@@ -509,9 +509,9 @@ void svr_switch_user(void) {
|
||||
/* We can only change uid/gid as root ... */
|
||||
if (getuid() == 0) {
|
||||
|
||||
@@ -11,6 +11,11 @@
|
||||
+ ses.authstate.pw_gid) < 0))) {
|
||||
dropbear_exit("Error changing user group");
|
||||
}
|
||||
|
||||
@@ -533,7 +533,7 @@ void svr_switch_user(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
- if (setuid(ses.authstate.pw_uid) < 0) {
|
||||
+ if ((ses.authstate.pw_uid != 0) && (setuid(ses.authstate.pw_uid) < 0)) {
|
||||
dropbear_exit("Error changing user");
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=odhcpd
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
From be7ca7c0792b185263ad86b961ea61129494a7f9 Mon Sep 17 00:00:00 2001
|
||||
From: Fei Lv <feilv@asrmicro.com>
|
||||
Date: Fri, 14 Nov 2025 15:31:22 +0800
|
||||
Subject: [PATCH] config: fix memleak during odhcpd reload
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- The memset in close_interface reset the pios pointer before it
|
||||
could be freed, causing a memory leak. Relocate the free call
|
||||
to clean_interface to ensure proper deallocation.
|
||||
|
||||
- Use realloc instead of malloc in config_load_ra_pio()
|
||||
This function may be called multiple times during odhcpd reload,
|
||||
and using malloc without freeing the previous allocation was
|
||||
causing memory leaks.
|
||||
|
||||
Signed-off-by: Fei Lv <feilv@asrmicro.com>
|
||||
Link: https://github.com/openwrt/odhcpd/pull/309
|
||||
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
---
|
||||
src/config.c | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/src/config.c
|
||||
+++ b/src/config.c
|
||||
@@ -314,6 +314,7 @@ static void clean_interface(struct inter
|
||||
free(iface->dnr[i].svc);
|
||||
}
|
||||
free(iface->dnr);
|
||||
+ free(iface->pios);
|
||||
memset(&iface->ra, 0, sizeof(*iface) - offsetof(struct interface, ra));
|
||||
set_interface_defaults(iface);
|
||||
}
|
||||
@@ -335,7 +336,6 @@ static void close_interface(struct inter
|
||||
clean_interface(iface);
|
||||
free(iface->addr4);
|
||||
free(iface->addr6);
|
||||
- free(iface->pios);
|
||||
free(iface->ifname);
|
||||
free(iface);
|
||||
}
|
||||
@@ -1810,6 +1810,7 @@ static json_object *config_load_ra_pio_j
|
||||
void config_load_ra_pio(struct interface *iface)
|
||||
{
|
||||
json_object *json, *slaac_json;
|
||||
+ struct ra_pio *new_pios;
|
||||
size_t pio_cnt;
|
||||
time_t now;
|
||||
|
||||
@@ -1829,12 +1830,13 @@ void config_load_ra_pio(struct interface
|
||||
now = odhcpd_time();
|
||||
|
||||
pio_cnt = json_object_array_length(slaac_json);
|
||||
- iface->pios = malloc(sizeof(struct ra_pio) * pio_cnt);
|
||||
- if (!iface->pios) {
|
||||
+ new_pios = realloc(iface->pios, sizeof(struct ra_pio) * pio_cnt);
|
||||
+ if (!new_pios) {
|
||||
json_object_put(json);
|
||||
return;
|
||||
}
|
||||
|
||||
+ iface->pios = new_pios;
|
||||
iface->pio_cnt = 0;
|
||||
for (size_t i = 0; i < pio_cnt; i++) {
|
||||
json_object *cur_pio_json, *length_json, *prefix_json;
|
||||
@@ -26,9 +26,11 @@ if [ -n "$AUTOIPV6" ]; then
|
||||
[ -n "$ZONE" ] && json_add_string zone "$ZONE"
|
||||
[ -n "$EXTENDPREFIX" ] && json_add_string extendprefix 1
|
||||
[ -n "$IP6TABLE" ] && json_add_string ip6table $IP6TABLE
|
||||
[ -n "$REQPREFIX" ] && json_add_string reqprefix $REQPREFIX
|
||||
[ -n "$PEERDNS" ] && json_add_boolean peerdns $PEERDNS
|
||||
[ "$NOSOURCEFILTER" = "1" ] && json_add_boolean sourcefilter "0"
|
||||
[ "$DELEGATE" = "0" ] && json_add_boolean delegate "0"
|
||||
[ -n "$NORELEASE" ] && json_add_boolean norelease "1"
|
||||
json_close_object
|
||||
ubus call network add_dynamic "$(json_dump)"
|
||||
fi
|
||||
|
||||
@@ -79,18 +79,20 @@ ppp_generic_init_config() {
|
||||
proto_config_add_int mtu
|
||||
proto_config_add_string pppname
|
||||
proto_config_add_string unnumbered
|
||||
proto_config_add_string reqprefix
|
||||
proto_config_add_boolean persist
|
||||
proto_config_add_int maxfail
|
||||
proto_config_add_int holdoff
|
||||
proto_config_add_boolean sourcefilter
|
||||
proto_config_add_boolean delegate
|
||||
proto_config_add_boolean norelease
|
||||
}
|
||||
|
||||
ppp_generic_setup() {
|
||||
local config="$1"; shift
|
||||
local localip
|
||||
|
||||
json_get_vars ip6table demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered persist maxfail holdoff peerdns sourcefilter delegate
|
||||
json_get_vars ip6table demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered reqprefix persist maxfail holdoff peerdns sourcefilter delegate norelease
|
||||
|
||||
[ ! -e /proc/sys/net/ipv6 ] && ipv6=0 || json_get_var ipv6 ipv6
|
||||
|
||||
@@ -101,6 +103,11 @@ ppp_generic_setup() {
|
||||
autoipv6=1
|
||||
fi
|
||||
|
||||
if [ "$autoipv6" != 1 ]; then
|
||||
reqprefix=""
|
||||
norelease=""
|
||||
fi
|
||||
|
||||
if [ "${demand:-0}" -gt 0 ]; then
|
||||
demand="precompiled-active-filter /etc/ppp/filter demand idle $demand"
|
||||
else
|
||||
@@ -137,6 +144,7 @@ ppp_generic_setup() {
|
||||
[ -n "$disconnect" ] || json_get_var disconnect disconnect
|
||||
[ "$sourcefilter" = "0" ] || sourcefilter=""
|
||||
[ "$delegate" != "0" ] && delegate=""
|
||||
[ "$norelease" = "1" ] || norelease=""
|
||||
|
||||
proto_run_command "$config" /usr/sbin/pppd \
|
||||
nodetach ipparam "$config" \
|
||||
@@ -145,6 +153,8 @@ ppp_generic_setup() {
|
||||
${lcp_failure:+lcp-echo-interval $lcp_interval lcp-echo-failure $lcp_failure $lcp_adaptive} \
|
||||
${ipv6:++ipv6} \
|
||||
${autoipv6:+set AUTOIPV6=1} \
|
||||
${reqprefix:+set REQPREFIX=$reqprefix} \
|
||||
${norelease:+set NORELEASE=1} \
|
||||
${ip6table:+set IP6TABLE=$ip6table} \
|
||||
${peerdns:+set PEERDNS=$peerdns} \
|
||||
${sourcefilter:+set NOSOURCEFILTER=1} \
|
||||
@@ -215,6 +225,7 @@ proto_pppoe_init_config() {
|
||||
ppp_generic_init_config
|
||||
proto_config_add_string "ac"
|
||||
proto_config_add_string "service"
|
||||
proto_config_add_string "ac_mac"
|
||||
proto_config_add_string "host_uniq"
|
||||
proto_config_add_int "padi_attempts"
|
||||
proto_config_add_int "padi_timeout"
|
||||
@@ -233,6 +244,7 @@ proto_pppoe_setup() {
|
||||
|
||||
json_get_var ac ac
|
||||
json_get_var service service
|
||||
json_get_var ac_mac ac_mac
|
||||
json_get_var host_uniq host_uniq
|
||||
json_get_var padi_attempts padi_attempts
|
||||
json_get_var padi_timeout padi_timeout
|
||||
@@ -241,6 +253,7 @@ proto_pppoe_setup() {
|
||||
plugin pppoe.so \
|
||||
${ac:+rp_pppoe_ac "$ac"} \
|
||||
${service:+rp_pppoe_service "$service"} \
|
||||
${ac_mac:+pppoe-mac "$ac_mac"} \
|
||||
${host_uniq:+host-uniq "$host_uniq"} \
|
||||
${padi_attempts:+pppoe-padi-attempts $padi_attempts} \
|
||||
${padi_timeout:+pppoe-padi-timeout $padi_timeout} \
|
||||
|
||||
@@ -128,8 +128,14 @@ sub update_index($)
|
||||
-d "./feeds/$name.tmp/info" or mkdir "./feeds/$name.tmp/info" or return 1;
|
||||
|
||||
system("$mk -s prepare-mk OPENWRT_BUILD= TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
|
||||
system("$mk -s -f include/scan.mk IS_TTY=1 SCAN_TARGET=\"packageinfo\" SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"package\" SCAN_DEPTH=5 SCAN_EXTRA=\"\" TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
|
||||
system("$mk -s -f include/scan.mk IS_TTY=1 SCAN_TARGET=\"targetinfo\" SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"target\" SCAN_DEPTH=5 SCAN_EXTRA=\"\" SCAN_MAKEOPTS=\"TARGET_BUILD=1\" TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
|
||||
|
||||
my $is_tty = $ENV{IS_TTY};
|
||||
$is_tty = defined $is_tty ? $is_tty : $ENV{MAKE_TERMOUT};
|
||||
$is_tty = defined $is_tty ? $is_tty : 1;
|
||||
|
||||
system("$mk -s -f include/scan.mk IS_TTY=$is_tty SCAN_TARGET=\"packageinfo\" SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"package\" SCAN_DEPTH=5 SCAN_EXTRA=\"\" TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
|
||||
system("$mk -s -f include/scan.mk IS_TTY=$is_tty SCAN_TARGET=\"targetinfo\" SCAN_DIR=\"feeds/$name\" SCAN_NAME=\"target\" SCAN_DEPTH=5 SCAN_EXTRA=\"\" SCAN_MAKEOPTS=\"TARGET_BUILD=1\" TMP_DIR=\"$ENV{TOPDIR}/feeds/$name.tmp\"");
|
||||
|
||||
system("ln -sf $name.tmp/.packageinfo ./feeds/$name.index");
|
||||
system("ln -sf $name.tmp/.targetinfo ./feeds/$name.targetindex");
|
||||
|
||||
|
||||
@@ -43,12 +43,3 @@ for i in ${patchdir}/${patchpattern} ; do
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Check for rejects...
|
||||
if [ "`find $targetdir/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
|
||||
echo "Aborting. Reject files found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Remove backup files
|
||||
find $targetdir/ '(' -name '*.orig' -o -name '.*.orig' ')' -exec rm -f {} \;
|
||||
|
||||
@@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk
|
||||
ARCH:=arm
|
||||
BOARD:=airoha
|
||||
BOARDNAME:=Airoha ARM
|
||||
SUBTARGETS:=en7523 an7581
|
||||
SUBTARGETS:=en7523 an7581 an7583
|
||||
FEATURES:=dt squashfs nand ramdisk gpio
|
||||
|
||||
KERNEL_PATCHVER:=6.6
|
||||
|
||||
20
target/linux/airoha/an7581/base-files/etc/board.d/01_leds
Normal file
20
target/linux/airoha/an7581/base-files/etc/board.d/01_leds
Normal file
@@ -0,0 +1,20 @@
|
||||
#
|
||||
# Copyright (C) 2015 OpenWrt.org
|
||||
#
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
airoha,an7581-evb)
|
||||
ucidef_set_led_usbport "usb1" "USB 1" "green:usb-1" "usb1-port1" "usb2-port1"
|
||||
ucidef_set_led_usbport "usb2" "USB 2" "green:usb-2" "usb3-port1" "usb4-port1"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
28
target/linux/airoha/an7581/base-files/etc/board.d/02_network
Normal file
28
target/linux/airoha/an7581/base-files/etc/board.d/02_network
Normal file
@@ -0,0 +1,28 @@
|
||||
#
|
||||
# Copyright (c) 2015 The Linux Foundation. All rights reserved.
|
||||
# Copyright (c) 2011-2015 OpenWrt.org
|
||||
#
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
. /lib/functions/system.sh
|
||||
|
||||
an7581_setup_interfaces()
|
||||
{
|
||||
local board="$1"
|
||||
|
||||
case "$board" in
|
||||
airoha,an7581-evb)
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "eth1"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported hardware. Network interfaces not initialized"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
board_config_update
|
||||
board=$(board_name)
|
||||
an7581_setup_interfaces $board
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
@@ -345,6 +345,7 @@ CONFIG_LOG_BUF_SHIFT=14
|
||||
# CONFIG_LRU_GEN is not set
|
||||
CONFIG_LZO_COMPRESS=y
|
||||
CONFIG_LZO_DECOMPRESS=y
|
||||
# CONFIG_MDIO_AIROHA is not set
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
@@ -388,6 +389,7 @@ CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEED_SG_DMA_FLAGS=y
|
||||
CONFIG_NEED_SG_DMA_LENGTH=y
|
||||
CONFIG_NET_AIROHA=y
|
||||
# CONFIG_NET_AIROHA_FLOW_STATS is not set
|
||||
CONFIG_NET_DEVLINK=y
|
||||
CONFIG_NET_DSA=y
|
||||
CONFIG_NET_DSA_MT7530=y
|
||||
@@ -446,7 +448,8 @@ CONFIG_PCI_DOMAINS=y
|
||||
CONFIG_PCI_DOMAINS_GENERIC=y
|
||||
CONFIG_PCI_MSI=y
|
||||
CONFIG_PCPU_DEV_REFCNT=y
|
||||
CONFIG_PCS_MTK_LYNXI=y
|
||||
CONFIG_PCS_AIROHA_AN7581=y
|
||||
# CONFIG_PCS_AIROHA_AN7583 is not set
|
||||
CONFIG_PERF_EVENTS=y
|
||||
CONFIG_PER_VMA_LOCK=y
|
||||
CONFIG_PGTABLE_LEVELS=3
|
||||
@@ -455,6 +458,7 @@ CONFIG_PHYLIB_LEDS=y
|
||||
CONFIG_PHYLINK=y
|
||||
CONFIG_PHYS_ADDR_T_64BIT=y
|
||||
CONFIG_PHY_AIROHA_PCIE=y
|
||||
CONFIG_PHY_AIROHA_USB=y
|
||||
CONFIG_PID_NS=y
|
||||
CONFIG_PINCTRL=y
|
||||
CONFIG_PINCTRL_AIROHA=y
|
||||
@@ -516,6 +520,7 @@ CONFIG_SECURITY=y
|
||||
CONFIG_SECURITYFS=y
|
||||
# CONFIG_SECURITY_DMESG_RESTRICT is not set
|
||||
# CONFIG_SECURITY_NETWORK is not set
|
||||
CONFIG_SERIAL_8250_AIROHA=y
|
||||
CONFIG_SERIAL_8250_EXTENDED=y
|
||||
CONFIG_SERIAL_8250_FSL=y
|
||||
CONFIG_SERIAL_8250_NR_UARTS=5
|
||||
|
||||
28
target/linux/airoha/an7583/base-files/etc/board.d/02_network
Normal file
28
target/linux/airoha/an7583/base-files/etc/board.d/02_network
Normal file
@@ -0,0 +1,28 @@
|
||||
#
|
||||
# Copyright (c) 2015 The Linux Foundation. All rights reserved.
|
||||
# Copyright (c) 2011-2015 OpenWrt.org
|
||||
#
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
. /lib/functions/system.sh
|
||||
|
||||
an7583_setup_interfaces()
|
||||
{
|
||||
local board="$1"
|
||||
|
||||
case "$board" in
|
||||
airoha,an7583-evb)
|
||||
ucidef_set_interface_lan "lan1 lan2 lan3 lan4 eth1"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported hardware. Network interfaces not initialized"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
board_config_update
|
||||
board=$(board_name)
|
||||
an7583_setup_interfaces $board
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
403
target/linux/airoha/an7583/config-6.6
Normal file
403
target/linux/airoha/an7583/config-6.6
Normal file
@@ -0,0 +1,403 @@
|
||||
CONFIG_64BIT=y
|
||||
CONFIG_AIROHA_CPU_PM_DOMAIN=y
|
||||
CONFIG_AIROHA_SCU_SSR=y
|
||||
CONFIG_AIROHA_THERMAL=y
|
||||
CONFIG_AIROHA_WATCHDOG=y
|
||||
CONFIG_AMPERE_ERRATUM_AC03_CPU_38=y
|
||||
CONFIG_ARCH_AIROHA=y
|
||||
CONFIG_ARCH_BINFMT_ELF_EXTRA_PHDRS=y
|
||||
CONFIG_ARCH_CORRECT_STACKTRACE_ON_KRETPROBE=y
|
||||
CONFIG_ARCH_DEFAULT_KEXEC_IMAGE_VERIFY_SIG=y
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_FORCE_MAX_ORDER=10
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS=18
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=24
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MIN=18
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
|
||||
CONFIG_ARCH_PROC_KCORE_TEXT=y
|
||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
||||
CONFIG_ARCH_STACKWALK=y
|
||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_ARCH_WANTS_NO_INSTR=y
|
||||
CONFIG_ARCH_WANTS_THP_SWAP=y
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_ARM64_4K_PAGES=y
|
||||
CONFIG_ARM64_ERRATUM_843419=y
|
||||
CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419=y
|
||||
CONFIG_ARM64_PA_BITS=48
|
||||
CONFIG_ARM64_PA_BITS_48=y
|
||||
CONFIG_ARM64_PLATFORM_DEVICES=y
|
||||
CONFIG_ARM64_TAGGED_ADDR_ABI=y
|
||||
CONFIG_ARM64_VA_BITS=39
|
||||
CONFIG_ARM64_VA_BITS_39=y
|
||||
# CONFIG_ARM64_VA_BITS_48 is not set
|
||||
# CONFIG_ARM64_VA_BITS_52 is not set
|
||||
CONFIG_ARM_AIROHA_SOC_CPUFREQ=y
|
||||
CONFIG_ARM_AMBA=y
|
||||
CONFIG_ARM_ARCH_TIMER=y
|
||||
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
|
||||
# CONFIG_ARM_DEBUG_WX is not set
|
||||
CONFIG_ARM_GIC=y
|
||||
CONFIG_ARM_GIC_V2M=y
|
||||
CONFIG_ARM_GIC_V3=y
|
||||
CONFIG_ARM_GIC_V3_ITS=y
|
||||
CONFIG_ARM_PMU=y
|
||||
CONFIG_ARM_PMUV3=y
|
||||
CONFIG_ARM_PSCI_FW=y
|
||||
CONFIG_ARM_SMCCC_SOC_ID=y
|
||||
# CONFIG_ARM_SMMU is not set
|
||||
# CONFIG_ARM_SMMU_V3 is not set
|
||||
CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
|
||||
CONFIG_BLK_MQ_PCI=y
|
||||
CONFIG_BLK_PM=y
|
||||
CONFIG_BUFFER_HEAD=y
|
||||
CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y
|
||||
CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
|
||||
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_COMMON_CLK=y
|
||||
CONFIG_COMMON_CLK_EN7523=y
|
||||
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
|
||||
# CONFIG_COMPAT_32BIT_TIME is not set
|
||||
# CONFIG_COMPRESSED_INSTALL is not set
|
||||
CONFIG_CONTEXT_TRACKING=y
|
||||
CONFIG_CONTEXT_TRACKING_IDLE=y
|
||||
CONFIG_CPUFREQ_DT=y
|
||||
CONFIG_CPUFREQ_DT_PLATDEV=y
|
||||
CONFIG_CPU_FREQ=y
|
||||
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
|
||||
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
|
||||
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
|
||||
CONFIG_CPU_FREQ_GOV_COMMON=y
|
||||
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
|
||||
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
|
||||
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
|
||||
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
|
||||
CONFIG_CPU_FREQ_GOV_USERSPACE=y
|
||||
CONFIG_CPU_FREQ_STAT=y
|
||||
CONFIG_CPU_LITTLE_ENDIAN=y
|
||||
CONFIG_CPU_RMAP=y
|
||||
CONFIG_CRC16=y
|
||||
CONFIG_CRC_CCITT=y
|
||||
CONFIG_CRYPTO_CRC32C=y
|
||||
CONFIG_CRYPTO_DEFLATE=y
|
||||
CONFIG_CRYPTO_DEV_EIP93=y
|
||||
CONFIG_CRYPTO_DRBG=y
|
||||
CONFIG_CRYPTO_DRBG_HMAC=y
|
||||
CONFIG_CRYPTO_DRBG_MENU=y
|
||||
CONFIG_CRYPTO_ECB=y
|
||||
CONFIG_CRYPTO_HASH_INFO=y
|
||||
CONFIG_CRYPTO_HMAC=y
|
||||
CONFIG_CRYPTO_JITTERENTROPY=y
|
||||
CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKS=64
|
||||
CONFIG_CRYPTO_JITTERENTROPY_MEMORY_BLOCKSIZE=32
|
||||
CONFIG_CRYPTO_JITTERENTROPY_OSR=1
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_LIB_GF128MUL=y
|
||||
CONFIG_CRYPTO_LIB_SHA1=y
|
||||
CONFIG_CRYPTO_LIB_SHA256=y
|
||||
CONFIG_CRYPTO_LIB_UTILS=y
|
||||
CONFIG_CRYPTO_LZO=y
|
||||
CONFIG_CRYPTO_RNG=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
CONFIG_CRYPTO_RNG_DEFAULT=y
|
||||
CONFIG_CRYPTO_SHA256=y
|
||||
CONFIG_CRYPTO_SHA3=y
|
||||
CONFIG_CRYPTO_SHA512=y
|
||||
CONFIG_CRYPTO_ZSTD=y
|
||||
CONFIG_DCACHE_WORD_ACCESS=y
|
||||
CONFIG_DEBUG_MISC=y
|
||||
CONFIG_DMADEVICES=y
|
||||
CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC=y
|
||||
CONFIG_DMA_DIRECT_REMAP=y
|
||||
CONFIG_DMA_ENGINE=y
|
||||
CONFIG_DMA_NEED_SYNC=y
|
||||
CONFIG_DMA_OF=y
|
||||
CONFIG_DMA_OPS_HELPERS=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_EDAC_SUPPORT=y
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_FIXED_PHY=y
|
||||
CONFIG_FIX_EARLYCON_MEM=y
|
||||
CONFIG_FRAME_POINTER=y
|
||||
CONFIG_FS_IOMAP=y
|
||||
CONFIG_FS_MBCACHE=y
|
||||
CONFIG_FUNCTION_ALIGNMENT=4
|
||||
CONFIG_FUNCTION_ALIGNMENT_4B=y
|
||||
CONFIG_FWNODE_MDIO=y
|
||||
CONFIG_FW_CACHE=y
|
||||
# CONFIG_FW_LOADER_USER_HELPER is not set
|
||||
CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_ARCH_TOPOLOGY=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
|
||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||
CONFIG_GENERIC_CPU_DEVICES=y
|
||||
CONFIG_GENERIC_CPU_VULNERABILITIES=y
|
||||
CONFIG_GENERIC_CSUM=y
|
||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
||||
CONFIG_GENERIC_IDLE_POLL_SETUP=y
|
||||
CONFIG_GENERIC_IOREMAP=y
|
||||
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
|
||||
CONFIG_GENERIC_IRQ_SHOW=y
|
||||
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
|
||||
CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y
|
||||
CONFIG_GENERIC_MSI_IRQ=y
|
||||
CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_PHY=y
|
||||
CONFIG_GENERIC_PINCONF=y
|
||||
CONFIG_GENERIC_PINCTRL_GROUPS=y
|
||||
CONFIG_GENERIC_PINMUX_FUNCTIONS=y
|
||||
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
CONFIG_GLOB=y
|
||||
CONFIG_GPIOLIB_IRQCHIP=y
|
||||
CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GPIO_EN7523=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GRO_CELLS=y
|
||||
CONFIG_HARDIRQS_SW_RESEND=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_IOPORT=y
|
||||
CONFIG_HAS_IOPORT_MAP=y
|
||||
CONFIG_HOTPLUG_CORE_SYNC=y
|
||||
CONFIG_HOTPLUG_CORE_SYNC_DEAD=y
|
||||
CONFIG_HOTPLUG_CPU=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
CONFIG_HW_RANDOM_AIROHA=y
|
||||
# CONFIG_HISILICON_ERRATUM_162100801 is not set
|
||||
# CONFIG_IDPF is not set
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
|
||||
CONFIG_INET_AH=y
|
||||
CONFIG_INET_ESP=y
|
||||
# CONFIG_INET_ESP_OFFLOAD is not set
|
||||
CONFIG_INET_IPCOMP=y
|
||||
CONFIG_INET_TUNNEL=y
|
||||
CONFIG_INET_XFRM_TUNNEL=y
|
||||
CONFIG_IO_URING=y
|
||||
CONFIG_IPC_NS=y
|
||||
CONFIG_IPV6=y
|
||||
CONFIG_IPV6_MULTIPLE_TABLES=y
|
||||
# CONFIG_IPV6_SUBTREES is not set
|
||||
CONFIG_IP_MROUTE=y
|
||||
CONFIG_IP_MROUTE_COMMON=y
|
||||
# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set
|
||||
CONFIG_IP_PNP=y
|
||||
# CONFIG_IP_PNP_BOOTP is not set
|
||||
# CONFIG_IP_PNP_DHCP is not set
|
||||
# CONFIG_IP_PNP_RARP is not set
|
||||
# CONFIG_IP_ROUTE_MULTIPATH is not set
|
||||
# CONFIG_IP_ROUTE_VERBOSE is not set
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_DOMAIN_HIERARCHY=y
|
||||
CONFIG_IRQ_FORCED_THREADING=y
|
||||
CONFIG_IRQ_MSI_LIB=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_JBD2=y
|
||||
CONFIG_LIBFDT=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
CONFIG_LOCK_SPIN_ON_OWNER=y
|
||||
CONFIG_LRU_GEN_WALKS_MMU=y
|
||||
CONFIG_LZO_COMPRESS=y
|
||||
CONFIG_LZO_DECOMPRESS=y
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_AIROHA=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
# CONFIG_MEDIATEK_GE_SOC_PHY is not set
|
||||
# CONFIG_MEMCG is not set
|
||||
CONFIG_MFD_SYSCON=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MMC=y
|
||||
CONFIG_MMC_BLOCK=y
|
||||
CONFIG_MMC_CQHCI=y
|
||||
CONFIG_MMC_MTK=y
|
||||
CONFIG_MMU_LAZY_TLB_REFCOUNT=y
|
||||
CONFIG_MODULES_TREE_LOOKUP=y
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
CONFIG_MTD_NAND_CORE=y
|
||||
CONFIG_MTD_NAND_ECC=y
|
||||
CONFIG_MTD_NAND_MTK_BMT=y
|
||||
CONFIG_MTD_RAW_NAND=y
|
||||
CONFIG_MTD_SPI_NAND=y
|
||||
CONFIG_MTD_SPLIT_FIRMWARE=y
|
||||
CONFIG_MTD_SPLIT_FIT_FW=y
|
||||
CONFIG_MTD_UBI=y
|
||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
||||
CONFIG_MTD_UBI_BLOCK=y
|
||||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
||||
CONFIG_MUTEX_SPIN_ON_OWNER=y
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEED_SG_DMA_LENGTH=y
|
||||
CONFIG_NET_AIROHA=y
|
||||
CONFIG_NET_AIROHA_FLOW_STATS=y
|
||||
CONFIG_NET_AIROHA_NPU=y
|
||||
CONFIG_NET_DEVLINK=y
|
||||
CONFIG_NET_DSA=y
|
||||
CONFIG_NET_DSA_MT7530=y
|
||||
CONFIG_NET_DSA_MT7530_MDIO=y
|
||||
CONFIG_NET_DSA_MT7530_MMIO=y
|
||||
CONFIG_NET_DSA_TAG_MTK=y
|
||||
CONFIG_NET_FLOW_LIMIT=y
|
||||
# CONFIG_NET_MEDIATEK_SOC is not set
|
||||
CONFIG_NET_SELFTESTS=y
|
||||
# CONFIG_NET_VENDOR_3COM is not set
|
||||
CONFIG_NET_VENDOR_AIROHA=y
|
||||
# CONFIG_NET_VENDOR_MEDIATEK is not set
|
||||
CONFIG_NLS=y
|
||||
CONFIG_NO_HZ_COMMON=y
|
||||
CONFIG_NO_HZ_IDLE=y
|
||||
CONFIG_NR_CPUS=4
|
||||
CONFIG_NVMEM=y
|
||||
CONFIG_NVMEM_BLOCK=y
|
||||
CONFIG_NVMEM_LAYOUTS=y
|
||||
CONFIG_NVMEM_LAYOUT_ASCII_ENV=y
|
||||
CONFIG_NVMEM_SYSFS=y
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_EARLY_FLATTREE=y
|
||||
CONFIG_OF_FLATTREE=y
|
||||
CONFIG_OF_GPIO=y
|
||||
CONFIG_OF_IRQ=y
|
||||
CONFIG_OF_KOBJ=y
|
||||
CONFIG_OF_MDIO=y
|
||||
CONFIG_PAGE_POOL=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
|
||||
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
|
||||
CONFIG_PARTITION_PERCPU=y
|
||||
CONFIG_PCI=y
|
||||
CONFIG_PCIEAER=y
|
||||
CONFIG_PCIEASPM=y
|
||||
# CONFIG_PCIEASPM_DEFAULT is not set
|
||||
CONFIG_PCIEASPM_PERFORMANCE=y
|
||||
# CONFIG_PCIEASPM_POWERSAVE is not set
|
||||
# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set
|
||||
CONFIG_PCIEPORTBUS=y
|
||||
CONFIG_PCIE_MEDIATEK=y
|
||||
CONFIG_PCIE_MEDIATEK_GEN3=y
|
||||
CONFIG_PCIE_PME=y
|
||||
CONFIG_PCI_DOMAINS=y
|
||||
CONFIG_PCI_DOMAINS_GENERIC=y
|
||||
CONFIG_PCI_MSI=y
|
||||
# CONFIG_PCS_AIROHA_AN7581 is not set
|
||||
CONFIG_PCS_AIROHA_AN7583=y
|
||||
CONFIG_PERF_EVENTS=y
|
||||
CONFIG_PER_VMA_LOCK=y
|
||||
CONFIG_PGTABLE_LEVELS=3
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PHYLIB_LEDS=y
|
||||
CONFIG_PHYLINK=y
|
||||
CONFIG_PHYS_ADDR_T_64BIT=y
|
||||
CONFIG_PHY_AIROHA_PCIE=y
|
||||
# CONFIG_PHY_AIROHA_USB is not set
|
||||
CONFIG_PINCTRL=y
|
||||
CONFIG_PINCTRL_AIROHA=y
|
||||
# CONFIG_PINCTRL_MT2712 is not set
|
||||
# CONFIG_PINCTRL_MT6765 is not set
|
||||
# CONFIG_PINCTRL_MT6795 is not set
|
||||
# CONFIG_PINCTRL_MT6797 is not set
|
||||
# CONFIG_PINCTRL_MT7622 is not set
|
||||
# CONFIG_PINCTRL_MT7981 is not set
|
||||
# CONFIG_PINCTRL_MT7986 is not set
|
||||
# CONFIG_PINCTRL_MT8173 is not set
|
||||
# CONFIG_PINCTRL_MT8183 is not set
|
||||
# CONFIG_PINCTRL_MT8186 is not set
|
||||
# CONFIG_PINCTRL_MT8188 is not set
|
||||
# CONFIG_PINCTRL_MT8516 is not set
|
||||
CONFIG_PM=y
|
||||
CONFIG_PM_CLK=y
|
||||
CONFIG_PM_OPP=y
|
||||
CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y
|
||||
CONFIG_POWER_RESET=y
|
||||
CONFIG_POWER_RESET_SYSCON=y
|
||||
CONFIG_POWER_SUPPLY=y
|
||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
||||
CONFIG_QUEUED_RWLOCKS=y
|
||||
CONFIG_QUEUED_SPINLOCKS=y
|
||||
CONFIG_RANDSTRUCT_NONE=y
|
||||
CONFIG_RAS=y
|
||||
CONFIG_RATIONAL=y
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_REGMAP_MMIO=y
|
||||
CONFIG_REGULATOR=y
|
||||
CONFIG_REGULATOR_FIXED_VOLTAGE=y
|
||||
CONFIG_RELOCATABLE=y
|
||||
CONFIG_RESET_CONTROLLER=y
|
||||
CONFIG_RFS_ACCEL=y
|
||||
CONFIG_RODATA_FULL_DEFAULT_ENABLED=y
|
||||
CONFIG_RPS=y
|
||||
CONFIG_RTL8261N_PHY=y
|
||||
CONFIG_RWSEM_SPIN_ON_OWNER=y
|
||||
CONFIG_SERIAL_8250_AIROHA=y
|
||||
CONFIG_SERIAL_8250_EXTENDED=y
|
||||
CONFIG_SERIAL_8250_FSL=y
|
||||
CONFIG_SERIAL_8250_NR_UARTS=5
|
||||
CONFIG_SERIAL_8250_RUNTIME_UARTS=5
|
||||
CONFIG_SERIAL_8250_SHARE_IRQ=y
|
||||
CONFIG_SERIAL_MCTRL_GPIO=y
|
||||
CONFIG_SERIAL_OF_PLATFORM=y
|
||||
CONFIG_SGL_ALLOC=y
|
||||
CONFIG_SKB_EXTENSIONS=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SOCK_RX_QUEUE_MAPPING=y
|
||||
CONFIG_SOC_BUS=y
|
||||
CONFIG_SOFTIRQ_ON_OWN_STACK=y
|
||||
CONFIG_SPARSEMEM=y
|
||||
CONFIG_SPARSEMEM_EXTREME=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP=y
|
||||
CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
|
||||
CONFIG_SPARSE_IRQ=y
|
||||
CONFIG_SPI=y
|
||||
# CONFIG_SPI_AIROHA_EN7523 is not set
|
||||
CONFIG_SPI_AIROHA_SNFI=y
|
||||
CONFIG_SPI_MASTER=y
|
||||
CONFIG_SPI_MEM=y
|
||||
CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y
|
||||
CONFIG_SWIOTLB=y
|
||||
CONFIG_SWPHY=y
|
||||
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||
# CONFIG_TEST_FPU is not set
|
||||
CONFIG_THERMAL=y
|
||||
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0
|
||||
CONFIG_THERMAL_GOV_STEP_WISE=y
|
||||
CONFIG_THERMAL_OF=y
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TIMER_OF=y
|
||||
CONFIG_TIMER_PROBE=y
|
||||
CONFIG_TRACE_IRQFLAGS_NMI_SUPPORT=y
|
||||
CONFIG_TREE_RCU=y
|
||||
CONFIG_TREE_SRCU=y
|
||||
CONFIG_UBIFS_FS=y
|
||||
# CONFIG_UNMAP_KERNEL_AT_EL0 is not set
|
||||
CONFIG_USER_STACKTRACE_SUPPORT=y
|
||||
CONFIG_VDSO_GETRANDOM=y
|
||||
CONFIG_VMAP_STACK=y
|
||||
CONFIG_WATCHDOG_CORE=y
|
||||
# CONFIG_WLAN is not set
|
||||
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
|
||||
CONFIG_XFRM_AH=y
|
||||
CONFIG_XFRM_ALGO=y
|
||||
CONFIG_XFRM_ESP=y
|
||||
CONFIG_XFRM_IPCOMP=y
|
||||
CONFIG_XFRM_MIGRATE=y
|
||||
CONFIG_XPS=y
|
||||
CONFIG_XXHASH=y
|
||||
CONFIG_ZLIB_DEFLATE=y
|
||||
CONFIG_ZLIB_INFLATE=y
|
||||
CONFIG_ZONE_DMA32=y
|
||||
CONFIG_ZSTD_COMMON=y
|
||||
CONFIG_ZSTD_COMPRESS=y
|
||||
CONFIG_ZSTD_DECOMPRESS=y
|
||||
11
target/linux/airoha/an7583/target.mk
Normal file
11
target/linux/airoha/an7583/target.mk
Normal file
@@ -0,0 +1,11 @@
|
||||
ARCH:=aarch64
|
||||
SUBTARGET:=an7583
|
||||
BOARDNAME:=AN7583
|
||||
CPU_TYPE:=cortex-a53
|
||||
KERNELNAME:=Image dtbs
|
||||
FEATURES+=pwm source-only
|
||||
|
||||
define Target/Description
|
||||
Build firmware images for Airoha an7583 ARM based boards.
|
||||
endef
|
||||
|
||||
@@ -57,6 +57,13 @@
|
||||
};
|
||||
};
|
||||
|
||||
pcie2_rst_pins: pcie2-rst-pins {
|
||||
conf {
|
||||
pins = "pcie_reset2";
|
||||
drive-open-drain = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
gswp1_led0_pins: gswp1-led0-pins {
|
||||
mux {
|
||||
function = "phy1_led0";
|
||||
@@ -99,6 +106,17 @@
|
||||
};
|
||||
};
|
||||
|
||||
&usb0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb1 {
|
||||
status = "okay";
|
||||
|
||||
mediatek,u3p-dis-msk = <0x1>;
|
||||
phys = <&usb1_phy PHY_TYPE_USB2>;
|
||||
};
|
||||
|
||||
&mmc0 {
|
||||
pinctrl-names = "default", "state_uhs";
|
||||
pinctrl-0 = <&mmc_pins>;
|
||||
@@ -156,6 +174,46 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie2 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pcie2_rst_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mdio {
|
||||
as21xx_1: ethernet-phy@1d {
|
||||
compatible = "ethernet-phy-ieee802.3-c45";
|
||||
reg = <0x1d>;
|
||||
|
||||
firmware-name = "as21x1x_fw.bin";
|
||||
|
||||
reset-deassert-us = <1000000>;
|
||||
reset-assert-us = <1000000>;
|
||||
reset-gpios = <&en7581_pinctrl 31 GPIO_ACTIVE_LOW>;
|
||||
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
led@0 {
|
||||
reg = <0>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
function-enumerator = <0>;
|
||||
default-state = "keep";
|
||||
};
|
||||
|
||||
led@1 {
|
||||
reg = <1>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
function-enumerator = <1>;
|
||||
default-state = "keep";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ð {
|
||||
status = "okay";
|
||||
};
|
||||
@@ -164,6 +222,13 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gdm4 {
|
||||
status = "okay";
|
||||
|
||||
phy-handle = <&as21xx_1>;
|
||||
phy-mode = "usxgmii";
|
||||
};
|
||||
|
||||
&switch {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&mdio_pins>;
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
#include <dt-bindings/clock/en7523-clk.h>
|
||||
#include <dt-bindings/phy/phy.h>
|
||||
#include <dt-bindings/phy/airoha,an7581-usb-phy.h>
|
||||
#include <dt-bindings/soc/airoha,scu-ssr.h>
|
||||
#include <dt-bindings/reset/airoha,en7581-reset.h>
|
||||
#include <dt-bindings/leds/common.h>
|
||||
#include <dt-bindings/thermal/thermal.h>
|
||||
@@ -17,29 +20,39 @@
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
|
||||
npu-binary@84000000 {
|
||||
atf@80000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x80000000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
npu_binary: npu-binary@84000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x84000000 0x0 0xa00000>;
|
||||
};
|
||||
|
||||
npu-flag@84b0000 {
|
||||
qdma0_buf: qdma0-buf@87000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x84b00000 0x0 0x100000>;
|
||||
reg = <0x0 0x87000000 0x0 0x2000000>;
|
||||
};
|
||||
|
||||
npu-pkt@85000000 {
|
||||
qdma1_buf: qdma1-buf@89000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x85000000 0x0 0x1a00000>;
|
||||
reg = <0x0 0x89000000 0x0 0x1000000>;
|
||||
};
|
||||
|
||||
npu-phyaddr@86b00000 {
|
||||
npu_pkt: npu-pkt@8a000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x86b00000 0x0 0x100000>;
|
||||
reg = <0x0 0x8a000000 0x0 0x2c00000>;
|
||||
};
|
||||
|
||||
npu-rxdesc@86d00000 {
|
||||
npu_txpkt: npu-txpkt@8cc00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x86d00000 0x0 0x100000>;
|
||||
reg = <0x0 0x8cc00000 0x0 0x4000000>;
|
||||
};
|
||||
|
||||
npu_txbufid: npu-txbufid@90c00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x90c00000 0x0 0x6800>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -428,6 +441,48 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pon_pcs: pcs@1fa08000 {
|
||||
compatible = "airoha,an7581-pcs-pon";
|
||||
reg = <0x0 0x1fa08000 0x0 0x1000>,
|
||||
<0x0 0x1fa80000 0x0 0x60>,
|
||||
<0x0 0x1fa80a00 0x0 0x164>,
|
||||
<0x0 0x1fa84000 0x0 0x450>,
|
||||
<0x0 0x1fa85900 0x0 0x338>,
|
||||
<0x0 0x1fa86000 0x0 0x300>,
|
||||
<0x0 0x1fa8a000 0x0 0x1000>,
|
||||
<0x0 0x1fa8b000 0x0 0x1000>;
|
||||
reg-names = "xfi_mac", "hsgmii_an", "hsgmii_pcs",
|
||||
"multi_sgmii", "usxgmii",
|
||||
"hsgmii_rate_adp", "xfi_ana", "xfi_pma";
|
||||
|
||||
resets = <&scuclk EN7581_XPON_MAC_RST>,
|
||||
<&scuclk EN7581_XPON_PHY_RST>;
|
||||
reset-names = "mac", "phy";
|
||||
|
||||
airoha,scu = <&scuclk>;
|
||||
};
|
||||
|
||||
eth_pcs: pcs@1fa09000 {
|
||||
compatible = "airoha,an7581-pcs-eth";
|
||||
reg = <0x0 0x1fa09000 0x0 0x1000>,
|
||||
<0x0 0x1fa70000 0x0 0x60>,
|
||||
<0x0 0x1fa70a00 0x0 0x164>,
|
||||
<0x0 0x1fa74000 0x0 0x450>,
|
||||
<0x0 0x1fa75900 0x0 0x338>,
|
||||
<0x0 0x1fa76000 0x0 0x300>,
|
||||
<0x0 0x1fa7a000 0x0 0x1000>,
|
||||
<0x0 0x1fa7b000 0x0 0x1000>;
|
||||
reg-names = "xfi_mac", "hsgmii_an", "hsgmii_pcs",
|
||||
"multi_sgmii", "usxgmii",
|
||||
"hsgmii_rate_adp", "xfi_ana", "xfi_pma";
|
||||
|
||||
resets = <&scuclk EN7581_XSI_MAC_RST>,
|
||||
<&scuclk EN7581_XSI_PHY_RST>;
|
||||
reset-names = "mac", "phy";
|
||||
|
||||
airoha,scu = <&scuclk>;
|
||||
};
|
||||
|
||||
chip_scu: syscon@1fa20000 {
|
||||
compatible = "airoha,en7581-chip-scu", "syscon";
|
||||
reg = <0x0 0x1fa20000 0x0 0x388>;
|
||||
@@ -438,8 +493,8 @@
|
||||
reg = <0x0 0x1fbe3400 0x0 0xff>;
|
||||
};
|
||||
|
||||
scuclk: clock-controller@1fa20000 {
|
||||
compatible = "airoha,en7581-scu";
|
||||
scuclk: clock-controller@1fb00000 {
|
||||
compatible = "airoha,en7581-scu", "syscon";
|
||||
reg = <0x0 0x1fb00000 0x0 0x970>;
|
||||
#clock-cells = <1>;
|
||||
#reset-cells = <1>;
|
||||
@@ -451,6 +506,52 @@
|
||||
interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
|
||||
};
|
||||
|
||||
usb0: usb@1fab0000 {
|
||||
compatible = "mediatek,mtk-xhci";
|
||||
reg = <0x0 0x1fab0000 0x0 0x3e00>,
|
||||
<0x0 0x1fab3e00 0x0 0x100>;
|
||||
reg-names = "mac", "ippc";
|
||||
interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
phys = <&usb0_phy PHY_TYPE_USB2>, <&usb0_phy PHY_TYPE_USB3>;
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
usb0_phy: phy@1fac0000 {
|
||||
compatible = "airoha,an7581-usb-phy";
|
||||
reg = <0x0 0x1fac0000 0x0 0x10000>;
|
||||
|
||||
airoha,scu = <&scuclk>;
|
||||
airoha,usb2-monitor-clk-sel = <AIROHA_USB2_MONCLK_SEL1>;
|
||||
airoha,serdes-port = <AIROHA_SCU_SERDES_USB1>;
|
||||
|
||||
#phy-cells = <1>;
|
||||
};
|
||||
|
||||
usb1: usb@1fad0000 {
|
||||
compatible = "mediatek,mtk-xhci";
|
||||
reg = <0x0 0x1fad0000 0x0 0x3e00>,
|
||||
<0x0 0x1fad3e00 0x0 0x100>;
|
||||
reg-names = "mac", "ippc";
|
||||
interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
phys = <&usb1_phy PHY_TYPE_USB2>, <&usb1_phy PHY_TYPE_USB3>;
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
usb1_phy: phy@1fae0000 {
|
||||
compatible = "airoha,an7581-usb-phy";
|
||||
reg = <0x0 0x1fae0000 0x0 0x10000>;
|
||||
|
||||
airoha,scu = <&scuclk>;
|
||||
airoha,usb2-monitor-clk-sel = <AIROHA_USB2_MONCLK_SEL2>;
|
||||
airoha,serdes-port = <AIROHA_SCU_SERDES_USB2>;
|
||||
|
||||
#phy-cells = <1>;
|
||||
};
|
||||
|
||||
crypto@1e004000 {
|
||||
compatible = "inside-secure,safexcel-eip93ies";
|
||||
reg = <0x0 0x1fb70000 0x0 0x1000>;
|
||||
@@ -510,7 +611,7 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
status = "disable";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
i2c1: i2c1@1fbf8100 {
|
||||
@@ -524,7 +625,7 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
status = "disable";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
snfi: spi@1fa10000 {
|
||||
@@ -666,6 +767,74 @@
|
||||
};
|
||||
};
|
||||
|
||||
pcie2: pcie@1fc40000 {
|
||||
compatible = "airoha,en7581-pcie";
|
||||
device_type = "pci";
|
||||
linux,pci-domain = <2>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
||||
reg = <0x0 0x1fc40000 0x0 0x1670>;
|
||||
reg-names = "pcie-mac";
|
||||
|
||||
clocks = <&scuclk EN7523_CLK_PCIE>;
|
||||
clock-names = "sys-ck";
|
||||
|
||||
phys = <&usb1_phy PHY_TYPE_USB3>;
|
||||
phy-names = "pcie-phy";
|
||||
|
||||
ranges = <0x02000000 0 0x28000000 0x0 0x28000000 0 0x4000000>;
|
||||
|
||||
resets = <&scuclk EN7581_PCIE0_RST>,
|
||||
<&scuclk EN7581_PCIE1_RST>,
|
||||
<&scuclk EN7581_PCIE2_RST>;
|
||||
reset-names = "phy-lane0", "phy-lane1", "phy-lane2";
|
||||
|
||||
mediatek,pbus-csr = <&pbus_csr 0x10 0x14>;
|
||||
|
||||
interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
|
||||
bus-range = <0x00 0xff>;
|
||||
#interrupt-cells = <1>;
|
||||
interrupt-map-mask = <0 0 0 7>;
|
||||
interrupt-map = <0 0 0 1 &pcie_intc2 0>,
|
||||
<0 0 0 2 &pcie_intc2 1>,
|
||||
<0 0 0 3 &pcie_intc2 2>,
|
||||
<0 0 0 4 &pcie_intc2 3>;
|
||||
|
||||
status = "disabled";
|
||||
|
||||
pcie_intc2: interrupt-controller {
|
||||
interrupt-controller;
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
npu: npu@1e900000 {
|
||||
compatible = "airoha,en7581-npu";
|
||||
reg = <0x0 0x1e900000 0x0 0x313000>;
|
||||
interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
|
||||
memory-region = <&npu_binary>, <&npu_pkt>, <&npu_txpkt>,
|
||||
<&npu_txbufid>;
|
||||
memory-region-names = "binary", "pkt", "tx-pkt",
|
||||
"tx-bufid";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
eth: ethernet@1fb50000 {
|
||||
compatible = "airoha,en7581-eth";
|
||||
reg = <0 0x1fb50000 0 0x2600>,
|
||||
@@ -696,6 +865,11 @@
|
||||
<GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
memory-region = <&qdma0_buf>, <&qdma1_buf>;
|
||||
memory-region-names = "qdma0-buf", "qdma1-buf";
|
||||
|
||||
airoha,npu = <&npu>;
|
||||
|
||||
status = "disabled";
|
||||
|
||||
#address-cells = <1>;
|
||||
@@ -713,6 +887,22 @@
|
||||
pause;
|
||||
};
|
||||
};
|
||||
|
||||
gdm2: ethernet@2 {
|
||||
compatible = "airoha,eth-mac";
|
||||
reg = <2>;
|
||||
pcs = <&pon_pcs>;
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gdm4: ethernet@4 {
|
||||
compatible = "airoha,eth-mac";
|
||||
reg = <4>;
|
||||
pcs = <ð_pcs>;
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
switch: switch@1fb58000 {
|
||||
@@ -776,7 +966,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
mdio {
|
||||
mdio: mdio {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
|
||||
297
target/linux/airoha/dts/an7583-evb-emmc.dts
Normal file
297
target/linux/airoha/dts/an7583-evb-emmc.dts
Normal file
@@ -0,0 +1,297 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
/dts-v1/;
|
||||
|
||||
#include <dt-bindings/leds/common.h>
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include "an7583.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Airoha AN7583 Evaluation Board";
|
||||
compatible = "airoha,an7583-evb", "airoha,an7583", "airoha,en7583";
|
||||
|
||||
aliases {
|
||||
serial0 = &uart1;
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyS0,115200 earlycon";
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
memory@80000000 {
|
||||
device_type = "memory";
|
||||
reg = <0x0 0x80000000 0x2 0x00000000>;
|
||||
};
|
||||
|
||||
gpio-keys-polled {
|
||||
compatible = "gpio-keys-polled";
|
||||
poll-interval = <100>;
|
||||
|
||||
btn-reset {
|
||||
label = "reset";
|
||||
linux,code = <BTN_0>;
|
||||
gpios = <&an7583_pinctrl 0 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led-1 {
|
||||
label = "pon";
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
gpios = <&an7583_pinctrl 12 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led-2 {
|
||||
label = "internet";
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
gpios = <&an7583_pinctrl 26 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led-3 {
|
||||
label = "wps";
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
gpios = <&an7583_pinctrl 31 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led-4 {
|
||||
label = "los";
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
gpios = <&an7583_pinctrl 27 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led-5 {
|
||||
label = "voip_hook";
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
gpios = <&an7583_pinctrl 29 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&an7583_pinctrl {
|
||||
gpio-ranges = <&an7583_pinctrl 0 2 53>;
|
||||
|
||||
mdio0_pins: mdio0-pins {
|
||||
conf {
|
||||
pins = "mdio_0";
|
||||
output-high;
|
||||
};
|
||||
};
|
||||
|
||||
pcie0_rst_pins: pcie0-rst-pins {
|
||||
conf {
|
||||
pins = "pcie_reset0";
|
||||
drive-open-drain = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
pcie1_rst_pins: pcie1-rst-pins {
|
||||
conf {
|
||||
pins = "pcie_reset1";
|
||||
drive-open-drain = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
gswp1_led0_pins: gswp1-led0-pins {
|
||||
mux {
|
||||
function = "phy1_led0";
|
||||
pins = "gpio1";
|
||||
};
|
||||
};
|
||||
|
||||
gswp2_led0_pins: gswp2-led0-pins {
|
||||
mux {
|
||||
function = "phy2_led0";
|
||||
pins = "gpio2";
|
||||
};
|
||||
};
|
||||
|
||||
gswp3_led0_pins: gswp3-led0-pins {
|
||||
mux {
|
||||
function = "phy3_led0";
|
||||
pins = "gpio3";
|
||||
};
|
||||
};
|
||||
|
||||
gswp4_led0_pins: gswp4-led0-pins {
|
||||
mux {
|
||||
function = "phy4_led0";
|
||||
pins = "gpio4";
|
||||
};
|
||||
};
|
||||
|
||||
mmc_pins: mmc-pins {
|
||||
mux {
|
||||
function = "emmc";
|
||||
groups = "emmc";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&mmc0 {
|
||||
pinctrl-names = "default", "state_uhs";
|
||||
pinctrl-0 = <&mmc_pins>;
|
||||
pinctrl-1 = <&mmc_pins>;
|
||||
status = "okay";
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
card@0 {
|
||||
compatible = "mmc-card";
|
||||
reg = <0>;
|
||||
|
||||
block {
|
||||
compatible = "block-device";
|
||||
partitions {
|
||||
block-partition-factory {
|
||||
partname = "art";
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
eeprom_factory_0: eeprom@0 {
|
||||
reg = <0x40000 0x1e00>;
|
||||
};
|
||||
|
||||
mac_factory_2c0000: mac@2c0000 {
|
||||
reg = <0x2c0000 0x6>;
|
||||
};
|
||||
|
||||
pon_mac_factory_2c0006: pon_mac@2c0006 {
|
||||
reg = <0x2c0006 0x6>;
|
||||
};
|
||||
|
||||
onu_type_factory_2e0000: onu_type@2e0000 {
|
||||
reg = <0x2e0000 0x10>;
|
||||
};
|
||||
|
||||
board_config_factory_2e0010: board_config@2e0010 {
|
||||
reg = <0x2e0010 0x8>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mdio_0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&mdio0_pins>;
|
||||
|
||||
en8811: ethernet-phy@f {
|
||||
reg = <0xf>;
|
||||
|
||||
reset-gpios = <&an7583_pinctrl 28 GPIO_ACTIVE_LOW>;
|
||||
reset-assert-us = <10000>;
|
||||
reset-deassert-us = <20000>;
|
||||
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
led@0 {
|
||||
reg = <0>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function-enumerator = <0>;
|
||||
default-state = "keep";
|
||||
};
|
||||
|
||||
led@1 {
|
||||
reg = <1>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function-enumerator = <1>;
|
||||
default-state = "keep";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&npu {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ð {
|
||||
status = "okay";
|
||||
nvmem-cells = <&mac_factory_2c0000>;
|
||||
nvmem-cell-names = "mac";
|
||||
};
|
||||
|
||||
&gdm1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gdm3 {
|
||||
status = "okay";
|
||||
|
||||
phy-handle = <&en8811>;
|
||||
phy-mode = "2500base-x";
|
||||
};
|
||||
|
||||
&switch {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gsw_phy1 {
|
||||
pinctrl-names = "gbe-led";
|
||||
pinctrl-0 = <&gswp1_led0_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gsw_phy1_led0 {
|
||||
status = "okay";
|
||||
active-low;
|
||||
};
|
||||
|
||||
&gsw_phy2 {
|
||||
pinctrl-names = "gbe-led";
|
||||
pinctrl-0 = <&gswp2_led0_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gsw_phy2_led0 {
|
||||
status = "okay";
|
||||
active-low;
|
||||
};
|
||||
|
||||
&gsw_phy3 {
|
||||
pinctrl-names = "gbe-led";
|
||||
pinctrl-0 = <&gswp3_led0_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gsw_phy3_led0 {
|
||||
status = "okay";
|
||||
active-low;
|
||||
};
|
||||
|
||||
&gsw_phy4 {
|
||||
pinctrl-names = "gbe-led";
|
||||
pinctrl-0 = <&gswp4_led0_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gsw_phy4_led0 {
|
||||
status = "okay";
|
||||
active-low;
|
||||
};
|
||||
226
target/linux/airoha/dts/an7583-evb.dts
Normal file
226
target/linux/airoha/dts/an7583-evb.dts
Normal file
@@ -0,0 +1,226 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
/dts-v1/;
|
||||
|
||||
#include <dt-bindings/leds/common.h>
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include "an7583.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Airoha AN7583 Evaluation Board";
|
||||
compatible = "airoha,an7583-evb", "airoha,an7583", "airoha,en7583";
|
||||
|
||||
aliases {
|
||||
serial0 = &uart1;
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyS0,115200 earlycon";
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
memory@80000000 {
|
||||
device_type = "memory";
|
||||
reg = <0x0 0x80000000 0x2 0x00000000>;
|
||||
};
|
||||
};
|
||||
|
||||
&an7583_pinctrl {
|
||||
gpio-ranges = <&an7583_pinctrl 0 2 53>;
|
||||
|
||||
mdio0_pins: mdio0-pins {
|
||||
conf {
|
||||
pins = "mdio_0";
|
||||
output-high;
|
||||
};
|
||||
};
|
||||
|
||||
pcie0_rst_pins: pcie0-rst-pins {
|
||||
conf {
|
||||
pins = "pcie_reset0";
|
||||
drive-open-drain = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
pcie1_rst_pins: pcie1-rst-pins {
|
||||
conf {
|
||||
pins = "pcie_reset1";
|
||||
drive-open-drain = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
gswp1_led0_pins: gswp1-led0-pins {
|
||||
mux {
|
||||
function = "phy1_led0";
|
||||
pins = "gpio1";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&snfi {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
||||
&spi_nand {
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
bl2@0 {
|
||||
label = "bl2";
|
||||
reg = <0x0 0x20000>;
|
||||
};
|
||||
|
||||
ubi@20000 {
|
||||
label = "ubi";
|
||||
reg = <0x20000 0x0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&npu {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ð {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gdm1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&switch {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gsw_phy1 {
|
||||
pinctrl-names = "gbe-led";
|
||||
pinctrl-0 = <&gswp1_led0_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gsw_phy1_led0 {
|
||||
status = "okay";
|
||||
active-low;
|
||||
};
|
||||
|
||||
&gsw_port2 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&gsw_port3 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&gsw_port4 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&gsw_phy2 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&gsw_phy3 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&gsw_phy4 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&mdio_0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&mdio0_pins>;
|
||||
|
||||
/* Present but not HW connected to GDM port */
|
||||
/*
|
||||
* as21xx_0: ethernet-phy@1d {
|
||||
* reg = <0x1d>;
|
||||
* compatible = "ethernet-phy-ieee802.3-c45";
|
||||
* status = "disabled";
|
||||
*
|
||||
* firmware-name = "as21x1x_fw.bin";
|
||||
*
|
||||
* reset-deassert-us = <350000>;
|
||||
* reset-assert-us = <200000>;
|
||||
* reset-gpios = <&an7583_pinctrl 34 GPIO_ACTIVE_LOW>;
|
||||
*
|
||||
* leds {
|
||||
* #address-cells = <1>;
|
||||
* #size-cells = <0>;
|
||||
*
|
||||
* led@0 {
|
||||
* reg = <0>;
|
||||
* color = <LED_COLOR_ID_GREEN>;
|
||||
* function = LED_FUNCTION_LAN;
|
||||
* function-enumerator = <0>;
|
||||
* default-state = "keep";
|
||||
* };
|
||||
*
|
||||
* led@1 {
|
||||
* reg = <1>;
|
||||
* color = <LED_COLOR_ID_GREEN>;
|
||||
* function = LED_FUNCTION_LAN;
|
||||
* function-enumerator = <1>;
|
||||
* default-state = "keep";
|
||||
* };
|
||||
* };
|
||||
* };
|
||||
*/
|
||||
|
||||
as21xx_1: ethernet-phy@1f {
|
||||
reg = <0x1f>;
|
||||
compatible = "ethernet-phy-ieee802.3-c45";
|
||||
|
||||
firmware-name = "as21x1x_fw.bin";
|
||||
|
||||
reset-deassert-us = <350000>;
|
||||
reset-assert-us = <200000>;
|
||||
reset-gpios = <&an7583_pinctrl 35 GPIO_ACTIVE_LOW>;
|
||||
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
led@0 {
|
||||
reg = <0>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
function-enumerator = <0>;
|
||||
default-state = "keep";
|
||||
};
|
||||
|
||||
led@1 {
|
||||
reg = <1>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
function-enumerator = <1>;
|
||||
default-state = "keep";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/* GDM2 seems to be connected to PON */
|
||||
/*
|
||||
*&gdm2 {
|
||||
* status = "disabled";
|
||||
*
|
||||
* phy-handle = <&as21xx_0>;
|
||||
* phy-mode = "usxgmii";
|
||||
*};
|
||||
*/
|
||||
|
||||
&gdm3 {
|
||||
status = "okay";
|
||||
|
||||
phy-handle = <&as21xx_1>;
|
||||
phy-mode = "usxgmii";
|
||||
};
|
||||
844
target/linux/airoha/dts/an7583.dtsi
Normal file
844
target/linux/airoha/dts/an7583.dtsi
Normal file
@@ -0,0 +1,844 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
#include <dt-bindings/clock/en7523-clk.h>
|
||||
#include <dt-bindings/phy/phy.h>
|
||||
#include <dt-bindings/reset/airoha,an7583-reset.h>
|
||||
#include <dt-bindings/leds/common.h>
|
||||
#include <dt-bindings/thermal/thermal.h>
|
||||
|
||||
/ {
|
||||
interrupt-parent = <&gic>;
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
|
||||
reserved-memory {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
|
||||
atf@80000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x80000000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
npu_binary: npu-binary@84000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x84000000 0x0 0xa00000>;
|
||||
};
|
||||
|
||||
qdma0_buf: qdma0-buf@87000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x87000000 0x0 0x2000000>;
|
||||
};
|
||||
|
||||
qdma1_buf: qdma1-buf@89000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x89000000 0x0 0x1000000>;
|
||||
};
|
||||
};
|
||||
|
||||
psci {
|
||||
compatible = "arm,psci-1.0";
|
||||
method = "smc";
|
||||
};
|
||||
|
||||
cpus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
cpu-map {
|
||||
cluster0 {
|
||||
core0 {
|
||||
cpu = <&cpu0>;
|
||||
};
|
||||
|
||||
core1 {
|
||||
cpu = <&cpu1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
cpu0: cpu@0 {
|
||||
device_type = "cpu";
|
||||
compatible = "arm,cortex-a53";
|
||||
reg = <0x0>;
|
||||
operating-points-v2 = <&cpu_opp_table>;
|
||||
enable-method = "psci";
|
||||
clocks = <&cpufreq>;
|
||||
clock-names = "cpu";
|
||||
power-domains = <&cpufreq>;
|
||||
power-domain-names = "perf";
|
||||
next-level-cache = <&l2>;
|
||||
#cooling-cells = <2>;
|
||||
};
|
||||
|
||||
cpu1: cpu@1 {
|
||||
device_type = "cpu";
|
||||
compatible = "arm,cortex-a53";
|
||||
reg = <0x1>;
|
||||
operating-points-v2 = <&cpu_opp_table>;
|
||||
enable-method = "psci";
|
||||
clocks = <&cpufreq>;
|
||||
clock-names = "cpu";
|
||||
power-domains = <&cpufreq>;
|
||||
power-domain-names = "perf";
|
||||
next-level-cache = <&l2>;
|
||||
#cooling-cells = <2>;
|
||||
};
|
||||
|
||||
l2: l2-cache {
|
||||
compatible = "cache";
|
||||
cache-size = <0x80000>;
|
||||
cache-line-size = <64>;
|
||||
cache-level = <2>;
|
||||
cache-unified;
|
||||
};
|
||||
};
|
||||
|
||||
cpufreq: cpufreq {
|
||||
compatible = "airoha,en7581-cpufreq";
|
||||
|
||||
operating-points-v2 = <&cpu_smcc_opp_table>;
|
||||
|
||||
#power-domain-cells = <0>;
|
||||
#clock-cells = <0>;
|
||||
};
|
||||
|
||||
cpu_opp_table: opp-table {
|
||||
compatible = "operating-points-v2";
|
||||
opp-shared;
|
||||
|
||||
opp-500000000 {
|
||||
opp-hz = /bits/ 64 <500000000>;
|
||||
required-opps = <&smcc_opp0>;
|
||||
};
|
||||
|
||||
opp-550000000 {
|
||||
opp-hz = /bits/ 64 <550000000>;
|
||||
required-opps = <&smcc_opp1>;
|
||||
};
|
||||
|
||||
opp-600000000 {
|
||||
opp-hz = /bits/ 64 <600000000>;
|
||||
required-opps = <&smcc_opp2>;
|
||||
};
|
||||
|
||||
opp-650000000 {
|
||||
opp-hz = /bits/ 64 <650000000>;
|
||||
required-opps = <&smcc_opp3>;
|
||||
};
|
||||
|
||||
opp-7000000000 {
|
||||
opp-hz = /bits/ 64 <700000000>;
|
||||
required-opps = <&smcc_opp4>;
|
||||
};
|
||||
|
||||
opp-7500000000 {
|
||||
opp-hz = /bits/ 64 <750000000>;
|
||||
required-opps = <&smcc_opp5>;
|
||||
};
|
||||
|
||||
opp-8000000000 {
|
||||
opp-hz = /bits/ 64 <800000000>;
|
||||
required-opps = <&smcc_opp6>;
|
||||
};
|
||||
|
||||
opp-8500000000 {
|
||||
opp-hz = /bits/ 64 <850000000>;
|
||||
required-opps = <&smcc_opp7>;
|
||||
};
|
||||
|
||||
opp-9000000000 {
|
||||
opp-hz = /bits/ 64 <900000000>;
|
||||
required-opps = <&smcc_opp8>;
|
||||
};
|
||||
|
||||
opp-9500000000 {
|
||||
opp-hz = /bits/ 64 <950000000>;
|
||||
required-opps = <&smcc_opp9>;
|
||||
};
|
||||
|
||||
opp-10000000000 {
|
||||
opp-hz = /bits/ 64 <1000000000>;
|
||||
required-opps = <&smcc_opp10>;
|
||||
};
|
||||
|
||||
opp-10500000000 {
|
||||
opp-hz = /bits/ 64 <1050000000>;
|
||||
required-opps = <&smcc_opp11>;
|
||||
};
|
||||
|
||||
opp-11000000000 {
|
||||
opp-hz = /bits/ 64 <1100000000>;
|
||||
required-opps = <&smcc_opp12>;
|
||||
};
|
||||
|
||||
opp-11500000000 {
|
||||
opp-hz = /bits/ 64 <1150000000>;
|
||||
required-opps = <&smcc_opp13>;
|
||||
};
|
||||
|
||||
opp-12000000000 {
|
||||
opp-hz = /bits/ 64 <1200000000>;
|
||||
required-opps = <&smcc_opp14>;
|
||||
};
|
||||
};
|
||||
|
||||
cpu_smcc_opp_table: opp-table-cpu-smcc {
|
||||
compatible = "operating-points-v2";
|
||||
|
||||
smcc_opp0: opp0 {
|
||||
opp-level = <0>;
|
||||
};
|
||||
|
||||
smcc_opp1: opp1 {
|
||||
opp-level = <1>;
|
||||
};
|
||||
|
||||
smcc_opp2: opp2 {
|
||||
opp-level = <2>;
|
||||
};
|
||||
|
||||
smcc_opp3: opp3 {
|
||||
opp-level = <3>;
|
||||
};
|
||||
|
||||
smcc_opp4: opp4 {
|
||||
opp-level = <4>;
|
||||
};
|
||||
|
||||
smcc_opp5: opp5 {
|
||||
opp-level = <5>;
|
||||
};
|
||||
|
||||
smcc_opp6: opp6 {
|
||||
opp-level = <6>;
|
||||
};
|
||||
|
||||
smcc_opp7: opp7 {
|
||||
opp-level = <7>;
|
||||
};
|
||||
|
||||
smcc_opp8: opp8 {
|
||||
opp-level = <8>;
|
||||
};
|
||||
|
||||
smcc_opp9: opp9 {
|
||||
opp-level = <9>;
|
||||
};
|
||||
|
||||
smcc_opp10: opp10 {
|
||||
opp-level = <10>;
|
||||
};
|
||||
|
||||
smcc_opp11: opp11 {
|
||||
opp-level = <11>;
|
||||
};
|
||||
|
||||
smcc_opp12: opp12 {
|
||||
opp-level = <12>;
|
||||
};
|
||||
|
||||
smcc_opp13: opp13 {
|
||||
opp-level = <13>;
|
||||
};
|
||||
|
||||
smcc_opp14: opp14 {
|
||||
opp-level = <14>;
|
||||
};
|
||||
};
|
||||
|
||||
timer {
|
||||
compatible = "arm,armv8-timer";
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
|
||||
<GIC_PPI 14 IRQ_TYPE_LEVEL_LOW>,
|
||||
<GIC_PPI 11 IRQ_TYPE_LEVEL_LOW>,
|
||||
<GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>;
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
cpu_thermal: cpu-thermal {
|
||||
polling-delay-passive = <10000>;
|
||||
polling-delay = <5000>;
|
||||
|
||||
thermal-sensors = <&thermal 0>;
|
||||
|
||||
trips {
|
||||
cpu_hot: cpu-hot {
|
||||
temperature = <95000>;
|
||||
hysteresis = <1000>;
|
||||
type = "hot";
|
||||
};
|
||||
|
||||
cpu-critical {
|
||||
temperature = <110000>;
|
||||
hysteresis = <1000>;
|
||||
type = "critical";
|
||||
};
|
||||
};
|
||||
|
||||
cooling-maps {
|
||||
map0 {
|
||||
trip = <&cpu_hot>;
|
||||
cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
|
||||
<&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
clk25m: oscillator {
|
||||
compatible = "fixed-clock";
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <25000000>;
|
||||
clock-output-names = "clkxtal";
|
||||
};
|
||||
|
||||
sys_hclk: clk-oscillator-100mhz {
|
||||
compatible = "fixed-clock";
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <100000000>;
|
||||
clock-output-names = "sys_hclk";
|
||||
};
|
||||
|
||||
vmmc_3v3: regulator-vmmc-3v3 {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vmmc";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
sfp1: sfp1 {
|
||||
compatible = "sff,sfp";
|
||||
};
|
||||
|
||||
sfp2: sfp2 {
|
||||
compatible = "sff,sfp";
|
||||
};
|
||||
|
||||
soc {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
|
||||
gic: interrupt-controller@9000000 {
|
||||
compatible = "arm,gic-v3";
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <3>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0x0 0x09000000 0x0 0x20000>,
|
||||
<0x0 0x09080000 0x0 0x80000>,
|
||||
<0x0 0x09400000 0x0 0x2000>,
|
||||
<0x0 0x09500000 0x0 0x2000>,
|
||||
<0x0 0x09600000 0x0 0x20000>;
|
||||
interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_LOW>;
|
||||
};
|
||||
|
||||
chip_scu: syscon@1fa20000 {
|
||||
compatible = "airoha,en7581-chip-scu", "syscon", "simple-mfd";
|
||||
reg = <0x0 0x1fa20000 0x0 0x388>;
|
||||
|
||||
thermal: thermal {
|
||||
compatible = "airoha,an7583-thermal";
|
||||
|
||||
#thermal-sensor-cells = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
pbus_csr: syscon@1fbe3400 {
|
||||
compatible = "airoha,en7581-pbus-csr", "syscon";
|
||||
reg = <0x0 0x1fbe3400 0x0 0xff>;
|
||||
};
|
||||
|
||||
scuclk: system-controller@1fa20000 {
|
||||
compatible = "airoha,an7583-scu", "syscon";
|
||||
reg = <0x0 0x1fb00000 0x0 0x970>;
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
#clock-cells = <1>;
|
||||
#reset-cells = <1>;
|
||||
|
||||
airoha,chip-scu = <&chip_scu>;
|
||||
|
||||
mdio_0: mdio-bus@c8 {
|
||||
compatible = "airoha,an7583-mdio";
|
||||
reg = <0xc8>;
|
||||
|
||||
clocks = <&scuclk AN7583_CLK_MDIO0>;
|
||||
resets = <&scuclk AN7583_MDIO0>;
|
||||
};
|
||||
|
||||
mdio_1: mdio-bus@cc {
|
||||
compatible = "airoha,an7583-mdio";
|
||||
reg = <0xcc>;
|
||||
|
||||
clocks = <&scuclk AN7583_CLK_MDIO1>;
|
||||
resets = <&scuclk AN7583_MDIO1>;
|
||||
};
|
||||
};
|
||||
|
||||
system-controller@1fbf0200 {
|
||||
compatible = "syscon", "simple-mfd";
|
||||
reg = <0x0 0x1fbf0200 0x0 0xc0>;
|
||||
|
||||
an7583_pinctrl: pinctrl {
|
||||
compatible = "airoha,an7583-pinctrl";
|
||||
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
i2cclock: i2cclock@0 {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
|
||||
/* 20 MHz */
|
||||
clock-frequency = <20000000>;
|
||||
};
|
||||
|
||||
i2c0: i2c0@1fbf8000 {
|
||||
compatible = "airoha,an7581-i2c";
|
||||
reg = <0x0 0x1fbf8000 0x0 0x100>;
|
||||
|
||||
clocks = <&i2cclock>;
|
||||
|
||||
/* 100 kHz */
|
||||
clock-frequency = <100000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
status = "disable";
|
||||
};
|
||||
|
||||
i2c1: i2c1@1fbf8100 {
|
||||
compatible = "airoha,an7581-i2c";
|
||||
reg = <0x0 0x1fbf8100 0x0 0x100>;
|
||||
|
||||
clocks = <&i2cclock>;
|
||||
|
||||
/* 100 kHz */
|
||||
clock-frequency = <100000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
status = "disable";
|
||||
};
|
||||
|
||||
mmc0: mmc@1fa0e000 {
|
||||
compatible = "mediatek,mt7622-mmc";
|
||||
reg = <0x0 0x1fa0e000 0x0 0x1000>,
|
||||
<0x0 0x1fa0c000 0x0 0x60>;
|
||||
interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&scuclk EN7581_CLK_EMMC>, <&clk25m>;
|
||||
clock-names = "source", "hclk";
|
||||
bus-width = <4>;
|
||||
max-frequency = <52000000>;
|
||||
vmmc-supply = <&vmmc_3v3>;
|
||||
disable-wp;
|
||||
cap-mmc-highspeed;
|
||||
non-removable;
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
snfi: spi@1fa10000 {
|
||||
compatible = "airoha,en7581-snand";
|
||||
reg = <0x0 0x1fa10000 0x0 0x140>,
|
||||
<0x0 0x1fa11000 0x0 0x160>;
|
||||
|
||||
clocks = <&scuclk EN7523_CLK_SPI>;
|
||||
clock-names = "spi";
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
status = "disabled";
|
||||
|
||||
spi_nand: nand@0 {
|
||||
compatible = "spi-nand";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <50000000>;
|
||||
spi-tx-bus-width = <1>;
|
||||
spi-rx-bus-width = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
uart1: serial@1fbf0000 {
|
||||
compatible = "ns16550";
|
||||
reg = <0x0 0x1fbf0000 0x0 0x30>;
|
||||
reg-io-width = <4>;
|
||||
reg-shift = <2>;
|
||||
interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clock-frequency = <1843200>;
|
||||
};
|
||||
|
||||
watchdog@1fbf0100 {
|
||||
compatible = "airoha,en7581-wdt";
|
||||
reg = <0x0 0x1fbf0100 0x0 0x38>;
|
||||
|
||||
clocks = <&sys_hclk>;
|
||||
clock-names = "bus";
|
||||
};
|
||||
|
||||
uart2: serial@1fbf0300 {
|
||||
compatible = "airoha,en7523-uart";
|
||||
reg = <0x0 0x1fbf0300 0x0 0x30>;
|
||||
reg-io-width = <4>;
|
||||
reg-shift = <2>;
|
||||
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clock-frequency = <7372800>;
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
hsuart3: serial@1fbe1000 {
|
||||
compatible = "airoha,en7523-uart";
|
||||
reg = <0x0 0x1fbe1000 0x0 0x40>;
|
||||
reg-io-width = <4>;
|
||||
reg-shift = <2>;
|
||||
interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clock-frequency = <7372800>;
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
uart4: serial@1fbf0600 {
|
||||
compatible = "airoha,en7523-uart";
|
||||
reg = <0x0 0x1fbf0600 0x0 0x30>;
|
||||
reg-io-width = <4>;
|
||||
reg-shift = <2>;
|
||||
interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clock-frequency = <7372800>;
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
uart5: serial@1fbf0700 {
|
||||
compatible = "airoha,en7523-uart";
|
||||
reg = <0x0 0x1fbf0700 0x0 0x30>;
|
||||
reg-io-width = <4>;
|
||||
reg-shift = <2>;
|
||||
interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clock-frequency = <7372800>;
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
crypto@1e004000 {
|
||||
compatible = "inside-secure,safexcel-eip93ies";
|
||||
reg = <0x0 0x1fb70000 0x0 0x1000>;
|
||||
|
||||
interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
|
||||
};
|
||||
|
||||
npu: npu@1e900000 {
|
||||
compatible = "airoha,an7583-npu";
|
||||
reg = <0x0 0x1e900000 0x0 0x313000>;
|
||||
interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
|
||||
memory-region = <&npu_binary>;
|
||||
memory-region-names = "binary";
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pon_pcs: pcs@1fa08000 {
|
||||
compatible = "airoha,an7583-pcs-pon";
|
||||
reg = <0x0 0x1fa08000 0x0 0x1000>,
|
||||
<0x0 0x1fa80000 0x0 0x60>,
|
||||
<0x0 0x1fa80a00 0x0 0x164>,
|
||||
<0x0 0x1fa84000 0x0 0x450>,
|
||||
<0x0 0x1fa85900 0x0 0x338>,
|
||||
<0x0 0x1fa86000 0x0 0x300>,
|
||||
<0x0 0x1fa8f000 0x0 0x1000>,
|
||||
<0x0 0x1fa8e000 0x0 0x1000>;
|
||||
reg-names = "xfi_mac", "hsgmii_an", "hsgmii_pcs",
|
||||
"multi_sgmii", "usxgmii",
|
||||
"hsgmii_rate_adp", "xfi_ana", "xfi_pma";
|
||||
|
||||
resets = <&scuclk AN7583_XPON_MAC_RST>,
|
||||
<&scuclk AN7583_XPON_PHY_RST>,
|
||||
<&scuclk AN7583_XPON_XFI_RST>;
|
||||
reset-names = "mac", "phy", "xfi";
|
||||
|
||||
airoha,scu = <&scuclk>;
|
||||
};
|
||||
|
||||
eth_pcs: pcs@1fa09000 {
|
||||
compatible = "airoha,an7583-pcs-eth";
|
||||
reg = <0x0 0x1fa09000 0x0 0x1000>,
|
||||
<0x0 0x1fa70000 0x0 0x60>,
|
||||
<0x0 0x1fa70a00 0x0 0x164>,
|
||||
<0x0 0x1fa74000 0x0 0x450>,
|
||||
<0x0 0x1fa75900 0x0 0x338>,
|
||||
<0x0 0x1fa76000 0x0 0x300>,
|
||||
<0x0 0x1fa7f000 0x0 0x1000>,
|
||||
<0x0 0x1fa7e000 0x0 0x1000>;
|
||||
reg-names = "xfi_mac", "hsgmii_an", "hsgmii_pcs",
|
||||
"multi_sgmii", "usxgmii",
|
||||
"hsgmii_rate_adp", "xfi_ana", "xfi_pma";
|
||||
|
||||
resets = <&scuclk AN7583_XSI_MAC_RST>,
|
||||
<&scuclk AN7583_XSI_PHY_RST>;
|
||||
reset-names = "mac", "phy";
|
||||
|
||||
airoha,scu = <&scuclk>;
|
||||
};
|
||||
|
||||
eth: ethernet@1fb50000 {
|
||||
compatible = "airoha,an7583-eth";
|
||||
reg = <0 0x1fb50000 0 0x2600>,
|
||||
<0 0x1fb54000 0 0x2000>,
|
||||
<0 0x1fb56000 0 0x2000>;
|
||||
reg-names = "fe", "qdma0", "qdma1";
|
||||
|
||||
resets = <&scuclk AN7583_FE_RST>,
|
||||
<&scuclk AN7583_FE_PDMA_RST>,
|
||||
<&scuclk AN7583_FE_QDMA_RST>,
|
||||
<&scuclk AN7583_DUAL_HSI0_MAC_RST>,
|
||||
<&scuclk AN7583_DUAL_HSI1_MAC_RST>,
|
||||
<&scuclk AN7583_XFP_MAC_RST>;
|
||||
reset-names = "fe", "pdma", "qdma",
|
||||
"hsi0-mac", "hsi1-mac",
|
||||
"xfp-mac";
|
||||
|
||||
interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
memory-region = <&qdma0_buf>, <&qdma1_buf>;
|
||||
memory-region-names = "qdma0-buf", "qdma1-buf";
|
||||
|
||||
airoha,npu = <&npu>;
|
||||
|
||||
status = "disabled";
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
gdm1: ethernet@1 {
|
||||
compatible = "airoha,eth-mac";
|
||||
reg = <1>;
|
||||
phy-mode = "internal";
|
||||
status = "disabled";
|
||||
|
||||
fixed-link {
|
||||
speed = <10000>;
|
||||
full-duplex;
|
||||
pause;
|
||||
};
|
||||
};
|
||||
|
||||
gdm2: ethernet@2 {
|
||||
compatible = "airoha,eth-mac";
|
||||
reg = <2>;
|
||||
pcs = <&pon_pcs>;
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gdm3: ethernet@3 {
|
||||
compatible = "airoha,eth-mac";
|
||||
reg = <3>;
|
||||
pcs = <ð_pcs>;
|
||||
airoha,gdm-srcport = <0x16>;
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
switch: switch@1fb58000 {
|
||||
compatible = "airoha,an7583-switch";
|
||||
reg = <0 0x1fb58000 0 0x8000>;
|
||||
resets = <&scuclk AN7583_GSW_RST>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <1>;
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
status = "disabled";
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
gsw_port1: port@1 {
|
||||
reg = <1>;
|
||||
label = "lan1";
|
||||
phy-mode = "internal";
|
||||
phy-handle = <&gsw_phy1>;
|
||||
};
|
||||
|
||||
gsw_port2: port@2 {
|
||||
reg = <2>;
|
||||
label = "lan2";
|
||||
phy-mode = "internal";
|
||||
phy-handle = <&gsw_phy2>;
|
||||
};
|
||||
|
||||
gsw_port3: port@3 {
|
||||
reg = <3>;
|
||||
label = "lan3";
|
||||
phy-mode = "internal";
|
||||
phy-handle = <&gsw_phy3>;
|
||||
};
|
||||
|
||||
gsw_port4: port@4 {
|
||||
reg = <4>;
|
||||
label = "lan4";
|
||||
phy-mode = "internal";
|
||||
phy-handle = <&gsw_phy4>;
|
||||
};
|
||||
|
||||
port@6 {
|
||||
reg = <6>;
|
||||
label = "cpu";
|
||||
ethernet = <&gdm1>;
|
||||
phy-mode = "internal";
|
||||
|
||||
fixed-link {
|
||||
speed = <10000>;
|
||||
full-duplex;
|
||||
pause;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
mdio: mdio {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
gsw_phy1: ethernet-phy@1 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <9>;
|
||||
phy-mode = "internal";
|
||||
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
gsw_phy1_led0: gsw-phy1-led0@0 {
|
||||
reg = <0>;
|
||||
function = "phy1_led0";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gsw_phy1_led1: gsw-phy1-led1@1 {
|
||||
reg = <1>;
|
||||
function = "phy1_led1";
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
gsw_phy2: ethernet-phy@2 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <10>;
|
||||
phy-mode = "internal";
|
||||
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
gsw_phy2_led0: gsw-phy2-led0@0 {
|
||||
reg = <0>;
|
||||
function = "phy2_led0";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gsw_phy2_led1: gsw-phy2-led1@1 {
|
||||
reg = <1>;
|
||||
function = "phy1_led1";
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
gsw_phy3: ethernet-phy@3 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <11>;
|
||||
phy-mode = "internal";
|
||||
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
gsw_phy3_led0: gsw-phy3-led0@0 {
|
||||
reg = <0>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gsw_phy3_led1: gsw-phy3-led1@1 {
|
||||
reg = <1>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
gsw_phy4: ethernet-phy@4 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <12>;
|
||||
phy-mode = "internal";
|
||||
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
gsw_phy4_led0: gsw-phy4-led0@0 {
|
||||
reg = <0>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gsw_phy4_led1: gsw-phy4-led1@1 {
|
||||
reg = <1>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -1,6 +1,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/image.mk
|
||||
|
||||
loadaddr-$(CONFIG_TARGET_airoha_an7581) := 0x80200000
|
||||
loadaddr-$(CONFIG_TARGET_airoha_an7583) := 0x80200000
|
||||
loadaddr-$(CONFIG_TARGET_airoha_en7523) := 0x80200000
|
||||
|
||||
# default all platform image(fit) build
|
||||
define Device/Default
|
||||
PROFILES = Default $$(DEVICE_NAME)
|
||||
@@ -9,8 +13,10 @@ define Device/Default
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
||||
KERNEL_INITRAMFS = kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
|
||||
KERNEL_LOADADDR = $(loadaddr-y)
|
||||
FILESYSTEMS := squashfs
|
||||
DEVICE_DTS_DIR := $(DTS_DIR)
|
||||
DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1)))
|
||||
DEVICE_DTS_DIR := ../dts
|
||||
IMAGES := sysupgrade.bin
|
||||
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | \
|
||||
pad-rootfs | append-metadata
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
define Build/an7581-emmc-bl2-bl31-uboot
|
||||
head -c $$((0x800)) /dev/zero > $@
|
||||
cat $(STAGING_DIR_IMAGE)/an7581_$1-bl2.fip >> $@
|
||||
dd if=$(STAGING_DIR_IMAGE)/an7581_$1-bl31-u-boot.fip of=$@ bs=1 seek=$$((0x20000)) conv=notrunc
|
||||
endef
|
||||
|
||||
define Build/an7581-preloader
|
||||
cat $(STAGING_DIR_IMAGE)/an7581_$1-bl2.fip >> $@
|
||||
endef
|
||||
|
||||
define Build/an7581-bl31-uboot
|
||||
cat $(STAGING_DIR_IMAGE)/an7581_$1-bl31-u-boot.fip >> $@
|
||||
endef
|
||||
|
||||
define Device/FitImageLzma
|
||||
KERNEL_SUFFIX := -uImage.itb
|
||||
KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb
|
||||
@@ -10,10 +24,11 @@ define Device/airoha_an7581-evb
|
||||
DEVICE_MODEL := AN7581 Evaluation Board (SNAND)
|
||||
DEVICE_PACKAGES := kmod-leds-pwm kmod-i2c-an7581 kmod-pwm-airoha kmod-input-gpio-keys-polled
|
||||
DEVICE_DTS := an7581-evb
|
||||
DEVICE_DTS_DIR := ../dts
|
||||
DEVICE_DTS_CONFIG := config@1
|
||||
KERNEL_LOADADDR := 0x80088000
|
||||
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | append-metadata
|
||||
ARTIFACT/preloader.bin := an7581-preloader rfb
|
||||
ARTIFACT/bl31-uboot.fip := an7581-bl31-uboot rfb
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
endef
|
||||
TARGET_DEVICES += airoha_an7581-evb
|
||||
|
||||
@@ -21,7 +36,9 @@ define Device/airoha_an7581-evb-emmc
|
||||
DEVICE_VENDOR := Airoha
|
||||
DEVICE_MODEL := AN7581 Evaluation Board (EMMC)
|
||||
DEVICE_DTS := an7581-evb-emmc
|
||||
DEVICE_DTS_DIR := ../dts
|
||||
DEVICE_PACKAGES := kmod-i2c-an7581
|
||||
ARTIFACT/preloader.bin := an7581-preloader rfb
|
||||
ARTIFACT/bl31-uboot.fip := an7581-bl31-uboot rfb
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
endef
|
||||
TARGET_DEVICES += airoha_an7581-evb-emmc
|
||||
|
||||
25
target/linux/airoha/image/an7583.mk
Normal file
25
target/linux/airoha/image/an7583.mk
Normal file
@@ -0,0 +1,25 @@
|
||||
define Device/FitImageLzma
|
||||
KERNEL_SUFFIX := -uImage.itb
|
||||
KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb
|
||||
KERNEL_NAME := Image
|
||||
endef
|
||||
|
||||
define Device/airoha_an7583-evb
|
||||
$(call Device/FitImageLzma)
|
||||
DEVICE_VENDOR := Airoha
|
||||
DEVICE_MODEL := AN7583 Evaluation Board (SNAND)
|
||||
DEVICE_PACKAGES := kmod-phy-aeonsemi-as21xxx kmod-leds-pwm kmod-pwm-airoha kmod-input-gpio-keys-polled
|
||||
DEVICE_DTS := an7583-evb
|
||||
DEVICE_DTS_CONFIG := config@1
|
||||
KERNEL_LOADADDR := 0x80088000
|
||||
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | append-metadata
|
||||
endef
|
||||
TARGET_DEVICES += airoha_an7583-evb
|
||||
|
||||
define Device/airoha_an7583-evb-emmc
|
||||
DEVICE_VENDOR := Airoha
|
||||
DEVICE_MODEL := AN7583 Evaluation Board (EMMC)
|
||||
DEVICE_DTS := an7583-evb-emmc
|
||||
DEVICE_PACKAGES := kmod-phy-airoha-en8811h kmod-i2c-an7581
|
||||
endef
|
||||
TARGET_DEVICES += airoha_an7583-evb-emmc
|
||||
@@ -1,5 +1,3 @@
|
||||
KERNEL_LOADADDR := 0x80208000
|
||||
|
||||
define Target/Description
|
||||
Build firmware images for Airoha EN7523 ARM based boards.
|
||||
endef
|
||||
@@ -8,6 +6,5 @@ define Device/airoha_en7523-evb
|
||||
DEVICE_VENDOR := Airoha
|
||||
DEVICE_MODEL := EN7523 Evaluation Board
|
||||
DEVICE_DTS := en7523-evb
|
||||
DEVICE_DTS_DIR := ../dts
|
||||
endef
|
||||
TARGET_DEVICES += airoha_en7523-evb
|
||||
TARGET_DEVICES += airoha_en7523-evb
|
||||
|
||||
@@ -29,7 +29,7 @@ Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
|
||||
--- a/MAINTAINERS
|
||||
+++ b/MAINTAINERS
|
||||
@@ -16871,6 +16871,13 @@ F: drivers/pinctrl/
|
||||
@@ -16872,6 +16872,13 @@ F: drivers/pinctrl/
|
||||
F: include/dt-bindings/pinctrl/
|
||||
F: include/linux/pinctrl/
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From bc6a6a4ec6c28467683121cc165e5681b4acdf8d Mon Sep 17 00:00:00 2001
|
||||
From 42de37f40e1bc818df216dfa0918c114cfb5941d Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Tue, 27 Aug 2024 23:04:53 +0200
|
||||
Subject: [PATCH 3/3] thermal: Add support for Airoha EN7581 thermal sensor
|
||||
Date: Sun, 11 May 2025 20:49:55 +0200
|
||||
Subject: [PATCH] thermal/drivers: Add support for Airoha EN7581 thermal sensor
|
||||
|
||||
Add support for Airoha EN7581 thermal sensor. This provide support for
|
||||
reading the CPU or SoC Package sensor and to setup trip points for hot
|
||||
@@ -12,12 +12,20 @@ The thermal regs provide a way to read the ADC value from an external
|
||||
register placed in the Chip SCU regs. Monitor will read this value and
|
||||
fire an interrupt if the trip condition configured is reached.
|
||||
|
||||
The Thermal Trip and Interrupt logic is conceptually similar to Mediatek
|
||||
LVTS Thermal but differ in register mapping and actual function/bug
|
||||
workaround. The implementation only share some register names but from
|
||||
functionality observation it's very different and used only for the
|
||||
basic function of periodically poll the temp and trip the interrupt.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Link: https://lore.kernel.org/r/20250511185003.3754495-2-ansuelsmth@gmail.com
|
||||
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
|
||||
---
|
||||
drivers/thermal/Kconfig | 9 +
|
||||
drivers/thermal/Makefile | 1 +
|
||||
drivers/thermal/airoha_thermal.c | 482 +++++++++++++++++++++++++++++++
|
||||
3 files changed, 492 insertions(+)
|
||||
drivers/thermal/airoha_thermal.c | 489 +++++++++++++++++++++++++++++++
|
||||
3 files changed, 499 insertions(+)
|
||||
create mode 100644 drivers/thermal/airoha_thermal.c
|
||||
|
||||
--- a/drivers/thermal/Kconfig
|
||||
@@ -50,7 +58,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
obj-$(CONFIG_ROCKCHIP_THERMAL) += rockchip_thermal.o
|
||||
--- /dev/null
|
||||
+++ b/drivers/thermal/airoha_thermal.c
|
||||
@@ -0,0 +1,482 @@
|
||||
@@ -0,0 +1,489 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
@@ -235,15 +243,17 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+#define EN7581_SCU_THERMAL_MUX_DIODE1 0x7
|
||||
+
|
||||
+/* Convert temp to raw value as read from ADC ((((temp / 100) - init) * slope) / 1000) + offset */
|
||||
+#define TEMP_TO_RAW(priv, tz, temp) ((((((temp) / 100) - (priv)->init_temp) * \
|
||||
+ thermal_zone_get_slope(tz)) / 1000) + \
|
||||
+ thermal_zone_get_offset(tz))
|
||||
+#define TEMP_TO_RAW(priv, temp) ((((((temp) / 100) - (priv)->init_temp) * \
|
||||
+ (priv)->default_slope) / 1000) + \
|
||||
+ (priv)->default_offset)
|
||||
+
|
||||
+/* Convert raw to temp ((((temp - offset) * 1000) / slope + init) * 100) */
|
||||
+#define RAW_TO_TEMP(priv, tz, raw) (((((raw) - thermal_zone_get_offset(tz)) * 1000) / \
|
||||
+ thermal_zone_get_slope(tz) + \
|
||||
+#define RAW_TO_TEMP(priv, raw) (((((raw) - (priv)->default_offset) * 1000) / \
|
||||
+ (priv)->default_slope + \
|
||||
+ (priv)->init_temp) * 100)
|
||||
+
|
||||
+#define AIROHA_MAX_SAMPLES 6
|
||||
+
|
||||
+struct airoha_thermal_priv {
|
||||
+ void __iomem *base;
|
||||
+ struct regmap *chip_scu;
|
||||
@@ -251,6 +261,8 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+
|
||||
+ struct thermal_zone_device *tz;
|
||||
+ int init_temp;
|
||||
+ int default_slope;
|
||||
+ int default_offset;
|
||||
+};
|
||||
+
|
||||
+static int airoha_get_thermal_ADC(struct airoha_thermal_priv *priv)
|
||||
@@ -280,28 +292,25 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+static int airoha_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
|
||||
+{
|
||||
+ struct airoha_thermal_priv *priv = thermal_zone_device_priv(tz);
|
||||
+ int min, max, avg_temp, temp_adc;
|
||||
+ int min_value, max_value, avg_value, value;
|
||||
+ int i;
|
||||
+
|
||||
+ /* Get the starting temp */
|
||||
+ temp_adc = airoha_get_thermal_ADC(priv);
|
||||
+ min = temp_adc;
|
||||
+ max = temp_adc;
|
||||
+ avg_temp = temp_adc;
|
||||
+ avg_value = 0;
|
||||
+ min_value = INT_MAX;
|
||||
+ max_value = INT_MIN;
|
||||
+
|
||||
+ /* Make 5 more measurement and average the temp ADC difference */
|
||||
+ for (i = 0; i < 5; i++) {
|
||||
+ temp_adc = airoha_get_thermal_ADC(priv);
|
||||
+ avg_temp += temp_adc;
|
||||
+ if (temp_adc > max)
|
||||
+ max = temp_adc;
|
||||
+ if (temp_adc < min)
|
||||
+ min = temp_adc;
|
||||
+ for (i = 0; i < AIROHA_MAX_SAMPLES; i++) {
|
||||
+ value = airoha_get_thermal_ADC(priv);
|
||||
+ min_value = min(value, min_value);
|
||||
+ max_value = max(value, max_value);
|
||||
+ avg_value += value;
|
||||
+ }
|
||||
+ avg_temp = avg_temp - max - min;
|
||||
+ avg_temp /= 4;
|
||||
+
|
||||
+ *temp = RAW_TO_TEMP(priv, tz, avg_temp);
|
||||
+ /* Drop min and max and average for the remaining sample */
|
||||
+ avg_value -= (min_value + max_value);
|
||||
+ avg_value /= AIROHA_MAX_SAMPLES - 2;
|
||||
+
|
||||
+ *temp = RAW_TO_TEMP(priv, avg_value);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
@@ -309,29 +318,35 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+ int high)
|
||||
+{
|
||||
+ struct airoha_thermal_priv *priv = thermal_zone_device_priv(tz);
|
||||
+ bool enable_monitor = false;
|
||||
+
|
||||
+ if (high != INT_MAX) {
|
||||
+ /* Validate high and clamp them a sane value */
|
||||
+ if (high > RAW_TO_TEMP(priv, tz, FIELD_MAX(EN7581_DOUT_TADC_MASK)))
|
||||
+ high = 110000;
|
||||
+ /* Validate high and clamp it a supported value */
|
||||
+ high = clamp_t(int, high, RAW_TO_TEMP(priv, 0),
|
||||
+ RAW_TO_TEMP(priv, FIELD_MAX(EN7581_DOUT_TADC_MASK)));
|
||||
+
|
||||
+ /* We offset the high temp of 1°C to trigger correct event */
|
||||
+ writel(TEMP_TO_RAW(priv, tz, high) >> 4,
|
||||
+ writel(TEMP_TO_RAW(priv, high) >> 4,
|
||||
+ priv->base + EN7581_TEMPOFFSETH);
|
||||
+
|
||||
+ enable_monitor = true;
|
||||
+ }
|
||||
+
|
||||
+ if (low != -INT_MAX) {
|
||||
+ /* Validate low and clamp them to a sane value */
|
||||
+ if (low < RAW_TO_TEMP(priv, tz, 0))
|
||||
+ low = -33000;
|
||||
+ /* Validate low and clamp it to a supported value */
|
||||
+ low = clamp_t(int, high, RAW_TO_TEMP(priv, 0),
|
||||
+ RAW_TO_TEMP(priv, FIELD_MAX(EN7581_DOUT_TADC_MASK)));
|
||||
+
|
||||
+ /* We offset the low temp of 1°C to trigger correct event */
|
||||
+ writel(TEMP_TO_RAW(priv, tz, low) >> 4,
|
||||
+ writel(TEMP_TO_RAW(priv, low) >> 4,
|
||||
+ priv->base + EN7581_TEMPOFFSETL);
|
||||
+
|
||||
+ enable_monitor = true;
|
||||
+ }
|
||||
+
|
||||
+ /* Enable sensor 0 monitor */
|
||||
+ writel(EN7581_SENSE0_EN, priv->base + EN7581_TEMPMONCTL0);
|
||||
+ /* Enable sensor 0 monitor after trip are set */
|
||||
+ if (enable_monitor)
|
||||
+ writel(EN7581_SENSE0_EN, priv->base + EN7581_TEMPMONCTL0);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
@@ -345,32 +360,35 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+{
|
||||
+ struct airoha_thermal_priv *priv = data;
|
||||
+ enum thermal_notify_event event;
|
||||
+ bool update = false;
|
||||
+ u32 status;
|
||||
+
|
||||
+ status = readl(priv->base + EN7581_TEMPMONINTSTS);
|
||||
+ switch (status & (EN7581_HOFSINTSTS0 | EN7581_LOFSINTSTS0)) {
|
||||
+ case EN7581_HOFSINTSTS0:
|
||||
+ event = THERMAL_TRIP_VIOLATED;
|
||||
+ update = true;
|
||||
+ break;
|
||||
+ case EN7581_LOFSINTSTS0:
|
||||
+ event = THERMAL_EVENT_UNSPECIFIED;
|
||||
+ update = true;
|
||||
+ break;
|
||||
+ default:
|
||||
+ goto exit;
|
||||
+ /* Should be impossible as we enable only these Interrupt */
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ thermal_zone_device_update(priv->tz, event);
|
||||
+
|
||||
+exit:
|
||||
+ /* reset interrupt */
|
||||
+ /* Reset Interrupt */
|
||||
+ writel(status, priv->base + EN7581_TEMPMONINTSTS);
|
||||
+
|
||||
+ if (update)
|
||||
+ thermal_zone_device_update(priv->tz, event);
|
||||
+
|
||||
+ return IRQ_HANDLED;
|
||||
+}
|
||||
+
|
||||
+static void airoha_thermal_setup_adc_val(struct device *dev,
|
||||
+ struct airoha_thermal_priv *priv,
|
||||
+ struct thermal_zone_params *tzp)
|
||||
+ struct airoha_thermal_priv *priv)
|
||||
+{
|
||||
+ u32 efuse_calib_info, cpu_sensor;
|
||||
+
|
||||
@@ -381,19 +399,19 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+
|
||||
+ efuse_calib_info = readl(priv->base + EN7581_EFUSE_TEMP_OFFSET_REG);
|
||||
+ if (efuse_calib_info) {
|
||||
+ tzp->offset = FIELD_GET(EN7581_EFUSE_TEMP_OFFSET, efuse_calib_info);
|
||||
+ priv->default_offset = FIELD_GET(EN7581_EFUSE_TEMP_OFFSET, efuse_calib_info);
|
||||
+ /* Different slope are applied if the sensor is used for CPU or for package */
|
||||
+ cpu_sensor = readl(priv->base + EN7581_EFUSE_TEMP_CPU_SENSOR_REG);
|
||||
+ if (cpu_sensor) {
|
||||
+ tzp->slope = EN7581_SLOPE_X100_DIO_DEFAULT;
|
||||
+ priv->default_slope = EN7581_SLOPE_X100_DIO_DEFAULT;
|
||||
+ priv->init_temp = EN7581_INIT_TEMP_FTK_X10;
|
||||
+ } else {
|
||||
+ tzp->slope = EN7581_SLOPE_X100_DIO_AVS;
|
||||
+ priv->default_slope = EN7581_SLOPE_X100_DIO_AVS;
|
||||
+ priv->init_temp = EN7581_INIT_TEMP_CPK_X10;
|
||||
+ }
|
||||
+ } else {
|
||||
+ tzp->offset = airoha_get_thermal_ADC(priv);
|
||||
+ tzp->slope = EN7581_SLOPE_X100_DIO_DEFAULT;
|
||||
+ priv->default_offset = airoha_get_thermal_ADC(priv);
|
||||
+ priv->default_slope = EN7581_SLOPE_X100_DIO_DEFAULT;
|
||||
+ priv->init_temp = EN7581_INIT_TEMP_NONK_X10;
|
||||
+ dev_info(dev, "missing thermal calibrarion EFUSE, using non calibrated value\n");
|
||||
+ }
|
||||
@@ -456,7 +474,6 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+
|
||||
+static int airoha_thermal_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct thermal_zone_params tzp = { };
|
||||
+ struct airoha_thermal_priv *priv;
|
||||
+ struct device_node *chip_scu_np;
|
||||
+ struct device *dev = &pdev->dev;
|
||||
@@ -487,19 +504,17 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+
|
||||
+ ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
|
||||
+ airoha_thermal_irq, IRQF_ONESHOT,
|
||||
+ pdev->name, (void *)priv);
|
||||
+ pdev->name, priv);
|
||||
+ if (ret) {
|
||||
+ dev_err(dev, "Can't get interrupt working.\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ airoha_thermal_setup_monitor(priv);
|
||||
+ airoha_thermal_setup_adc_val(dev, priv, &tzp);
|
||||
+ airoha_thermal_setup_adc_val(dev, priv);
|
||||
+
|
||||
+ /* register of thermal sensor and get info from DT */
|
||||
+ priv->tz = devm_thermal_of_zone_register_with_params(dev, 0, priv,
|
||||
+ &thdev_ops,
|
||||
+ &tzp);
|
||||
+ priv->tz = devm_thermal_of_zone_register(dev, 0, priv, &thdev_ops);
|
||||
+ if (IS_ERR(priv->tz)) {
|
||||
+ dev_err(dev, "register thermal zone sensor failed\n");
|
||||
+ return PTR_ERR(priv->tz);
|
||||
@@ -0,0 +1,44 @@
|
||||
From e23cba0ab49a9cf95e9bc3a86cfbf336b0e285f6 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Wed, 14 May 2025 23:39:12 +0200
|
||||
Subject: [PATCH] thermal/drivers/airoha: Fix spelling mistake
|
||||
|
||||
Fix various spelling mistake in airoha_thermal_setup_monitor() and
|
||||
define.
|
||||
|
||||
Reported-by: Alok Tiwari <alok.a.tiwari@oracle.com>
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Link: https://lore.kernel.org/r/20250514213919.2321490-1-ansuelsmth@gmail.com
|
||||
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
|
||||
---
|
||||
drivers/thermal/airoha_thermal.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/thermal/airoha_thermal.c
|
||||
+++ b/drivers/thermal/airoha_thermal.c
|
||||
@@ -155,7 +155,7 @@
|
||||
* Can operate in:
|
||||
* - 1 sample
|
||||
* - 2 sample and make average of them
|
||||
- * - 4,6,10,16 sample, drop max and min and make avgerage of them
|
||||
+ * - 4,6,10,16 sample, drop max and min and make average of them
|
||||
*/
|
||||
#define EN7581_MSRCTL_1SAMPLE 0x0
|
||||
#define EN7581_MSRCTL_AVG2SAMPLE 0x1
|
||||
@@ -365,12 +365,12 @@ static void airoha_thermal_setup_monitor
|
||||
/*
|
||||
* Configure ADC valid reading addr
|
||||
* The AHB temp monitor system doesn't have direct access to the
|
||||
- * thermal sensor. It does instead work by providing all kind of
|
||||
- * address to configure how to access and setup an ADC for the
|
||||
+ * thermal sensor. It does instead work by providing various
|
||||
+ * addresses to configure how to access and setup an ADC for the
|
||||
* sensor. EN7581 supports only one sensor hence the
|
||||
* implementation is greatly simplified but the AHB supports
|
||||
- * up to 4 different sensor from the same ADC that can be
|
||||
- * switched by tuning the ADC mux or wiriting address.
|
||||
+ * up to 4 different sensors from the same ADC that can be
|
||||
+ * switched by tuning the ADC mux or writing address.
|
||||
*
|
||||
* We set valid instead of volt as we don't enable valid/volt
|
||||
* split reading and AHB read valid addr in such case.
|
||||
@@ -0,0 +1,435 @@
|
||||
From 457d9772e8a5cdae64f66b5f7d5b0247365191ec Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Tue, 1 Apr 2025 15:50:21 +0200
|
||||
Subject: [PATCH] pinctrl: airoha: fix wrong PHY LED mapping and PHY2 LED
|
||||
defines
|
||||
|
||||
The current PHY2 LED define are wrong and actually set BITs outside the
|
||||
related mask. Fix it and set the correct value. While at it, also use
|
||||
FIELD_PREP_CONST macro to make it simple to understand what values are
|
||||
actually applied for the mask.
|
||||
|
||||
Also fix wrong PHY LED mapping. The SoC Switch supports up to 4 port but
|
||||
the register define mapping for 5 PHY port, starting from 0. The mapping
|
||||
was wrongly defined starting from PHY1. Reorder the function group to
|
||||
start from PHY0. PHY4 is actually never supported as we don't have a
|
||||
GPIO pin to assign.
|
||||
|
||||
Cc: stable@vger.kernel.org
|
||||
Fixes: 1c8ace2d0725 ("pinctrl: airoha: Add support for EN7581 SoC")
|
||||
Reviewed-by: Benjamin Larsson <benjamin.larsson@genexis.eu>
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Link: https://lore.kernel.org/20250401135026.18018-1-ansuelsmth@gmail.com
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
---
|
||||
drivers/pinctrl/mediatek/pinctrl-airoha.c | 159 ++++++++++------------
|
||||
1 file changed, 70 insertions(+), 89 deletions(-)
|
||||
|
||||
--- a/drivers/pinctrl/mediatek/pinctrl-airoha.c
|
||||
+++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include <dt-bindings/pinctrl/mt65xx.h>
|
||||
+#include <linux/bitfield.h>
|
||||
#include <linux/bits.h>
|
||||
#include <linux/cleanup.h>
|
||||
#include <linux/gpio/driver.h>
|
||||
@@ -106,39 +107,19 @@
|
||||
#define REG_LAN_LED1_MAPPING 0x0280
|
||||
|
||||
#define LAN4_LED_MAPPING_MASK GENMASK(18, 16)
|
||||
-#define LAN4_PHY4_LED_MAP BIT(18)
|
||||
-#define LAN4_PHY2_LED_MAP BIT(17)
|
||||
-#define LAN4_PHY1_LED_MAP BIT(16)
|
||||
-#define LAN4_PHY0_LED_MAP 0
|
||||
-#define LAN4_PHY3_LED_MAP GENMASK(17, 16)
|
||||
+#define LAN4_PHY_LED_MAP(_n) FIELD_PREP_CONST(LAN4_LED_MAPPING_MASK, (_n))
|
||||
|
||||
#define LAN3_LED_MAPPING_MASK GENMASK(14, 12)
|
||||
-#define LAN3_PHY4_LED_MAP BIT(14)
|
||||
-#define LAN3_PHY2_LED_MAP BIT(13)
|
||||
-#define LAN3_PHY1_LED_MAP BIT(12)
|
||||
-#define LAN3_PHY0_LED_MAP 0
|
||||
-#define LAN3_PHY3_LED_MAP GENMASK(13, 12)
|
||||
+#define LAN3_PHY_LED_MAP(_n) FIELD_PREP_CONST(LAN3_LED_MAPPING_MASK, (_n))
|
||||
|
||||
#define LAN2_LED_MAPPING_MASK GENMASK(10, 8)
|
||||
-#define LAN2_PHY4_LED_MAP BIT(12)
|
||||
-#define LAN2_PHY2_LED_MAP BIT(11)
|
||||
-#define LAN2_PHY1_LED_MAP BIT(10)
|
||||
-#define LAN2_PHY0_LED_MAP 0
|
||||
-#define LAN2_PHY3_LED_MAP GENMASK(11, 10)
|
||||
+#define LAN2_PHY_LED_MAP(_n) FIELD_PREP_CONST(LAN2_LED_MAPPING_MASK, (_n))
|
||||
|
||||
#define LAN1_LED_MAPPING_MASK GENMASK(6, 4)
|
||||
-#define LAN1_PHY4_LED_MAP BIT(6)
|
||||
-#define LAN1_PHY2_LED_MAP BIT(5)
|
||||
-#define LAN1_PHY1_LED_MAP BIT(4)
|
||||
-#define LAN1_PHY0_LED_MAP 0
|
||||
-#define LAN1_PHY3_LED_MAP GENMASK(5, 4)
|
||||
+#define LAN1_PHY_LED_MAP(_n) FIELD_PREP_CONST(LAN1_LED_MAPPING_MASK, (_n))
|
||||
|
||||
#define LAN0_LED_MAPPING_MASK GENMASK(2, 0)
|
||||
-#define LAN0_PHY4_LED_MAP BIT(3)
|
||||
-#define LAN0_PHY2_LED_MAP BIT(2)
|
||||
-#define LAN0_PHY1_LED_MAP BIT(1)
|
||||
-#define LAN0_PHY0_LED_MAP 0
|
||||
-#define LAN0_PHY3_LED_MAP GENMASK(2, 1)
|
||||
+#define LAN0_PHY_LED_MAP(_n) FIELD_PREP_CONST(LAN0_LED_MAPPING_MASK, (_n))
|
||||
|
||||
/* CONF */
|
||||
#define REG_I2C_SDA_E2 0x001c
|
||||
@@ -1470,8 +1451,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED0_MAPPING,
|
||||
- LAN1_LED_MAPPING_MASK,
|
||||
- LAN1_PHY1_LED_MAP
|
||||
+ LAN0_LED_MAPPING_MASK,
|
||||
+ LAN0_PHY_LED_MAP(0)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1485,8 +1466,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED0_MAPPING,
|
||||
- LAN2_LED_MAPPING_MASK,
|
||||
- LAN2_PHY1_LED_MAP
|
||||
+ LAN1_LED_MAPPING_MASK,
|
||||
+ LAN1_PHY_LED_MAP(0)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1500,8 +1481,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED0_MAPPING,
|
||||
- LAN3_LED_MAPPING_MASK,
|
||||
- LAN3_PHY1_LED_MAP
|
||||
+ LAN2_LED_MAPPING_MASK,
|
||||
+ LAN2_PHY_LED_MAP(0)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1515,8 +1496,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED0_MAPPING,
|
||||
- LAN4_LED_MAPPING_MASK,
|
||||
- LAN4_PHY1_LED_MAP
|
||||
+ LAN3_LED_MAPPING_MASK,
|
||||
+ LAN3_PHY_LED_MAP(0)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
},
|
||||
@@ -1534,8 +1515,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED0_MAPPING,
|
||||
- LAN1_LED_MAPPING_MASK,
|
||||
- LAN1_PHY2_LED_MAP
|
||||
+ LAN0_LED_MAPPING_MASK,
|
||||
+ LAN0_PHY_LED_MAP(1)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1549,8 +1530,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED0_MAPPING,
|
||||
- LAN2_LED_MAPPING_MASK,
|
||||
- LAN2_PHY2_LED_MAP
|
||||
+ LAN1_LED_MAPPING_MASK,
|
||||
+ LAN1_PHY_LED_MAP(1)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1564,8 +1545,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED0_MAPPING,
|
||||
- LAN3_LED_MAPPING_MASK,
|
||||
- LAN3_PHY2_LED_MAP
|
||||
+ LAN2_LED_MAPPING_MASK,
|
||||
+ LAN2_PHY_LED_MAP(1)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1579,8 +1560,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED0_MAPPING,
|
||||
- LAN4_LED_MAPPING_MASK,
|
||||
- LAN4_PHY2_LED_MAP
|
||||
+ LAN3_LED_MAPPING_MASK,
|
||||
+ LAN3_PHY_LED_MAP(1)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
},
|
||||
@@ -1598,8 +1579,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED0_MAPPING,
|
||||
- LAN1_LED_MAPPING_MASK,
|
||||
- LAN1_PHY3_LED_MAP
|
||||
+ LAN0_LED_MAPPING_MASK,
|
||||
+ LAN0_PHY_LED_MAP(2)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1613,8 +1594,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED0_MAPPING,
|
||||
- LAN2_LED_MAPPING_MASK,
|
||||
- LAN2_PHY3_LED_MAP
|
||||
+ LAN1_LED_MAPPING_MASK,
|
||||
+ LAN1_PHY_LED_MAP(2)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1628,8 +1609,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED0_MAPPING,
|
||||
- LAN3_LED_MAPPING_MASK,
|
||||
- LAN3_PHY3_LED_MAP
|
||||
+ LAN2_LED_MAPPING_MASK,
|
||||
+ LAN2_PHY_LED_MAP(2)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1643,8 +1624,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED0_MAPPING,
|
||||
- LAN4_LED_MAPPING_MASK,
|
||||
- LAN4_PHY3_LED_MAP
|
||||
+ LAN3_LED_MAPPING_MASK,
|
||||
+ LAN3_PHY_LED_MAP(2)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
},
|
||||
@@ -1662,8 +1643,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED0_MAPPING,
|
||||
- LAN1_LED_MAPPING_MASK,
|
||||
- LAN1_PHY4_LED_MAP
|
||||
+ LAN0_LED_MAPPING_MASK,
|
||||
+ LAN0_PHY_LED_MAP(3)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1677,8 +1658,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED0_MAPPING,
|
||||
- LAN2_LED_MAPPING_MASK,
|
||||
- LAN2_PHY4_LED_MAP
|
||||
+ LAN1_LED_MAPPING_MASK,
|
||||
+ LAN1_PHY_LED_MAP(3)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1692,8 +1673,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED0_MAPPING,
|
||||
- LAN3_LED_MAPPING_MASK,
|
||||
- LAN3_PHY4_LED_MAP
|
||||
+ LAN2_LED_MAPPING_MASK,
|
||||
+ LAN2_PHY_LED_MAP(3)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1707,8 +1688,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED0_MAPPING,
|
||||
- LAN4_LED_MAPPING_MASK,
|
||||
- LAN4_PHY4_LED_MAP
|
||||
+ LAN3_LED_MAPPING_MASK,
|
||||
+ LAN3_PHY_LED_MAP(3)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
},
|
||||
@@ -1726,8 +1707,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED1_MAPPING,
|
||||
- LAN1_LED_MAPPING_MASK,
|
||||
- LAN1_PHY1_LED_MAP
|
||||
+ LAN0_LED_MAPPING_MASK,
|
||||
+ LAN0_PHY_LED_MAP(0)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1741,8 +1722,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED1_MAPPING,
|
||||
- LAN2_LED_MAPPING_MASK,
|
||||
- LAN2_PHY1_LED_MAP
|
||||
+ LAN1_LED_MAPPING_MASK,
|
||||
+ LAN1_PHY_LED_MAP(0)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1756,8 +1737,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED1_MAPPING,
|
||||
- LAN3_LED_MAPPING_MASK,
|
||||
- LAN3_PHY1_LED_MAP
|
||||
+ LAN2_LED_MAPPING_MASK,
|
||||
+ LAN2_PHY_LED_MAP(0)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1771,8 +1752,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED1_MAPPING,
|
||||
- LAN4_LED_MAPPING_MASK,
|
||||
- LAN4_PHY1_LED_MAP
|
||||
+ LAN3_LED_MAPPING_MASK,
|
||||
+ LAN3_PHY_LED_MAP(0)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
},
|
||||
@@ -1790,8 +1771,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED1_MAPPING,
|
||||
- LAN1_LED_MAPPING_MASK,
|
||||
- LAN1_PHY2_LED_MAP
|
||||
+ LAN0_LED_MAPPING_MASK,
|
||||
+ LAN0_PHY_LED_MAP(1)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1805,8 +1786,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED1_MAPPING,
|
||||
- LAN2_LED_MAPPING_MASK,
|
||||
- LAN2_PHY2_LED_MAP
|
||||
+ LAN1_LED_MAPPING_MASK,
|
||||
+ LAN1_PHY_LED_MAP(1)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1820,8 +1801,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED1_MAPPING,
|
||||
- LAN3_LED_MAPPING_MASK,
|
||||
- LAN3_PHY2_LED_MAP
|
||||
+ LAN2_LED_MAPPING_MASK,
|
||||
+ LAN2_PHY_LED_MAP(1)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1835,8 +1816,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED1_MAPPING,
|
||||
- LAN4_LED_MAPPING_MASK,
|
||||
- LAN4_PHY2_LED_MAP
|
||||
+ LAN3_LED_MAPPING_MASK,
|
||||
+ LAN3_PHY_LED_MAP(1)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
},
|
||||
@@ -1854,8 +1835,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED1_MAPPING,
|
||||
- LAN1_LED_MAPPING_MASK,
|
||||
- LAN1_PHY3_LED_MAP
|
||||
+ LAN0_LED_MAPPING_MASK,
|
||||
+ LAN0_PHY_LED_MAP(2)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1869,8 +1850,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED1_MAPPING,
|
||||
- LAN2_LED_MAPPING_MASK,
|
||||
- LAN2_PHY3_LED_MAP
|
||||
+ LAN1_LED_MAPPING_MASK,
|
||||
+ LAN1_PHY_LED_MAP(2)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1884,8 +1865,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED1_MAPPING,
|
||||
- LAN3_LED_MAPPING_MASK,
|
||||
- LAN3_PHY3_LED_MAP
|
||||
+ LAN2_LED_MAPPING_MASK,
|
||||
+ LAN2_PHY_LED_MAP(2)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1899,8 +1880,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED1_MAPPING,
|
||||
- LAN4_LED_MAPPING_MASK,
|
||||
- LAN4_PHY3_LED_MAP
|
||||
+ LAN3_LED_MAPPING_MASK,
|
||||
+ LAN3_PHY_LED_MAP(2)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
},
|
||||
@@ -1918,8 +1899,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED1_MAPPING,
|
||||
- LAN1_LED_MAPPING_MASK,
|
||||
- LAN1_PHY4_LED_MAP
|
||||
+ LAN0_LED_MAPPING_MASK,
|
||||
+ LAN0_PHY_LED_MAP(3)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1933,8 +1914,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED1_MAPPING,
|
||||
- LAN2_LED_MAPPING_MASK,
|
||||
- LAN2_PHY4_LED_MAP
|
||||
+ LAN1_LED_MAPPING_MASK,
|
||||
+ LAN1_PHY_LED_MAP(3)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1948,8 +1929,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED1_MAPPING,
|
||||
- LAN3_LED_MAPPING_MASK,
|
||||
- LAN3_PHY4_LED_MAP
|
||||
+ LAN2_LED_MAPPING_MASK,
|
||||
+ LAN2_PHY_LED_MAP(3)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
}, {
|
||||
@@ -1963,8 +1944,8 @@ static const struct airoha_pinctrl_func_
|
||||
.regmap[1] = {
|
||||
AIROHA_FUNC_MUX,
|
||||
REG_LAN_LED1_MAPPING,
|
||||
- LAN4_LED_MAPPING_MASK,
|
||||
- LAN4_PHY4_LED_MAP
|
||||
+ LAN3_LED_MAPPING_MASK,
|
||||
+ LAN3_PHY_LED_MAP(3)
|
||||
},
|
||||
.regmap_size = 2,
|
||||
},
|
||||
@@ -0,0 +1,130 @@
|
||||
From 6a325aed130bb68790e765f923e76ec5669d2da7 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Thu, 10 Apr 2025 12:04:04 +0200
|
||||
Subject: [PATCH 2/2] net: phy: mediatek: add Airoha PHY ID to SoC driver
|
||||
|
||||
Airoha AN7581 SoC ship with a Switch based on the MT753x Switch embedded
|
||||
in other SoC like the MT7581 and the MT7988. Similar to these they
|
||||
require configuring some pin to enable LED PHYs.
|
||||
|
||||
Add support for the PHY ID for the Airoha embedded Switch and define a
|
||||
simple probe function to toggle these pins. Also fill the LED functions
|
||||
and add dedicated function to define LED polarity.
|
||||
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Link: https://patch.msgid.link/20250410100410.348-2-ansuelsmth@gmail.com
|
||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||||
---
|
||||
drivers/net/phy/Kconfig | 4 +-
|
||||
drivers/net/phy/mediatek-ge-soc.c | 62 +++++++++++++++++++++++++++
|
||||
2 files changed, 65 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/phy/Kconfig
|
||||
+++ b/drivers/net/phy/Kconfig
|
||||
@@ -320,8 +320,9 @@ config MEDIATEK_GE_PHY
|
||||
|
||||
config MEDIATEK_GE_SOC_PHY
|
||||
tristate "MediaTek SoC Ethernet PHYs"
|
||||
- depends on (ARM64 && ARCH_MEDIATEK) || COMPILE_TEST
|
||||
- depends on NVMEM_MTK_EFUSE
|
||||
+ depends on ARM64 || COMPILE_TEST
|
||||
+ depends on ARCH_AIROHA || (ARCH_MEDIATEK && NVMEM_MTK_EFUSE) || \
|
||||
+ COMPILE_TEST
|
||||
help
|
||||
Supports MediaTek SoC built-in Gigabit Ethernet PHYs.
|
||||
|
||||
--- a/drivers/net/phy/mediatek-ge-soc.c
|
||||
+++ b/drivers/net/phy/mediatek-ge-soc.c
|
||||
@@ -8,8 +8,11 @@
|
||||
#include <linux/phy.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
+#define MTK_PHY_MAX_LEDS 2
|
||||
+
|
||||
#define MTK_GPHY_ID_MT7981 0x03a29461
|
||||
#define MTK_GPHY_ID_MT7988 0x03a29481
|
||||
+#define MTK_GPHY_ID_AN7581 0x03a294c1
|
||||
|
||||
#define MTK_EXT_PAGE_ACCESS 0x1f
|
||||
#define MTK_PHY_PAGE_STANDARD 0x0000
|
||||
@@ -1502,6 +1505,53 @@ static int mt7981_phy_probe(struct phy_d
|
||||
return mt798x_phy_calibration(phydev);
|
||||
}
|
||||
|
||||
+static int an7581_phy_probe(struct phy_device *phydev)
|
||||
+{
|
||||
+ struct mtk_socphy_priv *priv;
|
||||
+ struct pinctrl *pinctrl;
|
||||
+
|
||||
+ /* Toggle pinctrl to enable PHY LED */
|
||||
+ pinctrl = devm_pinctrl_get_select(&phydev->mdio.dev, "gbe-led");
|
||||
+ if (IS_ERR(pinctrl))
|
||||
+ dev_err(&phydev->mdio.bus->dev,
|
||||
+ "Failed to setup PHY LED pinctrl\n");
|
||||
+
|
||||
+ priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL);
|
||||
+ if (!priv)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ phydev->priv = priv;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int an7581_phy_led_polarity_set(struct phy_device *phydev, int index,
|
||||
+ unsigned long modes)
|
||||
+{
|
||||
+ u32 mode;
|
||||
+ u16 val;
|
||||
+
|
||||
+ if (index >= MTK_PHY_MAX_LEDS)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ for_each_set_bit(mode, &modes, __PHY_LED_MODES_NUM) {
|
||||
+ switch (mode) {
|
||||
+ case PHY_LED_ACTIVE_LOW:
|
||||
+ val = MTK_PHY_LED_ON_POLARITY;
|
||||
+ break;
|
||||
+ case PHY_LED_ACTIVE_HIGH:
|
||||
+ val = 0;
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return phy_modify_mmd(phydev, MDIO_MMD_VEND2, index ?
|
||||
+ MTK_PHY_LED1_ON_CTRL : MTK_PHY_LED0_ON_CTRL,
|
||||
+ MTK_PHY_LED_ON_POLARITY, val);
|
||||
+}
|
||||
+
|
||||
static struct phy_driver mtk_socphy_driver[] = {
|
||||
{
|
||||
PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7981),
|
||||
@@ -1537,6 +1587,17 @@ static struct phy_driver mtk_socphy_driv
|
||||
.led_hw_control_set = mt798x_phy_led_hw_control_set,
|
||||
.led_hw_control_get = mt798x_phy_led_hw_control_get,
|
||||
},
|
||||
+ {
|
||||
+ PHY_ID_MATCH_EXACT(MTK_GPHY_ID_AN7581),
|
||||
+ .name = "Airoha AN7581 PHY",
|
||||
+ .probe = an7581_phy_probe,
|
||||
+ .led_blink_set = mt798x_phy_led_blink_set,
|
||||
+ .led_brightness_set = mt798x_phy_led_brightness_set,
|
||||
+ .led_hw_is_supported = mt798x_phy_led_hw_is_supported,
|
||||
+ .led_hw_control_set = mt798x_phy_led_hw_control_set,
|
||||
+ .led_hw_control_get = mt798x_phy_led_hw_control_get,
|
||||
+ .led_polarity_set = an7581_phy_led_polarity_set,
|
||||
+ },
|
||||
};
|
||||
|
||||
module_phy_driver(mtk_socphy_driver);
|
||||
@@ -1544,6 +1605,7 @@ module_phy_driver(mtk_socphy_driver);
|
||||
static struct mdio_device_id __maybe_unused mtk_socphy_tbl[] = {
|
||||
{ PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7981) },
|
||||
{ PHY_ID_MATCH_EXACT(MTK_GPHY_ID_MT7988) },
|
||||
+ { PHY_ID_MATCH_EXACT(MTK_GPHY_ID_AN7581) },
|
||||
{ }
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user