Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
4686ebeb17
@ -168,7 +168,7 @@ define DownloadMethod/cvs
|
|||||||
cd $(TMP_DIR)/dl && \
|
cd $(TMP_DIR)/dl && \
|
||||||
rm -rf $(SUBDIR) && \
|
rm -rf $(SUBDIR) && \
|
||||||
[ \! -d $(SUBDIR) ] && \
|
[ \! -d $(SUBDIR) ] && \
|
||||||
cvs -d $(URL) export $(VERSION) $(SUBDIR) && \
|
cvs -d $(URL) export $(SOURCE_VERSION) $(SUBDIR) && \
|
||||||
echo "Packing checkout..." && \
|
echo "Packing checkout..." && \
|
||||||
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
|
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
|
||||||
mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \
|
mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \
|
||||||
@ -184,10 +184,10 @@ define DownloadMethod/svn
|
|||||||
rm -rf $(SUBDIR) && \
|
rm -rf $(SUBDIR) && \
|
||||||
[ \! -d $(SUBDIR) ] && \
|
[ \! -d $(SUBDIR) ] && \
|
||||||
( svn help export | grep -q trust-server-cert && \
|
( svn help export | grep -q trust-server-cert && \
|
||||||
svn export --non-interactive --trust-server-cert -r$(VERSION) $(URL) $(SUBDIR) || \
|
svn export --non-interactive --trust-server-cert -r$(SOURCE_VERSION) $(URL) $(SUBDIR) || \
|
||||||
svn export --non-interactive -r$(VERSION) $(URL) $(SUBDIR) ) && \
|
svn export --non-interactive -r$(SOURCE_VERSION) $(URL) $(SUBDIR) ) && \
|
||||||
echo "Packing checkout..." && \
|
echo "Packing checkout..." && \
|
||||||
export TAR_TIMESTAMP="`svn info -r$(VERSION) --show-item last-changed-date $(URL)`" && \
|
export TAR_TIMESTAMP="`svn info -r$(SOURCE_VERSION) --show-item last-changed-date $(URL)`" && \
|
||||||
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
|
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
|
||||||
mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \
|
mv $(TMP_DIR)/dl/$(FILE) $(DL_DIR)/ && \
|
||||||
rm -rf $(SUBDIR); \
|
rm -rf $(SUBDIR); \
|
||||||
@ -205,7 +205,7 @@ define DownloadMethod/github_archive
|
|||||||
$(SCRIPT_DIR)/dl_github_archive.py \
|
$(SCRIPT_DIR)/dl_github_archive.py \
|
||||||
--dl-dir="$(DL_DIR)" \
|
--dl-dir="$(DL_DIR)" \
|
||||||
--url="$(URL)" \
|
--url="$(URL)" \
|
||||||
--version="$(VERSION)" \
|
--version="$(SOURCE_VERSION)" \
|
||||||
--subdir="$(SUBDIR)" \
|
--subdir="$(SUBDIR)" \
|
||||||
--source="$(FILE)" \
|
--source="$(FILE)" \
|
||||||
--hash="$(MIRROR_HASH)" \
|
--hash="$(MIRROR_HASH)" \
|
||||||
@ -227,7 +227,7 @@ define DownloadMethod/rawgit
|
|||||||
rm -rf $(SUBDIR) && \
|
rm -rf $(SUBDIR) && \
|
||||||
[ \! -d $(SUBDIR) ] && \
|
[ \! -d $(SUBDIR) ] && \
|
||||||
git clone --filter=blob:none $(OPTS) $(URL) $(SUBDIR) && \
|
git clone --filter=blob:none $(OPTS) $(URL) $(SUBDIR) && \
|
||||||
(cd $(SUBDIR) && git checkout $(VERSION)) && \
|
(cd $(SUBDIR) && git checkout $(SOURCE_VERSION)) && \
|
||||||
export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \
|
export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \
|
||||||
echo "Generating formal git archive (apply .gitattributes rules)" && \
|
echo "Generating formal git archive (apply .gitattributes rules)" && \
|
||||||
(cd $(SUBDIR) && git config core.abbrev 8 && \
|
(cd $(SUBDIR) && git config core.abbrev 8 && \
|
||||||
@ -250,7 +250,7 @@ define DownloadMethod/bzr
|
|||||||
cd $(TMP_DIR)/dl && \
|
cd $(TMP_DIR)/dl && \
|
||||||
rm -rf $(SUBDIR) && \
|
rm -rf $(SUBDIR) && \
|
||||||
[ \! -d $(SUBDIR) ] && \
|
[ \! -d $(SUBDIR) ] && \
|
||||||
bzr export --per-file-timestamps -r$(VERSION) $(SUBDIR) $(URL) && \
|
bzr export --per-file-timestamps -r$(SOURCE_VERSION) $(SUBDIR) $(URL) && \
|
||||||
echo "Packing checkout..." && \
|
echo "Packing checkout..." && \
|
||||||
export TAR_TIMESTAMP="" && \
|
export TAR_TIMESTAMP="" && \
|
||||||
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
|
$(call dl_tar_pack,$(TMP_DIR)/dl/$(FILE),$(SUBDIR)) && \
|
||||||
@ -266,7 +266,7 @@ define DownloadMethod/hg
|
|||||||
cd $(TMP_DIR)/dl && \
|
cd $(TMP_DIR)/dl && \
|
||||||
rm -rf $(SUBDIR) && \
|
rm -rf $(SUBDIR) && \
|
||||||
[ \! -d $(SUBDIR) ] && \
|
[ \! -d $(SUBDIR) ] && \
|
||||||
hg clone -r $(VERSION) $(URL) $(SUBDIR) && \
|
hg clone -r $(SOURCE_VERSION) $(URL) $(SUBDIR) && \
|
||||||
export TAR_TIMESTAMP=`cd $(SUBDIR) && hg log --template '@{date}' -l 1` && \
|
export TAR_TIMESTAMP=`cd $(SUBDIR) && hg log --template '@{date}' -l 1` && \
|
||||||
find $(SUBDIR) -name .hg | xargs rm -rf && \
|
find $(SUBDIR) -name .hg | xargs rm -rf && \
|
||||||
echo "Packing checkout..." && \
|
echo "Packing checkout..." && \
|
||||||
@ -283,7 +283,7 @@ define DownloadMethod/darcs
|
|||||||
cd $(TMP_DIR)/dl && \
|
cd $(TMP_DIR)/dl && \
|
||||||
rm -rf $(SUBDIR) && \
|
rm -rf $(SUBDIR) && \
|
||||||
[ \! -d $(SUBDIR) ] && \
|
[ \! -d $(SUBDIR) ] && \
|
||||||
darcs get -t $(VERSION) $(URL) $(SUBDIR) && \
|
darcs get -t $(SOURCE_VERSION) $(URL) $(SUBDIR) && \
|
||||||
export TAR_TIMESTAMP=`cd $(SUBDIR) && LC_ALL=C darcs log --last 1 | sed -ne 's!^Date: \+!!p'` && \
|
export TAR_TIMESTAMP=`cd $(SUBDIR) && LC_ALL=C darcs log --last 1 | sed -ne 's!^Date: \+!!p'` && \
|
||||||
find $(SUBDIR) -name _darcs | xargs rm -rf && \
|
find $(SUBDIR) -name _darcs | xargs rm -rf && \
|
||||||
echo "Packing checkout..." && \
|
echo "Packing checkout..." && \
|
||||||
@ -293,12 +293,12 @@ define DownloadMethod/darcs
|
|||||||
)
|
)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
Validate/cvs=VERSION SUBDIR
|
Validate/cvs=SOURCE_VERSION SUBDIR
|
||||||
Validate/svn=VERSION SUBDIR
|
Validate/svn=SOURCE_VERSION SUBDIR
|
||||||
Validate/git=VERSION SUBDIR
|
Validate/git=SOURCE_VERSION SUBDIR
|
||||||
Validate/bzr=VERSION SUBDIR
|
Validate/bzr=SOURCE_VERSION SUBDIR
|
||||||
Validate/hg=VERSION SUBDIR
|
Validate/hg=SOURCE_VERSION SUBDIR
|
||||||
Validate/darcs=VERSION SUBDIR
|
Validate/darcs=SOURCE_VERSION SUBDIR
|
||||||
|
|
||||||
define Download/Defaults
|
define Download/Defaults
|
||||||
URL:=
|
URL:=
|
||||||
@ -311,7 +311,7 @@ define Download/Defaults
|
|||||||
MIRROR:=1
|
MIRROR:=1
|
||||||
MIRROR_HASH=$$(MIRROR_MD5SUM)
|
MIRROR_HASH=$$(MIRROR_MD5SUM)
|
||||||
MIRROR_MD5SUM:=x
|
MIRROR_MD5SUM:=x
|
||||||
VERSION:=
|
SOURCE_VERSION:=
|
||||||
OPTS:=
|
OPTS:=
|
||||||
SUBMODULES:=
|
SUBMODULES:=
|
||||||
endef
|
endef
|
||||||
@ -326,7 +326,7 @@ define Download/default
|
|||||||
$(if $(PKG_SOURCE_MIRROR),MIRROR:=$(filter 1,$(PKG_MIRROR)))
|
$(if $(PKG_SOURCE_MIRROR),MIRROR:=$(filter 1,$(PKG_MIRROR)))
|
||||||
$(if $(PKG_MIRROR_MD5SUM),MIRROR_MD5SUM:=$(PKG_MIRROR_MD5SUM))
|
$(if $(PKG_MIRROR_MD5SUM),MIRROR_MD5SUM:=$(PKG_MIRROR_MD5SUM))
|
||||||
$(if $(PKG_MIRROR_HASH),MIRROR_HASH:=$(PKG_MIRROR_HASH))
|
$(if $(PKG_MIRROR_HASH),MIRROR_HASH:=$(PKG_MIRROR_HASH))
|
||||||
VERSION:=$(PKG_SOURCE_VERSION)
|
SOURCE_VERSION:=$(PKG_SOURCE_VERSION)
|
||||||
$(if $(PKG_MD5SUM),MD5SUM:=$(PKG_MD5SUM))
|
$(if $(PKG_MD5SUM),MD5SUM:=$(PKG_MD5SUM))
|
||||||
$(if $(PKG_HASH),HASH:=$(PKG_HASH))
|
$(if $(PKG_HASH),HASH:=$(PKG_HASH))
|
||||||
endef
|
endef
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
LINUX_VERSION-6.6 = .28
|
LINUX_VERSION-6.6 = .29
|
||||||
LINUX_KERNEL_HASH-6.6.28 = 818716ed13e7dba6aaeae24e3073993e260812ed128d10272e94b922ee6d3394
|
LINUX_KERNEL_HASH-6.6.29 = 7f26f74c08082c86b1daf866e4d49c5d8276cc1906a89d0e367e457ec167cbd0
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_VERSION:=2.9
|
PKG_VERSION:=2.9
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
PKG_HASH:=76a66a1de0c01aeb83dfc7b72b51173fe62c6e51d6fca17cc562393117bed08b
|
PKG_HASH:=76a66a1de0c01aeb83dfc7b72b51173fe62c6e51d6fca17cc562393117bed08b
|
||||||
|
|
||||||
PKG_MAINTAINER:=Vladimir Vid <vladimir.vid@sartura.hr>
|
PKG_MAINTAINER:=Vladimir Vid <vladimir.vid@sartura.hr>
|
||||||
@ -145,7 +145,7 @@ define Download/a3700-utils
|
|||||||
FILE:=$(A3700_UTILS_SOURCE)
|
FILE:=$(A3700_UTILS_SOURCE)
|
||||||
PROTO:=git
|
PROTO:=git
|
||||||
URL:=https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell.git
|
URL:=https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell.git
|
||||||
VERSION:=a3e1c67bb378e1d8a938e1b826cb602af83628d2
|
SOURCE_VERSION:=a3e1c67bb378e1d8a938e1b826cb602af83628d2
|
||||||
MIRROR_HASH:=0e6b8ef6423dcb52a5e282669a8aeebc6eea2d45a7c3a2c9a2fc7a749b3275a7
|
MIRROR_HASH:=0e6b8ef6423dcb52a5e282669a8aeebc6eea2d45a7c3a2c9a2fc7a749b3275a7
|
||||||
SUBDIR:=$(A3700_UTILS_NAME)
|
SUBDIR:=$(A3700_UTILS_NAME)
|
||||||
endef
|
endef
|
||||||
@ -158,8 +158,8 @@ define Download/cryptopp
|
|||||||
FILE:=$(CRYPTOPP_SOURCE)
|
FILE:=$(CRYPTOPP_SOURCE)
|
||||||
PROTO:=git
|
PROTO:=git
|
||||||
URL:=https://github.com/weidai11/cryptopp.git
|
URL:=https://github.com/weidai11/cryptopp.git
|
||||||
VERSION:=4d0cad5401d1a2c998b314bc89288c9620d3021d
|
SOURCE_VERSION:=4d0cad5401d1a2c998b314bc89288c9620d3021d
|
||||||
MIRROR_HASH:=74ec9e48ee04b9f2d9a1d8c4f2392ed0ab52780d7af0f70405d7bbb23d1504fa
|
MIRROR_HASH:=6c53c8b4dfa07df0c5915a90c20f70c64d150b652cf5ac52e2eae08c5a9cc7cd
|
||||||
SUBDIR:=$(CRYPTOPP_NAME)
|
SUBDIR:=$(CRYPTOPP_NAME)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ define Download/mv-ddr-marvell
|
|||||||
FILE:=$(MV_DDR_SOURCE)
|
FILE:=$(MV_DDR_SOURCE)
|
||||||
PROTO:=git
|
PROTO:=git
|
||||||
URL:=https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git
|
URL:=https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git
|
||||||
VERSION:=541616bc5d25a0167c9901546255c55973e2c0f0
|
SOURCE_VERSION:=541616bc5d25a0167c9901546255c55973e2c0f0
|
||||||
MIRROR_HASH:=9e86a986c7400ed1a72165a88150b6c494ebd87303b16314b43e5785e3f13068
|
MIRROR_HASH:=9e86a986c7400ed1a72165a88150b6c494ebd87303b16314b43e5785e3f13068
|
||||||
SUBDIR:=$(MV_DDR_NAME)
|
SUBDIR:=$(MV_DDR_NAME)
|
||||||
endef
|
endef
|
||||||
@ -185,7 +185,7 @@ define Download/mox-boot-builder
|
|||||||
PROTO:=git
|
PROTO:=git
|
||||||
SUBMODULES:=skip
|
SUBMODULES:=skip
|
||||||
URL:=https://gitlab.nic.cz/turris/mox-boot-builder.git
|
URL:=https://gitlab.nic.cz/turris/mox-boot-builder.git
|
||||||
VERSION:=604f8f51d97b4e59fa6d1e579101daa194d6ed2d
|
SOURCE_VERSION:=604f8f51d97b4e59fa6d1e579101daa194d6ed2d
|
||||||
MIRROR_HASH:=b09337a7dde140f57e40133b6e7b7e1eb338e7cea9b15a3af6874824462f15f7
|
MIRROR_HASH:=b09337a7dde140f57e40133b6e7b7e1eb338e7cea9b15a3af6874824462f15f7
|
||||||
SUBDIR:=$(MOX_BB_NAME)
|
SUBDIR:=$(MOX_BB_NAME)
|
||||||
endef
|
endef
|
||||||
|
@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk
|
|||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
|
||||||
PKG_NAME:=grub
|
PKG_NAME:=grub
|
||||||
PKG_VERSION:=2.06
|
PKG_VERSION:=2.12
|
||||||
PKG_RELEASE:=6
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||||
PKG_SOURCE_URL:=@GNU/grub
|
PKG_SOURCE_URL:=@GNU/grub
|
||||||
PKG_HASH:=b79ea44af91b93d17cd3fe80bdae6ed43770678a9a5ae192ccea803ebb657ee1
|
PKG_HASH:=f3c97391f7c4eaa677a78e090c7e97e6dc47b16f655f04683ebd37bef7fe0faa
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-3.0-or-later
|
PKG_LICENSE:=GPL-3.0-or-later
|
||||||
PKG_CPE_ID:=cpe:/a:gnu:grub2
|
PKG_CPE_ID:=cpe:/a:gnu:grub2
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
From 4d4dae6a52b1749642261a15f5dcc1e3d4150b36 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Julien Olivain <ju.o@free.fr>
|
||||||
|
Date: Fri, 22 Dec 2023 19:02:53 +0100
|
||||||
|
Subject: [PATCH] Add missing grub-core/extra_deps.lst file in release tarball
|
||||||
|
|
||||||
|
A file is missing in the grub-2.12 release tarballs (both .gz and .xz).
|
||||||
|
See [1]. The issue was reported in [2] and fixed upstream in [3].
|
||||||
|
|
||||||
|
This patch adds the missing file, on top of the release tarball. This
|
||||||
|
patch won't apply on upstream git, since the file is present in the
|
||||||
|
source repository. Since the issue is fixed upstream in [3], it is
|
||||||
|
expected upcoming releases tarballs will include the file.
|
||||||
|
|
||||||
|
The file content was fetched from the upstream git repo:
|
||||||
|
https://git.savannah.gnu.org/gitweb/?p=grub.git;a=blob_plain;f=grub-core/extra_deps.lst;hb=refs/tags/grub-2.12
|
||||||
|
|
||||||
|
[1] https://ftp.gnu.org/gnu/grub/grub-2.12.tar.xz
|
||||||
|
[2] https://lists.gnu.org/archive/html/grub-devel/2023-12/msg00054.html
|
||||||
|
[3] https://git.savannah.gnu.org/gitweb/?p=grub.git;a=commit;h=b835601c7639ed1890f2d3db91900a8506011a8e
|
||||||
|
|
||||||
|
Signed-off-by: Julien Olivain <ju.o@free.fr>
|
||||||
|
Upstream: Fixed by: https://git.savannah.gnu.org/gitweb/?p=grub.git;a=commit;h=b835601c7639ed1890f2d3db91900a8506011a8e
|
||||||
|
---
|
||||||
|
grub-core/extra_deps.lst | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
create mode 100644 grub-core/extra_deps.lst
|
||||||
|
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/grub-core/extra_deps.lst
|
||||||
|
@@ -0,0 +1 @@
|
||||||
|
+depends bli part_gpt
|
@ -1,6 +1,6 @@
|
|||||||
--- a/include/grub/util/install.h
|
--- a/include/grub/util/install.h
|
||||||
+++ b/include/grub/util/install.h
|
+++ b/include/grub/util/install.h
|
||||||
@@ -198,13 +198,13 @@ grub_install_get_image_target (const cha
|
@@ -199,13 +199,13 @@ grub_install_get_image_target (const cha
|
||||||
void
|
void
|
||||||
grub_util_bios_setup (const char *dir,
|
grub_util_bios_setup (const char *dir,
|
||||||
const char *boot_file, const char *core_file,
|
const char *boot_file, const char *core_file,
|
||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
--- a/util/grub-install.c
|
--- a/util/grub-install.c
|
||||||
+++ b/util/grub-install.c
|
+++ b/util/grub-install.c
|
||||||
@@ -1721,7 +1721,7 @@ main (int argc, char *argv[])
|
@@ -1770,7 +1770,7 @@ main (int argc, char *argv[])
|
||||||
if (install_bootsector)
|
if (install_bootsector)
|
||||||
{
|
{
|
||||||
grub_util_bios_setup (platdir, "boot.img", "core.img",
|
grub_util_bios_setup (platdir, "boot.img", "core.img",
|
||||||
@ -27,7 +27,7 @@
|
|||||||
fs_probe, allow_floppy, add_rs_codes,
|
fs_probe, allow_floppy, add_rs_codes,
|
||||||
!grub_install_is_short_mbrgap_supported ());
|
!grub_install_is_short_mbrgap_supported ());
|
||||||
|
|
||||||
@@ -1752,7 +1752,7 @@ main (int argc, char *argv[])
|
@@ -1801,7 +1801,7 @@ main (int argc, char *argv[])
|
||||||
if (install_bootsector)
|
if (install_bootsector)
|
||||||
{
|
{
|
||||||
grub_util_sparc_setup (platdir, "boot.img", "core.img",
|
grub_util_sparc_setup (platdir, "boot.img", "core.img",
|
||||||
|
@ -38,7 +38,8 @@ asus,rt-ax59u)
|
|||||||
;;
|
;;
|
||||||
bananapi,bpi-r3|\
|
bananapi,bpi-r3|\
|
||||||
bananapi,bpi-r3-mini|\
|
bananapi,bpi-r3-mini|\
|
||||||
bananapi,bpi-r4)
|
bananapi,bpi-r4|\
|
||||||
|
jdcloud,re-cp-03)
|
||||||
. /lib/upgrade/common.sh
|
. /lib/upgrade/common.sh
|
||||||
|
|
||||||
bootdev="$(fitblk_get_bootdev)"
|
bootdev="$(fitblk_get_bootdev)"
|
||||||
@ -104,9 +105,6 @@ zyxel,ex5601-t0-ubootmod)
|
|||||||
imou,lc-hx3001-ubootmod)
|
imou,lc-hx3001-ubootmod)
|
||||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x80000" "1"
|
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x80000" "1"
|
||||||
;;
|
;;
|
||||||
jdcloud,re-cp-03)
|
|
||||||
ubootenv_add_mmc_default
|
|
||||||
;;
|
|
||||||
livinet,zr-3020|\
|
livinet,zr-3020|\
|
||||||
livinet,zr-3020-ubootmod)
|
livinet,zr-3020-ubootmod)
|
||||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" "1"
|
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" "1"
|
||||||
|
@ -271,7 +271,7 @@
|
|||||||
+serverip=192.168.1.254
|
+serverip=192.168.1.254
|
||||||
+loadaddr=0x46000000
|
+loadaddr=0x46000000
|
||||||
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
|
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
|
||||||
+bootargs=root=/dev/mmcblk0p65
|
+bootargs=root=/dev/fit0 rootwait
|
||||||
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_emmc ; fi
|
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_emmc ; fi
|
||||||
+bootconf=config-1
|
+bootconf=config-1
|
||||||
+bootdelay=0
|
+bootdelay=0
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
From ca4ecdce4cdcfab7df101b5df6ddad43d2f549e1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <kabel@kernel.org>
|
||||||
|
Date: Thu, 4 Apr 2024 09:50:50 +0200
|
||||||
|
Subject: [PATCH] arm: mvebu: turris_omnia: Enable LTO by default on Turris
|
||||||
|
Omnia
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
U-Boot builds for Turris Omnia are approaching the limit of 0xf0000
|
||||||
|
bytes, which is the size of the U-Boot partition on Omnia.
|
||||||
|
|
||||||
|
Enable LTO to get more size optimized binaries.
|
||||||
|
|
||||||
|
Signed-off-by: Marek Behún <kabel@kernel.org>
|
||||||
|
Reviewed-by: Stefan Roese <sr@denx.de>
|
||||||
|
---
|
||||||
|
configs/turris_omnia_defconfig | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
--- a/configs/turris_omnia_defconfig
|
||||||
|
+++ b/configs/turris_omnia_defconfig
|
||||||
|
@@ -31,6 +31,7 @@ CONFIG_AHCI=y
|
||||||
|
CONFIG_OF_BOARD_FIXUP=y
|
||||||
|
CONFIG_SYS_MEMTEST_START=0x00800000
|
||||||
|
CONFIG_SYS_MEMTEST_END=0x00ffffff
|
||||||
|
+CONFIG_LTO=y
|
||||||
|
CONFIG_HAS_BOARD_SIZE_LIMIT=y
|
||||||
|
CONFIG_BOARD_SIZE_LIMIT=983040
|
||||||
|
CONFIG_FIT=y
|
@ -1,109 +0,0 @@
|
|||||||
#
|
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
|
||||||
# See /LICENSE for more information.
|
|
||||||
#
|
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
|
||||||
|
|
||||||
PKG_NAME:=libaudit
|
|
||||||
PKG_VERSION:=2.8.5
|
|
||||||
PKG_RELEASE:=1
|
|
||||||
|
|
||||||
PKG_SOURCE_NAME:=audit
|
|
||||||
PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.gz
|
|
||||||
PKG_SOURCE_URL:=https://people.redhat.com/sgrubb/audit
|
|
||||||
PKG_HASH:=0e5d4103646e00f8d1981e1cd2faea7a2ae28e854c31a803e907a383c5e2ecb7
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
|
|
||||||
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
|
|
||||||
PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
|
||||||
PKG_LICENSE:=GPL-2.0
|
|
||||||
PKG_LICENSE_FILES:=COPYING
|
|
||||||
PKG_CPE_ID:=cpe:/a:linux_audit_project:linux_audit
|
|
||||||
|
|
||||||
PKG_FIXUP:=autoreconf
|
|
||||||
|
|
||||||
PKG_BUILD_FLAGS:=no-mips16
|
|
||||||
PKG_INSTALL:=1
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
|
||||||
include $(INCLUDE_DIR)/host-build.mk
|
|
||||||
|
|
||||||
define Package/libaudit
|
|
||||||
CATEGORY:=Libraries
|
|
||||||
TITLE:=Linux Auditing Framework (shared library)
|
|
||||||
URL:=http://people.redhat.com/sgrubb/audit/
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/libaudit/description
|
|
||||||
This package contains the audit shared library.
|
|
||||||
endef
|
|
||||||
|
|
||||||
CONFIGURE_VARS += \
|
|
||||||
LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
|
|
||||||
CPPFLAGS_FOR_BUILD="$(HOST_CPPFLAGS)" \
|
|
||||||
CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
|
|
||||||
CC_FOR_BUILD="$(HOSTCC)"
|
|
||||||
|
|
||||||
CONFIGURE_ARGS += \
|
|
||||||
--without-libcap-ng \
|
|
||||||
--disable-systemd \
|
|
||||||
--without-python \
|
|
||||||
--without-python3 \
|
|
||||||
--disable-zos-remote
|
|
||||||
|
|
||||||
ifeq ($(ARCH),aarch64)
|
|
||||||
CONFIGURE_ARGS += --with-aarch64
|
|
||||||
else ifeq ($(ARCH),arm)
|
|
||||||
CONFIGURE_ARGS += --with-arm
|
|
||||||
endif
|
|
||||||
|
|
||||||
HOST_CONFIGURE_ARGS += \
|
|
||||||
--without-libcap-ng \
|
|
||||||
--disable-systemd \
|
|
||||||
--without-python \
|
|
||||||
--without-python3 \
|
|
||||||
--disable-zos-remote
|
|
||||||
|
|
||||||
MAKE_PATH:=lib
|
|
||||||
|
|
||||||
# Host/Compile/default doesn't include $(MAKE_PATH), override to use,
|
|
||||||
# so we avoid building and installing unnecessary parts on the host.
|
|
||||||
define Host/Compile
|
|
||||||
+$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/$(MAKE_PATH) $(HOST_MAKE_FLAGS) all
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Host/Install
|
|
||||||
+$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/lib $(HOST_MAKE_FLAGS) install
|
|
||||||
+$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/init.d $(HOST_MAKE_FLAGS) install
|
|
||||||
endef
|
|
||||||
|
|
||||||
# We can't use the default, as the default passes $(MAKE_ARGS), which
|
|
||||||
# overrides CC, CFLAGS, etc. and defeats the *_FOR_BUILD definitions
|
|
||||||
# passed in CONFIGURE_VARS
|
|
||||||
define Build/Compile
|
|
||||||
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH)
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/Install
|
|
||||||
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/lib $(MAKE_INSTALL_FLAGS) install
|
|
||||||
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/init.d $(MAKE_INSTALL_FLAGS) install
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Build/InstallDev
|
|
||||||
$(INSTALL_DIR) $(1)/usr/include
|
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
|
||||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
|
|
||||||
endef
|
|
||||||
|
|
||||||
define Package/libaudit/install
|
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
|
|
||||||
$(INSTALL_DIR) $(1)/etc
|
|
||||||
$(CP) $(PKG_INSTALL_DIR)/etc/libaudit.conf $(1)/etc/
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(eval $(call HostBuild))
|
|
||||||
$(eval $(call BuildPackage,libaudit))
|
|
@ -1,133 +0,0 @@
|
|||||||
From c39a071e7c021f6ff3554aca2758e97b47a9777c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Steve Grubb <sgrubb@redhat.com>
|
|
||||||
Date: Tue, 26 Feb 2019 18:33:33 -0500
|
|
||||||
Subject: [PATCH] Add substitue functions for strndupa & rawmemchr
|
|
||||||
|
|
||||||
(cherry picked from commit d579a08bb1cde71f939c13ac6b2261052ae9f77e)
|
|
||||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
|
||||||
---
|
|
||||||
auparse/auparse.c | 12 +++++++++++-
|
|
||||||
auparse/interpret.c | 9 ++++++++-
|
|
||||||
configure.ac | 14 +++++++++++++-
|
|
||||||
src/ausearch-lol.c | 12 +++++++++++-
|
|
||||||
4 files changed, 43 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/auparse/auparse.c b/auparse/auparse.c
|
|
||||||
index 650db02..2e1c737 100644
|
|
||||||
--- a/auparse/auparse.c
|
|
||||||
+++ b/auparse/auparse.c
|
|
||||||
@@ -1,5 +1,5 @@
|
|
||||||
/* auparse.c --
|
|
||||||
- * Copyright 2006-08,2012-17 Red Hat Inc., Durham, North Carolina.
|
|
||||||
+ * Copyright 2006-08,2012-19 Red Hat Inc., Durham, North Carolina.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
@@ -1118,6 +1118,16 @@ static int str2event(char *s, au_event_t *e)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
+#ifndef HAVE_STRNDUPA
|
|
||||||
+static inline char *strndupa(const char *old, size_t n)
|
|
||||||
+{
|
|
||||||
+ size_t len = strnlen(old, n);
|
|
||||||
+ char *tmp = alloca(len + 1);
|
|
||||||
+ tmp[len] = 0;
|
|
||||||
+ return memcpy(tmp, old, len);
|
|
||||||
+}
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
/* Returns 0 on success and 1 on error */
|
|
||||||
static int extract_timestamp(const char *b, au_event_t *e)
|
|
||||||
{
|
|
||||||
diff --git a/auparse/interpret.c b/auparse/interpret.c
|
|
||||||
index 51c4a5e..67b7b77 100644
|
|
||||||
--- a/auparse/interpret.c
|
|
||||||
+++ b/auparse/interpret.c
|
|
||||||
@@ -853,6 +853,13 @@ err_out:
|
|
||||||
return print_escaped(id->val);
|
|
||||||
}
|
|
||||||
|
|
||||||
+// rawmemchr is faster. Let's use it if we have it.
|
|
||||||
+#ifdef HAVE_RAWMEMCHR
|
|
||||||
+#define STRCHR rawmemchr
|
|
||||||
+#else
|
|
||||||
+#define STRCHR strchr
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
static const char *print_proctitle(const char *val)
|
|
||||||
{
|
|
||||||
char *out = (char *)print_escaped(val);
|
|
||||||
@@ -863,7 +870,7 @@ static const char *print_proctitle(const char *val)
|
|
||||||
// Proctitle has arguments separated by NUL bytes
|
|
||||||
// We need to write over the NUL bytes with a space
|
|
||||||
// so that we can see the arguments
|
|
||||||
- while ((ptr = rawmemchr(ptr, '\0'))) {
|
|
||||||
+ while ((ptr = STRCHR(ptr, '\0'))) {
|
|
||||||
if (ptr >= end)
|
|
||||||
break;
|
|
||||||
*ptr = ' ';
|
|
||||||
diff --git a/configure.ac b/configure.ac
|
|
||||||
index 6e345f1..6f3007e 100644
|
|
||||||
--- a/configure.ac
|
|
||||||
+++ b/configure.ac
|
|
||||||
@@ -1,7 +1,7 @@
|
|
||||||
dnl
|
|
||||||
define([AC_INIT_NOTICE],
|
|
||||||
[### Generated automatically using autoconf version] AC_ACVERSION [
|
|
||||||
-### Copyright 2005-18 Steve Grubb <sgrubb@redhat.com>
|
|
||||||
+### Copyright 2005-19 Steve Grubb <sgrubb@redhat.com>
|
|
||||||
###
|
|
||||||
### Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
### copy of this software and associated documentation files (the "Software"),
|
|
||||||
@@ -72,6 +72,18 @@ dnl; posix_fallocate is used in audisp-remote
|
|
||||||
AC_CHECK_FUNCS([posix_fallocate])
|
|
||||||
dnl; signalfd is needed for libev
|
|
||||||
AC_CHECK_FUNC([signalfd], [], [ AC_MSG_ERROR([The signalfd system call is necessary for auditd]) ])
|
|
||||||
+dnl; check if rawmemchr is available
|
|
||||||
+AC_CHECK_FUNCS([rawmemchr])
|
|
||||||
+dnl; check if strndupa is available
|
|
||||||
+AC_LINK_IFELSE(
|
|
||||||
+ [AC_LANG_SOURCE(
|
|
||||||
+ [[
|
|
||||||
+ #define _GNU_SOURCE
|
|
||||||
+ #include <string.h>
|
|
||||||
+ int main() { (void) strndupa("test", 10); return 0; }]])],
|
|
||||||
+ [AC_DEFINE(HAVE_STRNDUPA, 1, [Let us know if we have it or not])],
|
|
||||||
+ []
|
|
||||||
+)
|
|
||||||
|
|
||||||
ALLWARNS=""
|
|
||||||
ALLDEBUG="-g"
|
|
||||||
diff --git a/src/ausearch-lol.c b/src/ausearch-lol.c
|
|
||||||
index 5d17a72..758c33e 100644
|
|
||||||
--- a/src/ausearch-lol.c
|
|
||||||
+++ b/src/ausearch-lol.c
|
|
||||||
@@ -1,6 +1,6 @@
|
|
||||||
/*
|
|
||||||
* ausearch-lol.c - linked list of linked lists library
|
|
||||||
-* Copyright (c) 2008,2010,2014,2016 Red Hat Inc., Durham, North Carolina.
|
|
||||||
+* Copyright (c) 2008,2010,2014,2016,2019 Red Hat Inc., Durham, North Carolina.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*
|
|
||||||
* This software may be freely redistributed and/or modified under the
|
|
||||||
@@ -152,6 +152,16 @@ static int compare_event_time(event *e1, event *e2)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
+#ifndef HAVE_STRNDUPA
|
|
||||||
+static inline char *strndupa(const char *old, size_t n)
|
|
||||||
+{
|
|
||||||
+ size_t len = strnlen(old, n);
|
|
||||||
+ char *tmp = alloca(len + 1);
|
|
||||||
+ tmp[len] = 0;
|
|
||||||
+ return memcpy(tmp, old, len);
|
|
||||||
+}
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
* This function will look at the line and pick out pieces of it.
|
|
||||||
*/
|
|
||||||
--
|
|
||||||
2.21.0
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
|||||||
From 017e6c6ab95df55f34e339d2139def83e5dada1f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Steve Grubb <sgrubb@redhat.com>
|
|
||||||
Date: Fri, 10 Jan 2020 21:13:50 -0500
|
|
||||||
Subject: [PATCH 01/30] Header definitions need to be external when building
|
|
||||||
with -fno-common (which is default in GCC 10) - Tony Jones
|
|
||||||
|
|
||||||
---
|
|
||||||
src/ausearch-common.h | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/ausearch-common.h b/src/ausearch-common.h
|
|
||||||
index 6669203..3040547 100644
|
|
||||||
--- a/src/ausearch-common.h
|
|
||||||
+++ b/src/ausearch-common.h
|
|
||||||
@@ -50,7 +50,7 @@ extern pid_t event_pid;
|
|
||||||
extern int event_exact_match;
|
|
||||||
extern uid_t event_uid, event_euid, event_loginuid;
|
|
||||||
extern const char *event_tuid, *event_teuid, *event_tauid;
|
|
||||||
-slist *event_node_list;
|
|
||||||
+extern slist *event_node_list;
|
|
||||||
extern const char *event_comm;
|
|
||||||
extern const char *event_filename;
|
|
||||||
extern const char *event_hostname;
|
|
||||||
--
|
|
||||||
2.26.2
|
|
||||||
|
|
@ -18,7 +18,7 @@ PKG_LICENSE_FILES:=COPYING
|
|||||||
PKG_CPE_ID:=cpe:/a:selinuxproject:libsemanage
|
PKG_CPE_ID:=cpe:/a:selinuxproject:libsemanage
|
||||||
|
|
||||||
|
|
||||||
HOST_BUILD_DEPENDS:=libaudit/host libselinux/host bzip2/host
|
HOST_BUILD_DEPENDS:=audit/host libselinux/host bzip2/host
|
||||||
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
@ -9,12 +9,12 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=libunwind
|
PKG_NAME:=libunwind
|
||||||
PKG_VERSION:=1.6.2
|
PKG_VERSION:=1.8.1
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME)
|
PKG_SOURCE_URL:=https://github.com/$(PKG_NAME)/$(PKG_NAME)/releases/download/v$(PKG_VERSION)/
|
||||||
PKG_HASH:=4a6aec666991fb45d0889c44aede8ad6eb108071c3554fcdff671f9c94794976
|
PKG_HASH:=ddf0e32dd5fafe5283198d37e4bf9decf7ba1770b6e7e006c33e6df79e6a6157
|
||||||
|
|
||||||
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
|
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
|
||||||
PKG_LICENSE:=X11
|
PKG_LICENSE:=X11
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/include/libunwind-mips.h
|
--- a/include/libunwind-mips.h
|
||||||
+++ b/include/libunwind-mips.h
|
+++ b/include/libunwind-mips.h
|
||||||
@@ -114,6 +114,42 @@ typedef enum
|
@@ -121,6 +121,42 @@ typedef enum
|
||||||
}
|
}
|
||||||
mips_regnum_t;
|
mips_regnum_t;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/include/libunwind-ppc32.h
|
--- a/include/libunwind-ppc32.h
|
||||||
+++ b/include/libunwind-ppc32.h
|
+++ b/include/libunwind-ppc32.h
|
||||||
@@ -74,6 +74,88 @@ typedef int64_t unw_sword_t;
|
@@ -81,6 +81,88 @@ typedef int64_t unw_sword_t;
|
||||||
|
|
||||||
typedef long double unw_tdep_fpreg_t;
|
typedef long double unw_tdep_fpreg_t;
|
||||||
|
|
||||||
@ -91,7 +91,7 @@
|
|||||||
UNW_PPC32_R0,
|
UNW_PPC32_R0,
|
||||||
--- a/include/libunwind-ppc64.h
|
--- a/include/libunwind-ppc64.h
|
||||||
+++ b/include/libunwind-ppc64.h
|
+++ b/include/libunwind-ppc64.h
|
||||||
@@ -81,6 +81,88 @@ typedef struct {
|
@@ -88,6 +88,88 @@ typedef struct {
|
||||||
uint64_t halves[2];
|
uint64_t halves[2];
|
||||||
} unw_tdep_vreg_t;
|
} unw_tdep_vreg_t;
|
||||||
|
|
||||||
@ -182,7 +182,7 @@
|
|||||||
UNW_PPC64_R0,
|
UNW_PPC64_R0,
|
||||||
--- a/src/ppc32/Ginit.c
|
--- a/src/ppc32/Ginit.c
|
||||||
+++ b/src/ppc32/Ginit.c
|
+++ b/src/ppc32/Ginit.c
|
||||||
@@ -46,14 +46,19 @@ static void *
|
@@ -46,10 +46,15 @@ static void *
|
||||||
uc_addr (ucontext_t *uc, int reg)
|
uc_addr (ucontext_t *uc, int reg)
|
||||||
{
|
{
|
||||||
void *addr;
|
void *addr;
|
||||||
@ -193,191 +193,43 @@
|
|||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
if ((unsigned) (reg - UNW_PPC32_R0) < 32)
|
if ((unsigned) (reg - UNW_PPC32_R0) < 32)
|
||||||
|
#if defined(__linux__)
|
||||||
- addr = &uc->uc_mcontext.uc_regs->gregs[reg - UNW_PPC32_R0];
|
- addr = &uc->uc_mcontext.uc_regs->gregs[reg - UNW_PPC32_R0];
|
||||||
+ addr = &mc->gregs[reg - UNW_PPC32_R0];
|
+ addr = &mc->gregs[reg - UNW_PPC32_R0];
|
||||||
|
#elif defined(__FreeBSD__)
|
||||||
else
|
addr = &uc->uc_mcontext.mc_gpr[reg - UNW_PPC32_R0];
|
||||||
|
#endif
|
||||||
|
@@ -58,7 +63,7 @@ uc_addr (ucontext_t *uc, int reg)
|
||||||
if ( ((unsigned) (reg - UNW_PPC32_F0) < 32) &&
|
if ( ((unsigned) (reg - UNW_PPC32_F0) < 32) &&
|
||||||
((unsigned) (reg - UNW_PPC32_F0) >= 0) )
|
((unsigned) (reg - UNW_PPC32_F0) >= 0) )
|
||||||
|
#if defined(__linux__)
|
||||||
- addr = &uc->uc_mcontext.uc_regs->fpregs.fpregs[reg - UNW_PPC32_F0];
|
- addr = &uc->uc_mcontext.uc_regs->fpregs.fpregs[reg - UNW_PPC32_F0];
|
||||||
+ addr = &mc->fpregs.fpregs[reg - UNW_PPC32_F0];
|
+ addr = &mc->fpregs.fpregs[reg - UNW_PPC32_F0];
|
||||||
|
#elif defined(__FreeBSD__)
|
||||||
else
|
addr = &uc->uc_mcontext.mc_fpreg[reg - UNW_PPC32_F0];
|
||||||
{
|
#endif
|
||||||
@@ -76,7 +81,7 @@ uc_addr (ucontext_t *uc, int reg)
|
@@ -85,7 +90,7 @@ uc_addr (ucontext_t *uc, int reg)
|
||||||
default:
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#if defined(__linux__)
|
||||||
- addr = &uc->uc_mcontext.uc_regs->gregs[gregs_idx];
|
- addr = &uc->uc_mcontext.uc_regs->gregs[gregs_idx];
|
||||||
+ addr = &mc->gregs[gregs_idx];
|
+ addr = &mc->gregs[gregs_idx];
|
||||||
}
|
#elif defined(__FreeBSD__)
|
||||||
return addr;
|
addr = &uc->uc_mcontext.mc_gpr[gregs_idx];
|
||||||
}
|
#endif
|
||||||
--- a/src/ppc32/ucontext_i.h
|
--- a/src/ppc32/ucontext_i.h
|
||||||
+++ b/src/ppc32/ucontext_i.h
|
+++ b/src/ppc32/ucontext_i.h
|
||||||
@@ -46,83 +46,89 @@ WITH THE SOFTWARE OR THE USE OR OTHER DE
|
@@ -44,8 +44,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DE
|
||||||
various structure members. */
|
//#define MQ_IDX 36
|
||||||
static ucontext_t dmy_ctxt UNUSED;
|
#define LINK_IDX 36
|
||||||
|
|
||||||
-#define UC_MCONTEXT_GREGS_R0 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[0] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R1 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[1] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R2 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[2] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R3 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[3] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R4 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[4] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R5 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[5] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R6 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[6] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R7 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[7] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R8 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[8] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R9 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[9] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R10 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[10] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R11 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[11] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R12 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[12] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R13 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[13] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R14 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[14] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R15 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[15] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R16 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[16] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R17 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[17] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R18 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[18] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R19 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[19] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R20 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[20] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R21 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[21] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R22 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[22] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R23 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[23] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R24 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[24] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R25 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[25] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R26 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[26] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R27 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[27] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R28 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[28] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R29 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[29] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R30 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[30] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_R31 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[31] - (void *)&dmy_ctxt)
|
|
||||||
+#ifdef __GLIBC__
|
+#ifdef __GLIBC__
|
||||||
+#define UC_MCONTEXT_OFFSET(field) ((void *)&dmy_ctxt.uc_mcontext.uc_regs->field - (void *)&dmy_ctxt)
|
#define _UC_MCONTEXT_GPR(x) ( ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[x] - (void *)&dmy_ctxt) )
|
||||||
|
#define _UC_MCONTEXT_FPR(x) ( ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[x] - (void *)&dmy_ctxt) )
|
||||||
+#else
|
+#else
|
||||||
+#define UC_MCONTEXT_OFFSET(field) ((void *)&dmy_ctxt.uc_mcontext.field - (void *)&dmy_ctxt)
|
+#define _UC_MCONTEXT_GPR(x) ( ((void *)&dmy_ctxt.uc_mcontext.gregs[x] - (void *)&dmy_ctxt) )
|
||||||
|
+#define _UC_MCONTEXT_FPR(x) ( ((void *)&dmy_ctxt.uc_mcontext.fpregs.fpregs[x] - (void *)&dmy_ctxt) )
|
||||||
+#endif
|
+#endif
|
||||||
+
|
|
||||||
+#define UC_MCONTEXT_GREGS_R0 UC_MCONTEXT_OFFSET(gregs[0])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R1 UC_MCONTEXT_OFFSET(gregs[1])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R2 UC_MCONTEXT_OFFSET(gregs[2])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R3 UC_MCONTEXT_OFFSET(gregs[3])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R4 UC_MCONTEXT_OFFSET(gregs[4])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R5 UC_MCONTEXT_OFFSET(gregs[5])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R6 UC_MCONTEXT_OFFSET(gregs[6])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R7 UC_MCONTEXT_OFFSET(gregs[7])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R8 UC_MCONTEXT_OFFSET(gregs[8])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R9 UC_MCONTEXT_OFFSET(gregs[9])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R10 UC_MCONTEXT_OFFSET(gregs[10])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R11 UC_MCONTEXT_OFFSET(gregs[11])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R12 UC_MCONTEXT_OFFSET(gregs[12])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R13 UC_MCONTEXT_OFFSET(gregs[13])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R14 UC_MCONTEXT_OFFSET(gregs[14])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R15 UC_MCONTEXT_OFFSET(gregs[15])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R16 UC_MCONTEXT_OFFSET(gregs[16])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R17 UC_MCONTEXT_OFFSET(gregs[17])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R18 UC_MCONTEXT_OFFSET(gregs[18])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R19 UC_MCONTEXT_OFFSET(gregs[19])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R20 UC_MCONTEXT_OFFSET(gregs[20])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R21 UC_MCONTEXT_OFFSET(gregs[21])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R22 UC_MCONTEXT_OFFSET(gregs[22])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R23 UC_MCONTEXT_OFFSET(gregs[23])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R24 UC_MCONTEXT_OFFSET(gregs[24])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R25 UC_MCONTEXT_OFFSET(gregs[25])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R26 UC_MCONTEXT_OFFSET(gregs[26])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R27 UC_MCONTEXT_OFFSET(gregs[27])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R28 UC_MCONTEXT_OFFSET(gregs[28])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R29 UC_MCONTEXT_OFFSET(gregs[29])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R30 UC_MCONTEXT_OFFSET(gregs[30])
|
|
||||||
+#define UC_MCONTEXT_GREGS_R31 UC_MCONTEXT_OFFSET(gregs[31])
|
|
||||||
|
|
||||||
-#define UC_MCONTEXT_GREGS_MSR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[MSR_IDX] - (void *)&dmy_ctxt)
|
/* These are dummy structures used only for obtaining the offsets of the
|
||||||
-#define UC_MCONTEXT_GREGS_ORIG_GPR3 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[ORIG_GPR3_IDX] - (void *)&dmy_ctxt)
|
various structure members. */
|
||||||
-#define UC_MCONTEXT_GREGS_CTR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[CTR_IDX] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_LINK ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[LINK_IDX] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_XER ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[XER_IDX] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_CCR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[CCR_IDX] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_SOFTE ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[SOFTE_IDX] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_TRAP ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[TRAP_IDX] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_DAR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[DAR_IDX] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_DSISR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[DSISR_IDX] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_GREGS_RESULT ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[RESULT_IDX] - (void *)&dmy_ctxt)
|
|
||||||
+#define UC_MCONTEXT_GREGS_MSR UC_MCONTEXT_OFFSET(gregs[MSR_IDX])
|
|
||||||
+#define UC_MCONTEXT_GREGS_ORIG_GPR3 UC_MCONTEXT_OFFSET(gregs[ORIG_GPR3_IDX])
|
|
||||||
+#define UC_MCONTEXT_GREGS_CTR UC_MCONTEXT_OFFSET(gregs[CTR_IDX])
|
|
||||||
+#define UC_MCONTEXT_GREGS_LINK UC_MCONTEXT_OFFSET(gregs[LINK_IDX])
|
|
||||||
+#define UC_MCONTEXT_GREGS_XER UC_MCONTEXT_OFFSET(gregs[XER_IDX])
|
|
||||||
+#define UC_MCONTEXT_GREGS_CCR UC_MCONTEXT_OFFSET(gregs[CCR_IDX])
|
|
||||||
+#define UC_MCONTEXT_GREGS_SOFTE UC_MCONTEXT_OFFSET(gregs[SOFTE_IDX])
|
|
||||||
+#define UC_MCONTEXT_GREGS_TRAP UC_MCONTEXT_OFFSET(gregs[TRAP_IDX])
|
|
||||||
+#define UC_MCONTEXT_GREGS_DAR UC_MCONTEXT_OFFSET(gregs[DAR_IDX])
|
|
||||||
+#define UC_MCONTEXT_GREGS_DSISR UC_MCONTEXT_OFFSET(gregs[DSISR_IDX])
|
|
||||||
+#define UC_MCONTEXT_GREGS_RESULT UC_MCONTEXT_OFFSET(gregs[RESULT_IDX])
|
|
||||||
|
|
||||||
-#define UC_MCONTEXT_FREGS_R0 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[0] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R1 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[1] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R2 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[2] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R3 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[3] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R4 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[4] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R5 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[5] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R6 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[6] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R7 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[7] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R8 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[8] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R9 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[9] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R10 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[10] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R11 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[11] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R12 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[12] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R13 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[13] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R14 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[14] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R15 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[15] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R16 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[16] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R17 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[17] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R18 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[18] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R19 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[19] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R20 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[20] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R21 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[21] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R22 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[22] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R23 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[23] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R24 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[24] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R25 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[25] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R26 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[26] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R27 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[27] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R28 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[28] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R29 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[29] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R30 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[30] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_R31 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[31] - (void *)&dmy_ctxt)
|
|
||||||
-#define UC_MCONTEXT_FREGS_FPSCR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[32] - (void *)&dmy_ctxt)
|
|
||||||
+#define UC_MCONTEXT_FREGS_R0 UC_MCONTEXT_OFFSET(fpregs.fpregs[0])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R1 UC_MCONTEXT_OFFSET(fpregs.fpregs[1])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R2 UC_MCONTEXT_OFFSET(fpregs.fpregs[2])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R3 UC_MCONTEXT_OFFSET(fpregs.fpregs[3])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R4 UC_MCONTEXT_OFFSET(fpregs.fpregs[4])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R5 UC_MCONTEXT_OFFSET(fpregs.fpregs[5])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R6 UC_MCONTEXT_OFFSET(fpregs.fpregs[6])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R7 UC_MCONTEXT_OFFSET(fpregs.fpregs[7])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R8 UC_MCONTEXT_OFFSET(fpregs.fpregs[8])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R9 UC_MCONTEXT_OFFSET(fpregs.fpregs[9])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R10 UC_MCONTEXT_OFFSET(fpregs.fpregs[10])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R11 UC_MCONTEXT_OFFSET(fpregs.fpregs[11])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R12 UC_MCONTEXT_OFFSET(fpregs.fpregs[12])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R13 UC_MCONTEXT_OFFSET(fpregs.fpregs[13])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R14 UC_MCONTEXT_OFFSET(fpregs.fpregs[14])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R15 UC_MCONTEXT_OFFSET(fpregs.fpregs[15])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R16 UC_MCONTEXT_OFFSET(fpregs.fpregs[16])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R17 UC_MCONTEXT_OFFSET(fpregs.fpregs[17])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R18 UC_MCONTEXT_OFFSET(fpregs.fpregs[18])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R19 UC_MCONTEXT_OFFSET(fpregs.fpregs[19])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R20 UC_MCONTEXT_OFFSET(fpregs.fpregs[20])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R21 UC_MCONTEXT_OFFSET(fpregs.fpregs[21])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R22 UC_MCONTEXT_OFFSET(fpregs.fpregs[22])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R23 UC_MCONTEXT_OFFSET(fpregs.fpregs[23])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R24 UC_MCONTEXT_OFFSET(fpregs.fpregs[24])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R25 UC_MCONTEXT_OFFSET(fpregs.fpregs[25])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R26 UC_MCONTEXT_OFFSET(fpregs.fpregs[26])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R27 UC_MCONTEXT_OFFSET(fpregs.fpregs[27])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R28 UC_MCONTEXT_OFFSET(fpregs.fpregs[28])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R29 UC_MCONTEXT_OFFSET(fpregs.fpregs[29])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R30 UC_MCONTEXT_OFFSET(fpregs.fpregs[30])
|
|
||||||
+#define UC_MCONTEXT_FREGS_R31 UC_MCONTEXT_OFFSET(fpregs.fpregs[31])
|
|
||||||
+#define UC_MCONTEXT_FREGS_FPSCR UC_MCONTEXT_OFFSET(fpregs.fpregs[32])
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -36,10 +36,6 @@ config MBEDTLS_RIPEMD160_C
|
|||||||
bool "MBEDTLS_RIPEMD160_C"
|
bool "MBEDTLS_RIPEMD160_C"
|
||||||
default n
|
default n
|
||||||
|
|
||||||
config MBEDTLS_XTEA_C
|
|
||||||
bool "MBEDTLS_XTEA_C"
|
|
||||||
default n
|
|
||||||
|
|
||||||
config MBEDTLS_RSA_NO_CRT
|
config MBEDTLS_RSA_NO_CRT
|
||||||
bool "MBEDTLS_RSA_NO_CRT"
|
bool "MBEDTLS_RSA_NO_CRT"
|
||||||
default y
|
default y
|
||||||
@ -140,15 +136,11 @@ config MBEDTLS_ECP_DP_CURVE448_ENABLED
|
|||||||
|
|
||||||
comment "Build Options - unselect features to reduce binary size"
|
comment "Build Options - unselect features to reduce binary size"
|
||||||
|
|
||||||
config MBEDTLS_ARMV8CE_AES_C
|
config MBEDTLS_AESCE_C
|
||||||
bool "MBEDTLS_ARMV8CE_AES_C"
|
bool "MBEDTLS_AESCE_C"
|
||||||
default y
|
default y
|
||||||
depends on aarch64 && !TARGET_bcm27xx
|
depends on aarch64 && !TARGET_bcm27xx
|
||||||
|
|
||||||
config MBEDTLS_CERTS_C
|
|
||||||
bool "MBEDTLS_CERTS_C"
|
|
||||||
default n
|
|
||||||
|
|
||||||
config MBEDTLS_CIPHER_MODE_OFB
|
config MBEDTLS_CIPHER_MODE_OFB
|
||||||
bool "MBEDTLS_CIPHER_MODE_OFB"
|
bool "MBEDTLS_CIPHER_MODE_OFB"
|
||||||
default n
|
default n
|
||||||
@ -178,10 +170,6 @@ config MBEDTLS_SELF_TEST
|
|||||||
bool "MBEDTLS_SELF_TEST"
|
bool "MBEDTLS_SELF_TEST"
|
||||||
default n
|
default n
|
||||||
|
|
||||||
config MBEDTLS_SSL_TRUNCATED_HMAC
|
|
||||||
bool "MBEDTLS_SSL_TRUNCATED_HMAC"
|
|
||||||
default n
|
|
||||||
|
|
||||||
config MBEDTLS_THREADING_C
|
config MBEDTLS_THREADING_C
|
||||||
bool "MBEDTLS_THREADING_C"
|
bool "MBEDTLS_THREADING_C"
|
||||||
default y
|
default y
|
||||||
@ -197,6 +185,43 @@ config MBEDTLS_VERSION_FEATURES
|
|||||||
bool "MBEDTLS_VERSION_FEATURES"
|
bool "MBEDTLS_VERSION_FEATURES"
|
||||||
default n
|
default n
|
||||||
|
|
||||||
|
config MBEDTLS_PSA_CRYPTO_CLIENT
|
||||||
|
bool "MBEDTLS_PSA_CRYPTO_CLIENT"
|
||||||
|
|
||||||
|
config MBEDTLS_DEPRECATED_WARNING
|
||||||
|
bool "MBEDTLS_DEPRECATED_WARNING"
|
||||||
|
default n
|
||||||
|
|
||||||
|
config MBEDTLS_SSL_PROTO_TLS1_2
|
||||||
|
bool "MBEDTLS_SSL_PROTO_TLS1_2"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config MBEDTLS_SSL_PROTO_TLS1_3
|
||||||
|
bool "MBEDTLS_SSL_PROTO_TLS1_3"
|
||||||
|
select MBEDTLS_PSA_CRYPTO_CLIENT
|
||||||
|
select MBEDTLS_HKDF_C
|
||||||
|
default y
|
||||||
|
|
||||||
|
config MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
||||||
|
bool "MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE"
|
||||||
|
depends on MBEDTLS_SSL_PROTO_TLS1_3
|
||||||
|
default y
|
||||||
|
|
||||||
|
config MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED
|
||||||
|
bool "MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED"
|
||||||
|
depends on MBEDTLS_SSL_PROTO_TLS1_3
|
||||||
|
default y
|
||||||
|
|
||||||
|
config MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED
|
||||||
|
bool "MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED"
|
||||||
|
depends on MBEDTLS_SSL_PROTO_TLS1_3
|
||||||
|
default y
|
||||||
|
|
||||||
|
config MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
|
||||||
|
bool "MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED"
|
||||||
|
depends on MBEDTLS_SSL_PROTO_TLS1_3
|
||||||
|
default y
|
||||||
|
|
||||||
comment "Build Options"
|
comment "Build Options"
|
||||||
|
|
||||||
config MBEDTLS_ENTROPY_FORCE_SHA256
|
config MBEDTLS_ENTROPY_FORCE_SHA256
|
||||||
@ -205,6 +230,7 @@ config MBEDTLS_ENTROPY_FORCE_SHA256
|
|||||||
|
|
||||||
config MBEDTLS_SSL_RENEGOTIATION
|
config MBEDTLS_SSL_RENEGOTIATION
|
||||||
bool "MBEDTLS_SSL_RENEGOTIATION"
|
bool "MBEDTLS_SSL_RENEGOTIATION"
|
||||||
|
depends on MBEDTLS_SSL_PROTO_TLS1_2
|
||||||
default n
|
default n
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
@ -8,13 +8,14 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=mbedtls
|
PKG_NAME:=mbedtls
|
||||||
PKG_VERSION:=2.28.8
|
PKG_VERSION:=3.6.0
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto
|
PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)?
|
PKG_SOURCE_URL=https://github.com/Mbed-TLS/mbedtls.git
|
||||||
PKG_HASH:=4fef7de0d8d542510d726d643350acb3cdb9dc76ad45611b59c9aa08372b4213
|
PKG_SOURCE_VERSION:=2ca6c285a0dd3f33982dd57299012dacab1ff206
|
||||||
|
PKG_MIRROR_HASH:=a684012126590b4e0b6ab41e244cc2af0d2bcfc4b6c94bf42fc37d2d08f0553e
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0-or-later
|
PKG_LICENSE:=GPL-2.0-or-later
|
||||||
PKG_LICENSE_FILES:=gpl-2.0.txt
|
PKG_LICENSE_FILES:=gpl-2.0.txt
|
||||||
@ -55,13 +56,14 @@ MBEDTLS_BUILD_OPTS_CIPHERS= \
|
|||||||
CONFIG_MBEDTLS_NIST_KW_C \
|
CONFIG_MBEDTLS_NIST_KW_C \
|
||||||
CONFIG_MBEDTLS_RIPEMD160_C \
|
CONFIG_MBEDTLS_RIPEMD160_C \
|
||||||
CONFIG_MBEDTLS_RSA_NO_CRT \
|
CONFIG_MBEDTLS_RSA_NO_CRT \
|
||||||
CONFIG_MBEDTLS_XTEA_C
|
CONFIG_MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED \
|
||||||
|
CONFIG_MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \
|
||||||
|
CONFIG_MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED
|
||||||
|
|
||||||
MBEDTLS_BUILD_OPTS= \
|
MBEDTLS_BUILD_OPTS= \
|
||||||
$(MBEDTLS_BUILD_OPTS_CURVES) \
|
$(MBEDTLS_BUILD_OPTS_CURVES) \
|
||||||
$(MBEDTLS_BUILD_OPTS_CIPHERS) \
|
$(MBEDTLS_BUILD_OPTS_CIPHERS) \
|
||||||
CONFIG_MBEDTLS_ARMV8CE_AES_C \
|
CONFIG_MBEDTLS_AESCE_C \
|
||||||
CONFIG_MBEDTLS_CERTS_C \
|
|
||||||
CONFIG_MBEDTLS_CIPHER_MODE_OFB \
|
CONFIG_MBEDTLS_CIPHER_MODE_OFB \
|
||||||
CONFIG_MBEDTLS_CIPHER_MODE_XTS \
|
CONFIG_MBEDTLS_CIPHER_MODE_XTS \
|
||||||
CONFIG_MBEDTLS_DEBUG_C \
|
CONFIG_MBEDTLS_DEBUG_C \
|
||||||
@ -71,11 +73,15 @@ MBEDTLS_BUILD_OPTS= \
|
|||||||
CONFIG_MBEDTLS_PLATFORM_C \
|
CONFIG_MBEDTLS_PLATFORM_C \
|
||||||
CONFIG_MBEDTLS_SELF_TEST \
|
CONFIG_MBEDTLS_SELF_TEST \
|
||||||
CONFIG_MBEDTLS_SSL_RENEGOTIATION \
|
CONFIG_MBEDTLS_SSL_RENEGOTIATION \
|
||||||
CONFIG_MBEDTLS_SSL_TRUNCATED_HMAC \
|
|
||||||
CONFIG_MBEDTLS_THREADING_C \
|
CONFIG_MBEDTLS_THREADING_C \
|
||||||
CONFIG_MBEDTLS_THREADING_PTHREAD \
|
CONFIG_MBEDTLS_THREADING_PTHREAD \
|
||||||
CONFIG_MBEDTLS_VERSION_C \
|
CONFIG_MBEDTLS_VERSION_C \
|
||||||
CONFIG_MBEDTLS_VERSION_FEATURES
|
CONFIG_MBEDTLS_VERSION_FEATURES \
|
||||||
|
CONFIG_MBEDTLS_PSA_CRYPTO_CLIENT \
|
||||||
|
CONFIG_MBEDTLS_DEPRECATED_WARNING \
|
||||||
|
CONFIG_MBEDTLS_SSL_PROTO_TLS1_2 \
|
||||||
|
CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 \
|
||||||
|
CONFIG_MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE
|
||||||
|
|
||||||
PKG_CONFIG_DEPENDS := $(MBEDTLS_BUILD_OPTS)
|
PKG_CONFIG_DEPENDS := $(MBEDTLS_BUILD_OPTS)
|
||||||
|
|
||||||
@ -98,7 +104,7 @@ $(call Package/mbedtls/Default)
|
|||||||
CATEGORY:=Libraries
|
CATEGORY:=Libraries
|
||||||
SUBMENU:=SSL
|
SUBMENU:=SSL
|
||||||
TITLE+= (library)
|
TITLE+= (library)
|
||||||
ABI_VERSION:=13
|
ABI_VERSION:=21
|
||||||
MENU:=1
|
MENU:=1
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@ -126,7 +132,7 @@ CSR generation (gen_key, cert_req)
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS))
|
TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS))
|
||||||
ifneq ($(CONFIG_MBEDTLS_ARMV8CE_AES_C),)
|
ifneq ($(CONFIG_MBEDTLS_AESCE_C),)
|
||||||
TARGET_CFLAGS := $(filter-out -march=%,$(TARGET_CFLAGS)) -march=armv8-a+crypto
|
TARGET_CFLAGS := $(filter-out -march=%,$(TARGET_CFLAGS)) -march=armv8-a+crypto
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -142,7 +148,7 @@ define Build/Prepare
|
|||||||
$(if $(strip $(foreach opt,$(MBEDTLS_BUILD_OPTS),$($(opt)))),
|
$(if $(strip $(foreach opt,$(MBEDTLS_BUILD_OPTS),$($(opt)))),
|
||||||
$(foreach opt,$(MBEDTLS_BUILD_OPTS),
|
$(foreach opt,$(MBEDTLS_BUILD_OPTS),
|
||||||
$(PKG_BUILD_DIR)/scripts/config.py \
|
$(PKG_BUILD_DIR)/scripts/config.py \
|
||||||
-f $(PKG_BUILD_DIR)/include/mbedtls/config.h \
|
-f $(PKG_BUILD_DIR)/include/mbedtls/mbedtls_config.h \
|
||||||
$(if $($(opt)),set,unset) $(patsubst CONFIG_%,%,$(opt))),)
|
$(if $($(opt)),set,unset) $(patsubst CONFIG_%,%,$(opt))),)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@ -155,6 +161,12 @@ define Build/InstallDev
|
|||||||
$(INSTALL_DIR) $(1)/usr/lib
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
|
||||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.a $(1)/usr/lib/
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.a $(1)/usr/lib/
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||||
|
$(CP) \
|
||||||
|
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/mbedcrypto.pc \
|
||||||
|
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/mbedtls.pc \
|
||||||
|
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/mbedx509.pc \
|
||||||
|
$(1)/usr/lib/pkgconfig/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/libmbedtls/install
|
define Package/libmbedtls/install
|
||||||
|
@ -1,197 +0,0 @@
|
|||||||
From eb9d4fdf1846e688d51d86a9a50f0312aca2af25 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Glenn Strauss <gstrauss@gluelogic.com>
|
|
||||||
Date: Sun, 23 Oct 2022 19:48:18 -0400
|
|
||||||
Subject: [PATCH] x509 crt verify SAN iPAddress
|
|
||||||
|
|
||||||
Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
|
|
||||||
---
|
|
||||||
include/mbedtls/x509_crt.h | 2 +-
|
|
||||||
library/x509_crt.c | 126 ++++++++++++++++++++++++++++++-------
|
|
||||||
2 files changed, 103 insertions(+), 25 deletions(-)
|
|
||||||
|
|
||||||
--- a/include/mbedtls/x509_crt.h
|
|
||||||
+++ b/include/mbedtls/x509_crt.h
|
|
||||||
@@ -596,7 +596,7 @@ int mbedtls_x509_crt_verify_info(char *b
|
|
||||||
* \param cn The expected Common Name. This will be checked to be
|
|
||||||
* present in the certificate's subjectAltNames extension or,
|
|
||||||
* if this extension is absent, as a CN component in its
|
|
||||||
- * Subject name. Currently only DNS names are supported. This
|
|
||||||
+ * Subject name. DNS names and IP addresses are supported. This
|
|
||||||
* may be \c NULL if the CN need not be verified.
|
|
||||||
* \param flags The address at which to store the result of the verification.
|
|
||||||
* If the verification couldn't be completed, the flag value is
|
|
||||||
--- a/library/x509_crt.c
|
|
||||||
+++ b/library/x509_crt.c
|
|
||||||
@@ -45,6 +45,10 @@
|
|
||||||
|
|
||||||
#if defined(MBEDTLS_HAVE_TIME)
|
|
||||||
#if defined(_WIN32) && !defined(EFIX64) && !defined(EFI32)
|
|
||||||
+#define WIN32_LEAN_AND_MEAN
|
|
||||||
+#ifndef _WIN32_WINNT
|
|
||||||
+#define _WIN32_WINNT 0x0600
|
|
||||||
+#endif
|
|
||||||
#include <windows.h>
|
|
||||||
#else
|
|
||||||
#include <time.h>
|
|
||||||
@@ -2990,6 +2994,61 @@ find_parent:
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+#ifdef _WIN32
|
|
||||||
+#ifdef _MSC_VER
|
|
||||||
+#pragma comment(lib, "ws2_32.lib")
|
|
||||||
+#include <winsock2.h>
|
|
||||||
+#include <ws2tcpip.h>
|
|
||||||
+#elif (defined(__MINGW32__) || defined(__MINGW64__)) && _WIN32_WINNT >= 0x0600
|
|
||||||
+#include <winsock2.h>
|
|
||||||
+#include <ws2tcpip.h>
|
|
||||||
+#endif
|
|
||||||
+#elif defined(__sun)
|
|
||||||
+/* Solaris requires -lsocket -lnsl for inet_pton() */
|
|
||||||
+#elif defined(__has_include)
|
|
||||||
+#if __has_include(<sys/socket.h>)
|
|
||||||
+#include <sys/socket.h>
|
|
||||||
+#endif
|
|
||||||
+#if __has_include(<arpa/inet.h>)
|
|
||||||
+#include <arpa/inet.h>
|
|
||||||
+#endif
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+/* Use whether or not AF_INET6 is defined to indicate whether or not to use
|
|
||||||
+ * the platform inet_pton() or a local implementation (below). The local
|
|
||||||
+ * implementation may be used even in cases where the platform provides
|
|
||||||
+ * inet_pton(), e.g. when there are different includes required and/or the
|
|
||||||
+ * platform implementation requires dependencies on additional libraries.
|
|
||||||
+ * Specifically, Windows requires custom includes and additional link
|
|
||||||
+ * dependencies, and Solaris requires additional link dependencies.
|
|
||||||
+ * Also, as a coarse heuristic, use the local implementation if the compiler
|
|
||||||
+ * does not support __has_include(), or if the definition of AF_INET6 is not
|
|
||||||
+ * provided by headers included (or not) via __has_include() above. */
|
|
||||||
+#ifndef AF_INET6
|
|
||||||
+
|
|
||||||
+#define x509_cn_inet_pton(cn, dst) (0)
|
|
||||||
+
|
|
||||||
+#else
|
|
||||||
+
|
|
||||||
+static int x509_inet_pton_ipv6(const char *src, void *dst)
|
|
||||||
+{
|
|
||||||
+ return inet_pton(AF_INET6, src, dst) == 1 ? 0 : -1;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int x509_inet_pton_ipv4(const char *src, void *dst)
|
|
||||||
+{
|
|
||||||
+ return inet_pton(AF_INET, src, dst) == 1 ? 0 : -1;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+#endif /* AF_INET6 */
|
|
||||||
+
|
|
||||||
+static size_t x509_cn_inet_pton(const char *cn, void *dst)
|
|
||||||
+{
|
|
||||||
+ return strchr(cn, ':') == NULL
|
|
||||||
+ ? x509_inet_pton_ipv4(cn, dst) == 0 ? 4 : 0
|
|
||||||
+ : x509_inet_pton_ipv6(cn, dst) == 0 ? 16 : 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
* Check for CN match
|
|
||||||
*/
|
|
||||||
@@ -3010,24 +3069,51 @@ static int x509_crt_check_cn(const mbedt
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
+static int x509_crt_check_san_ip(const mbedtls_x509_sequence *san,
|
|
||||||
+ const char *cn, size_t cn_len)
|
|
||||||
+{
|
|
||||||
+ uint32_t ip[4];
|
|
||||||
+ cn_len = x509_cn_inet_pton(cn, ip);
|
|
||||||
+ if (cn_len == 0) {
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ for (const mbedtls_x509_sequence *cur = san; cur != NULL; cur = cur->next) {
|
|
||||||
+ const unsigned char san_type = (unsigned char) cur->buf.tag &
|
|
||||||
+ MBEDTLS_ASN1_TAG_VALUE_MASK;
|
|
||||||
+ if (san_type == MBEDTLS_X509_SAN_IP_ADDRESS &&
|
|
||||||
+ cur->buf.len == cn_len && memcmp(cur->buf.p, ip, cn_len) == 0) {
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return -1;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
* Check for SAN match, see RFC 5280 Section 4.2.1.6
|
|
||||||
*/
|
|
||||||
-static int x509_crt_check_san(const mbedtls_x509_buf *name,
|
|
||||||
+static int x509_crt_check_san(const mbedtls_x509_sequence *san,
|
|
||||||
const char *cn, size_t cn_len)
|
|
||||||
{
|
|
||||||
- const unsigned char san_type = (unsigned char) name->tag &
|
|
||||||
- MBEDTLS_ASN1_TAG_VALUE_MASK;
|
|
||||||
-
|
|
||||||
- /* dNSName */
|
|
||||||
- if (san_type == MBEDTLS_X509_SAN_DNS_NAME) {
|
|
||||||
- return x509_crt_check_cn(name, cn, cn_len);
|
|
||||||
+ int san_ip = 0;
|
|
||||||
+ for (const mbedtls_x509_sequence *cur = san; cur != NULL; cur = cur->next) {
|
|
||||||
+ switch ((unsigned char) cur->buf.tag & MBEDTLS_ASN1_TAG_VALUE_MASK) {
|
|
||||||
+ case MBEDTLS_X509_SAN_DNS_NAME: /* dNSName */
|
|
||||||
+ if (x509_crt_check_cn(&cur->buf, cn, cn_len) == 0) {
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+ break;
|
|
||||||
+ case MBEDTLS_X509_SAN_IP_ADDRESS: /* iPAddress */
|
|
||||||
+ san_ip = 1;
|
|
||||||
+ break;
|
|
||||||
+ /* (We may handle other types here later.) */
|
|
||||||
+ default: /* Unrecognized type */
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
- /* (We may handle other types here later.) */
|
|
||||||
-
|
|
||||||
- /* Unrecognized type */
|
|
||||||
- return -1;
|
|
||||||
+ return san_ip ? x509_crt_check_san_ip(san, cn, cn_len) : -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
@@ -3038,31 +3124,23 @@ static void x509_crt_verify_name(const m
|
|
||||||
uint32_t *flags)
|
|
||||||
{
|
|
||||||
const mbedtls_x509_name *name;
|
|
||||||
- const mbedtls_x509_sequence *cur;
|
|
||||||
size_t cn_len = strlen(cn);
|
|
||||||
|
|
||||||
if (crt->ext_types & MBEDTLS_X509_EXT_SUBJECT_ALT_NAME) {
|
|
||||||
- for (cur = &crt->subject_alt_names; cur != NULL; cur = cur->next) {
|
|
||||||
- if (x509_crt_check_san(&cur->buf, cn, cn_len) == 0) {
|
|
||||||
- break;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (cur == NULL) {
|
|
||||||
- *flags |= MBEDTLS_X509_BADCERT_CN_MISMATCH;
|
|
||||||
+ if (x509_crt_check_san(&crt->subject_alt_names, cn, cn_len) == 0) {
|
|
||||||
+ return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (name = &crt->subject; name != NULL; name = name->next) {
|
|
||||||
if (MBEDTLS_OID_CMP(MBEDTLS_OID_AT_CN, &name->oid) == 0 &&
|
|
||||||
x509_crt_check_cn(&name->val, cn, cn_len) == 0) {
|
|
||||||
- break;
|
|
||||||
+ return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (name == NULL) {
|
|
||||||
- *flags |= MBEDTLS_X509_BADCERT_CN_MISMATCH;
|
|
||||||
- }
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ *flags |= MBEDTLS_X509_BADCERT_CN_MISMATCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
@ -1,7 +1,8 @@
|
|||||||
--- a/programs/CMakeLists.txt
|
--- a/programs/CMakeLists.txt
|
||||||
+++ b/programs/CMakeLists.txt
|
+++ b/programs/CMakeLists.txt
|
||||||
@@ -1,12 +1,8 @@
|
@@ -1,13 +1,9 @@
|
||||||
add_subdirectory(aes)
|
add_subdirectory(aes)
|
||||||
|
add_subdirectory(cipher)
|
||||||
-if (NOT WIN32)
|
-if (NOT WIN32)
|
||||||
- add_subdirectory(fuzz)
|
- add_subdirectory(fuzz)
|
||||||
-endif()
|
-endif()
|
||||||
|
@ -1,390 +0,0 @@
|
|||||||
From dfb6015ca79a9fee28f7fcb0af7e350a83574b83 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "Markku-Juhani O. Saarinen" <mjos@mjos.fi>
|
|
||||||
Date: Mon, 20 Nov 2017 14:58:41 +0000
|
|
||||||
Subject: Implements AES and GCM with ARMv8 Crypto Extensions
|
|
||||||
|
|
||||||
A compact patch that provides AES and GCM implementations that utilize the
|
|
||||||
ARMv8 Crypto Extensions. The config flag is MBEDTLS_ARMV8CE_AES_C, which
|
|
||||||
is disabled by default as we don't do runtime checking for the feature.
|
|
||||||
The new implementation lives in armv8ce_aes.c.
|
|
||||||
|
|
||||||
Provides similar functionality to https://github.com/ARMmbed/mbedtls/pull/432
|
|
||||||
Thanks to Barry O'Rourke and others for that contribtion.
|
|
||||||
|
|
||||||
Tested on a Cortex A53 device and QEMU. On a midrange phone the real AES-GCM
|
|
||||||
throughput increases about 4x, while raw AES speed is up to 10x faster.
|
|
||||||
|
|
||||||
When cross-compiling, you want to set something like:
|
|
||||||
|
|
||||||
export CC='aarch64-linux-gnu-gcc'
|
|
||||||
export CFLAGS='-Ofast -march=armv8-a+crypto'
|
|
||||||
scripts/config.pl set MBEDTLS_ARMV8CE_AES_C
|
|
||||||
|
|
||||||
QEMU seems to also need
|
|
||||||
|
|
||||||
export LDFLAGS='-static'
|
|
||||||
|
|
||||||
Then run normal make or cmake etc.
|
|
||||||
---
|
|
||||||
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/ChangeLog.d/armv8_crypto_extensions.txt
|
|
||||||
@@ -0,0 +1,2 @@
|
|
||||||
+Features
|
|
||||||
+ * Support ARMv8 Cryptography Extensions for AES and GCM.
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/include/mbedtls/armv8ce_aes.h
|
|
||||||
@@ -0,0 +1,63 @@
|
|
||||||
+/**
|
|
||||||
+ * \file armv8ce_aes.h
|
|
||||||
+ *
|
|
||||||
+ * \brief ARMv8 Cryptography Extensions -- Optimized code for AES and GCM
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+/*
|
|
||||||
+ *
|
|
||||||
+ * Copyright (C) 2006-2017, ARM Limited, All Rights Reserved
|
|
||||||
+ * SPDX-License-Identifier: Apache-2.0
|
|
||||||
+ *
|
|
||||||
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
+ * not use this file except in compliance with the License.
|
|
||||||
+ * You may obtain a copy of the License at
|
|
||||||
+ *
|
|
||||||
+ * http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
+ *
|
|
||||||
+ * Unless required by applicable law or agreed to in writing, software
|
|
||||||
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
+ * See the License for the specific language governing permissions and
|
|
||||||
+ * limitations under the License.
|
|
||||||
+ *
|
|
||||||
+ * This file is part of mbed TLS (https://tls.mbed.org)
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+#ifndef MBEDTLS_ARMV8CE_AES_H
|
|
||||||
+#define MBEDTLS_ARMV8CE_AES_H
|
|
||||||
+
|
|
||||||
+#include "aes.h"
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * \brief [ARMv8 Crypto Extensions] AES-ECB block en(de)cryption
|
|
||||||
+ *
|
|
||||||
+ * \param ctx AES context
|
|
||||||
+ * \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT
|
|
||||||
+ * \param input 16-byte input block
|
|
||||||
+ * \param output 16-byte output block
|
|
||||||
+ *
|
|
||||||
+ * \return 0 on success (cannot fail)
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+int mbedtls_armv8ce_aes_crypt_ecb( mbedtls_aes_context *ctx,
|
|
||||||
+ int mode,
|
|
||||||
+ const unsigned char input[16],
|
|
||||||
+ unsigned char output[16] );
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * \brief [ARMv8 Crypto Extensions] Multiply in GF(2^128) for GCM
|
|
||||||
+ *
|
|
||||||
+ * \param c Result
|
|
||||||
+ * \param a First operand
|
|
||||||
+ * \param b Second operand
|
|
||||||
+ *
|
|
||||||
+ * \note Both operands and result are bit strings interpreted as
|
|
||||||
+ * elements of GF(2^128) as per the GCM spec.
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+void mbedtls_armv8ce_gcm_mult( unsigned char c[16],
|
|
||||||
+ const unsigned char a[16],
|
|
||||||
+ const unsigned char b[16] );
|
|
||||||
+
|
|
||||||
+#endif /* MBEDTLS_ARMV8CE_AES_H */
|
|
||||||
--- a/include/mbedtls/check_config.h
|
|
||||||
+++ b/include/mbedtls/check_config.h
|
|
||||||
@@ -57,6 +57,10 @@
|
|
||||||
#error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#if defined(MBEDTLS_ARMV8CE_AES_C) && !defined(MBEDTLS_HAVE_ASM)
|
|
||||||
+#error "MBEDTLS_ARMV8CE_AES_C defined, but not all prerequisites"
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C)
|
|
||||||
#error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites"
|
|
||||||
#endif
|
|
||||||
@@ -947,3 +951,4 @@ typedef int mbedtls_iso_c_forbids_empty_
|
|
||||||
|
|
||||||
/* *INDENT-ON* */
|
|
||||||
#endif /* MBEDTLS_CHECK_CONFIG_H */
|
|
||||||
+
|
|
||||||
--- a/include/mbedtls/config.h
|
|
||||||
+++ b/include/mbedtls/config.h
|
|
||||||
@@ -34,6 +34,7 @@
|
|
||||||
* Requires support for asm() in compiler.
|
|
||||||
*
|
|
||||||
* Used in:
|
|
||||||
+ * library/armv8ce_aes.c
|
|
||||||
* library/aria.c
|
|
||||||
* library/timing.c
|
|
||||||
* include/mbedtls/bn_mul.h
|
|
||||||
@@ -2462,6 +2463,21 @@
|
|
||||||
#define MBEDTLS_AESNI_C
|
|
||||||
|
|
||||||
/**
|
|
||||||
+ * \def MBEDTLS_ARMV8CE_AES_C
|
|
||||||
+ *
|
|
||||||
+ * Enable ARMv8 Crypto Extensions for AES and GCM
|
|
||||||
+ *
|
|
||||||
+ * Module: library/armv8ce_aes.c
|
|
||||||
+ * Caller: library/aes.c
|
|
||||||
+ * library/gcm.c
|
|
||||||
+ *
|
|
||||||
+ * Requires: MBEDTLS_HAVE_ASM
|
|
||||||
+ *
|
|
||||||
+ * This module adds support for Armv8 Cryptography Extensions for AES and GCM.
|
|
||||||
+ */
|
|
||||||
+//#define MBEDTLS_ARMV8CE_AES_C
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
* \def MBEDTLS_AES_C
|
|
||||||
*
|
|
||||||
* Enable the AES block cipher.
|
|
||||||
--- a/library/aes.c
|
|
||||||
+++ b/library/aes.c
|
|
||||||
@@ -27,7 +27,9 @@
|
|
||||||
#if defined(MBEDTLS_AESNI_C)
|
|
||||||
#include "mbedtls/aesni.h"
|
|
||||||
#endif
|
|
||||||
-
|
|
||||||
+#if defined(MBEDTLS_ARMV8CE_AES_C)
|
|
||||||
+#include "mbedtls/armv8ce_aes.h"
|
|
||||||
+#endif
|
|
||||||
#include "mbedtls/platform.h"
|
|
||||||
|
|
||||||
#if !defined(MBEDTLS_AES_ALT)
|
|
||||||
@@ -1064,6 +1066,11 @@ int mbedtls_aes_crypt_ecb(mbedtls_aes_co
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#if defined(MBEDTLS_ARMV8CE_AES_C)
|
|
||||||
+ // We don't do runtime checking for ARMv8 Crypto Extensions
|
|
||||||
+ return mbedtls_armv8ce_aes_crypt_ecb( ctx, mode, input, output );
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#if defined(MBEDTLS_VIA_PADLOCK_HAVE_CODE)
|
|
||||||
if (aes_padlock_ace) {
|
|
||||||
return mbedtls_padlock_xcryptecb(ctx, mode, input, output);
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/library/armv8ce_aes.c
|
|
||||||
@@ -0,0 +1,142 @@
|
|
||||||
+/*
|
|
||||||
+ * ARMv8 Cryptography Extensions -- Optimized code for AES and GCM
|
|
||||||
+ *
|
|
||||||
+ * Copyright (C) 2006-2017, ARM Limited, All Rights Reserved
|
|
||||||
+ * SPDX-License-Identifier: Apache-2.0
|
|
||||||
+ *
|
|
||||||
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
+ * not use this file except in compliance with the License.
|
|
||||||
+ * You may obtain a copy of the License at
|
|
||||||
+ *
|
|
||||||
+ * http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
+ *
|
|
||||||
+ * Unless required by applicable law or agreed to in writing, software
|
|
||||||
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
+ * See the License for the specific language governing permissions and
|
|
||||||
+ * limitations under the License.
|
|
||||||
+ *
|
|
||||||
+ * This file is part of mbed TLS (https://tls.mbed.org)
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+#if !defined(MBEDTLS_CONFIG_FILE)
|
|
||||||
+#include "mbedtls/config.h"
|
|
||||||
+#else
|
|
||||||
+#include MBEDTLS_CONFIG_FILE
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+#if defined(MBEDTLS_ARMV8CE_AES_C)
|
|
||||||
+
|
|
||||||
+#include <arm_neon.h>
|
|
||||||
+#include "mbedtls/armv8ce_aes.h"
|
|
||||||
+
|
|
||||||
+#ifndef asm
|
|
||||||
+#define asm __asm
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+/*
|
|
||||||
+ * [Armv8 Cryptography Extensions] AES-ECB block en(de)cryption
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+#if defined(MBEDTLS_AES_C)
|
|
||||||
+
|
|
||||||
+int mbedtls_armv8ce_aes_crypt_ecb( mbedtls_aes_context *ctx,
|
|
||||||
+ int mode,
|
|
||||||
+ const unsigned char input[16],
|
|
||||||
+ unsigned char output[16] )
|
|
||||||
+{
|
|
||||||
+ unsigned int i;
|
|
||||||
+ const uint8_t *rk;
|
|
||||||
+ uint8x16_t x, k;
|
|
||||||
+
|
|
||||||
+ x = vld1q_u8( input ); /* input block */
|
|
||||||
+ rk = (const uint8_t *) ctx->rk; /* round keys */
|
|
||||||
+
|
|
||||||
+ if( mode == MBEDTLS_AES_ENCRYPT )
|
|
||||||
+ {
|
|
||||||
+ for( i = ctx->nr - 1; i != 0; i-- ) /* encryption loop */
|
|
||||||
+ {
|
|
||||||
+ k = vld1q_u8( rk );
|
|
||||||
+ rk += 16;
|
|
||||||
+ x = vaeseq_u8( x, k );
|
|
||||||
+ x = vaesmcq_u8( x );
|
|
||||||
+ }
|
|
||||||
+ k = vld1q_u8( rk );
|
|
||||||
+ rk += 16;
|
|
||||||
+ x = vaeseq_u8( x, k );
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ for( i = ctx->nr - 1; i != 0 ; i-- ) /* decryption loop */
|
|
||||||
+ {
|
|
||||||
+ k = vld1q_u8( rk );
|
|
||||||
+ rk += 16;
|
|
||||||
+ x = vaesdq_u8( x, k );
|
|
||||||
+ x = vaesimcq_u8( x );
|
|
||||||
+ }
|
|
||||||
+ k = vld1q_u8( rk );
|
|
||||||
+ rk += 16;
|
|
||||||
+ x = vaesdq_u8( x, k );
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ k = vld1q_u8( rk ); /* final key just XORed */
|
|
||||||
+ x = veorq_u8( x, k );
|
|
||||||
+ vst1q_u8( output, x ); /* write out */
|
|
||||||
+
|
|
||||||
+ return ( 0 );
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+#endif /* MBEDTLS_AES_C */
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+/*
|
|
||||||
+ * [Armv8 Cryptography Extensions] Multiply in GF(2^128) for GCM
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+#if defined(MBEDTLS_GCM_C)
|
|
||||||
+
|
|
||||||
+void mbedtls_armv8ce_gcm_mult( unsigned char c[16],
|
|
||||||
+ const unsigned char a[16],
|
|
||||||
+ const unsigned char b[16] )
|
|
||||||
+{
|
|
||||||
+ /* GCM's GF(2^128) polynomial basis is x^128 + x^7 + x^2 + x + 1 */
|
|
||||||
+ const uint64x2_t base = { 0, 0x86 }; /* note missing LS bit */
|
|
||||||
+
|
|
||||||
+ register uint8x16_t vc asm( "v0" ); /* named registers */
|
|
||||||
+ register uint8x16_t va asm( "v1" ); /* (to avoid conflict) */
|
|
||||||
+ register uint8x16_t vb asm( "v2" );
|
|
||||||
+ register uint64x2_t vp asm( "v3" );
|
|
||||||
+
|
|
||||||
+ va = vld1q_u8( a ); /* load inputs */
|
|
||||||
+ vb = vld1q_u8( b );
|
|
||||||
+ vp = base;
|
|
||||||
+
|
|
||||||
+ asm (
|
|
||||||
+ "rbit %1.16b, %1.16b \n\t" /* reverse bit order */
|
|
||||||
+ "rbit %2.16b, %2.16b \n\t"
|
|
||||||
+ "pmull2 %0.1q, %1.2d, %2.2d \n\t" /* v0 = a.hi * b.hi */
|
|
||||||
+ "pmull2 v4.1q, %0.2d, %3.2d \n\t" /* mul v0 by x^64, reduce */
|
|
||||||
+ "ext %0.16b, %0.16b, %0.16b, #8 \n\t"
|
|
||||||
+ "eor %0.16b, %0.16b, v4.16b \n\t"
|
|
||||||
+ "ext v5.16b, %2.16b, %2.16b, #8 \n\t" /* (swap hi and lo in b) */
|
|
||||||
+ "pmull v4.1q, %1.1d, v5.1d \n\t" /* v0 ^= a.lo * b.hi */
|
|
||||||
+ "eor %0.16b, %0.16b, v4.16b \n\t"
|
|
||||||
+ "pmull2 v4.1q, %1.2d, v5.2d \n\t" /* v0 ^= a.hi * b.lo */
|
|
||||||
+ "eor %0.16b, %0.16b, v4.16b \n\t"
|
|
||||||
+ "pmull2 v4.1q, %0.2d, %3.2d \n\t" /* mul v0 by x^64, reduce */
|
|
||||||
+ "ext %0.16b, %0.16b, %0.16b, #8 \n\t"
|
|
||||||
+ "eor %0.16b, %0.16b, v4.16b \n\t"
|
|
||||||
+ "pmull v4.1q, %1.1d, %2.1d \n\t" /* v0 ^= a.lo * b.lo */
|
|
||||||
+ "eor %0.16b, %0.16b, v4.16b \n\t"
|
|
||||||
+ "rbit %0.16b, %0.16b \n\t" /* reverse bits for output */
|
|
||||||
+ : "=w" (vc) /* q0: output */
|
|
||||||
+ : "w" (va), "w" (vb), "w" (vp) /* q1, q2: input */
|
|
||||||
+ : "v4", "v5" /* q4, q5: clobbered */
|
|
||||||
+ );
|
|
||||||
+
|
|
||||||
+ vst1q_u8( c, vc ); /* write out */
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+#endif /* MBEDTLS_GCM_C */
|
|
||||||
+
|
|
||||||
+#endif /* MBEDTLS_ARMV8CE_AES_C */
|
|
||||||
--- a/library/CMakeLists.txt
|
|
||||||
+++ b/library/CMakeLists.txt
|
|
||||||
@@ -15,6 +15,7 @@ set(src_crypto
|
|
||||||
aesni.c
|
|
||||||
arc4.c
|
|
||||||
aria.c
|
|
||||||
+ armv8ce_aes.c
|
|
||||||
asn1parse.c
|
|
||||||
asn1write.c
|
|
||||||
base64.c
|
|
||||||
--- a/library/gcm.c
|
|
||||||
+++ b/library/gcm.c
|
|
||||||
@@ -31,6 +31,10 @@
|
|
||||||
#include "mbedtls/aesni.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#if defined(MBEDTLS_ARMV8CE_AES_C)
|
|
||||||
+#include "mbedtls/armv8ce_aes.h"
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#if !defined(MBEDTLS_GCM_ALT)
|
|
||||||
|
|
||||||
/* Parameter validation macros */
|
|
||||||
@@ -69,6 +73,12 @@ static int gcm_gen_table(mbedtls_gcm_con
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
+#if defined(MBEDTLS_ARMV8CE_AES_C)
|
|
||||||
+ // we don't do feature testing with ARMv8 cryptography extensions
|
|
||||||
+ memcpy( ctx ->HL, h, 16 ); // put H at the beginning of buffer
|
|
||||||
+ return( 0 ); // that's all we need
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
/* pack h as two 64-bits ints, big-endian */
|
|
||||||
hi = MBEDTLS_GET_UINT32_BE(h, 0);
|
|
||||||
lo = MBEDTLS_GET_UINT32_BE(h, 4);
|
|
||||||
@@ -179,6 +189,11 @@ static void gcm_mult(mbedtls_gcm_context
|
|
||||||
unsigned char lo, hi, rem;
|
|
||||||
uint64_t zh, zl;
|
|
||||||
|
|
||||||
+#if defined(MBEDTLS_ARMV8CE_AES_C)
|
|
||||||
+ mbedtls_armv8ce_gcm_mult( output, x, (const unsigned char *) ctx->HL );
|
|
||||||
+ return;
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#if defined(MBEDTLS_AESNI_HAVE_CODE)
|
|
||||||
if (mbedtls_aesni_has_support(MBEDTLS_AESNI_CLMUL)) {
|
|
||||||
unsigned char h[16];
|
|
||||||
--- a/library/Makefile
|
|
||||||
+++ b/library/Makefile
|
|
||||||
@@ -74,6 +74,7 @@ OBJS_CRYPTO= \
|
|
||||||
aria.o \
|
|
||||||
asn1parse.o \
|
|
||||||
asn1write.o \
|
|
||||||
+ armv8ce_aes.o \
|
|
||||||
base64.o \
|
|
||||||
bignum.o \
|
|
||||||
blowfish.o \
|
|
||||||
--- a/library/version_features.c
|
|
||||||
+++ b/library/version_features.c
|
|
||||||
@@ -624,6 +624,9 @@ static const char * const features[] = {
|
|
||||||
#if defined(MBEDTLS_AESNI_C)
|
|
||||||
"MBEDTLS_AESNI_C",
|
|
||||||
#endif /* MBEDTLS_AESNI_C */
|
|
||||||
+#if defined(MBEDTLS_ARMV8CE_AES_C)
|
|
||||||
+ "MBEDTLS_ARMV8CE_AES_C",
|
|
||||||
+#endif /* MBEDTLS_ARMV8CE_AES_C */
|
|
||||||
#if defined(MBEDTLS_AES_C)
|
|
||||||
"MBEDTLS_AES_C",
|
|
||||||
#endif /* MBEDTLS_AES_C */
|
|
@ -6460,7 +6460,7 @@ Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
|
|||||||
+{
|
+{
|
||||||
+ #if !defined(MBEDTLS_USE_PSA_CRYPTO) /* XXX: (not extracted for PSA crypto) */
|
+ #if !defined(MBEDTLS_USE_PSA_CRYPTO) /* XXX: (not extracted for PSA crypto) */
|
||||||
+ #if defined(MBEDTLS_SSL_PROTO_TLS1_3)
|
+ #if defined(MBEDTLS_SSL_PROTO_TLS1_3)
|
||||||
+ if (tls_version == MBEDTLS_SSL_VERSION_TLS1_3)
|
+ if (mbedtls_ssl_get_version_number(ssl) == MBEDTLS_SSL_VERSION_TLS1_3)
|
||||||
+ return 0; /* (calculation not extracted) */
|
+ return 0; /* (calculation not extracted) */
|
||||||
+ #endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
|
+ #endif /* MBEDTLS_SSL_PROTO_TLS1_3 */
|
||||||
+
|
+
|
||||||
|
@ -5,9 +5,9 @@ PKG_RELEASE:=1
|
|||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/uqmi.git
|
PKG_SOURCE_URL=$(PROJECT_GIT)/project/uqmi.git
|
||||||
PKG_SOURCE_DATE:=2024-01-16
|
PKG_SOURCE_DATE:=2024-04-24
|
||||||
PKG_SOURCE_VERSION:=c3488b831ce6285c8107704156b9b8ed7d59deb3
|
PKG_SOURCE_VERSION:=e7207bec95f02f2f7a98254d642186a082af838d
|
||||||
PKG_MIRROR_HASH:=1aa576e46dfb6528ef12f5fd1b626585d565bbcf9119cde302cc34d732c75076
|
PKG_MIRROR_HASH:=53e83720472f07cb9bb3e2b68ea6c379fc8c43ed8f93227bcb3d06c94a32a669
|
||||||
PKG_MAINTAINER:=Matti Laakso <malaakso@elisanet.fi>
|
PKG_MAINTAINER:=Matti Laakso <malaakso@elisanet.fi>
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0
|
PKG_LICENSE:=GPL-2.0
|
||||||
@ -34,7 +34,6 @@ endef
|
|||||||
|
|
||||||
TARGET_CFLAGS += \
|
TARGET_CFLAGS += \
|
||||||
-I$(STAGING_DIR)/usr/include \
|
-I$(STAGING_DIR)/usr/include \
|
||||||
-Wno-error=dangling-pointer \
|
|
||||||
-Wno-error=maybe-uninitialized
|
-Wno-error=maybe-uninitialized
|
||||||
|
|
||||||
CMAKE_OPTIONS += \
|
CMAKE_OPTIONS += \
|
||||||
@ -42,7 +41,7 @@ CMAKE_OPTIONS += \
|
|||||||
|
|
||||||
define Package/uqmi/install
|
define Package/uqmi/install
|
||||||
$(INSTALL_DIR) $(1)/sbin
|
$(INSTALL_DIR) $(1)/sbin
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uqmi $(1)/sbin/
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uqmi/uqmi $(1)/sbin/
|
||||||
$(CP) ./files/* $(1)/
|
$(CP) ./files/* $(1)/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
87
package/system/apk/Makefile
Normal file
87
package/system/apk/Makefile
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=apk
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_SOURCE_URL=https://gitlab.alpinelinux.org/alpine/apk-tools.git
|
||||||
|
PKG_SOURCE_PROTO:=git
|
||||||
|
PKG_SOURCE_DATE:=2024-04-16
|
||||||
|
PKG_SOURCE_VERSION:=ba6c31a5469ef74fb85119508e55de9631ffef41
|
||||||
|
PKG_MIRROR_HASH:=3455d5799481add9ece3db685576d58be6303f3a13140133979b965cbd3c9966
|
||||||
|
|
||||||
|
PKG_VERSION=3.0.0_pre$(subst -,,$(PKG_SOURCE_DATE))
|
||||||
|
|
||||||
|
PKG_MAINTAINER:=Paul Spooren <mail@aparcar.org>
|
||||||
|
PKG_LICENSE:=GPL-2.0-only
|
||||||
|
PKG_LICENSE_FILES:=LICENSE
|
||||||
|
PKG_INSTALL:=1
|
||||||
|
|
||||||
|
HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)
|
||||||
|
HOST_BUILD_DEPENDS:=lua/host
|
||||||
|
PKG_BUILD_DEPENDS:=$(HOST_BUILD_DEPENDS)
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
include $(INCLUDE_DIR)/host-build.mk
|
||||||
|
include $(INCLUDE_DIR)/meson.mk
|
||||||
|
|
||||||
|
define Package/apk/default
|
||||||
|
SECTION:=base
|
||||||
|
CATEGORY:=Base system
|
||||||
|
TITLE:=apk package manager
|
||||||
|
DEPENDS:=+zlib
|
||||||
|
URL:=$(PKG_SOURCE_URL)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/apk-mbedtls
|
||||||
|
$(Package/apk/default)
|
||||||
|
TITLE += (mbedtls)
|
||||||
|
DEPENDS +=+libmbedtls
|
||||||
|
VARIANT:=mbedtls
|
||||||
|
DEFAULT_VARIANT:=1
|
||||||
|
CONFLICTS:=apk-openssl
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/apk-openssl
|
||||||
|
$(Package/apk/default)
|
||||||
|
TITLE += (openssl)
|
||||||
|
DEPENDS +=+libopenssl
|
||||||
|
VARIANT:=openssl
|
||||||
|
endef
|
||||||
|
|
||||||
|
MESON_HOST_VARS+=VERSION=$(PKG_VERSION)
|
||||||
|
MESON_VARS+=VERSION=$(PKG_VERSION)
|
||||||
|
|
||||||
|
MESON_HOST_ARGS += \
|
||||||
|
-Dlua_version=5.1 \
|
||||||
|
-Dcompressed-help=false \
|
||||||
|
-Ddocs=disabled \
|
||||||
|
-Dcrypto_backend=openssl \
|
||||||
|
-Dzstd=false
|
||||||
|
|
||||||
|
MESON_ARGS += \
|
||||||
|
-Dlua_version=5.1 \
|
||||||
|
-Dcompressed-help=false \
|
||||||
|
-Ddocs=disabled \
|
||||||
|
-Durl_backend=wget \
|
||||||
|
-Dcrypto_backend=$(BUILD_VARIANT) \
|
||||||
|
-Dzstd=false
|
||||||
|
|
||||||
|
HOST_LDFLAGS += \
|
||||||
|
-Wl,-rpath $(STAGING_DIR_HOST)/lib
|
||||||
|
|
||||||
|
define Package/apk/default/install
|
||||||
|
$(INSTALL_DIR) $(1)/lib/apk/db
|
||||||
|
|
||||||
|
$(INSTALL_DIR) $(1)/usr/bin
|
||||||
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/apk $(1)/usr/bin/apk
|
||||||
|
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libapk.so.* $(1)/usr/lib/
|
||||||
|
endef
|
||||||
|
|
||||||
|
Package/apk-mbedtls/install = $(Package/apk/default/install)
|
||||||
|
Package/apk-openssl/install = $(Package/apk/default/install)
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,apk-mbedtls))
|
||||||
|
$(eval $(call BuildPackage,apk-openssl))
|
||||||
|
$(eval $(call HostBuild))
|
@ -0,0 +1,21 @@
|
|||||||
|
From 9918c683fcc2f148328332d58d030ec5750a1473 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Paul Spooren <mail@aparcar.org>
|
||||||
|
Date: Sat, 19 Feb 2022 17:20:37 +0100
|
||||||
|
Subject: [PATCH 1/4] openwrt: move layer db to temp folder
|
||||||
|
|
||||||
|
Signed-off-by: Paul Spooren <mail@aparcar.org>
|
||||||
|
---
|
||||||
|
src/database.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
--- a/src/database.c
|
||||||
|
+++ b/src/database.c
|
||||||
|
@@ -1604,7 +1604,7 @@ const char *apk_db_layer_name(int layer)
|
||||||
|
{
|
||||||
|
switch (layer) {
|
||||||
|
case APK_DB_LAYER_ROOT: return "lib/apk/db";
|
||||||
|
- case APK_DB_LAYER_UVOL: return "lib/apk/db-uvol";
|
||||||
|
+ case APK_DB_LAYER_UVOL: return "tmp/run/uvol/.meta/apk";
|
||||||
|
default:
|
||||||
|
assert("invalid layer");
|
||||||
|
return 0;
|
917
package/system/apk/patches/0002-mbedtls-support.patch
Normal file
917
package/system/apk/patches/0002-mbedtls-support.patch
Normal file
@ -0,0 +1,917 @@
|
|||||||
|
From 74ea482102e1a7c1845b3eec19cbdb21264836d4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
|
||||||
|
Date: Fri, 5 Apr 2024 12:06:56 +0300
|
||||||
|
Subject: [PATCH 1/4] add alternate url wget implementation
|
||||||
|
|
||||||
|
---
|
||||||
|
.gitlab-ci.yml | 16 ++++-
|
||||||
|
meson.build | 6 +-
|
||||||
|
meson_options.txt | 1 +
|
||||||
|
src/io_url_wget.c | 150 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
src/meson.build | 4 +-
|
||||||
|
5 files changed, 173 insertions(+), 4 deletions(-)
|
||||||
|
create mode 100644 src/io_url_wget.c
|
||||||
|
|
||||||
|
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
|
||||||
|
index 7fc86563..b7e00008 100644
|
||||||
|
--- a/.gitlab-ci.yml
|
||||||
|
+++ b/.gitlab-ci.yml
|
||||||
|
@@ -24,7 +24,19 @@ test:alpine:
|
||||||
|
script:
|
||||||
|
- apk update
|
||||||
|
- apk add make gcc git musl-dev openssl-dev linux-headers zlib-dev zstd-dev lua5.3-dev lua5.3-lzlib meson zlib-static zstd-static openssl-libs-static
|
||||||
|
- - meson build
|
||||||
|
+ - meson setup build -Dstatic_apk=true
|
||||||
|
+ - ninja -C build
|
||||||
|
+ tags:
|
||||||
|
+ - docker-alpine
|
||||||
|
+ - x86_64
|
||||||
|
+
|
||||||
|
+test:alpine-alt-config:
|
||||||
|
+ image: alpine
|
||||||
|
+ stage: test
|
||||||
|
+ script:
|
||||||
|
+ - apk update
|
||||||
|
+ - apk add make gcc git musl-dev openssl-dev linux-headers zlib-dev lua5.3-dev lua5.3-lzlib meson
|
||||||
|
+ - meson setup build -Durl_backend=wget -Dzstd=false
|
||||||
|
- ninja -C build
|
||||||
|
tags:
|
||||||
|
- docker-alpine
|
||||||
|
@@ -38,7 +50,7 @@ test:debian:
|
||||||
|
- apt-get install -y make gcc git libssl-dev zlib1g-dev libzstd-dev lua5.3-dev lua5.2 lua-zlib-dev sudo meson
|
||||||
|
- unlink /bin/sh
|
||||||
|
- ln -s /bin/bash /bin/sh
|
||||||
|
- - meson build
|
||||||
|
+ - meson setup build
|
||||||
|
- ninja -C build
|
||||||
|
tags:
|
||||||
|
- docker-alpine
|
||||||
|
diff --git a/meson.build b/meson.build
|
||||||
|
index 1a44c11f..9a14cac0 100644
|
||||||
|
--- a/meson.build
|
||||||
|
+++ b/meson.build
|
||||||
|
@@ -33,6 +33,10 @@ subproject = meson.is_subproject()
|
||||||
|
|
||||||
|
subdir('doc')
|
||||||
|
subdir('portability')
|
||||||
|
-subdir('libfetch')
|
||||||
|
+if get_option('url_backend') == 'libfetch'
|
||||||
|
+ subdir('libfetch')
|
||||||
|
+else
|
||||||
|
+ libfetch_dep = dependency('', required: false)
|
||||||
|
+endif
|
||||||
|
subdir('src')
|
||||||
|
subdir('tests')
|
||||||
|
diff --git a/meson_options.txt b/meson_options.txt
|
||||||
|
index 693f46ec..940fe9a4 100644
|
||||||
|
--- a/meson_options.txt
|
||||||
|
+++ b/meson_options.txt
|
||||||
|
@@ -5,5 +5,6 @@ option('help', description: 'Build help into apk binaries, needs lua', type: 'fe
|
||||||
|
option('lua', description: 'Build luaapk (lua bindings)', type: 'feature', value: 'auto')
|
||||||
|
option('lua_version', description: 'Lua version to build against', type: 'string', value: '5.3')
|
||||||
|
option('static_apk', description: 'Also build apk.static', type: 'boolean', value: false)
|
||||||
|
+option('url_backend', description: 'URL backend', type: 'combo', choices: ['libfetch', 'wget'], value: 'libfetch')
|
||||||
|
option('uvol_db_target', description: 'Default target for uvol database layer', type: 'string')
|
||||||
|
option('zstd', description: 'Build with zstd support', type: 'boolean', value: true)
|
||||||
|
diff --git a/src/io_url_wget.c b/src/io_url_wget.c
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..9a929222
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/io_url_wget.c
|
||||||
|
@@ -0,0 +1,150 @@
|
||||||
|
+/* io_url_wget.c - Alpine Package Keeper (APK)
|
||||||
|
+ *
|
||||||
|
+ * Copyright (C) 2005-2008 Natanael Copa <n@tanael.org>
|
||||||
|
+ * Copyright (C) 2008-2011 Timo Teräs <timo.teras@iki.fi>
|
||||||
|
+ * All rights reserved.
|
||||||
|
+ *
|
||||||
|
+ * SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#include <spawn.h>
|
||||||
|
+#include <unistd.h>
|
||||||
|
+#include <sys/wait.h>
|
||||||
|
+#include "apk_io.h"
|
||||||
|
+
|
||||||
|
+static char wget_timeout[16];
|
||||||
|
+static char wget_no_check_certificate;
|
||||||
|
+
|
||||||
|
+static int wget_translate_status(int status)
|
||||||
|
+{
|
||||||
|
+ if (!WIFEXITED(status)) return -EFAULT;
|
||||||
|
+ switch (WEXITSTATUS(status)) {
|
||||||
|
+ case 0: return 0;
|
||||||
|
+ case 3: return -EIO;
|
||||||
|
+ case 4: return -ENETUNREACH;
|
||||||
|
+ case 5: return -EACCES;
|
||||||
|
+ case 6: return -EACCES;
|
||||||
|
+ case 7: return -EPROTO;
|
||||||
|
+ default: return -APKE_REMOTE_IO;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+struct apk_wget_istream {
|
||||||
|
+ struct apk_istream is;
|
||||||
|
+ int fd;
|
||||||
|
+ pid_t pid;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static int wget_spawn(const char *url, pid_t *pid, int *fd)
|
||||||
|
+{
|
||||||
|
+ int i = 0, r, pipefds[2];
|
||||||
|
+ posix_spawn_file_actions_t act;
|
||||||
|
+ char *argv[16];
|
||||||
|
+
|
||||||
|
+ argv[i++] = "wget";
|
||||||
|
+ argv[i++] = "-q";
|
||||||
|
+ argv[i++] = "-T";
|
||||||
|
+ argv[i++] = wget_timeout;
|
||||||
|
+ if (wget_no_check_certificate) argv[i++] = "--no-check-certificate";
|
||||||
|
+ argv[i++] = (char *) url;
|
||||||
|
+ argv[i++] = "-O";
|
||||||
|
+ argv[i++] = "-";
|
||||||
|
+ argv[i++] = 0;
|
||||||
|
+
|
||||||
|
+ if (pipe2(pipefds, O_CLOEXEC) != 0) return -errno;
|
||||||
|
+
|
||||||
|
+ posix_spawn_file_actions_init(&act);
|
||||||
|
+ posix_spawn_file_actions_adddup2(&act, pipefds[1], STDOUT_FILENO);
|
||||||
|
+ r = posix_spawnp(pid, "wget", &act, 0, argv, environ);
|
||||||
|
+ posix_spawn_file_actions_destroy(&act);
|
||||||
|
+ if (r != 0) return -r;
|
||||||
|
+ close(pipefds[1]);
|
||||||
|
+ *fd = pipefds[0];
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int wget_check_exit(struct apk_wget_istream *wis)
|
||||||
|
+{
|
||||||
|
+ int status;
|
||||||
|
+
|
||||||
|
+ if (wis->pid == 0) return apk_istream_error(&wis->is, 0);
|
||||||
|
+ if (waitpid(wis->pid, &status, 0) == wis->pid) {
|
||||||
|
+ wis->pid = 0;
|
||||||
|
+ return apk_istream_error(&wis->is, wget_translate_status(status));
|
||||||
|
+ }
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void wget_get_meta(struct apk_istream *is, struct apk_file_meta *meta)
|
||||||
|
+{
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static ssize_t wget_read(struct apk_istream *is, void *ptr, size_t size)
|
||||||
|
+{
|
||||||
|
+ struct apk_wget_istream *wis = container_of(is, struct apk_wget_istream, is);
|
||||||
|
+ ssize_t r;
|
||||||
|
+
|
||||||
|
+ r = read(wis->fd, ptr, size);
|
||||||
|
+ if (r < 0) return -errno;
|
||||||
|
+ if (r == 0) return wget_check_exit(wis);
|
||||||
|
+ return r;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int wget_close(struct apk_istream *is)
|
||||||
|
+{
|
||||||
|
+ int r = is->err;
|
||||||
|
+ struct apk_wget_istream *wis = container_of(is, struct apk_wget_istream, is);
|
||||||
|
+
|
||||||
|
+ while (wis->pid != 0)
|
||||||
|
+ wget_check_exit(wis);
|
||||||
|
+
|
||||||
|
+ close(wis->fd);
|
||||||
|
+ free(wis);
|
||||||
|
+ return r < 0 ? r : 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static const struct apk_istream_ops wget_istream_ops = {
|
||||||
|
+ .get_meta = wget_get_meta,
|
||||||
|
+ .read = wget_read,
|
||||||
|
+ .close = wget_close,
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+struct apk_istream *apk_io_url_istream(const char *url, time_t since)
|
||||||
|
+{
|
||||||
|
+ struct apk_wget_istream *wis;
|
||||||
|
+ int r;
|
||||||
|
+
|
||||||
|
+ wis = malloc(sizeof(*wis) + apk_io_bufsize);
|
||||||
|
+ if (wis == NULL) return ERR_PTR(-ENOMEM);
|
||||||
|
+
|
||||||
|
+ *wis = (struct apk_wget_istream) {
|
||||||
|
+ .is.ops = &wget_istream_ops,
|
||||||
|
+ .is.buf = (uint8_t *)(wis + 1),
|
||||||
|
+ .is.buf_size = apk_io_bufsize,
|
||||||
|
+ };
|
||||||
|
+ r = wget_spawn(url, &wis->pid, &wis->fd);
|
||||||
|
+ if (r != 0) {
|
||||||
|
+ free(wis);
|
||||||
|
+ return ERR_PTR(r);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return &wis->is;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void apk_io_url_no_check_certificate(void)
|
||||||
|
+{
|
||||||
|
+ wget_no_check_certificate = 1;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void apk_io_url_set_timeout(int timeout)
|
||||||
|
+{
|
||||||
|
+ snprintf(wget_timeout, sizeof wget_timeout, "%d", timeout);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void apk_io_url_set_redirect_callback(void (*cb)(int, const char *))
|
||||||
|
+{
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void apk_io_url_init(void)
|
||||||
|
+{
|
||||||
|
+}
|
||||||
|
diff --git a/src/meson.build b/src/meson.build
|
||||||
|
index c1aae550..38e9d3b0 100644
|
||||||
|
--- a/src/meson.build
|
||||||
|
+++ b/src/meson.build
|
||||||
|
@@ -1,3 +1,5 @@
|
||||||
|
+url_backend = get_option('url_backend')
|
||||||
|
+
|
||||||
|
libapk_so_version = '2.99.0'
|
||||||
|
libapk_src = [
|
||||||
|
'adb.c',
|
||||||
|
@@ -22,8 +24,8 @@ libapk_src = [
|
||||||
|
'fs_uvol.c',
|
||||||
|
'hash.c',
|
||||||
|
'io.c',
|
||||||
|
- 'io_url_libfetch.c',
|
||||||
|
'io_gunzip.c',
|
||||||
|
+ 'io_url_@0@.c'.format(url_backend),
|
||||||
|
'package.c',
|
||||||
|
'pathbuilder.c',
|
||||||
|
'print.c',
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
||||||
|
|
||||||
|
From b9fe78fbf19bb10e1d0b8eb1cb1de123bee2ed7e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||||
|
Date: Tue, 16 Apr 2024 17:55:15 +0200
|
||||||
|
Subject: [PATCH 2/4] add option to configure url backend in legacy make build
|
||||||
|
system
|
||||||
|
|
||||||
|
Can be configured by setting URL_BACKEND. If not set libfetch is
|
||||||
|
selected by default.
|
||||||
|
|
||||||
|
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||||
|
---
|
||||||
|
src/Makefile | 20 ++++++++++++++------
|
||||||
|
1 file changed, 14 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/Makefile b/src/Makefile
|
||||||
|
index f7873cb1..efdc68df 100644
|
||||||
|
--- a/src/Makefile
|
||||||
|
+++ b/src/Makefile
|
||||||
|
@@ -9,8 +9,8 @@ else
|
||||||
|
$(error Lua interpreter not found. Please specify LUA interpreter, or use LUA=no to build without help.)
|
||||||
|
endif
|
||||||
|
|
||||||
|
-OPENSSL_CFLAGS := $(shell $(PKG_CONFIG) --cflags openssl)
|
||||||
|
-OPENSSL_LIBS := $(shell $(PKG_CONFIG) --libs openssl)
|
||||||
|
+OPENSSL_CFLAGS := $(shell $(PKG_CONFIG) --cflags openssl)
|
||||||
|
+OPENSSL_LIBS := $(shell $(PKG_CONFIG) --libs openssl)
|
||||||
|
|
||||||
|
ZLIB_CFLAGS := $(shell $(PKG_CONFIG) --cflags zlib)
|
||||||
|
ZLIB_LIBS := $(shell $(PKG_CONFIG) --libs zlib)
|
||||||
|
@@ -21,10 +21,18 @@ libapk_so := $(obj)/libapk.so.$(libapk_soname)
|
||||||
|
libapk.so.$(libapk_soname)-objs := \
|
||||||
|
adb.o adb_comp.o adb_walk_adb.o adb_walk_genadb.o adb_walk_gentext.o adb_walk_text.o apk_adb.o \
|
||||||
|
atom.o blob.o commit.o common.o context.o crypto.o crypto_openssl.o ctype.o database.o hash.o \
|
||||||
|
- extract_v2.o extract_v3.o fs_fsys.o fs_uvol.o io.o io_gunzip.o io_url_libfetch.o \
|
||||||
|
- tar.o package.o pathbuilder.o print.o solver.o trust.o version.o
|
||||||
|
+ extract_v2.o extract_v3.o fs_fsys.o fs_uvol.o io.o io_gunzip.o tar.o package.o pathbuilder.o \
|
||||||
|
+ print.o solver.o trust.o version.o
|
||||||
|
|
||||||
|
-libapk.so.$(libapk_soname)-libs := libfetch/libfetch.a
|
||||||
|
+libapk.so.$(libapk_soname)-libs :=
|
||||||
|
+
|
||||||
|
+ifeq ($(URL_BACKEND),wget)
|
||||||
|
+libapk.so.$(libapk_soname)-objs += io_url_wget.o
|
||||||
|
+else
|
||||||
|
+CFLAGS_ALL += -Ilibfetch
|
||||||
|
+libapk.so.$(libapk_soname)-objs += io_url_libfetch.o
|
||||||
|
+libapk.so.$(libapk_soname)-libs += libfetch/libfetch.a
|
||||||
|
+endif
|
||||||
|
|
||||||
|
# ZSTD support can be disabled
|
||||||
|
ifneq ($(ZSTD),no)
|
||||||
|
@@ -79,7 +87,7 @@ LIBS_apk := -lapk
|
||||||
|
LIBS_apk-test := -lapk
|
||||||
|
LIBS_apk.so := -L$(obj) -lapk
|
||||||
|
|
||||||
|
-CFLAGS_ALL += -D_ATFILE_SOURCE -Ilibfetch -Iportability
|
||||||
|
+CFLAGS_ALL += -D_ATFILE_SOURCE -Iportability
|
||||||
|
CFLAGS_apk.o := -DAPK_VERSION=\"$(VERSION)\"
|
||||||
|
CFLAGS_apk-static.o := -DAPK_VERSION=\"$(VERSION)\" -DOPENSSL_NO_ENGINE
|
||||||
|
CFLAGS_apk-test.o := -DAPK_VERSION=\"$(VERSION)\" -DOPENSSL_NO_ENGINE -DTEST_MODE
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
||||||
|
|
||||||
|
From 0418b684898403c49905c1f0e4b7c5ca522b2d50 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jonas Jelonek <jelonek.jonas@gmail.com>
|
||||||
|
Date: Sun, 14 Apr 2024 00:20:14 +0200
|
||||||
|
Subject: [PATCH 3/4] crypto: add support for mbedtls as backend
|
||||||
|
|
||||||
|
backend is selected at compile-time with crypto_backend option
|
||||||
|
|
||||||
|
Co-developed-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||||
|
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||||
|
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
|
||||||
|
---
|
||||||
|
libfetch/meson.build | 2 +-
|
||||||
|
meson.build | 14 +-
|
||||||
|
meson_options.txt | 1 +
|
||||||
|
portability/getrandom.c | 19 +++
|
||||||
|
portability/meson.build | 3 +-
|
||||||
|
portability/sys/random.h | 6 +
|
||||||
|
src/apk_crypto.h | 5 +
|
||||||
|
src/apk_crypto_mbedtls.h | 30 +++++
|
||||||
|
src/crypto_mbedtls.c | 285 +++++++++++++++++++++++++++++++++++++++
|
||||||
|
src/meson.build | 21 ++-
|
||||||
|
10 files changed, 373 insertions(+), 13 deletions(-)
|
||||||
|
create mode 100644 portability/getrandom.c
|
||||||
|
create mode 100644 portability/sys/random.h
|
||||||
|
create mode 100644 src/apk_crypto_mbedtls.h
|
||||||
|
create mode 100644 src/crypto_mbedtls.c
|
||||||
|
|
||||||
|
diff --git a/libfetch/meson.build b/libfetch/meson.build
|
||||||
|
index 431ba197..e24f95eb 100644
|
||||||
|
--- a/libfetch/meson.build
|
||||||
|
+++ b/libfetch/meson.build
|
||||||
|
@@ -40,7 +40,7 @@ libfetch = static_library(
|
||||||
|
c_args: libfetch_cargs,
|
||||||
|
dependencies: [
|
||||||
|
libportability_dep.partial_dependency(compile_args: true, includes: true),
|
||||||
|
- openssl_dep.partial_dependency(compile_args: true, includes: true)
|
||||||
|
+ crypto_dep.partial_dependency(compile_args: true, includes: true)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
diff --git a/meson.build b/meson.build
|
||||||
|
index 9a14cac0..3a83f4e1 100644
|
||||||
|
--- a/meson.build
|
||||||
|
+++ b/meson.build
|
||||||
|
@@ -13,15 +13,21 @@ apk_libdir = get_option('libdir')
|
||||||
|
lua_bin = find_program('lua' + get_option('lua_version'), required: get_option('help'))
|
||||||
|
lua_dep = dependency('lua' + get_option('lua_version'), required: get_option('lua'))
|
||||||
|
scdoc_dep = dependency('scdoc', version: '>=1.10', required: get_option('docs'))
|
||||||
|
-openssl_dep = dependency('openssl')
|
||||||
|
-openssl_static_dep = dependency('openssl', static: true)
|
||||||
|
zlib_dep = dependency('zlib')
|
||||||
|
zlib_static_dep = dependency('zlib', static: true)
|
||||||
|
libzstd_dep = dependency('libzstd', required: get_option('zstd'))
|
||||||
|
libzstd_static_dep = dependency('libzstd', required: get_option('zstd'), static: true)
|
||||||
|
|
||||||
|
-shared_deps = [ openssl_dep, zlib_dep, libzstd_dep ]
|
||||||
|
-static_deps = [ openssl_static_dep, zlib_static_dep, libzstd_static_dep ]
|
||||||
|
+if get_option('crypto_backend') == 'openssl'
|
||||||
|
+ crypto_dep = dependency('openssl')
|
||||||
|
+ crypto_static_dep = dependency('openssl', static: true)
|
||||||
|
+elif get_option('crypto_backend') == 'mbedtls'
|
||||||
|
+ crypto_dep = [ dependency('mbedtls'), dependency('mbedcrypto') ]
|
||||||
|
+ crypto_static_dep = [ dependency('mbedtls', static: true), dependency('mbedcrypto', static: true) ]
|
||||||
|
+endif
|
||||||
|
+
|
||||||
|
+shared_deps = [ crypto_dep, zlib_dep, libzstd_dep ]
|
||||||
|
+static_deps = [ crypto_static_dep, zlib_static_dep, libzstd_static_dep ]
|
||||||
|
|
||||||
|
add_project_arguments('-D_GNU_SOURCE', language: 'c')
|
||||||
|
|
||||||
|
diff --git a/meson_options.txt b/meson_options.txt
|
||||||
|
index 940fe9a4..df0b07dc 100644
|
||||||
|
--- a/meson_options.txt
|
||||||
|
+++ b/meson_options.txt
|
||||||
|
@@ -1,4 +1,5 @@
|
||||||
|
option('arch_prefix', description: 'Define a custom arch prefix for default arch', type: 'string')
|
||||||
|
+option('crypto_backend', description: 'Crypto backend', type: 'combo', choices: ['openssl', 'mbedtls'], value: 'openssl')
|
||||||
|
option('compressed-help', description: 'Compress help database, needs lua-zlib', type: 'boolean', value: true)
|
||||||
|
option('docs', description: 'Build manpages with scdoc', type: 'feature', value: 'auto')
|
||||||
|
option('help', description: 'Build help into apk binaries, needs lua', type: 'feature', value: 'auto')
|
||||||
|
diff --git a/portability/getrandom.c b/portability/getrandom.c
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..b2f4a07c
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/portability/getrandom.c
|
||||||
|
@@ -0,0 +1,19 @@
|
||||||
|
+#include <sys/random.h>
|
||||||
|
+#include <sys/types.h>
|
||||||
|
+#include <unistd.h>
|
||||||
|
+#include <fcntl.h>
|
||||||
|
+
|
||||||
|
+ssize_t getrandom(void *buf, size_t buflen, unsigned int flags)
|
||||||
|
+{
|
||||||
|
+ int fd;
|
||||||
|
+ ssize_t ret;
|
||||||
|
+
|
||||||
|
+ fd = open("/dev/urandom", O_RDONLY|O_CLOEXEC);
|
||||||
|
+ if (fd < 0)
|
||||||
|
+ return -1;
|
||||||
|
+
|
||||||
|
+ ret = read(fd, buf, buflen);
|
||||||
|
+ close(fd);
|
||||||
|
+ return ret;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
diff --git a/portability/meson.build b/portability/meson.build
|
||||||
|
index 89957c3c..3172044e 100644
|
||||||
|
--- a/portability/meson.build
|
||||||
|
+++ b/portability/meson.build
|
||||||
|
@@ -3,7 +3,8 @@ cc = meson.get_compiler('c')
|
||||||
|
libportability_src = []
|
||||||
|
|
||||||
|
check_symbols = [
|
||||||
|
- ['memrchr', 'memrchr.c', 'NEED_MEMRCHR', 'string.h'],
|
||||||
|
+ ['getrandom', 'getrandom.c', 'NEED_GETRANDOM', 'sys/random.h'],
|
||||||
|
+ ['memrchr', 'memrchr.c', 'NEED_MEMRCHR', 'string.h'],
|
||||||
|
['mknodat', 'mknodat.c', 'NEED_MKNODAT', 'sys/stat.h'],
|
||||||
|
['pipe2', 'pipe2.c', 'NEED_PIPE2', 'unistd.h'],
|
||||||
|
['qsort_r', 'qsort_r.c', 'NEED_QSORT_R', 'stdlib.h'],
|
||||||
|
diff --git a/portability/sys/random.h b/portability/sys/random.h
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..02d5b1ca
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/portability/sys/random.h
|
||||||
|
@@ -0,0 +1,6 @@
|
||||||
|
+#include_next <sys/random.h>
|
||||||
|
+#include <sys/types.h>
|
||||||
|
+
|
||||||
|
+#ifdef NEED_GETRANDOM
|
||||||
|
+ssize_t getrandom(void *buf, size_t buflen, unsigned int flags);
|
||||||
|
+#endif
|
||||||
|
diff --git a/src/apk_crypto.h b/src/apk_crypto.h
|
||||||
|
index 7de88dfc..5cae3bfe 100644
|
||||||
|
--- a/src/apk_crypto.h
|
||||||
|
+++ b/src/apk_crypto.h
|
||||||
|
@@ -12,7 +12,12 @@
|
||||||
|
#include <string.h>
|
||||||
|
#include "apk_defines.h"
|
||||||
|
#include "apk_blob.h"
|
||||||
|
+
|
||||||
|
+#if defined(CRYPTO_USE_OPENSSL)
|
||||||
|
#include "apk_crypto_openssl.h"
|
||||||
|
+#elif defined(CRYPTO_USE_MBEDTLS)
|
||||||
|
+#include "apk_crypto_mbedtls.h"
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
// Digest
|
||||||
|
|
||||||
|
diff --git a/src/apk_crypto_mbedtls.h b/src/apk_crypto_mbedtls.h
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..5481d149
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/apk_crypto_mbedtls.h
|
||||||
|
@@ -0,0 +1,30 @@
|
||||||
|
+/* apk_crypto_mbedtls.h - Alpine Package Keeper (APK)
|
||||||
|
+ *
|
||||||
|
+ * Copyright (C) 2024
|
||||||
|
+ * All rights reserved.
|
||||||
|
+ *
|
||||||
|
+ * SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#ifndef APK_CRYPTO_MBEDTLS_H
|
||||||
|
+#define APK_CRYPTO_MBEDTLS_H
|
||||||
|
+
|
||||||
|
+#include <mbedtls/md.h>
|
||||||
|
+#include <mbedtls/pk.h>
|
||||||
|
+#include <mbedtls/bignum.h>
|
||||||
|
+
|
||||||
|
+struct apk_pkey {
|
||||||
|
+ uint8_t id[16];
|
||||||
|
+ mbedtls_pk_context key;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+struct apk_digest_ctx {
|
||||||
|
+ mbedtls_md_context_t mdctx;
|
||||||
|
+ struct apk_pkey *sigver_key;
|
||||||
|
+ uint8_t alg;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+/* based on mbedtls' internal pkwrite.h calculations */
|
||||||
|
+#define APK_ENC_KEY_MAX_LENGTH (38 + 2 * MBEDTLS_MPI_MAX_SIZE)
|
||||||
|
+
|
||||||
|
+#endif
|
||||||
|
diff --git a/src/crypto_mbedtls.c b/src/crypto_mbedtls.c
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..73d60e9d
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/crypto_mbedtls.c
|
||||||
|
@@ -0,0 +1,285 @@
|
||||||
|
+#include <errno.h>
|
||||||
|
+#include <stdio.h>
|
||||||
|
+#include <stdlib.h>
|
||||||
|
+#include <fcntl.h>
|
||||||
|
+#include <sys/random.h>
|
||||||
|
+#include <sys/stat.h>
|
||||||
|
+#include <unistd.h>
|
||||||
|
+
|
||||||
|
+#include <mbedtls/platform.h>
|
||||||
|
+#include <mbedtls/md.h>
|
||||||
|
+#include <mbedtls/pk.h>
|
||||||
|
+#include <mbedtls/entropy.h>
|
||||||
|
+
|
||||||
|
+#ifdef MBEDTLS_PSA_CRYPTO_C
|
||||||
|
+#include <psa/crypto.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+#include "apk_crypto.h"
|
||||||
|
+
|
||||||
|
+static inline const mbedtls_md_type_t apk_digest_alg_to_mbedtls_type(uint8_t alg) {
|
||||||
|
+ switch (alg) {
|
||||||
|
+ case APK_DIGEST_NONE: return MBEDTLS_MD_NONE;
|
||||||
|
+ case APK_DIGEST_MD5: return MBEDTLS_MD_MD5;
|
||||||
|
+ case APK_DIGEST_SHA1: return MBEDTLS_MD_SHA1;
|
||||||
|
+ case APK_DIGEST_SHA256_160:
|
||||||
|
+ case APK_DIGEST_SHA256: return MBEDTLS_MD_SHA256;
|
||||||
|
+ case APK_DIGEST_SHA512: return MBEDTLS_MD_SHA512;
|
||||||
|
+ default:
|
||||||
|
+ assert(alg);
|
||||||
|
+ return MBEDTLS_MD_NONE;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static inline const mbedtls_md_info_t *apk_digest_alg_to_mdinfo(uint8_t alg)
|
||||||
|
+{
|
||||||
|
+ return mbedtls_md_info_from_type(
|
||||||
|
+ apk_digest_alg_to_mbedtls_type(alg)
|
||||||
|
+ );
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int apk_digest_calc(struct apk_digest *d, uint8_t alg, const void *ptr, size_t sz)
|
||||||
|
+{
|
||||||
|
+ if (mbedtls_md(apk_digest_alg_to_mdinfo(alg), ptr, sz, d->data))
|
||||||
|
+ return -APKE_CRYPTO_ERROR;
|
||||||
|
+
|
||||||
|
+ apk_digest_set(d, alg);
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int apk_digest_ctx_init(struct apk_digest_ctx *dctx, uint8_t alg)
|
||||||
|
+{
|
||||||
|
+ dctx->alg = alg;
|
||||||
|
+
|
||||||
|
+ mbedtls_md_init(&dctx->mdctx);
|
||||||
|
+ if (alg == APK_DIGEST_NONE) return 0;
|
||||||
|
+ if (mbedtls_md_setup(&dctx->mdctx, apk_digest_alg_to_mdinfo(alg), 0) ||
|
||||||
|
+ mbedtls_md_starts(&dctx->mdctx))
|
||||||
|
+ return -APKE_CRYPTO_ERROR;
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int apk_digest_ctx_reset(struct apk_digest_ctx *dctx)
|
||||||
|
+{
|
||||||
|
+ if (dctx->alg == APK_DIGEST_NONE) return 0;
|
||||||
|
+ if (mbedtls_md_starts(&dctx->mdctx)) return -APKE_CRYPTO_ERROR;
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int apk_digest_ctx_reset_alg(struct apk_digest_ctx *dctx, uint8_t alg)
|
||||||
|
+{
|
||||||
|
+ mbedtls_md_free(&dctx->mdctx);
|
||||||
|
+
|
||||||
|
+ dctx->alg = alg;
|
||||||
|
+ if (alg == APK_DIGEST_NONE) return 0;
|
||||||
|
+ if (mbedtls_md_setup(&dctx->mdctx, apk_digest_alg_to_mdinfo(alg), 0) ||
|
||||||
|
+ mbedtls_md_starts(&dctx->mdctx))
|
||||||
|
+ return -APKE_CRYPTO_ERROR;
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void apk_digest_ctx_free(struct apk_digest_ctx *dctx)
|
||||||
|
+{
|
||||||
|
+ mbedtls_md_free(&dctx->mdctx);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int apk_digest_ctx_update(struct apk_digest_ctx *dctx, const void *ptr, size_t sz)
|
||||||
|
+{
|
||||||
|
+ if (dctx->alg == APK_DIGEST_NONE) return 0;
|
||||||
|
+ return mbedtls_md_update(&dctx->mdctx, ptr, sz) == 0 ? 0 : -APKE_CRYPTO_ERROR;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int apk_digest_ctx_final(struct apk_digest_ctx *dctx, struct apk_digest *d)
|
||||||
|
+{
|
||||||
|
+ if (mbedtls_md_finish(&dctx->mdctx, d->data)) {
|
||||||
|
+ apk_digest_reset(d);
|
||||||
|
+ return -APKE_CRYPTO_ERROR;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ d->alg = dctx->alg;
|
||||||
|
+ d->len = apk_digest_alg_len(d->alg);
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int apk_load_file_at(int dirfd, const char *fn, unsigned char **buf, size_t *n)
|
||||||
|
+{
|
||||||
|
+ struct stat stats;
|
||||||
|
+ size_t size;
|
||||||
|
+ int fd;
|
||||||
|
+
|
||||||
|
+ if ((fd = openat(dirfd, fn, O_RDONLY|O_CLOEXEC)) < 0)
|
||||||
|
+ return -errno;
|
||||||
|
+
|
||||||
|
+ if (fstat(fd, &stats)) {
|
||||||
|
+ close(fd);
|
||||||
|
+ return -errno;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ size = (size_t)stats.st_size;
|
||||||
|
+ *n = size;
|
||||||
|
+
|
||||||
|
+ if (size == 0 || (*buf = mbedtls_calloc(1, size + 1)) == NULL)
|
||||||
|
+ return MBEDTLS_ERR_PK_ALLOC_FAILED;
|
||||||
|
+
|
||||||
|
+ if (read(fd, *buf, size) != size) {
|
||||||
|
+ close(fd);
|
||||||
|
+
|
||||||
|
+ mbedtls_platform_zeroize(*buf, size);
|
||||||
|
+ mbedtls_free(*buf);
|
||||||
|
+
|
||||||
|
+ return MBEDTLS_ERR_PK_FILE_IO_ERROR;
|
||||||
|
+ }
|
||||||
|
+ close(fd);
|
||||||
|
+
|
||||||
|
+ (*buf)[size] = '\0';
|
||||||
|
+
|
||||||
|
+ if (strstr((const char *) *buf, "-----BEGIN ") != NULL) {
|
||||||
|
+ ++*n;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int apk_pkey_init(struct apk_pkey *pkey)
|
||||||
|
+{
|
||||||
|
+ unsigned char dig[APK_DIGEST_MAX_LENGTH];
|
||||||
|
+ unsigned char pub[APK_ENC_KEY_MAX_LENGTH] = {};
|
||||||
|
+ unsigned char *c;
|
||||||
|
+ int len, r = -APKE_CRYPTO_ERROR;
|
||||||
|
+
|
||||||
|
+ c = pub + APK_ENC_KEY_MAX_LENGTH;
|
||||||
|
+
|
||||||
|
+ // key is written backwards into pub starting at c!
|
||||||
|
+ if ((len = mbedtls_pk_write_pubkey(&c, pub, &pkey->key)) < 0) return -APKE_CRYPTO_ERROR;
|
||||||
|
+ if (!mbedtls_md(apk_digest_alg_to_mdinfo(APK_DIGEST_SHA512), c, len, dig)) {
|
||||||
|
+ memcpy(pkey->id, dig, sizeof pkey->id);
|
||||||
|
+ r = 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return r;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void apk_pkey_free(struct apk_pkey *pkey)
|
||||||
|
+{
|
||||||
|
+ mbedtls_pk_free(&pkey->key);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int apk_random(void *ctx, unsigned char *out, size_t len)
|
||||||
|
+{
|
||||||
|
+ return (int)getrandom(out, len, 0);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#if MBEDTLS_VERSION_NUMBER >= 0x03000000
|
||||||
|
+static inline int apk_mbedtls_parse_privkey(struct apk_pkey *pkey, const unsigned char *buf, size_t blen)
|
||||||
|
+{
|
||||||
|
+ return mbedtls_pk_parse_key(&pkey->key, buf, blen, NULL, 0, apk_random, NULL);
|
||||||
|
+}
|
||||||
|
+static inline int apk_mbedtls_sign(struct apk_digest_ctx *dctx, struct apk_digest *dig,
|
||||||
|
+ unsigned char *sig, size_t *sig_len)
|
||||||
|
+{
|
||||||
|
+ return mbedtls_pk_sign(&dctx->sigver_key->key, apk_digest_alg_to_mbedtls_type(dctx->alg),
|
||||||
|
+ (const unsigned char *)&dig->data, dig->len, sig, sizeof *sig, sig_len,
|
||||||
|
+ apk_random, NULL);
|
||||||
|
+}
|
||||||
|
+#else
|
||||||
|
+static inline int apk_mbedtls_parse_privkey(struct apk_pkey *pkey, const unsigned char *buf, size_t blen)
|
||||||
|
+{
|
||||||
|
+ return mbedtls_pk_parse_key(&pkey->key, buf, blen, NULL, 0);
|
||||||
|
+}
|
||||||
|
+static inline int apk_mbedtls_sign(struct apk_digest_ctx *dctx, struct apk_digest *dig,
|
||||||
|
+ unsigned char *sig, size_t *sig_len)
|
||||||
|
+{
|
||||||
|
+ return mbedtls_pk_sign(&dctx->sigver_key->key, apk_digest_alg_to_mbedtls_type(dctx->alg),
|
||||||
|
+ (const unsigned char *)&dig->data, dig->len, sig, sig_len, apk_random, NULL);
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+int apk_pkey_load(struct apk_pkey *pkey, int dirfd, const char *fn)
|
||||||
|
+{
|
||||||
|
+ unsigned char *buf = NULL;
|
||||||
|
+ size_t blen = 0;
|
||||||
|
+ int ret;
|
||||||
|
+
|
||||||
|
+ if (apk_load_file_at(dirfd, fn, &buf, &blen))
|
||||||
|
+ return -APKE_CRYPTO_ERROR;
|
||||||
|
+
|
||||||
|
+ mbedtls_pk_init(&pkey->key);
|
||||||
|
+ if ((ret = mbedtls_pk_parse_public_key(&pkey->key, buf, blen)) != 0)
|
||||||
|
+ ret = apk_mbedtls_parse_privkey(pkey, buf, blen);
|
||||||
|
+
|
||||||
|
+ mbedtls_platform_zeroize(buf, blen);
|
||||||
|
+ mbedtls_free(buf);
|
||||||
|
+ if (ret != 0)
|
||||||
|
+ return -APKE_CRYPTO_KEY_FORMAT;
|
||||||
|
+
|
||||||
|
+ return apk_pkey_init(pkey);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int apk_sign_start(struct apk_digest_ctx *dctx, uint8_t alg, struct apk_pkey *pkey)
|
||||||
|
+{
|
||||||
|
+ if (apk_digest_ctx_reset_alg(dctx, alg))
|
||||||
|
+ return -APKE_CRYPTO_ERROR;
|
||||||
|
+
|
||||||
|
+ dctx->sigver_key = pkey;
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int apk_sign(struct apk_digest_ctx *dctx, void *sig, size_t *len)
|
||||||
|
+{
|
||||||
|
+ struct apk_digest dig;
|
||||||
|
+ int r = 0;
|
||||||
|
+
|
||||||
|
+ if (apk_digest_ctx_final(dctx, &dig))
|
||||||
|
+ return -APKE_SIGNATURE_GEN_FAILURE;
|
||||||
|
+
|
||||||
|
+ if (apk_mbedtls_sign(dctx, &dig, sig, len))
|
||||||
|
+ r = -APKE_SIGNATURE_GEN_FAILURE;
|
||||||
|
+
|
||||||
|
+ dctx->sigver_key = NULL;
|
||||||
|
+ return r;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int apk_verify_start(struct apk_digest_ctx *dctx, uint8_t alg, struct apk_pkey *pkey)
|
||||||
|
+{
|
||||||
|
+ if (apk_digest_ctx_reset_alg(dctx, alg))
|
||||||
|
+ return -APKE_CRYPTO_ERROR;
|
||||||
|
+
|
||||||
|
+ dctx->sigver_key = pkey;
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int apk_verify(struct apk_digest_ctx *dctx, void *sig, size_t len)
|
||||||
|
+{
|
||||||
|
+ struct apk_digest dig;
|
||||||
|
+ int r = 0;
|
||||||
|
+
|
||||||
|
+ if (apk_digest_ctx_final(dctx, &dig))
|
||||||
|
+ return -APKE_SIGNATURE_GEN_FAILURE;
|
||||||
|
+
|
||||||
|
+ if (mbedtls_pk_verify(&dctx->sigver_key->key, apk_digest_alg_to_mbedtls_type(dctx->alg),
|
||||||
|
+ (const unsigned char *)&dig.data, dig.len, sig, len))
|
||||||
|
+ r = -APKE_SIGNATURE_INVALID;
|
||||||
|
+
|
||||||
|
+ dctx->sigver_key = NULL;
|
||||||
|
+ return r;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void apk_crypto_cleanup(void)
|
||||||
|
+{
|
||||||
|
+#ifdef MBEDTLS_PSA_CRYPTO_C
|
||||||
|
+ mbedtls_psa_crypto_free();
|
||||||
|
+#endif
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void apk_crypto_init(void)
|
||||||
|
+{
|
||||||
|
+ atexit(apk_crypto_cleanup);
|
||||||
|
+
|
||||||
|
+#ifdef MBEDTLS_PSA_CRYPTO_C
|
||||||
|
+ psa_crypto_init();
|
||||||
|
+#endif
|
||||||
|
+}
|
||||||
|
diff --git a/src/meson.build b/src/meson.build
|
||||||
|
index 38e9d3b0..e1204fc0 100644
|
||||||
|
--- a/src/meson.build
|
||||||
|
+++ b/src/meson.build
|
||||||
|
@@ -1,3 +1,4 @@
|
||||||
|
+crypto_backend = get_option('crypto_backend')
|
||||||
|
url_backend = get_option('url_backend')
|
||||||
|
|
||||||
|
libapk_so_version = '2.99.0'
|
||||||
|
@@ -15,7 +16,7 @@ libapk_src = [
|
||||||
|
'common.c',
|
||||||
|
'context.c',
|
||||||
|
'crypto.c',
|
||||||
|
- 'crypto_openssl.c',
|
||||||
|
+ 'crypto_@0@.c'.format(crypto_backend),
|
||||||
|
'ctype.c',
|
||||||
|
'database.c',
|
||||||
|
'extract_v2.c',
|
||||||
|
@@ -40,7 +41,7 @@ libapk_headers = [
|
||||||
|
'apk_atom.h',
|
||||||
|
'apk_blob.h',
|
||||||
|
'apk_crypto.h',
|
||||||
|
- 'apk_crypto_openssl.h',
|
||||||
|
+ 'apk_crypto_@0@.h'.format(crypto_backend),
|
||||||
|
'apk_ctype.h',
|
||||||
|
'apk_database.h',
|
||||||
|
'apk_defines.h',
|
||||||
|
@@ -89,6 +90,17 @@ apk_src = [
|
||||||
|
'applet.c',
|
||||||
|
]
|
||||||
|
|
||||||
|
+apk_cargs = [
|
||||||
|
+ '-DAPK_VERSION="' + meson.project_version() + '"',
|
||||||
|
+ '-D_ATFILE_SOURCE',
|
||||||
|
+]
|
||||||
|
+
|
||||||
|
+if crypto_backend == 'openssl'
|
||||||
|
+ apk_cargs += [ '-DCRYPTO_USE_OPENSSL' ]
|
||||||
|
+elif crypto_backend == 'mbedtls'
|
||||||
|
+ apk_cargs += [ '-DCRYPTO_USE_MBEDTLS' ]
|
||||||
|
+endif
|
||||||
|
+
|
||||||
|
if lua_bin.found()
|
||||||
|
genhelp_script = files('genhelp.lua')
|
||||||
|
genhelp_args = [lua_bin, genhelp_script, '@INPUT@']
|
||||||
|
@@ -115,11 +127,6 @@ endif
|
||||||
|
|
||||||
|
apk_src += [ generated_help ]
|
||||||
|
|
||||||
|
-apk_cargs = [
|
||||||
|
- '-DAPK_VERSION="' + meson.project_version() + '"',
|
||||||
|
- '-D_ATFILE_SOURCE',
|
||||||
|
-]
|
||||||
|
-
|
||||||
|
apk_arch_prefix = get_option('arch_prefix')
|
||||||
|
if apk_arch_prefix != ''
|
||||||
|
apk_cargs += ['-DAPK_ARCH_PREFIX="@0@"'.format(apk_arch_prefix)]
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
||||||
|
|
||||||
|
From 34bb1021284dccbf97f02b0a0bb9e751b8887cad Mon Sep 17 00:00:00 2001
|
||||||
|
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||||
|
Date: Tue, 16 Apr 2024 17:56:45 +0200
|
||||||
|
Subject: [PATCH 4/4] add option to configure crypto backend in legacy make
|
||||||
|
build system
|
||||||
|
|
||||||
|
Define CRYPTO to select mbedtls as alternative crypto backend. By
|
||||||
|
default openssl is used.
|
||||||
|
|
||||||
|
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||||
|
---
|
||||||
|
src/Makefile | 20 +++++++++++++++-----
|
||||||
|
1 file changed, 15 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/Makefile b/src/Makefile
|
||||||
|
index efdc68df..97db0e72 100644
|
||||||
|
--- a/src/Makefile
|
||||||
|
+++ b/src/Makefile
|
||||||
|
@@ -20,9 +20,9 @@ libapk_soname := 2.99.0
|
||||||
|
libapk_so := $(obj)/libapk.so.$(libapk_soname)
|
||||||
|
libapk.so.$(libapk_soname)-objs := \
|
||||||
|
adb.o adb_comp.o adb_walk_adb.o adb_walk_genadb.o adb_walk_gentext.o adb_walk_text.o apk_adb.o \
|
||||||
|
- atom.o blob.o commit.o common.o context.o crypto.o crypto_openssl.o ctype.o database.o hash.o \
|
||||||
|
- extract_v2.o extract_v3.o fs_fsys.o fs_uvol.o io.o io_gunzip.o tar.o package.o pathbuilder.o \
|
||||||
|
- print.o solver.o trust.o version.o
|
||||||
|
+ atom.o blob.o commit.o common.o context.o crypto.o ctype.o database.o hash.o extract_v2.o \
|
||||||
|
+ extract_v3.o fs_fsys.o fs_uvol.o io.o io_gunzip.o tar.o package.o pathbuilder.o print.o \
|
||||||
|
+ solver.o trust.o version.o
|
||||||
|
|
||||||
|
libapk.so.$(libapk_soname)-libs :=
|
||||||
|
|
||||||
|
@@ -34,6 +34,16 @@ libapk.so.$(libapk_soname)-objs += io_url_libfetch.o
|
||||||
|
libapk.so.$(libapk_soname)-libs += libfetch/libfetch.a
|
||||||
|
endif
|
||||||
|
|
||||||
|
+ifeq ($(CRYPTO),mbedtls)
|
||||||
|
+CRYPTO_CFLAGS := $(shell $(PKG_CONFIG) --cflags mbedtls mbedcrypto) -DCRYPTO_USE_MBEDTLS
|
||||||
|
+CRYPTO_LIBS := $(shell $(PKG_CONFIG) --libs mbedtls mbedcrypto)
|
||||||
|
+libapk.so.$(libapk_soname)-objs += crypto_mbedtls.o
|
||||||
|
+else
|
||||||
|
+CRYPTO_CFLAGS := $(shell $(PKG_CONFIG) --cflags openssl) -DCRYPTO_USE_OPENSSL
|
||||||
|
+CRYPTO_LIBS := $(shell $(PKG_CONFIG) --libs openssl)
|
||||||
|
+libapk.so.$(libapk_soname)-objs += crypto_openssl.o
|
||||||
|
+endif
|
||||||
|
+
|
||||||
|
# ZSTD support can be disabled
|
||||||
|
ifneq ($(ZSTD),no)
|
||||||
|
ZSTD_CFLAGS := $(shell $(PKG_CONFIG) --cflags libzstd)
|
||||||
|
@@ -100,9 +110,9 @@ LIBS_apk.static := -Wl,--as-needed -ldl -Wl,--no-as-needed
|
||||||
|
LDFLAGS_apk += -L$(obj)
|
||||||
|
LDFLAGS_apk-test += -L$(obj)
|
||||||
|
|
||||||
|
-CFLAGS_ALL += $(OPENSSL_CFLAGS) $(ZLIB_CFLAGS) $(ZSTD_CFLAGS)
|
||||||
|
+CFLAGS_ALL += $(CRYPTO_CFLAGS) $(ZLIB_CFLAGS) $(ZSTD_CFLAGS)
|
||||||
|
LIBS := -Wl,--as-needed \
|
||||||
|
- $(OPENSSL_LIBS) $(ZLIB_LIBS) $(ZSTD_LIBS) \
|
||||||
|
+ $(CRYPTO_LIBS) $(ZLIB_LIBS) $(ZSTD_LIBS) \
|
||||||
|
-Wl,--no-as-needed
|
||||||
|
|
||||||
|
# Help generation
|
||||||
|
--
|
||||||
|
GitLab
|
@ -592,18 +592,21 @@ _procd_set_config_changed() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
procd_add_mdns_service() {
|
procd_add_mdns_service() {
|
||||||
local service proto port
|
local service proto port txt_count=0
|
||||||
service=$1; shift
|
service=$1; shift
|
||||||
proto=$1; shift
|
proto=$1; shift
|
||||||
port=$1; shift
|
port=$1; shift
|
||||||
json_add_object "${service}_$port"
|
json_add_object "${service}_$port"
|
||||||
json_add_string "service" "_$service._$proto.local"
|
json_add_string "service" "_$service._$proto.local"
|
||||||
json_add_int port "$port"
|
json_add_int port "$port"
|
||||||
[ -n "$1" ] && {
|
for txt in "$@"; do
|
||||||
json_add_array txt
|
[ -z "$txt" ] && continue
|
||||||
for txt in "$@"; do json_add_string "" "$txt"; done
|
txt_count=$((txt_count+1))
|
||||||
json_select ..
|
[ $txt_count -eq 1 ] && json_add_array txt
|
||||||
}
|
json_add_string "" "$txt"
|
||||||
|
done
|
||||||
|
[ $txt_count -gt 0 ] && json_select ..
|
||||||
|
|
||||||
json_select ..
|
json_select ..
|
||||||
}
|
}
|
||||||
|
|
||||||
|
184
package/utils/audit/Makefile
Normal file
184
package/utils/audit/Makefile
Normal file
@ -0,0 +1,184 @@
|
|||||||
|
#
|
||||||
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
# See /LICENSE for more information.
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=audit-userspace
|
||||||
|
PKG_VERSION:=3.1.4
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
|
PKG_SOURCE_URL:=https://github.com/linux-audit/audit-userspace/archive/refs/tags/v$(PKG_VERSION).tar.gz?
|
||||||
|
PKG_HASH:=aec501760acd13ebbe00e78b9b59f795d16a430b1d673628e346cd18905c594b
|
||||||
|
PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||||
|
PKG_LICENSE:=GPL-2.0-or-later
|
||||||
|
PKG_LICENSE_FILES:=COPYING
|
||||||
|
PKG_CPE_ID:=cpe:/a:linux_audit_project:linux_audit
|
||||||
|
|
||||||
|
PKG_CONFIG_DEPENDS:=CONFIG_KERNEL_IO_URING
|
||||||
|
PKG_FIXUP:=autoreconf
|
||||||
|
|
||||||
|
PKG_BUILD_FLAGS:=no-mips16
|
||||||
|
PKG_INSTALL:=1
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
include $(INCLUDE_DIR)/host-build.mk
|
||||||
|
|
||||||
|
define Package/audit/Default
|
||||||
|
TITLE:=Audit
|
||||||
|
URL:=https://github.com/linux-audit/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/audit/Default/description
|
||||||
|
The audit package contains the user space utilities for
|
||||||
|
storing and searching the audit records generated by
|
||||||
|
the audit subsystem in the kernel.
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/libaudit
|
||||||
|
$(call Package/audit/Default)
|
||||||
|
SECTION:=libs
|
||||||
|
CATEGORY:=Libraries
|
||||||
|
TITLE+= (libaudit)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/libaudit/description
|
||||||
|
$(call Package/audit/Default/description)
|
||||||
|
This package contains the audit shared library.
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/libauparse
|
||||||
|
$(call Package/audit/Default)
|
||||||
|
SECTION:=libs
|
||||||
|
CATEGORY:=Libraries
|
||||||
|
TITLE+= (libauparse)
|
||||||
|
DEPENDS:= +libaudit
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/libauparse/description
|
||||||
|
$(call Package/audit/Default/description)
|
||||||
|
This package contains the audit parsing shared library.
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/audit-utils
|
||||||
|
$(call Package/audit/Default)
|
||||||
|
SECTION:=admin
|
||||||
|
CATEGORY:=Administration
|
||||||
|
TITLE+= (utilities)
|
||||||
|
DEPENDS:= +libaudit +libauparse
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/audit-utils/description
|
||||||
|
$(call Package/audit/Default/description)
|
||||||
|
This package contains the audit utilities.
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/auditd
|
||||||
|
$(call Package/audit/Default)
|
||||||
|
SECTION:=admin
|
||||||
|
CATEGORY:=Administration
|
||||||
|
TITLE+= (daemon)
|
||||||
|
DEPENDS:= +libaudit +libauparse +audit-utils +libev
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/auditd/description
|
||||||
|
$(call Package/audit/Default/description)
|
||||||
|
This package contains the audit daemon.
|
||||||
|
endef
|
||||||
|
|
||||||
|
CONFIGURE_VARS += \
|
||||||
|
LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
|
||||||
|
CPPFLAGS_FOR_BUILD="$(HOST_CPPFLAGS)" \
|
||||||
|
CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
|
||||||
|
CC_FOR_BUILD="$(HOSTCC)"
|
||||||
|
|
||||||
|
CONFIGURE_ARGS += \
|
||||||
|
--with-debug \
|
||||||
|
--disable-systemd \
|
||||||
|
--disable-zos-remote \
|
||||||
|
--disable-gssapi-krb5 \
|
||||||
|
--without-libcap-ng \
|
||||||
|
--without-python \
|
||||||
|
--without-python3 \
|
||||||
|
--without-golang
|
||||||
|
|
||||||
|
ifeq ($(ARCH),aarch64)
|
||||||
|
CONFIGURE_ARGS += --with-aarch64
|
||||||
|
else ifeq ($(ARCH),arm)
|
||||||
|
CONFIGURE_ARGS += --with-arm
|
||||||
|
endif
|
||||||
|
|
||||||
|
HOST_CONFIGURE_ARGS += \
|
||||||
|
--disable-systemd \
|
||||||
|
--disable-zos-remote \
|
||||||
|
--disable-gssapi-krb5 \
|
||||||
|
--without-libcap-ng \
|
||||||
|
--without-python \
|
||||||
|
--without-python3 \
|
||||||
|
--without-golang
|
||||||
|
|
||||||
|
define Host/Install
|
||||||
|
+$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/lib $(HOST_MAKE_FLAGS) install
|
||||||
|
+$(HOST_MAKE_VARS) $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/init.d $(HOST_MAKE_FLAGS) install
|
||||||
|
endef
|
||||||
|
|
||||||
|
# We can't use the default, as the default passes $(MAKE_ARGS), which
|
||||||
|
# overrides CC, CFLAGS, etc. and defeats the *_FOR_BUILD definitions
|
||||||
|
# passed in CONFIGURE_VARS
|
||||||
|
define Build/Compile
|
||||||
|
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Install
|
||||||
|
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/lib $(MAKE_INSTALL_FLAGS) install
|
||||||
|
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/init.d $(MAKE_INSTALL_FLAGS) install
|
||||||
|
$(call Build/Install/Default,install)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/InstallDev
|
||||||
|
$(INSTALL_DIR) $(1)/usr/include
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||||
|
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/libaudit/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libaudit.so* $(1)/usr/lib/
|
||||||
|
$(INSTALL_DIR) $(1)/etc
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/etc/libaudit.conf $(1)/etc/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/libauparse/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libauparse.so* $(1)/usr/lib/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/audit-utils/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/bin
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
|
||||||
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
|
$(CP) \
|
||||||
|
$(PKG_INSTALL_DIR)/usr/sbin/{audisp-remote,audisp-syslog,auditctl,augenrules,aureport,ausearch,autrace} \
|
||||||
|
$(1)/usr/sbin/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/auditd/install
|
||||||
|
$(INSTALL_DIR) $(1)/etc/audit
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/etc/audit/* $(1)/etc/audit/
|
||||||
|
# af_unix plugin is not installed. Remove it's .conf.
|
||||||
|
if [[ -f $(1)/etc/audit/plugins.d/af_unix.conf ]] ; then rm $(1)/etc/audit/plugins.d/af_unix.conf ; fi
|
||||||
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
|
$(INSTALL_BIN) ./files/audit.init $(1)/etc/init.d/audit
|
||||||
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
|
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/auditd $(1)/usr/sbin/
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call HostBuild))
|
||||||
|
$(eval $(call BuildPackage,libaudit))
|
||||||
|
$(eval $(call BuildPackage,libauparse))
|
||||||
|
$(eval $(call BuildPackage,audit-utils))
|
||||||
|
$(eval $(call BuildPackage,auditd))
|
16
package/utils/audit/files/audit.init
Normal file
16
package/utils/audit/files/audit.init
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
# Copyright (c) 2014 OpenWrt.org
|
||||||
|
|
||||||
|
START=11
|
||||||
|
|
||||||
|
USE_PROCD=1
|
||||||
|
PROG=/usr/sbin/auditd
|
||||||
|
|
||||||
|
start_service() {
|
||||||
|
mkdir -p /var/log/audit
|
||||||
|
procd_open_instance
|
||||||
|
procd_set_param command "$PROG" -n
|
||||||
|
procd_set_param respawn
|
||||||
|
procd_close_instance
|
||||||
|
test -f /etc/audit/rules.d/audit.rules && /usr/sbin/auditctl -R /etc/audit/rules.d/audit.rules
|
||||||
|
}
|
@ -9,6 +9,58 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "uencrypt.h"
|
#include "uencrypt.h"
|
||||||
|
|
||||||
|
#if MBEDTLS_VERSION_NUMBER < 0x03010000 /* mbedtls 3.1.0 */
|
||||||
|
static inline mbedtls_cipher_mode_t mbedtls_cipher_info_get_mode(
|
||||||
|
const mbedtls_cipher_info_t *info)
|
||||||
|
{
|
||||||
|
if (info == NULL) {
|
||||||
|
return MBEDTLS_MODE_NONE;
|
||||||
|
} else {
|
||||||
|
return info->mode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline size_t mbedtls_cipher_info_get_key_bitlen(
|
||||||
|
const mbedtls_cipher_info_t *info)
|
||||||
|
{
|
||||||
|
if (info == NULL) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return info->key_bitlen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline const char *mbedtls_cipher_info_get_name(
|
||||||
|
const mbedtls_cipher_info_t *info)
|
||||||
|
{
|
||||||
|
if (info == NULL) {
|
||||||
|
return NULL;
|
||||||
|
} else {
|
||||||
|
return info->name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline size_t mbedtls_cipher_info_get_iv_size(
|
||||||
|
const mbedtls_cipher_info_t *info)
|
||||||
|
{
|
||||||
|
if (info == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return info->iv_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline size_t mbedtls_cipher_info_get_block_size(
|
||||||
|
const mbedtls_cipher_info_t *info)
|
||||||
|
{
|
||||||
|
if (info == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return info->block_size;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
unsigned char *hexstr2buf(const char *str, long *len)
|
unsigned char *hexstr2buf(const char *str, long *len)
|
||||||
{
|
{
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
@ -50,7 +102,7 @@ const cipher_t *get_cipher_or_print_error(char *name)
|
|||||||
cipher = mbedtls_cipher_info_from_type(*list);
|
cipher = mbedtls_cipher_info_from_type(*list);
|
||||||
if (!cipher)
|
if (!cipher)
|
||||||
continue;
|
continue;
|
||||||
fprintf(stderr, "\t%s\n", cipher->name);
|
fprintf(stderr, "\t%s\n", mbedtls_cipher_info_get_name(cipher));
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -59,14 +111,14 @@ int get_cipher_ivsize(const cipher_t *cipher)
|
|||||||
{
|
{
|
||||||
const mbedtls_cipher_info_t *c = cipher;
|
const mbedtls_cipher_info_t *c = cipher;
|
||||||
|
|
||||||
return c->iv_size;
|
return mbedtls_cipher_info_get_iv_size(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
int get_cipher_keysize(const cipher_t *cipher)
|
int get_cipher_keysize(const cipher_t *cipher)
|
||||||
{
|
{
|
||||||
const mbedtls_cipher_info_t *c = cipher;
|
const mbedtls_cipher_info_t *c = cipher;
|
||||||
|
|
||||||
return c->key_bitlen >> 3;
|
return mbedtls_cipher_info_get_key_bitlen(c) >> 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx_t *create_ctx(const cipher_t *cipher, const unsigned char *key,
|
ctx_t *create_ctx(const cipher_t *cipher, const unsigned char *key,
|
||||||
@ -103,7 +155,7 @@ ctx_t *create_ctx(const cipher_t *cipher, const unsigned char *key,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cipher_info->mode == MBEDTLS_MODE_CBC) {
|
if (mbedtls_cipher_info_get_mode(cipher_info) == MBEDTLS_MODE_CBC) {
|
||||||
ret = mbedtls_cipher_set_padding_mode(ctx, padding ?
|
ret = mbedtls_cipher_set_padding_mode(ctx, padding ?
|
||||||
MBEDTLS_PADDING_PKCS7 :
|
MBEDTLS_PADDING_PKCS7 :
|
||||||
MBEDTLS_PADDING_NONE);
|
MBEDTLS_PADDING_NONE);
|
||||||
@ -113,7 +165,7 @@ ctx_t *create_ctx(const cipher_t *cipher, const unsigned char *key,
|
|||||||
goto abort;
|
goto abort;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (cipher_info->block_size > 1 && padding) {
|
if (mbedtls_cipher_info_get_block_size(cipher_info) > 1 && padding) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Error: mbedTLS only allows padding with CBC ciphers.\n");
|
"Error: mbedTLS only allows padding with CBC ciphers.\n");
|
||||||
goto abort;
|
goto abort;
|
||||||
|
@ -85,12 +85,12 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ivlen != get_cipher_ivsize(cipher)) {
|
if (ivlen != get_cipher_ivsize(cipher)) {
|
||||||
fprintf(stderr, "Error: IV must be %d bytes; given IV is %zd bytes.\n",
|
fprintf(stderr, "Error: IV must be %d bytes; given IV is %ld bytes.\n",
|
||||||
get_cipher_ivsize(cipher), ivlen);
|
get_cipher_ivsize(cipher), ivlen);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
if (keylen != get_cipher_keysize(cipher)) {
|
if (keylen != get_cipher_keysize(cipher)) {
|
||||||
fprintf(stderr, "Error: key must be %d bytes; given key is %zd bytes.\n",
|
fprintf(stderr, "Error: key must be %d bytes; given key is %ld bytes.\n",
|
||||||
get_cipher_keysize(cipher), keylen);
|
get_cipher_keysize(cipher), keylen);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ bump_kernel()
|
|||||||
git commit \
|
git commit \
|
||||||
--signoff \
|
--signoff \
|
||||||
--message "kernel/${platform_name}: Restore kernel files for v${source_version}" \
|
--message "kernel/${platform_name}: Restore kernel files for v${source_version}" \
|
||||||
--message "$(printf "This is an automatically generated commit which aids following Kernel patch history,\nas git will see the move and copy as a rename thus defeating the purpose.\n\nSee: https://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041673.html\nfor the original discussion.")"
|
--message "$(printf "This is an automatically generated commit which aids following Kernel patch\nhistory, as git will see the move and copy as a rename thus defeating the\npurpose.\n\nFor the original discussion see:\nhttps://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041673.html")"
|
||||||
git switch "${initial_branch:?Unable to switch back to original branch. Quitting.}"
|
git switch "${initial_branch:?Unable to switch back to original branch. Quitting.}"
|
||||||
GIT_EDITOR=true git merge --no-ff '__openwrt_kernel_files_mover'
|
GIT_EDITOR=true git merge --no-ff '__openwrt_kernel_files_mover'
|
||||||
git branch --delete '__openwrt_kernel_files_mover'
|
git branch --delete '__openwrt_kernel_files_mover'
|
||||||
|
@ -10,8 +10,7 @@ BOARDNAME:=Microchip (Atmel AT91)
|
|||||||
FEATURES:=ext4 squashfs targz usbgadget ubifs
|
FEATURES:=ext4 squashfs targz usbgadget ubifs
|
||||||
SUBTARGETS:=sama7 sama5 sam9x
|
SUBTARGETS:=sama7 sama5 sam9x
|
||||||
|
|
||||||
KERNEL_PATCHVER:=5.15
|
KERNEL_PATCHVER:=6.1
|
||||||
KERNEL_TESTING_PATCHVER:=6.1
|
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/target.mk
|
include $(INCLUDE_DIR)/target.mk
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,89 +0,0 @@
|
|||||||
From 63a0c32028148e91ea91cfbf95841c4ecd69d21b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Date: Mon, 11 Oct 2021 14:27:06 +0300
|
|
||||||
Subject: [PATCH 235/247] clk: at91: pmc: execute suspend/resume only for
|
|
||||||
backup mode
|
|
||||||
|
|
||||||
Before going to backup mode architecture specific PM code sets the first
|
|
||||||
word in securam (file arch/arm/mach-at91/pm.c, function at91_pm_begin()).
|
|
||||||
Thus take this into account when suspending/resuming clocks. This will
|
|
||||||
avoid executing unnecessary instructions when suspending to non backup
|
|
||||||
modes.
|
|
||||||
|
|
||||||
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Link: https://lore.kernel.org/r/20211011112719.3951784-3-claudiu.beznea@microchip.com
|
|
||||||
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
|
|
||||||
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
|
|
||||||
---
|
|
||||||
drivers/clk/at91/pmc.c | 39 +++++++++++++++++++++++++++++++++++++++
|
|
||||||
1 file changed, 39 insertions(+)
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/pmc.c
|
|
||||||
+++ b/drivers/clk/at91/pmc.c
|
|
||||||
@@ -8,6 +8,7 @@
|
|
||||||
#include <linux/clkdev.h>
|
|
||||||
#include <linux/clk/at91_pmc.h>
|
|
||||||
#include <linux/of.h>
|
|
||||||
+#include <linux/of_address.h>
|
|
||||||
#include <linux/mfd/syscon.h>
|
|
||||||
#include <linux/platform_device.h>
|
|
||||||
#include <linux/regmap.h>
|
|
||||||
@@ -110,13 +111,35 @@ struct pmc_data *pmc_data_allocate(unsig
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
+
|
|
||||||
+/* Address in SECURAM that say if we suspend to backup mode. */
|
|
||||||
+static void __iomem *at91_pmc_backup_suspend;
|
|
||||||
+
|
|
||||||
static int at91_pmc_suspend(void)
|
|
||||||
{
|
|
||||||
+ unsigned int backup;
|
|
||||||
+
|
|
||||||
+ if (!at91_pmc_backup_suspend)
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
+ backup = readl_relaxed(at91_pmc_backup_suspend);
|
|
||||||
+ if (!backup)
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
return clk_save_context();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void at91_pmc_resume(void)
|
|
||||||
{
|
|
||||||
+ unsigned int backup;
|
|
||||||
+
|
|
||||||
+ if (!at91_pmc_backup_suspend)
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ backup = readl_relaxed(at91_pmc_backup_suspend);
|
|
||||||
+ if (!backup)
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
clk_restore_context();
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -144,6 +167,22 @@ static int __init pmc_register_ops(void)
|
|
||||||
}
|
|
||||||
of_node_put(np);
|
|
||||||
|
|
||||||
+ np = of_find_compatible_node(NULL, NULL, "atmel,sama5d2-securam");
|
|
||||||
+ if (!np)
|
|
||||||
+ return -ENODEV;
|
|
||||||
+
|
|
||||||
+ if (!of_device_is_available(np)) {
|
|
||||||
+ of_node_put(np);
|
|
||||||
+ return -ENODEV;
|
|
||||||
+ }
|
|
||||||
+ of_node_put(np);
|
|
||||||
+
|
|
||||||
+ at91_pmc_backup_suspend = of_iomap(np, 0);
|
|
||||||
+ if (!at91_pmc_backup_suspend) {
|
|
||||||
+ pr_warn("%s(): unable to map securam\n", __func__);
|
|
||||||
+ return -ENOMEM;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
register_syscore_ops(&pmc_syscore_ops);
|
|
||||||
|
|
||||||
return 0;
|
|
@ -1,124 +0,0 @@
|
|||||||
From c716562753d1e51a1c53647aa77a332f97187d15 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Date: Mon, 11 Oct 2021 14:27:08 +0300
|
|
||||||
Subject: [PATCH 237/247] clk: at91: clk-master: add register definition for
|
|
||||||
sama7g5's master clock
|
|
||||||
|
|
||||||
SAMA7G5 has 4 master clocks (MCK1..4) which are controlled though the
|
|
||||||
register at offset 0x30 (relative to PMC). In the last/first phase of
|
|
||||||
suspend/resume procedure (which is architecture specific) the parent
|
|
||||||
of master clocks are changed (via assembly code) for more power saving
|
|
||||||
(see file arch/arm/mach-at91/pm_suspend.S, macros at91_mckx_ps_enable
|
|
||||||
and at91_mckx_ps_restore). Thus the macros corresponding to register
|
|
||||||
at offset 0x30 need to be shared b/w clk-master.c and pm_suspend.S.
|
|
||||||
commit ec03f18cc222 ("clk: at91: add register definition for sama7g5's
|
|
||||||
master clock") introduced the proper macros but didn't adapted the
|
|
||||||
clk-master.c as well. Thus, this commit adapt the clk-master.c to use
|
|
||||||
the macros introduced in commit ec03f18cc222 ("clk: at91: add register
|
|
||||||
definition for sama7g5's master clock").
|
|
||||||
|
|
||||||
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Link: https://lore.kernel.org/r/20211011112719.3951784-5-claudiu.beznea@microchip.com
|
|
||||||
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
|
|
||||||
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
|
|
||||||
---
|
|
||||||
drivers/clk/at91/clk-master.c | 50 ++++++++++++++++-------------------
|
|
||||||
1 file changed, 23 insertions(+), 27 deletions(-)
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/clk-master.c
|
|
||||||
+++ b/drivers/clk/at91/clk-master.c
|
|
||||||
@@ -17,15 +17,7 @@
|
|
||||||
#define MASTER_DIV_SHIFT 8
|
|
||||||
#define MASTER_DIV_MASK 0x7
|
|
||||||
|
|
||||||
-#define PMC_MCR 0x30
|
|
||||||
-#define PMC_MCR_ID_MSK GENMASK(3, 0)
|
|
||||||
-#define PMC_MCR_CMD BIT(7)
|
|
||||||
-#define PMC_MCR_DIV GENMASK(10, 8)
|
|
||||||
-#define PMC_MCR_CSS GENMASK(20, 16)
|
|
||||||
#define PMC_MCR_CSS_SHIFT (16)
|
|
||||||
-#define PMC_MCR_EN BIT(28)
|
|
||||||
-
|
|
||||||
-#define PMC_MCR_ID(x) ((x) & PMC_MCR_ID_MSK)
|
|
||||||
|
|
||||||
#define MASTER_MAX_ID 4
|
|
||||||
|
|
||||||
@@ -687,20 +679,22 @@ static void clk_sama7g5_master_set(struc
|
|
||||||
{
|
|
||||||
unsigned long flags;
|
|
||||||
unsigned int val, cparent;
|
|
||||||
- unsigned int enable = status ? PMC_MCR_EN : 0;
|
|
||||||
+ unsigned int enable = status ? AT91_PMC_MCR_V2_EN : 0;
|
|
||||||
|
|
||||||
spin_lock_irqsave(master->lock, flags);
|
|
||||||
|
|
||||||
- regmap_write(master->regmap, PMC_MCR, PMC_MCR_ID(master->id));
|
|
||||||
- regmap_read(master->regmap, PMC_MCR, &val);
|
|
||||||
- regmap_update_bits(master->regmap, PMC_MCR,
|
|
||||||
- enable | PMC_MCR_CSS | PMC_MCR_DIV |
|
|
||||||
- PMC_MCR_CMD | PMC_MCR_ID_MSK,
|
|
||||||
+ regmap_write(master->regmap, AT91_PMC_MCR_V2,
|
|
||||||
+ AT91_PMC_MCR_V2_ID(master->id));
|
|
||||||
+ regmap_read(master->regmap, AT91_PMC_MCR_V2, &val);
|
|
||||||
+ regmap_update_bits(master->regmap, AT91_PMC_MCR_V2,
|
|
||||||
+ enable | AT91_PMC_MCR_V2_CSS | AT91_PMC_MCR_V2_DIV |
|
|
||||||
+ AT91_PMC_MCR_V2_CMD | AT91_PMC_MCR_V2_ID_MSK,
|
|
||||||
enable | (master->parent << PMC_MCR_CSS_SHIFT) |
|
|
||||||
(master->div << MASTER_DIV_SHIFT) |
|
|
||||||
- PMC_MCR_CMD | PMC_MCR_ID(master->id));
|
|
||||||
+ AT91_PMC_MCR_V2_CMD |
|
|
||||||
+ AT91_PMC_MCR_V2_ID(master->id));
|
|
||||||
|
|
||||||
- cparent = (val & PMC_MCR_CSS) >> PMC_MCR_CSS_SHIFT;
|
|
||||||
+ cparent = (val & AT91_PMC_MCR_V2_CSS) >> PMC_MCR_CSS_SHIFT;
|
|
||||||
|
|
||||||
/* Wait here only if parent is being changed. */
|
|
||||||
while ((cparent != master->parent) && !clk_master_ready(master))
|
|
||||||
@@ -725,10 +719,12 @@ static void clk_sama7g5_master_disable(s
|
|
||||||
|
|
||||||
spin_lock_irqsave(master->lock, flags);
|
|
||||||
|
|
||||||
- regmap_write(master->regmap, PMC_MCR, master->id);
|
|
||||||
- regmap_update_bits(master->regmap, PMC_MCR,
|
|
||||||
- PMC_MCR_EN | PMC_MCR_CMD | PMC_MCR_ID_MSK,
|
|
||||||
- PMC_MCR_CMD | PMC_MCR_ID(master->id));
|
|
||||||
+ regmap_write(master->regmap, AT91_PMC_MCR_V2, master->id);
|
|
||||||
+ regmap_update_bits(master->regmap, AT91_PMC_MCR_V2,
|
|
||||||
+ AT91_PMC_MCR_V2_EN | AT91_PMC_MCR_V2_CMD |
|
|
||||||
+ AT91_PMC_MCR_V2_ID_MSK,
|
|
||||||
+ AT91_PMC_MCR_V2_CMD |
|
|
||||||
+ AT91_PMC_MCR_V2_ID(master->id));
|
|
||||||
|
|
||||||
spin_unlock_irqrestore(master->lock, flags);
|
|
||||||
}
|
|
||||||
@@ -741,12 +737,12 @@ static int clk_sama7g5_master_is_enabled
|
|
||||||
|
|
||||||
spin_lock_irqsave(master->lock, flags);
|
|
||||||
|
|
||||||
- regmap_write(master->regmap, PMC_MCR, master->id);
|
|
||||||
- regmap_read(master->regmap, PMC_MCR, &val);
|
|
||||||
+ regmap_write(master->regmap, AT91_PMC_MCR_V2, master->id);
|
|
||||||
+ regmap_read(master->regmap, AT91_PMC_MCR_V2, &val);
|
|
||||||
|
|
||||||
spin_unlock_irqrestore(master->lock, flags);
|
|
||||||
|
|
||||||
- return !!(val & PMC_MCR_EN);
|
|
||||||
+ return !!(val & AT91_PMC_MCR_V2_EN);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int clk_sama7g5_master_set_rate(struct clk_hw *hw, unsigned long rate,
|
|
||||||
@@ -842,10 +838,10 @@ at91_clk_sama7g5_register_master(struct
|
|
||||||
master->mux_table = mux_table;
|
|
||||||
|
|
||||||
spin_lock_irqsave(master->lock, flags);
|
|
||||||
- regmap_write(master->regmap, PMC_MCR, master->id);
|
|
||||||
- regmap_read(master->regmap, PMC_MCR, &val);
|
|
||||||
- master->parent = (val & PMC_MCR_CSS) >> PMC_MCR_CSS_SHIFT;
|
|
||||||
- master->div = (val & PMC_MCR_DIV) >> MASTER_DIV_SHIFT;
|
|
||||||
+ regmap_write(master->regmap, AT91_PMC_MCR_V2, master->id);
|
|
||||||
+ regmap_read(master->regmap, AT91_PMC_MCR_V2, &val);
|
|
||||||
+ master->parent = (val & AT91_PMC_MCR_V2_CSS) >> PMC_MCR_CSS_SHIFT;
|
|
||||||
+ master->div = (val & AT91_PMC_MCR_V2_DIV) >> MASTER_DIV_SHIFT;
|
|
||||||
spin_unlock_irqrestore(master->lock, flags);
|
|
||||||
|
|
||||||
hw = &master->hw;
|
|
@ -1,40 +0,0 @@
|
|||||||
From 17b53ad1574cb5f41789993289d3d94f7a50f0ce Mon Sep 17 00:00:00 2001
|
|
||||||
From: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Date: Mon, 11 Oct 2021 14:27:09 +0300
|
|
||||||
Subject: [PATCH 238/247] clk: at91: clk-master: improve readability by using
|
|
||||||
local variables
|
|
||||||
|
|
||||||
Improve readability in clk_sama7g5_master_set() by using local
|
|
||||||
variables.
|
|
||||||
|
|
||||||
Suggested-by: Nicolas Ferre <nicolas.ferre@microchip.com>
|
|
||||||
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Link: https://lore.kernel.org/r/20211011112719.3951784-6-claudiu.beznea@microchip.com
|
|
||||||
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
|
|
||||||
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
|
|
||||||
---
|
|
||||||
drivers/clk/at91/clk-master.c | 6 +++---
|
|
||||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/clk-master.c
|
|
||||||
+++ b/drivers/clk/at91/clk-master.c
|
|
||||||
@@ -680,6 +680,8 @@ static void clk_sama7g5_master_set(struc
|
|
||||||
unsigned long flags;
|
|
||||||
unsigned int val, cparent;
|
|
||||||
unsigned int enable = status ? AT91_PMC_MCR_V2_EN : 0;
|
|
||||||
+ unsigned int parent = master->parent << PMC_MCR_CSS_SHIFT;
|
|
||||||
+ unsigned int div = master->div << MASTER_DIV_SHIFT;
|
|
||||||
|
|
||||||
spin_lock_irqsave(master->lock, flags);
|
|
||||||
|
|
||||||
@@ -689,9 +691,7 @@ static void clk_sama7g5_master_set(struc
|
|
||||||
regmap_update_bits(master->regmap, AT91_PMC_MCR_V2,
|
|
||||||
enable | AT91_PMC_MCR_V2_CSS | AT91_PMC_MCR_V2_DIV |
|
|
||||||
AT91_PMC_MCR_V2_CMD | AT91_PMC_MCR_V2_ID_MSK,
|
|
||||||
- enable | (master->parent << PMC_MCR_CSS_SHIFT) |
|
|
||||||
- (master->div << MASTER_DIV_SHIFT) |
|
|
||||||
- AT91_PMC_MCR_V2_CMD |
|
|
||||||
+ enable | parent | div | AT91_PMC_MCR_V2_CMD |
|
|
||||||
AT91_PMC_MCR_V2_ID(master->id));
|
|
||||||
|
|
||||||
cparent = (val & AT91_PMC_MCR_V2_CSS) >> PMC_MCR_CSS_SHIFT;
|
|
@ -1,39 +0,0 @@
|
|||||||
From 8a38e0dda46c9d941a61d8b2e6c14704531b7871 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Date: Mon, 11 Oct 2021 14:27:10 +0300
|
|
||||||
Subject: [PATCH 239/247] clk: at91: pmc: add sama7g5 to the list of available
|
|
||||||
pmcs
|
|
||||||
|
|
||||||
Add SAMA7G5 to the list of available PMCs such that the suspend/resume
|
|
||||||
code for clocks to be used on backup mode.
|
|
||||||
|
|
||||||
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Link: https://lore.kernel.org/r/20211011112719.3951784-7-claudiu.beznea@microchip.com
|
|
||||||
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
|
|
||||||
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
|
|
||||||
---
|
|
||||||
drivers/clk/at91/pmc.c | 5 +++--
|
|
||||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/pmc.c
|
|
||||||
+++ b/drivers/clk/at91/pmc.c
|
|
||||||
@@ -148,8 +148,9 @@ static struct syscore_ops pmc_syscore_op
|
|
||||||
.resume = at91_pmc_resume,
|
|
||||||
};
|
|
||||||
|
|
||||||
-static const struct of_device_id sama5d2_pmc_dt_ids[] = {
|
|
||||||
+static const struct of_device_id pmc_dt_ids[] = {
|
|
||||||
{ .compatible = "atmel,sama5d2-pmc" },
|
|
||||||
+ { .compatible = "microchip,sama7g5-pmc", },
|
|
||||||
{ /* sentinel */ }
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -157,7 +158,7 @@ static int __init pmc_register_ops(void)
|
|
||||||
{
|
|
||||||
struct device_node *np;
|
|
||||||
|
|
||||||
- np = of_find_matching_node(NULL, sama5d2_pmc_dt_ids);
|
|
||||||
+ np = of_find_matching_node(NULL, pmc_dt_ids);
|
|
||||||
if (!np)
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
|||||||
From 27c11c09346b7b9f67eeb39db1b943f4a9742ff3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Date: Mon, 11 Oct 2021 14:27:13 +0300
|
|
||||||
Subject: [PATCH 241/247] clk: at91: clk-master: mask mckr against layout->mask
|
|
||||||
|
|
||||||
Mask values read/written from/to MCKR against layout->mask as this
|
|
||||||
mask may be different b/w PMC versions.
|
|
||||||
|
|
||||||
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Link: https://lore.kernel.org/r/20211011112719.3951784-10-claudiu.beznea@microchip.com
|
|
||||||
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
|
|
||||||
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
|
|
||||||
---
|
|
||||||
drivers/clk/at91/clk-master.c | 7 +++++--
|
|
||||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/clk-master.c
|
|
||||||
+++ b/drivers/clk/at91/clk-master.c
|
|
||||||
@@ -186,8 +186,8 @@ static int clk_master_div_set_rate(struc
|
|
||||||
if (ret)
|
|
||||||
goto unlock;
|
|
||||||
|
|
||||||
- tmp = mckr & master->layout->mask;
|
|
||||||
- tmp = (tmp >> MASTER_DIV_SHIFT) & MASTER_DIV_MASK;
|
|
||||||
+ mckr &= master->layout->mask;
|
|
||||||
+ tmp = (mckr >> MASTER_DIV_SHIFT) & MASTER_DIV_MASK;
|
|
||||||
if (tmp == div)
|
|
||||||
goto unlock;
|
|
||||||
|
|
||||||
@@ -384,6 +384,7 @@ static unsigned long clk_master_pres_rec
|
|
||||||
regmap_read(master->regmap, master->layout->offset, &val);
|
|
||||||
spin_unlock_irqrestore(master->lock, flags);
|
|
||||||
|
|
||||||
+ val &= master->layout->mask;
|
|
||||||
pres = (val >> master->layout->pres_shift) & MASTER_PRES_MASK;
|
|
||||||
if (pres == MASTER_PRES_MAX && characteristics->have_div3_pres)
|
|
||||||
pres = 3;
|
|
||||||
@@ -403,6 +404,8 @@ static u8 clk_master_pres_get_parent(str
|
|
||||||
regmap_read(master->regmap, master->layout->offset, &mckr);
|
|
||||||
spin_unlock_irqrestore(master->lock, flags);
|
|
||||||
|
|
||||||
+ mckr &= master->layout->mask;
|
|
||||||
+
|
|
||||||
return mckr & AT91_PMC_CSS;
|
|
||||||
}
|
|
||||||
|
|
@ -1,312 +0,0 @@
|
|||||||
From e76d2af5009f52aa02d3db7ae32d150ad66398f9 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Date: Mon, 11 Oct 2021 14:27:15 +0300
|
|
||||||
Subject: [PATCH 243/247] clk: at91: clk-sam9x60-pll: add notifier for div part
|
|
||||||
of PLL
|
|
||||||
|
|
||||||
SAM9X60's PLL which is also part of SAMA7G5 is composed of 2 parts:
|
|
||||||
one fractional part and one divider. On SAMA7G5 the CPU PLL could be
|
|
||||||
changed at run-time to implement DVFS. The hardware clock tree on
|
|
||||||
SAMA7G5 for CPU PLL is as follows:
|
|
||||||
|
|
||||||
+---- div1 ----------------> cpuck
|
|
||||||
|
|
|
||||||
FRAC PLL ---> DIV PLL -+-> prescaler ---> div0 ---> mck0
|
|
||||||
|
|
||||||
The div1 block is not implemented in Linux; on prescaler block it has
|
|
||||||
been discovered a bug on some scenarios and will be removed from Linux
|
|
||||||
in next commits. Thus, the final clock tree that will be used in Linux
|
|
||||||
will be as follows:
|
|
||||||
|
|
||||||
+-----------> cpuck
|
|
||||||
|
|
|
||||||
FRAC PLL ---> DIV PLL -+-> div0 ---> mck0
|
|
||||||
|
|
||||||
It has been proposed in [1] to not introduce a new CPUFreq driver but
|
|
||||||
to overload the proper clock drivers with proper operation such that
|
|
||||||
cpufreq-dt to be used. To accomplish this DIV PLL and div0 implement
|
|
||||||
clock notifiers which applies safe dividers before FRAC PLL is changed.
|
|
||||||
The current commit treats only the DIV PLL by adding a notifier that
|
|
||||||
sets a safe divider on PRE_RATE_CHANGE events. The safe divider is
|
|
||||||
provided by initialization clock code (sama7g5.c). The div0 is treated
|
|
||||||
in next commits (to keep the changes as clean as possible).
|
|
||||||
|
|
||||||
[1] https://lore.kernel.org/lkml/20210105104426.4tmgc2l3vyicwedd@vireshk-i7/
|
|
||||||
|
|
||||||
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Link: https://lore.kernel.org/r/20211011112719.3951784-12-claudiu.beznea@microchip.com
|
|
||||||
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
|
|
||||||
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
|
|
||||||
---
|
|
||||||
drivers/clk/at91/clk-sam9x60-pll.c | 102 ++++++++++++++++++++++-------
|
|
||||||
drivers/clk/at91/pmc.h | 3 +-
|
|
||||||
drivers/clk/at91/sam9x60.c | 6 +-
|
|
||||||
drivers/clk/at91/sama7g5.c | 13 +++-
|
|
||||||
4 files changed, 95 insertions(+), 29 deletions(-)
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/clk-sam9x60-pll.c
|
|
||||||
+++ b/drivers/clk/at91/clk-sam9x60-pll.c
|
|
||||||
@@ -5,6 +5,7 @@
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <linux/bitfield.h>
|
|
||||||
+#include <linux/clk.h>
|
|
||||||
#include <linux/clk-provider.h>
|
|
||||||
#include <linux/clkdev.h>
|
|
||||||
#include <linux/clk/at91_pmc.h>
|
|
||||||
@@ -47,12 +48,15 @@ struct sam9x60_div {
|
|
||||||
struct sam9x60_pll_core core;
|
|
||||||
struct at91_clk_pms pms;
|
|
||||||
u8 div;
|
|
||||||
+ u8 safe_div;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define to_sam9x60_pll_core(hw) container_of(hw, struct sam9x60_pll_core, hw)
|
|
||||||
#define to_sam9x60_frac(core) container_of(core, struct sam9x60_frac, core)
|
|
||||||
#define to_sam9x60_div(core) container_of(core, struct sam9x60_div, core)
|
|
||||||
|
|
||||||
+static struct sam9x60_div *notifier_div;
|
|
||||||
+
|
|
||||||
static inline bool sam9x60_pll_ready(struct regmap *regmap, int id)
|
|
||||||
{
|
|
||||||
unsigned int status;
|
|
||||||
@@ -329,6 +333,26 @@ static const struct clk_ops sam9x60_frac
|
|
||||||
.restore_context = sam9x60_frac_pll_restore_context,
|
|
||||||
};
|
|
||||||
|
|
||||||
+/* This function should be called with spinlock acquired. */
|
|
||||||
+static void sam9x60_div_pll_set_div(struct sam9x60_pll_core *core, u32 div,
|
|
||||||
+ bool enable)
|
|
||||||
+{
|
|
||||||
+ struct regmap *regmap = core->regmap;
|
|
||||||
+ u32 ena_msk = enable ? core->layout->endiv_mask : 0;
|
|
||||||
+ u32 ena_val = enable ? (1 << core->layout->endiv_shift) : 0;
|
|
||||||
+
|
|
||||||
+ regmap_update_bits(regmap, AT91_PMC_PLL_CTRL0,
|
|
||||||
+ core->layout->div_mask | ena_msk,
|
|
||||||
+ (div << core->layout->div_shift) | ena_val);
|
|
||||||
+
|
|
||||||
+ regmap_update_bits(regmap, AT91_PMC_PLL_UPDT,
|
|
||||||
+ AT91_PMC_PLL_UPDT_UPDATE | AT91_PMC_PLL_UPDT_ID_MSK,
|
|
||||||
+ AT91_PMC_PLL_UPDT_UPDATE | core->id);
|
|
||||||
+
|
|
||||||
+ while (!sam9x60_pll_ready(regmap, core->id))
|
|
||||||
+ cpu_relax();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static int sam9x60_div_pll_set(struct sam9x60_pll_core *core)
|
|
||||||
{
|
|
||||||
struct sam9x60_div *div = to_sam9x60_div(core);
|
|
||||||
@@ -346,17 +370,7 @@ static int sam9x60_div_pll_set(struct sa
|
|
||||||
if (!!(val & core->layout->endiv_mask) && cdiv == div->div)
|
|
||||||
goto unlock;
|
|
||||||
|
|
||||||
- regmap_update_bits(regmap, AT91_PMC_PLL_CTRL0,
|
|
||||||
- core->layout->div_mask | core->layout->endiv_mask,
|
|
||||||
- (div->div << core->layout->div_shift) |
|
|
||||||
- (1 << core->layout->endiv_shift));
|
|
||||||
-
|
|
||||||
- regmap_update_bits(regmap, AT91_PMC_PLL_UPDT,
|
|
||||||
- AT91_PMC_PLL_UPDT_UPDATE | AT91_PMC_PLL_UPDT_ID_MSK,
|
|
||||||
- AT91_PMC_PLL_UPDT_UPDATE | core->id);
|
|
||||||
-
|
|
||||||
- while (!sam9x60_pll_ready(regmap, core->id))
|
|
||||||
- cpu_relax();
|
|
||||||
+ sam9x60_div_pll_set_div(core, div->div, 1);
|
|
||||||
|
|
||||||
unlock:
|
|
||||||
spin_unlock_irqrestore(core->lock, flags);
|
|
||||||
@@ -502,16 +516,7 @@ static int sam9x60_div_pll_set_rate_chg(
|
|
||||||
if (cdiv == div->div)
|
|
||||||
goto unlock;
|
|
||||||
|
|
||||||
- regmap_update_bits(regmap, AT91_PMC_PLL_CTRL0,
|
|
||||||
- core->layout->div_mask,
|
|
||||||
- (div->div << core->layout->div_shift));
|
|
||||||
-
|
|
||||||
- regmap_update_bits(regmap, AT91_PMC_PLL_UPDT,
|
|
||||||
- AT91_PMC_PLL_UPDT_UPDATE | AT91_PMC_PLL_UPDT_ID_MSK,
|
|
||||||
- AT91_PMC_PLL_UPDT_UPDATE | core->id);
|
|
||||||
-
|
|
||||||
- while (!sam9x60_pll_ready(regmap, core->id))
|
|
||||||
- cpu_relax();
|
|
||||||
+ sam9x60_div_pll_set_div(core, div->div, 0);
|
|
||||||
|
|
||||||
unlock:
|
|
||||||
spin_unlock_irqrestore(core->lock, irqflags);
|
|
||||||
@@ -538,6 +543,48 @@ static void sam9x60_div_pll_restore_cont
|
|
||||||
sam9x60_div_pll_set(core);
|
|
||||||
}
|
|
||||||
|
|
||||||
+static int sam9x60_div_pll_notifier_fn(struct notifier_block *notifier,
|
|
||||||
+ unsigned long code, void *data)
|
|
||||||
+{
|
|
||||||
+ struct sam9x60_div *div = notifier_div;
|
|
||||||
+ struct sam9x60_pll_core core = div->core;
|
|
||||||
+ struct regmap *regmap = core.regmap;
|
|
||||||
+ unsigned long irqflags;
|
|
||||||
+ u32 val, cdiv;
|
|
||||||
+ int ret = NOTIFY_DONE;
|
|
||||||
+
|
|
||||||
+ if (code != PRE_RATE_CHANGE)
|
|
||||||
+ return ret;
|
|
||||||
+
|
|
||||||
+ /*
|
|
||||||
+ * We switch to safe divider to avoid overclocking of other domains
|
|
||||||
+ * feed by us while the frac PLL (our parent) is changed.
|
|
||||||
+ */
|
|
||||||
+ div->div = div->safe_div;
|
|
||||||
+
|
|
||||||
+ spin_lock_irqsave(core.lock, irqflags);
|
|
||||||
+ regmap_update_bits(regmap, AT91_PMC_PLL_UPDT, AT91_PMC_PLL_UPDT_ID_MSK,
|
|
||||||
+ core.id);
|
|
||||||
+ regmap_read(regmap, AT91_PMC_PLL_CTRL0, &val);
|
|
||||||
+ cdiv = (val & core.layout->div_mask) >> core.layout->div_shift;
|
|
||||||
+
|
|
||||||
+ /* Stop if nothing changed. */
|
|
||||||
+ if (cdiv == div->safe_div)
|
|
||||||
+ goto unlock;
|
|
||||||
+
|
|
||||||
+ sam9x60_div_pll_set_div(&core, div->div, 0);
|
|
||||||
+ ret = NOTIFY_OK;
|
|
||||||
+
|
|
||||||
+unlock:
|
|
||||||
+ spin_unlock_irqrestore(core.lock, irqflags);
|
|
||||||
+
|
|
||||||
+ return ret;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static struct notifier_block sam9x60_div_pll_notifier = {
|
|
||||||
+ .notifier_call = sam9x60_div_pll_notifier_fn,
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
static const struct clk_ops sam9x60_div_pll_ops = {
|
|
||||||
.prepare = sam9x60_div_pll_prepare,
|
|
||||||
.unprepare = sam9x60_div_pll_unprepare,
|
|
||||||
@@ -647,7 +694,8 @@ struct clk_hw * __init
|
|
||||||
sam9x60_clk_register_div_pll(struct regmap *regmap, spinlock_t *lock,
|
|
||||||
const char *name, const char *parent_name, u8 id,
|
|
||||||
const struct clk_pll_characteristics *characteristics,
|
|
||||||
- const struct clk_pll_layout *layout, u32 flags)
|
|
||||||
+ const struct clk_pll_layout *layout, u32 flags,
|
|
||||||
+ u32 safe_div)
|
|
||||||
{
|
|
||||||
struct sam9x60_div *div;
|
|
||||||
struct clk_hw *hw;
|
|
||||||
@@ -656,9 +704,13 @@ sam9x60_clk_register_div_pll(struct regm
|
|
||||||
unsigned int val;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
- if (id > PLL_MAX_ID || !lock)
|
|
||||||
+ /* We only support one changeable PLL. */
|
|
||||||
+ if (id > PLL_MAX_ID || !lock || (safe_div && notifier_div))
|
|
||||||
return ERR_PTR(-EINVAL);
|
|
||||||
|
|
||||||
+ if (safe_div >= PLL_DIV_MAX)
|
|
||||||
+ safe_div = PLL_DIV_MAX - 1;
|
|
||||||
+
|
|
||||||
div = kzalloc(sizeof(*div), GFP_KERNEL);
|
|
||||||
if (!div)
|
|
||||||
return ERR_PTR(-ENOMEM);
|
|
||||||
@@ -678,6 +730,7 @@ sam9x60_clk_register_div_pll(struct regm
|
|
||||||
div->core.layout = layout;
|
|
||||||
div->core.regmap = regmap;
|
|
||||||
div->core.lock = lock;
|
|
||||||
+ div->safe_div = safe_div;
|
|
||||||
|
|
||||||
spin_lock_irqsave(div->core.lock, irqflags);
|
|
||||||
|
|
||||||
@@ -693,6 +746,9 @@ sam9x60_clk_register_div_pll(struct regm
|
|
||||||
if (ret) {
|
|
||||||
kfree(div);
|
|
||||||
hw = ERR_PTR(ret);
|
|
||||||
+ } else if (div->safe_div) {
|
|
||||||
+ notifier_div = div;
|
|
||||||
+ clk_notifier_register(hw->clk, &sam9x60_div_pll_notifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
return hw;
|
|
||||||
--- a/drivers/clk/at91/pmc.h
|
|
||||||
+++ b/drivers/clk/at91/pmc.h
|
|
||||||
@@ -214,7 +214,8 @@ struct clk_hw * __init
|
|
||||||
sam9x60_clk_register_div_pll(struct regmap *regmap, spinlock_t *lock,
|
|
||||||
const char *name, const char *parent_name, u8 id,
|
|
||||||
const struct clk_pll_characteristics *characteristics,
|
|
||||||
- const struct clk_pll_layout *layout, u32 flags);
|
|
||||||
+ const struct clk_pll_layout *layout, u32 flags,
|
|
||||||
+ u32 safe_div);
|
|
||||||
|
|
||||||
struct clk_hw * __init
|
|
||||||
sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock,
|
|
||||||
--- a/drivers/clk/at91/sam9x60.c
|
|
||||||
+++ b/drivers/clk/at91/sam9x60.c
|
|
||||||
@@ -242,7 +242,7 @@ static void __init sam9x60_pmc_setup(str
|
|
||||||
* This feeds CPU. It should not
|
|
||||||
* be disabled.
|
|
||||||
*/
|
|
||||||
- CLK_IS_CRITICAL | CLK_SET_RATE_GATE);
|
|
||||||
+ CLK_IS_CRITICAL | CLK_SET_RATE_GATE, 0);
|
|
||||||
if (IS_ERR(hw))
|
|
||||||
goto err_free;
|
|
||||||
|
|
||||||
@@ -260,7 +260,7 @@ static void __init sam9x60_pmc_setup(str
|
|
||||||
&pll_div_layout,
|
|
||||||
CLK_SET_RATE_GATE |
|
|
||||||
CLK_SET_PARENT_GATE |
|
|
||||||
- CLK_SET_RATE_PARENT);
|
|
||||||
+ CLK_SET_RATE_PARENT, 0);
|
|
||||||
if (IS_ERR(hw))
|
|
||||||
goto err_free;
|
|
||||||
|
|
||||||
@@ -279,7 +279,7 @@ static void __init sam9x60_pmc_setup(str
|
|
||||||
hw = at91_clk_register_master_div(regmap, "masterck_div",
|
|
||||||
"masterck_pres", &sam9x60_master_layout,
|
|
||||||
&mck_characteristics, &mck_lock,
|
|
||||||
- CLK_SET_RATE_GATE);
|
|
||||||
+ CLK_SET_RATE_GATE, 0);
|
|
||||||
if (IS_ERR(hw))
|
|
||||||
goto err_free;
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/sama7g5.c
|
|
||||||
+++ b/drivers/clk/at91/sama7g5.c
|
|
||||||
@@ -127,6 +127,8 @@ static const struct clk_pll_characterist
|
|
||||||
* @t: clock type
|
|
||||||
* @f: clock flags
|
|
||||||
* @eid: export index in sama7g5->chws[] array
|
|
||||||
+ * @safe_div: intermediate divider need to be set on PRE_RATE_CHANGE
|
|
||||||
+ * notification
|
|
||||||
*/
|
|
||||||
static const struct {
|
|
||||||
const char *n;
|
|
||||||
@@ -136,6 +138,7 @@ static const struct {
|
|
||||||
unsigned long f;
|
|
||||||
u8 t;
|
|
||||||
u8 eid;
|
|
||||||
+ u8 safe_div;
|
|
||||||
} sama7g5_plls[][PLL_ID_MAX] = {
|
|
||||||
[PLL_ID_CPU] = {
|
|
||||||
{ .n = "cpupll_fracck",
|
|
||||||
@@ -156,7 +159,12 @@ static const struct {
|
|
||||||
.t = PLL_TYPE_DIV,
|
|
||||||
/* This feeds CPU. It should not be disabled. */
|
|
||||||
.f = CLK_IS_CRITICAL | CLK_SET_RATE_PARENT,
|
|
||||||
- .eid = PMC_CPUPLL, },
|
|
||||||
+ .eid = PMC_CPUPLL,
|
|
||||||
+ /*
|
|
||||||
+ * Safe div=15 should be safe even for switching b/w 1GHz and
|
|
||||||
+ * 90MHz (frac pll might go up to 1.2GHz).
|
|
||||||
+ */
|
|
||||||
+ .safe_div = 15, },
|
|
||||||
},
|
|
||||||
|
|
||||||
[PLL_ID_SYS] = {
|
|
||||||
@@ -966,7 +974,8 @@ static void __init sama7g5_pmc_setup(str
|
|
||||||
sama7g5_plls[i][j].p, i,
|
|
||||||
sama7g5_plls[i][j].c,
|
|
||||||
sama7g5_plls[i][j].l,
|
|
||||||
- sama7g5_plls[i][j].f);
|
|
||||||
+ sama7g5_plls[i][j].f,
|
|
||||||
+ sama7g5_plls[i][j].safe_div);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
@ -1,519 +0,0 @@
|
|||||||
From 75d5d1d584ae73ba0c36d1d7255db6153ca4d3f3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Date: Mon, 11 Oct 2021 14:27:16 +0300
|
|
||||||
Subject: [PATCH 244/247] clk: at91: clk-master: add notifier for divider
|
|
||||||
|
|
||||||
SAMA7G5 supports DVFS by changing cpuck. On SAMA7G5 mck0 shares the same
|
|
||||||
parent with cpuck as seen in the following clock tree:
|
|
||||||
|
|
||||||
+----------> cpuck
|
|
||||||
|
|
|
||||||
FRAC PLL ---> DIV PLL -+-> DIV ---> mck0
|
|
||||||
|
|
||||||
mck0 could go b/w 32KHz and 200MHz on SAMA7G5. To avoid mck0 overclocking
|
|
||||||
while changing FRAC PLL or DIV PLL the commit implements a notifier for
|
|
||||||
mck0 which applies a safe divider to register (maximum value of the divider
|
|
||||||
which is 5) on PRE_RATE_CHANGE events (such that changes on PLL to not
|
|
||||||
overclock mck0) and sets the maximum allowed rate on POST_RATE_CHANGE
|
|
||||||
events.
|
|
||||||
|
|
||||||
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Link: https://lore.kernel.org/r/20211011112719.3951784-13-claudiu.beznea@microchip.com
|
|
||||||
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
|
|
||||||
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
|
|
||||||
---
|
|
||||||
drivers/clk/at91/at91rm9200.c | 2 +-
|
|
||||||
drivers/clk/at91/at91sam9260.c | 2 +-
|
|
||||||
drivers/clk/at91/at91sam9g45.c | 2 +-
|
|
||||||
drivers/clk/at91/at91sam9n12.c | 2 +-
|
|
||||||
drivers/clk/at91/at91sam9rl.c | 2 +-
|
|
||||||
drivers/clk/at91/at91sam9x5.c | 2 +-
|
|
||||||
drivers/clk/at91/clk-master.c | 244 +++++++++++++++++++++++----------
|
|
||||||
drivers/clk/at91/dt-compat.c | 2 +-
|
|
||||||
drivers/clk/at91/pmc.h | 2 +-
|
|
||||||
drivers/clk/at91/sama5d2.c | 2 +-
|
|
||||||
drivers/clk/at91/sama5d3.c | 2 +-
|
|
||||||
drivers/clk/at91/sama5d4.c | 2 +-
|
|
||||||
drivers/clk/at91/sama7g5.c | 2 +-
|
|
||||||
13 files changed, 186 insertions(+), 82 deletions(-)
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/at91rm9200.c
|
|
||||||
+++ b/drivers/clk/at91/at91rm9200.c
|
|
||||||
@@ -152,7 +152,7 @@ static void __init at91rm9200_pmc_setup(
|
|
||||||
"masterck_pres",
|
|
||||||
&at91rm9200_master_layout,
|
|
||||||
&rm9200_mck_characteristics,
|
|
||||||
- &rm9200_mck_lock, CLK_SET_RATE_GATE);
|
|
||||||
+ &rm9200_mck_lock, CLK_SET_RATE_GATE, 0);
|
|
||||||
if (IS_ERR(hw))
|
|
||||||
goto err_free;
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/at91sam9260.c
|
|
||||||
+++ b/drivers/clk/at91/at91sam9260.c
|
|
||||||
@@ -429,7 +429,7 @@ static void __init at91sam926x_pmc_setup
|
|
||||||
&at91rm9200_master_layout,
|
|
||||||
data->mck_characteristics,
|
|
||||||
&at91sam9260_mck_lock,
|
|
||||||
- CLK_SET_RATE_GATE);
|
|
||||||
+ CLK_SET_RATE_GATE, 0);
|
|
||||||
if (IS_ERR(hw))
|
|
||||||
goto err_free;
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/at91sam9g45.c
|
|
||||||
+++ b/drivers/clk/at91/at91sam9g45.c
|
|
||||||
@@ -164,7 +164,7 @@ static void __init at91sam9g45_pmc_setup
|
|
||||||
&at91rm9200_master_layout,
|
|
||||||
&mck_characteristics,
|
|
||||||
&at91sam9g45_mck_lock,
|
|
||||||
- CLK_SET_RATE_GATE);
|
|
||||||
+ CLK_SET_RATE_GATE, 0);
|
|
||||||
if (IS_ERR(hw))
|
|
||||||
goto err_free;
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/at91sam9n12.c
|
|
||||||
+++ b/drivers/clk/at91/at91sam9n12.c
|
|
||||||
@@ -191,7 +191,7 @@ static void __init at91sam9n12_pmc_setup
|
|
||||||
&at91sam9x5_master_layout,
|
|
||||||
&mck_characteristics,
|
|
||||||
&at91sam9n12_mck_lock,
|
|
||||||
- CLK_SET_RATE_GATE);
|
|
||||||
+ CLK_SET_RATE_GATE, 0);
|
|
||||||
if (IS_ERR(hw))
|
|
||||||
goto err_free;
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/at91sam9rl.c
|
|
||||||
+++ b/drivers/clk/at91/at91sam9rl.c
|
|
||||||
@@ -132,7 +132,7 @@ static void __init at91sam9rl_pmc_setup(
|
|
||||||
"masterck_pres",
|
|
||||||
&at91rm9200_master_layout,
|
|
||||||
&sam9rl_mck_characteristics,
|
|
||||||
- &sam9rl_mck_lock, CLK_SET_RATE_GATE);
|
|
||||||
+ &sam9rl_mck_lock, CLK_SET_RATE_GATE, 0);
|
|
||||||
if (IS_ERR(hw))
|
|
||||||
goto err_free;
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/at91sam9x5.c
|
|
||||||
+++ b/drivers/clk/at91/at91sam9x5.c
|
|
||||||
@@ -210,7 +210,7 @@ static void __init at91sam9x5_pmc_setup(
|
|
||||||
"masterck_pres",
|
|
||||||
&at91sam9x5_master_layout,
|
|
||||||
&mck_characteristics, &mck_lock,
|
|
||||||
- CLK_SET_RATE_GATE);
|
|
||||||
+ CLK_SET_RATE_GATE, 0);
|
|
||||||
if (IS_ERR(hw))
|
|
||||||
goto err_free;
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/clk-master.c
|
|
||||||
+++ b/drivers/clk/at91/clk-master.c
|
|
||||||
@@ -5,6 +5,7 @@
|
|
||||||
|
|
||||||
#include <linux/clk-provider.h>
|
|
||||||
#include <linux/clkdev.h>
|
|
||||||
+#include <linux/clk.h>
|
|
||||||
#include <linux/clk/at91_pmc.h>
|
|
||||||
#include <linux/of.h>
|
|
||||||
#include <linux/mfd/syscon.h>
|
|
||||||
@@ -36,8 +37,12 @@ struct clk_master {
|
|
||||||
u8 id;
|
|
||||||
u8 parent;
|
|
||||||
u8 div;
|
|
||||||
+ u32 safe_div;
|
|
||||||
};
|
|
||||||
|
|
||||||
+/* MCK div reference to be used by notifier. */
|
|
||||||
+static struct clk_master *master_div;
|
|
||||||
+
|
|
||||||
static inline bool clk_master_ready(struct clk_master *master)
|
|
||||||
{
|
|
||||||
unsigned int bit = master->id ? AT91_PMC_MCKXRDY : AT91_PMC_MCKRDY;
|
|
||||||
@@ -153,107 +158,81 @@ static const struct clk_ops master_div_o
|
|
||||||
.restore_context = clk_master_div_restore_context,
|
|
||||||
};
|
|
||||||
|
|
||||||
-static int clk_master_div_set_rate(struct clk_hw *hw, unsigned long rate,
|
|
||||||
- unsigned long parent_rate)
|
|
||||||
+/* This function must be called with lock acquired. */
|
|
||||||
+static int clk_master_div_set(struct clk_master *master,
|
|
||||||
+ unsigned long parent_rate, int div)
|
|
||||||
{
|
|
||||||
- struct clk_master *master = to_clk_master(hw);
|
|
||||||
const struct clk_master_characteristics *characteristics =
|
|
||||||
master->characteristics;
|
|
||||||
- unsigned long flags;
|
|
||||||
- unsigned int mckr, tmp;
|
|
||||||
- int div, i;
|
|
||||||
+ unsigned long rate = parent_rate;
|
|
||||||
+ unsigned int max_div = 0, div_index = 0, max_div_index = 0;
|
|
||||||
+ unsigned int i, mckr, tmp;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
- div = DIV_ROUND_CLOSEST(parent_rate, rate);
|
|
||||||
- if (div > ARRAY_SIZE(characteristics->divisors))
|
|
||||||
- return -EINVAL;
|
|
||||||
-
|
|
||||||
for (i = 0; i < ARRAY_SIZE(characteristics->divisors); i++) {
|
|
||||||
if (!characteristics->divisors[i])
|
|
||||||
break;
|
|
||||||
|
|
||||||
- if (div == characteristics->divisors[i]) {
|
|
||||||
- div = i;
|
|
||||||
- break;
|
|
||||||
+ if (div == characteristics->divisors[i])
|
|
||||||
+ div_index = i;
|
|
||||||
+
|
|
||||||
+ if (max_div < characteristics->divisors[i]) {
|
|
||||||
+ max_div = characteristics->divisors[i];
|
|
||||||
+ max_div_index = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (i == ARRAY_SIZE(characteristics->divisors))
|
|
||||||
- return -EINVAL;
|
|
||||||
+ if (div > max_div)
|
|
||||||
+ div_index = max_div_index;
|
|
||||||
|
|
||||||
- spin_lock_irqsave(master->lock, flags);
|
|
||||||
ret = regmap_read(master->regmap, master->layout->offset, &mckr);
|
|
||||||
if (ret)
|
|
||||||
- goto unlock;
|
|
||||||
+ return ret;
|
|
||||||
|
|
||||||
mckr &= master->layout->mask;
|
|
||||||
tmp = (mckr >> MASTER_DIV_SHIFT) & MASTER_DIV_MASK;
|
|
||||||
- if (tmp == div)
|
|
||||||
- goto unlock;
|
|
||||||
+ if (tmp == div_index)
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
+ rate /= characteristics->divisors[div_index];
|
|
||||||
+ if (rate < characteristics->output.min)
|
|
||||||
+ pr_warn("master clk div is underclocked");
|
|
||||||
+ else if (rate > characteristics->output.max)
|
|
||||||
+ pr_warn("master clk div is overclocked");
|
|
||||||
|
|
||||||
mckr &= ~(MASTER_DIV_MASK << MASTER_DIV_SHIFT);
|
|
||||||
- mckr |= (div << MASTER_DIV_SHIFT);
|
|
||||||
+ mckr |= (div_index << MASTER_DIV_SHIFT);
|
|
||||||
ret = regmap_write(master->regmap, master->layout->offset, mckr);
|
|
||||||
if (ret)
|
|
||||||
- goto unlock;
|
|
||||||
+ return ret;
|
|
||||||
|
|
||||||
while (!clk_master_ready(master))
|
|
||||||
cpu_relax();
|
|
||||||
-unlock:
|
|
||||||
- spin_unlock_irqrestore(master->lock, flags);
|
|
||||||
+
|
|
||||||
+ master->div = characteristics->divisors[div_index];
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
-static int clk_master_div_determine_rate(struct clk_hw *hw,
|
|
||||||
- struct clk_rate_request *req)
|
|
||||||
+static unsigned long clk_master_div_recalc_rate_chg(struct clk_hw *hw,
|
|
||||||
+ unsigned long parent_rate)
|
|
||||||
{
|
|
||||||
struct clk_master *master = to_clk_master(hw);
|
|
||||||
- const struct clk_master_characteristics *characteristics =
|
|
||||||
- master->characteristics;
|
|
||||||
- struct clk_hw *parent;
|
|
||||||
- unsigned long parent_rate, tmp_rate, best_rate = 0;
|
|
||||||
- int i, best_diff = INT_MIN, tmp_diff;
|
|
||||||
-
|
|
||||||
- parent = clk_hw_get_parent(hw);
|
|
||||||
- if (!parent)
|
|
||||||
- return -EINVAL;
|
|
||||||
-
|
|
||||||
- parent_rate = clk_hw_get_rate(parent);
|
|
||||||
- if (!parent_rate)
|
|
||||||
- return -EINVAL;
|
|
||||||
|
|
||||||
- for (i = 0; i < ARRAY_SIZE(characteristics->divisors); i++) {
|
|
||||||
- if (!characteristics->divisors[i])
|
|
||||||
- break;
|
|
||||||
-
|
|
||||||
- tmp_rate = DIV_ROUND_CLOSEST_ULL(parent_rate,
|
|
||||||
- characteristics->divisors[i]);
|
|
||||||
- tmp_diff = abs(tmp_rate - req->rate);
|
|
||||||
-
|
|
||||||
- if (!best_rate || best_diff > tmp_diff) {
|
|
||||||
- best_diff = tmp_diff;
|
|
||||||
- best_rate = tmp_rate;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (!best_diff)
|
|
||||||
- break;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- req->best_parent_rate = best_rate;
|
|
||||||
- req->best_parent_hw = parent;
|
|
||||||
- req->rate = best_rate;
|
|
||||||
-
|
|
||||||
- return 0;
|
|
||||||
+ return DIV_ROUND_CLOSEST_ULL(parent_rate, master->div);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void clk_master_div_restore_context_chg(struct clk_hw *hw)
|
|
||||||
{
|
|
||||||
struct clk_master *master = to_clk_master(hw);
|
|
||||||
+ unsigned long flags;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
- ret = clk_master_div_set_rate(hw, master->pms.rate,
|
|
||||||
- master->pms.parent_rate);
|
|
||||||
+ spin_lock_irqsave(master->lock, flags);
|
|
||||||
+ ret = clk_master_div_set(master, master->pms.parent_rate,
|
|
||||||
+ DIV_ROUND_CLOSEST(master->pms.parent_rate,
|
|
||||||
+ master->pms.rate));
|
|
||||||
+ spin_unlock_irqrestore(master->lock, flags);
|
|
||||||
if (ret)
|
|
||||||
pr_warn("Failed to restore MCK DIV clock\n");
|
|
||||||
}
|
|
||||||
@@ -261,13 +240,116 @@ static void clk_master_div_restore_conte
|
|
||||||
static const struct clk_ops master_div_ops_chg = {
|
|
||||||
.prepare = clk_master_prepare,
|
|
||||||
.is_prepared = clk_master_is_prepared,
|
|
||||||
- .recalc_rate = clk_master_div_recalc_rate,
|
|
||||||
- .determine_rate = clk_master_div_determine_rate,
|
|
||||||
- .set_rate = clk_master_div_set_rate,
|
|
||||||
+ .recalc_rate = clk_master_div_recalc_rate_chg,
|
|
||||||
.save_context = clk_master_div_save_context,
|
|
||||||
.restore_context = clk_master_div_restore_context_chg,
|
|
||||||
};
|
|
||||||
|
|
||||||
+static int clk_master_div_notifier_fn(struct notifier_block *notifier,
|
|
||||||
+ unsigned long code, void *data)
|
|
||||||
+{
|
|
||||||
+ const struct clk_master_characteristics *characteristics =
|
|
||||||
+ master_div->characteristics;
|
|
||||||
+ struct clk_notifier_data *cnd = data;
|
|
||||||
+ unsigned long flags, new_parent_rate, new_rate;
|
|
||||||
+ unsigned int mckr, div, new_div = 0;
|
|
||||||
+ int ret, i;
|
|
||||||
+ long tmp_diff;
|
|
||||||
+ long best_diff = -1;
|
|
||||||
+
|
|
||||||
+ spin_lock_irqsave(master_div->lock, flags);
|
|
||||||
+ switch (code) {
|
|
||||||
+ case PRE_RATE_CHANGE:
|
|
||||||
+ /*
|
|
||||||
+ * We want to avoid any overclocking of MCK DIV domain. To do
|
|
||||||
+ * this we set a safe divider (the underclocking is not of
|
|
||||||
+ * interest as we can go as low as 32KHz). The relation
|
|
||||||
+ * b/w this clock and its parents are as follows:
|
|
||||||
+ *
|
|
||||||
+ * FRAC PLL -> DIV PLL -> MCK DIV
|
|
||||||
+ *
|
|
||||||
+ * With the proper safe divider we should be good even with FRAC
|
|
||||||
+ * PLL at its maximum value.
|
|
||||||
+ */
|
|
||||||
+ ret = regmap_read(master_div->regmap, master_div->layout->offset,
|
|
||||||
+ &mckr);
|
|
||||||
+ if (ret) {
|
|
||||||
+ ret = NOTIFY_STOP_MASK;
|
|
||||||
+ goto unlock;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ mckr &= master_div->layout->mask;
|
|
||||||
+ div = (mckr >> MASTER_DIV_SHIFT) & MASTER_DIV_MASK;
|
|
||||||
+
|
|
||||||
+ /* Switch to safe divider. */
|
|
||||||
+ clk_master_div_set(master_div,
|
|
||||||
+ cnd->old_rate * characteristics->divisors[div],
|
|
||||||
+ master_div->safe_div);
|
|
||||||
+ break;
|
|
||||||
+
|
|
||||||
+ case POST_RATE_CHANGE:
|
|
||||||
+ /*
|
|
||||||
+ * At this point we want to restore MCK DIV domain to its maximum
|
|
||||||
+ * allowed rate.
|
|
||||||
+ */
|
|
||||||
+ ret = regmap_read(master_div->regmap, master_div->layout->offset,
|
|
||||||
+ &mckr);
|
|
||||||
+ if (ret) {
|
|
||||||
+ ret = NOTIFY_STOP_MASK;
|
|
||||||
+ goto unlock;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ mckr &= master_div->layout->mask;
|
|
||||||
+ div = (mckr >> MASTER_DIV_SHIFT) & MASTER_DIV_MASK;
|
|
||||||
+ new_parent_rate = cnd->new_rate * characteristics->divisors[div];
|
|
||||||
+
|
|
||||||
+ for (i = 0; i < ARRAY_SIZE(characteristics->divisors); i++) {
|
|
||||||
+ if (!characteristics->divisors[i])
|
|
||||||
+ break;
|
|
||||||
+
|
|
||||||
+ new_rate = DIV_ROUND_CLOSEST_ULL(new_parent_rate,
|
|
||||||
+ characteristics->divisors[i]);
|
|
||||||
+
|
|
||||||
+ tmp_diff = characteristics->output.max - new_rate;
|
|
||||||
+ if (tmp_diff < 0)
|
|
||||||
+ continue;
|
|
||||||
+
|
|
||||||
+ if (best_diff < 0 || best_diff > tmp_diff) {
|
|
||||||
+ new_div = characteristics->divisors[i];
|
|
||||||
+ best_diff = tmp_diff;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (!tmp_diff)
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (!new_div) {
|
|
||||||
+ ret = NOTIFY_STOP_MASK;
|
|
||||||
+ goto unlock;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* Update the div to preserve MCK DIV clock rate. */
|
|
||||||
+ clk_master_div_set(master_div, new_parent_rate,
|
|
||||||
+ new_div);
|
|
||||||
+
|
|
||||||
+ ret = NOTIFY_OK;
|
|
||||||
+ break;
|
|
||||||
+
|
|
||||||
+ default:
|
|
||||||
+ ret = NOTIFY_DONE;
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+unlock:
|
|
||||||
+ spin_unlock_irqrestore(master_div->lock, flags);
|
|
||||||
+
|
|
||||||
+ return ret;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static struct notifier_block clk_master_div_notifier = {
|
|
||||||
+ .notifier_call = clk_master_div_notifier_fn,
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
static void clk_sama7g5_master_best_diff(struct clk_rate_request *req,
|
|
||||||
struct clk_hw *parent,
|
|
||||||
unsigned long parent_rate,
|
|
||||||
@@ -496,6 +578,8 @@ at91_clk_register_master_internal(struct
|
|
||||||
struct clk_master *master;
|
|
||||||
struct clk_init_data init;
|
|
||||||
struct clk_hw *hw;
|
|
||||||
+ unsigned int mckr;
|
|
||||||
+ unsigned long irqflags;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (!name || !num_parents || !parent_names || !lock)
|
|
||||||
@@ -518,6 +602,16 @@ at91_clk_register_master_internal(struct
|
|
||||||
master->chg_pid = chg_pid;
|
|
||||||
master->lock = lock;
|
|
||||||
|
|
||||||
+ if (ops == &master_div_ops_chg) {
|
|
||||||
+ spin_lock_irqsave(master->lock, irqflags);
|
|
||||||
+ regmap_read(master->regmap, master->layout->offset, &mckr);
|
|
||||||
+ spin_unlock_irqrestore(master->lock, irqflags);
|
|
||||||
+
|
|
||||||
+ mckr &= layout->mask;
|
|
||||||
+ mckr = (mckr >> MASTER_DIV_SHIFT) & MASTER_DIV_MASK;
|
|
||||||
+ master->div = characteristics->divisors[mckr];
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
hw = &master->hw;
|
|
||||||
ret = clk_hw_register(NULL, &master->hw);
|
|
||||||
if (ret) {
|
|
||||||
@@ -554,19 +648,29 @@ at91_clk_register_master_div(struct regm
|
|
||||||
const char *name, const char *parent_name,
|
|
||||||
const struct clk_master_layout *layout,
|
|
||||||
const struct clk_master_characteristics *characteristics,
|
|
||||||
- spinlock_t *lock, u32 flags)
|
|
||||||
+ spinlock_t *lock, u32 flags, u32 safe_div)
|
|
||||||
{
|
|
||||||
const struct clk_ops *ops;
|
|
||||||
+ struct clk_hw *hw;
|
|
||||||
|
|
||||||
if (flags & CLK_SET_RATE_GATE)
|
|
||||||
ops = &master_div_ops;
|
|
||||||
else
|
|
||||||
ops = &master_div_ops_chg;
|
|
||||||
|
|
||||||
- return at91_clk_register_master_internal(regmap, name, 1,
|
|
||||||
- &parent_name, layout,
|
|
||||||
- characteristics, ops,
|
|
||||||
- lock, flags, -EINVAL);
|
|
||||||
+ hw = at91_clk_register_master_internal(regmap, name, 1,
|
|
||||||
+ &parent_name, layout,
|
|
||||||
+ characteristics, ops,
|
|
||||||
+ lock, flags, -EINVAL);
|
|
||||||
+
|
|
||||||
+ if (!IS_ERR(hw) && safe_div) {
|
|
||||||
+ master_div = to_clk_master(hw);
|
|
||||||
+ master_div->safe_div = safe_div;
|
|
||||||
+ clk_notifier_register(hw->clk,
|
|
||||||
+ &clk_master_div_notifier);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return hw;
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned long
|
|
||||||
--- a/drivers/clk/at91/dt-compat.c
|
|
||||||
+++ b/drivers/clk/at91/dt-compat.c
|
|
||||||
@@ -399,7 +399,7 @@ of_at91_clk_master_setup(struct device_n
|
|
||||||
|
|
||||||
hw = at91_clk_register_master_div(regmap, name, "masterck_pres",
|
|
||||||
layout, characteristics,
|
|
||||||
- &mck_lock, CLK_SET_RATE_GATE);
|
|
||||||
+ &mck_lock, CLK_SET_RATE_GATE, 0);
|
|
||||||
if (IS_ERR(hw))
|
|
||||||
goto out_free_characteristics;
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/pmc.h
|
|
||||||
+++ b/drivers/clk/at91/pmc.h
|
|
||||||
@@ -182,7 +182,7 @@ at91_clk_register_master_div(struct regm
|
|
||||||
const char *parent_names,
|
|
||||||
const struct clk_master_layout *layout,
|
|
||||||
const struct clk_master_characteristics *characteristics,
|
|
||||||
- spinlock_t *lock, u32 flags);
|
|
||||||
+ spinlock_t *lock, u32 flags, u32 safe_div);
|
|
||||||
|
|
||||||
struct clk_hw * __init
|
|
||||||
at91_clk_sama7g5_register_master(struct regmap *regmap,
|
|
||||||
--- a/drivers/clk/at91/sama5d2.c
|
|
||||||
+++ b/drivers/clk/at91/sama5d2.c
|
|
||||||
@@ -249,7 +249,7 @@ static void __init sama5d2_pmc_setup(str
|
|
||||||
"masterck_pres",
|
|
||||||
&at91sam9x5_master_layout,
|
|
||||||
&mck_characteristics, &mck_lock,
|
|
||||||
- CLK_SET_RATE_GATE);
|
|
||||||
+ CLK_SET_RATE_GATE, 0);
|
|
||||||
if (IS_ERR(hw))
|
|
||||||
goto err_free;
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/sama5d3.c
|
|
||||||
+++ b/drivers/clk/at91/sama5d3.c
|
|
||||||
@@ -184,7 +184,7 @@ static void __init sama5d3_pmc_setup(str
|
|
||||||
"masterck_pres",
|
|
||||||
&at91sam9x5_master_layout,
|
|
||||||
&mck_characteristics, &mck_lock,
|
|
||||||
- CLK_SET_RATE_GATE);
|
|
||||||
+ CLK_SET_RATE_GATE, 0);
|
|
||||||
if (IS_ERR(hw))
|
|
||||||
goto err_free;
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/sama5d4.c
|
|
||||||
+++ b/drivers/clk/at91/sama5d4.c
|
|
||||||
@@ -199,7 +199,7 @@ static void __init sama5d4_pmc_setup(str
|
|
||||||
"masterck_pres",
|
|
||||||
&at91sam9x5_master_layout,
|
|
||||||
&mck_characteristics, &mck_lock,
|
|
||||||
- CLK_SET_RATE_GATE);
|
|
||||||
+ CLK_SET_RATE_GATE, 0);
|
|
||||||
if (IS_ERR(hw))
|
|
||||||
goto err_free;
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/sama7g5.c
|
|
||||||
+++ b/drivers/clk/at91/sama7g5.c
|
|
||||||
@@ -993,7 +993,7 @@ static void __init sama7g5_pmc_setup(str
|
|
||||||
parent_names[0] = "cpupll_divpmcck";
|
|
||||||
hw = at91_clk_register_master_div(regmap, "mck0", "cpupll_divpmcck",
|
|
||||||
&mck0_layout, &mck0_characteristics,
|
|
||||||
- &pmc_mck0_lock, 0);
|
|
||||||
+ &pmc_mck0_lock, CLK_GET_RATE_NOCACHE, 5);
|
|
||||||
if (IS_ERR(hw))
|
|
||||||
goto err_free;
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
|||||||
From 9fd5a49f6da9de5da83f4a53eccefad647ab15ed Mon Sep 17 00:00:00 2001
|
|
||||||
From: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Date: Mon, 11 Oct 2021 14:27:18 +0300
|
|
||||||
Subject: [PATCH 246/247] clk: at91: sama7g5: set low limit for mck0 at 32KHz
|
|
||||||
|
|
||||||
MCK0 could go as low as 32KHz. Set this limit.
|
|
||||||
|
|
||||||
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Link: https://lore.kernel.org/r/20211011112719.3951784-15-claudiu.beznea@microchip.com
|
|
||||||
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
|
|
||||||
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
|
|
||||||
---
|
|
||||||
drivers/clk/at91/sama7g5.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
--- a/drivers/clk/at91/sama7g5.c
|
|
||||||
+++ b/drivers/clk/at91/sama7g5.c
|
|
||||||
@@ -849,7 +849,7 @@ static const struct {
|
|
||||||
|
|
||||||
/* MCK0 characteristics. */
|
|
||||||
static const struct clk_master_characteristics mck0_characteristics = {
|
|
||||||
- .output = { .min = 50000000, .max = 200000000 },
|
|
||||||
+ .output = { .min = 32768, .max = 200000000 },
|
|
||||||
.divisors = { 1, 2, 4, 3, 5 },
|
|
||||||
.have_div3_pres = 1,
|
|
||||||
};
|
|
@ -1,32 +0,0 @@
|
|||||||
From fe07791494a78d5a4be1363385e6ba7940740644 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Date: Mon, 11 Oct 2021 14:27:19 +0300
|
|
||||||
Subject: [PATCH 247/247] clk: use clk_core_get_rate_recalc() in clk_rate_get()
|
|
||||||
|
|
||||||
In case clock flags contains CLK_GET_RATE_NOCACHE the clk_rate_get()
|
|
||||||
will return the cached rate. Thus, use clk_core_get_rate_recalc() which
|
|
||||||
takes proper action when clock flags contains CLK_GET_RATE_NOCACHE.
|
|
||||||
|
|
||||||
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Link: https://lore.kernel.org/r/20211011112719.3951784-16-claudiu.beznea@microchip.com
|
|
||||||
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
|
|
||||||
[sboyd@kernel.org: Grab prepare lock around operation]
|
|
||||||
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
|
|
||||||
---
|
|
||||||
drivers/clk/clk.c | 5 ++++-
|
|
||||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
--- a/drivers/clk/clk.c
|
|
||||||
+++ b/drivers/clk/clk.c
|
|
||||||
@@ -3145,7 +3145,10 @@ static int clk_rate_get(void *data, u64
|
|
||||||
{
|
|
||||||
struct clk_core *core = data;
|
|
||||||
|
|
||||||
- *val = core->rate;
|
|
||||||
+ clk_prepare_lock();
|
|
||||||
+ *val = clk_core_get_rate_recalc(core);
|
|
||||||
+ clk_prepare_unlock();
|
|
||||||
+
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,317 +0,0 @@
|
|||||||
CONFIG_ALIGNMENT_TRAP=y
|
|
||||||
CONFIG_ARCH_32BIT_OFF_T=y
|
|
||||||
CONFIG_ARCH_AT91=y
|
|
||||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
|
||||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
|
||||||
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
|
|
||||||
CONFIG_ARCH_MULTIPLATFORM=y
|
|
||||||
# CONFIG_ARCH_MULTI_V4 is not set
|
|
||||||
CONFIG_ARCH_MULTI_V4T=y
|
|
||||||
CONFIG_ARCH_MULTI_V4_V5=y
|
|
||||||
CONFIG_ARCH_MULTI_V5=y
|
|
||||||
CONFIG_ARCH_NR_GPIO=0
|
|
||||||
CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
|
|
||||||
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
|
|
||||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
|
||||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
|
||||||
CONFIG_ARM=y
|
|
||||||
CONFIG_ARM_CPU_SUSPEND=y
|
|
||||||
CONFIG_ARM_CRYPTO=y
|
|
||||||
CONFIG_ARM_HAS_SG_CHAIN=y
|
|
||||||
CONFIG_ARM_L1_CACHE_SHIFT=5
|
|
||||||
CONFIG_ARM_PATCH_PHYS_VIRT=y
|
|
||||||
CONFIG_ARM_THUMB=y
|
|
||||||
CONFIG_ARM_UNWIND=y
|
|
||||||
# CONFIG_AT91RM9200_WATCHDOG is not set
|
|
||||||
CONFIG_AT91SAM9X_WATCHDOG=y
|
|
||||||
# CONFIG_AT91_ADC is not set
|
|
||||||
CONFIG_AT91_SAMA5D2_ADC=y
|
|
||||||
CONFIG_AT91_SOC_ID=y
|
|
||||||
# CONFIG_AT91_SOC_SFR is not set
|
|
||||||
CONFIG_ATMEL_AIC5_IRQ=y
|
|
||||||
CONFIG_ATMEL_AIC_IRQ=y
|
|
||||||
CONFIG_ATMEL_CLOCKSOURCE_PIT=y
|
|
||||||
CONFIG_ATMEL_CLOCKSOURCE_TCB=y
|
|
||||||
CONFIG_ATMEL_EBI=y
|
|
||||||
CONFIG_ATMEL_PIT=y
|
|
||||||
CONFIG_ATMEL_PM=y
|
|
||||||
CONFIG_ATMEL_SDRAMC=y
|
|
||||||
CONFIG_ATMEL_SSC=y
|
|
||||||
CONFIG_ATMEL_ST=y
|
|
||||||
CONFIG_ATMEL_TCB_CLKSRC=y
|
|
||||||
CONFIG_AT_HDMAC=y
|
|
||||||
CONFIG_AT_XDMAC=y
|
|
||||||
CONFIG_AUTO_ZRELADDR=y
|
|
||||||
CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y
|
|
||||||
CONFIG_BLK_PM=y
|
|
||||||
CONFIG_CLKSRC_MMIO=y
|
|
||||||
CONFIG_CLONE_BACKWARDS=y
|
|
||||||
CONFIG_COMMON_CLK=y
|
|
||||||
CONFIG_COMMON_CLK_AT91=y
|
|
||||||
CONFIG_COMPAT_32BIT_TIME=y
|
|
||||||
CONFIG_CONFIGFS_FS=y
|
|
||||||
CONFIG_CPU_32v4T=y
|
|
||||||
CONFIG_CPU_32v5=y
|
|
||||||
CONFIG_CPU_ABRT_EV4T=y
|
|
||||||
CONFIG_CPU_ABRT_EV5TJ=y
|
|
||||||
CONFIG_CPU_ARM920T=y
|
|
||||||
CONFIG_CPU_ARM926T=y
|
|
||||||
# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
|
|
||||||
CONFIG_CPU_CACHE_V4WT=y
|
|
||||||
CONFIG_CPU_CACHE_VIVT=y
|
|
||||||
CONFIG_CPU_COPY_V4WB=y
|
|
||||||
CONFIG_CPU_CP15=y
|
|
||||||
CONFIG_CPU_CP15_MMU=y
|
|
||||||
# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
|
|
||||||
CONFIG_CPU_NO_EFFICIENT_FFS=y
|
|
||||||
CONFIG_CPU_PABRT_LEGACY=y
|
|
||||||
CONFIG_CPU_PM=y
|
|
||||||
CONFIG_CPU_THUMB_CAPABLE=y
|
|
||||||
CONFIG_CPU_TLB_V4WBI=y
|
|
||||||
CONFIG_CPU_USE_DOMAINS=y
|
|
||||||
CONFIG_CRC16=y
|
|
||||||
CONFIG_CRC7=y
|
|
||||||
CONFIG_CRC_CCITT=y
|
|
||||||
CONFIG_CRC_ITU_T=y
|
|
||||||
CONFIG_CRYPTO_CRC32C=y
|
|
||||||
CONFIG_CRYPTO_DEFLATE=y
|
|
||||||
CONFIG_CRYPTO_HASH_INFO=y
|
|
||||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
|
||||||
CONFIG_CRYPTO_LZO=y
|
|
||||||
CONFIG_CRYPTO_RNG2=y
|
|
||||||
CONFIG_CRYPTO_ZSTD=y
|
|
||||||
CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
|
|
||||||
CONFIG_DMADEVICES=y
|
|
||||||
CONFIG_DMA_ENGINE=y
|
|
||||||
CONFIG_DMA_OF=y
|
|
||||||
CONFIG_DMA_OPS=y
|
|
||||||
CONFIG_DMA_REMAP=y
|
|
||||||
CONFIG_DTC=y
|
|
||||||
CONFIG_EDAC_ATOMIC_SCRUB=y
|
|
||||||
CONFIG_EDAC_SUPPORT=y
|
|
||||||
CONFIG_EEPROM_AT24=y
|
|
||||||
CONFIG_EXT4_FS=y
|
|
||||||
CONFIG_FIXED_PHY=y
|
|
||||||
CONFIG_FIX_EARLYCON_MEM=y
|
|
||||||
CONFIG_FREEZER=y
|
|
||||||
CONFIG_FS_IOMAP=y
|
|
||||||
CONFIG_FS_MBCACHE=y
|
|
||||||
CONFIG_FWNODE_MDIO=y
|
|
||||||
CONFIG_FW_CACHE=y
|
|
||||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
|
||||||
CONFIG_GENERIC_ALLOCATOR=y
|
|
||||||
CONFIG_GENERIC_ATOMIC64=y
|
|
||||||
CONFIG_GENERIC_BUG=y
|
|
||||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
|
||||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
|
||||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
|
||||||
CONFIG_GENERIC_IDLE_POLL_SETUP=y
|
|
||||||
CONFIG_GENERIC_IRQ_CHIP=y
|
|
||||||
CONFIG_GENERIC_IRQ_MULTI_HANDLER=y
|
|
||||||
CONFIG_GENERIC_IRQ_SHOW=y
|
|
||||||
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
|
|
||||||
CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y
|
|
||||||
CONFIG_GENERIC_PCI_IOMAP=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_GLOB=y
|
|
||||||
CONFIG_GPIOLIB_IRQCHIP=y
|
|
||||||
CONFIG_GPIO_CDEV=y
|
|
||||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
|
||||||
CONFIG_HARDIRQS_SW_RESEND=y
|
|
||||||
CONFIG_HAS_DMA=y
|
|
||||||
CONFIG_HAS_IOMEM=y
|
|
||||||
CONFIG_HAS_IOPORT_MAP=y
|
|
||||||
CONFIG_HW_RANDOM=y
|
|
||||||
CONFIG_HW_RANDOM_ATMEL=y
|
|
||||||
CONFIG_HZ=128
|
|
||||||
CONFIG_HZ_FIXED=128
|
|
||||||
CONFIG_HZ_PERIODIC=y
|
|
||||||
CONFIG_I2C=y
|
|
||||||
CONFIG_I2C_ALGOBIT=y
|
|
||||||
CONFIG_I2C_AT91=y
|
|
||||||
# CONFIG_I2C_AT91_SLAVE_EXPERIMENTAL is not set
|
|
||||||
CONFIG_I2C_BOARDINFO=y
|
|
||||||
CONFIG_I2C_CHARDEV=y
|
|
||||||
CONFIG_I2C_COMPAT=y
|
|
||||||
CONFIG_I2C_GPIO=y
|
|
||||||
CONFIG_IIO=y
|
|
||||||
CONFIG_IIO_BUFFER=y
|
|
||||||
CONFIG_IIO_KFIFO_BUF=y
|
|
||||||
CONFIG_IIO_TRIGGER=y
|
|
||||||
CONFIG_IIO_TRIGGERED_BUFFER=y
|
|
||||||
CONFIG_INITRAMFS_SOURCE=""
|
|
||||||
CONFIG_INPUT=y
|
|
||||||
CONFIG_IRQCHIP=y
|
|
||||||
CONFIG_IRQ_DOMAIN=y
|
|
||||||
CONFIG_IRQ_FORCED_THREADING=y
|
|
||||||
CONFIG_IRQ_WORK=y
|
|
||||||
CONFIG_JBD2=y
|
|
||||||
CONFIG_LEDS_GPIO=y
|
|
||||||
CONFIG_LEDS_PWM=y
|
|
||||||
CONFIG_LEDS_TRIGGER_CPU=y
|
|
||||||
CONFIG_LEDS_TRIGGER_GPIO=y
|
|
||||||
CONFIG_LIBFDT=y
|
|
||||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
|
||||||
CONFIG_LZO_COMPRESS=y
|
|
||||||
CONFIG_LZO_DECOMPRESS=y
|
|
||||||
CONFIG_MACB=y
|
|
||||||
CONFIG_MACB_USE_HWSTAMP=y
|
|
||||||
CONFIG_MDIO_BUS=y
|
|
||||||
CONFIG_MDIO_DEVICE=y
|
|
||||||
CONFIG_MDIO_DEVRES=y
|
|
||||||
CONFIG_MEMFD_CREATE=y
|
|
||||||
CONFIG_MEMORY=y
|
|
||||||
CONFIG_MFD_AT91_USART=y
|
|
||||||
CONFIG_MFD_ATMEL_FLEXCOM=y
|
|
||||||
CONFIG_MFD_ATMEL_HLCDC=y
|
|
||||||
CONFIG_MFD_ATMEL_SMC=y
|
|
||||||
CONFIG_MFD_CORE=y
|
|
||||||
CONFIG_MFD_SYSCON=y
|
|
||||||
CONFIG_MICREL_PHY=y
|
|
||||||
CONFIG_MICROCHIP_PIT64B=y
|
|
||||||
CONFIG_MIGRATION=y
|
|
||||||
CONFIG_MMC=y
|
|
||||||
CONFIG_MMC_ATMELMCI=y
|
|
||||||
CONFIG_MMC_BLOCK=y
|
|
||||||
CONFIG_MMC_SDHCI=y
|
|
||||||
CONFIG_MMC_SDHCI_OF_AT91=y
|
|
||||||
CONFIG_MMC_SDHCI_PLTFM=y
|
|
||||||
CONFIG_MODULES_USE_ELF_REL=y
|
|
||||||
CONFIG_MTD_CMDLINE_PARTS=y
|
|
||||||
CONFIG_MTD_DATAFLASH=y
|
|
||||||
# CONFIG_MTD_DATAFLASH_OTP is not set
|
|
||||||
# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set
|
|
||||||
CONFIG_MTD_SPI_NOR=y
|
|
||||||
CONFIG_MTD_UBI=y
|
|
||||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
|
||||||
# CONFIG_MTD_UBI_BLOCK is not set
|
|
||||||
CONFIG_MTD_UBI_FASTMAP=y
|
|
||||||
CONFIG_MTD_UBI_GLUEBI=y
|
|
||||||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
|
||||||
CONFIG_NEED_DMA_MAP_STATE=y
|
|
||||||
CONFIG_NEED_KUSER_HELPERS=y
|
|
||||||
CONFIG_NEED_PER_CPU_KM=y
|
|
||||||
CONFIG_NET_PTP_CLASSIFY=y
|
|
||||||
CONFIG_NET_SELFTESTS=y
|
|
||||||
CONFIG_NLS=y
|
|
||||||
CONFIG_NVMEM=y
|
|
||||||
# CONFIG_NVMEM_MICROCHIP_OTPC is not set
|
|
||||||
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_OLD_SIGACTION=y
|
|
||||||
CONFIG_OLD_SIGSUSPEND3=y
|
|
||||||
CONFIG_PAGE_OFFSET=0xC0000000
|
|
||||||
CONFIG_PERF_USE_VMALLOC=y
|
|
||||||
CONFIG_PGTABLE_LEVELS=2
|
|
||||||
CONFIG_PHYLIB=y
|
|
||||||
CONFIG_PHYLINK=y
|
|
||||||
CONFIG_PINCTRL=y
|
|
||||||
CONFIG_PINCTRL_AT91=y
|
|
||||||
# CONFIG_PINCTRL_AT91PIO4 is not set
|
|
||||||
CONFIG_PM=y
|
|
||||||
CONFIG_PM_CLK=y
|
|
||||||
CONFIG_PM_SLEEP=y
|
|
||||||
CONFIG_POWER_RESET=y
|
|
||||||
CONFIG_POWER_RESET_AT91_POWEROFF=y
|
|
||||||
CONFIG_POWER_RESET_AT91_RESET=y
|
|
||||||
CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC=y
|
|
||||||
CONFIG_POWER_SUPPLY=y
|
|
||||||
CONFIG_PPS=y
|
|
||||||
CONFIG_PTP_1588_CLOCK=y
|
|
||||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
|
||||||
CONFIG_PWM=y
|
|
||||||
CONFIG_PWM_ATMEL=y
|
|
||||||
CONFIG_PWM_ATMEL_HLCDC_PWM=y
|
|
||||||
CONFIG_PWM_ATMEL_TCB=y
|
|
||||||
CONFIG_PWM_SYSFS=y
|
|
||||||
CONFIG_RATIONAL=y
|
|
||||||
CONFIG_REGMAP=y
|
|
||||||
CONFIG_REGMAP_I2C=y
|
|
||||||
CONFIG_REGMAP_MMIO=y
|
|
||||||
CONFIG_REGULATOR=y
|
|
||||||
CONFIG_REGULATOR_FIXED_VOLTAGE=y
|
|
||||||
CONFIG_RTC_CLASS=y
|
|
||||||
CONFIG_RTC_DRV_AT91RM9200=y
|
|
||||||
CONFIG_RTC_DRV_AT91SAM9=y
|
|
||||||
CONFIG_RTC_I2C_AND_SPI=y
|
|
||||||
CONFIG_RTC_MC146818_LIB=y
|
|
||||||
CONFIG_SAMA5D4_WATCHDOG=y
|
|
||||||
# CONFIG_SERIAL_8250 is not set
|
|
||||||
CONFIG_SERIAL_ATMEL=y
|
|
||||||
CONFIG_SERIAL_ATMEL_CONSOLE=y
|
|
||||||
CONFIG_SERIAL_ATMEL_PDC=y
|
|
||||||
# CONFIG_SERIAL_ATMEL_TTYAT is not set
|
|
||||||
CONFIG_SERIAL_MCTRL_GPIO=y
|
|
||||||
CONFIG_SGL_ALLOC=y
|
|
||||||
CONFIG_SOC_AT91RM9200=y
|
|
||||||
CONFIG_SOC_AT91SAM9=y
|
|
||||||
CONFIG_SOC_BUS=y
|
|
||||||
CONFIG_SOC_SAM9X60=y
|
|
||||||
CONFIG_SOC_SAM_V4_V5=y
|
|
||||||
CONFIG_SPARSE_IRQ=y
|
|
||||||
CONFIG_SPI=y
|
|
||||||
# CONFIG_SPI_AT91_USART is not set
|
|
||||||
CONFIG_SPI_ATMEL=y
|
|
||||||
CONFIG_SPI_ATMEL_QUADSPI=y
|
|
||||||
CONFIG_SPI_BITBANG=y
|
|
||||||
CONFIG_SPI_GPIO=y
|
|
||||||
CONFIG_SPI_MASTER=y
|
|
||||||
CONFIG_SPI_MEM=y
|
|
||||||
CONFIG_SPI_SPIDEV=y
|
|
||||||
CONFIG_SPLIT_PTLOCK_CPUS=999999
|
|
||||||
CONFIG_SRAM=y
|
|
||||||
CONFIG_SRAM_EXEC=y
|
|
||||||
CONFIG_SRCU=y
|
|
||||||
CONFIG_SUSPEND=y
|
|
||||||
CONFIG_SUSPEND_FREEZER=y
|
|
||||||
CONFIG_SWPHY=y
|
|
||||||
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
|
|
||||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
|
||||||
CONFIG_TIMER_OF=y
|
|
||||||
CONFIG_TIMER_PROBE=y
|
|
||||||
CONFIG_TINY_SRCU=y
|
|
||||||
CONFIG_UBIFS_FS=y
|
|
||||||
CONFIG_UBIFS_FS_ADVANCED_COMPR=y
|
|
||||||
CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
|
|
||||||
CONFIG_UNWINDER_ARM=y
|
|
||||||
CONFIG_USB=y
|
|
||||||
CONFIG_USB_ACM=y
|
|
||||||
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
|
|
||||||
# CONFIG_USB_AT91 is not set
|
|
||||||
# CONFIG_USB_ATMEL_USBA is not set
|
|
||||||
CONFIG_USB_COMMON=y
|
|
||||||
CONFIG_USB_EHCI_HCD=y
|
|
||||||
CONFIG_USB_EHCI_HCD_AT91=y
|
|
||||||
# CONFIG_USB_EHCI_HCD_PLATFORM is not set
|
|
||||||
CONFIG_USB_GADGET=y
|
|
||||||
CONFIG_USB_OHCI_HCD=y
|
|
||||||
CONFIG_USB_OHCI_HCD_AT91=y
|
|
||||||
CONFIG_USB_OHCI_HCD_PLATFORM=y
|
|
||||||
CONFIG_USB_SERIAL=y
|
|
||||||
# CONFIG_USB_SERIAL_CONSOLE is not set
|
|
||||||
CONFIG_USB_SERIAL_FTDI_SIO=y
|
|
||||||
CONFIG_USB_SERIAL_PL2303=y
|
|
||||||
CONFIG_USB_SUPPORT=y
|
|
||||||
CONFIG_USE_OF=y
|
|
||||||
# CONFIG_VFP is not set
|
|
||||||
CONFIG_WATCHDOG_CORE=y
|
|
||||||
CONFIG_XXHASH=y
|
|
||||||
CONFIG_ZBOOT_ROM_BSS=0x0
|
|
||||||
CONFIG_ZBOOT_ROM_TEXT=0x0
|
|
||||||
CONFIG_ZLIB_DEFLATE=y
|
|
||||||
CONFIG_ZLIB_INFLATE=y
|
|
||||||
CONFIG_ZSTD_COMPRESS=y
|
|
||||||
CONFIG_ZSTD_DECOMPRESS=y
|
|
@ -1,493 +0,0 @@
|
|||||||
CONFIG_ALIGNMENT_TRAP=y
|
|
||||||
CONFIG_ARCH_32BIT_OFF_T=y
|
|
||||||
CONFIG_ARCH_AT91=y
|
|
||||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
|
||||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
|
||||||
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
|
|
||||||
CONFIG_ARCH_MULTIPLATFORM=y
|
|
||||||
CONFIG_ARCH_MULTI_V6_V7=y
|
|
||||||
CONFIG_ARCH_MULTI_V7=y
|
|
||||||
CONFIG_ARCH_NR_GPIO=0
|
|
||||||
CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
|
|
||||||
CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
|
|
||||||
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
|
|
||||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
|
||||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
|
||||||
CONFIG_ARM=y
|
|
||||||
CONFIG_ARM_AT91_CPUIDLE=y
|
|
||||||
CONFIG_ARM_CPU_SUSPEND=y
|
|
||||||
CONFIG_ARM_CRYPTO=y
|
|
||||||
CONFIG_ARM_HAS_SG_CHAIN=y
|
|
||||||
CONFIG_ARM_HEAVY_MB=y
|
|
||||||
CONFIG_ARM_L1_CACHE_SHIFT=6
|
|
||||||
CONFIG_ARM_L1_CACHE_SHIFT_6=y
|
|
||||||
CONFIG_ARM_PATCH_IDIV=y
|
|
||||||
CONFIG_ARM_PATCH_PHYS_VIRT=y
|
|
||||||
CONFIG_ARM_THUMB=y
|
|
||||||
CONFIG_ARM_UNWIND=y
|
|
||||||
CONFIG_ARM_VIRT_EXT=y
|
|
||||||
CONFIG_AT91SAM9X_WATCHDOG=y
|
|
||||||
CONFIG_AT91_ADC=y
|
|
||||||
CONFIG_AT91_SAMA5D2_ADC=y
|
|
||||||
CONFIG_AT91_SOC_ID=y
|
|
||||||
# CONFIG_AT91_SOC_SFR is not set
|
|
||||||
CONFIG_ATMEL_AIC5_IRQ=y
|
|
||||||
# CONFIG_ATMEL_CLOCKSOURCE_PIT is not set
|
|
||||||
CONFIG_ATMEL_CLOCKSOURCE_TCB=y
|
|
||||||
CONFIG_ATMEL_EBI=y
|
|
||||||
CONFIG_ATMEL_PM=y
|
|
||||||
CONFIG_ATMEL_SDRAMC=y
|
|
||||||
CONFIG_ATMEL_SSC=y
|
|
||||||
CONFIG_ATMEL_TCB_CLKSRC=y
|
|
||||||
CONFIG_AT_HDMAC=y
|
|
||||||
CONFIG_AT_XDMAC=y
|
|
||||||
CONFIG_AUTO_ZRELADDR=y
|
|
||||||
CONFIG_BACKLIGHT_CLASS_DEVICE=y
|
|
||||||
CONFIG_BACKLIGHT_PWM=y
|
|
||||||
CONFIG_BATTERY_ACT8945A=y
|
|
||||||
CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y
|
|
||||||
CONFIG_BLK_DEV_LOOP=y
|
|
||||||
CONFIG_BLK_DEV_RAM=y
|
|
||||||
CONFIG_BLK_DEV_RAM_COUNT=4
|
|
||||||
CONFIG_BLK_DEV_RAM_SIZE=8192
|
|
||||||
CONFIG_BLK_DEV_SD=y
|
|
||||||
CONFIG_BLK_PM=y
|
|
||||||
CONFIG_CACHE_L2X0=y
|
|
||||||
CONFIG_CLONE_BACKWARDS=y
|
|
||||||
CONFIG_CMA=y
|
|
||||||
CONFIG_CMA_ALIGNMENT=8
|
|
||||||
CONFIG_CMA_AREAS=7
|
|
||||||
# CONFIG_CMA_DEBUG is not set
|
|
||||||
# CONFIG_CMA_DEBUGFS is not set
|
|
||||||
CONFIG_CMA_SIZE_MBYTES=16
|
|
||||||
# CONFIG_CMA_SIZE_SEL_MAX is not set
|
|
||||||
CONFIG_CMA_SIZE_SEL_MBYTES=y
|
|
||||||
# CONFIG_CMA_SIZE_SEL_MIN is not set
|
|
||||||
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
|
|
||||||
# CONFIG_CMA_SYSFS is not set
|
|
||||||
CONFIG_CMDLINE="console=ttyS0,115200 initrd=0x21100000,25165824 root=/dev/ram0 rw"
|
|
||||||
CONFIG_CMDLINE_FROM_BOOTLOADER=y
|
|
||||||
CONFIG_COMMON_CLK=y
|
|
||||||
CONFIG_COMMON_CLK_AT91=y
|
|
||||||
CONFIG_COMPAT_32BIT_TIME=y
|
|
||||||
CONFIG_CONFIGFS_FS=y
|
|
||||||
CONFIG_CONTIG_ALLOC=y
|
|
||||||
CONFIG_COREDUMP=y
|
|
||||||
CONFIG_CPU_32v6K=y
|
|
||||||
CONFIG_CPU_32v7=y
|
|
||||||
CONFIG_CPU_ABRT_EV7=y
|
|
||||||
CONFIG_CPU_CACHE_V7=y
|
|
||||||
CONFIG_CPU_CACHE_VIPT=y
|
|
||||||
CONFIG_CPU_COPY_V6=y
|
|
||||||
CONFIG_CPU_CP15=y
|
|
||||||
CONFIG_CPU_CP15_MMU=y
|
|
||||||
CONFIG_CPU_HAS_ASID=y
|
|
||||||
CONFIG_CPU_IDLE=y
|
|
||||||
CONFIG_CPU_IDLE_GOV_LADDER=y
|
|
||||||
CONFIG_CPU_IDLE_GOV_MENU=y
|
|
||||||
CONFIG_CPU_PABRT_V7=y
|
|
||||||
CONFIG_CPU_PM=y
|
|
||||||
CONFIG_CPU_SPECTRE=y
|
|
||||||
CONFIG_CPU_THUMB_CAPABLE=y
|
|
||||||
CONFIG_CPU_TLB_V7=y
|
|
||||||
CONFIG_CPU_V7=y
|
|
||||||
CONFIG_CRASH_CORE=y
|
|
||||||
CONFIG_CRASH_DUMP=y
|
|
||||||
CONFIG_CRC16=y
|
|
||||||
# CONFIG_CRC32_SARWATE is not set
|
|
||||||
CONFIG_CRC32_SLICEBY8=y
|
|
||||||
CONFIG_CROSS_MEMORY_ATTACH=y
|
|
||||||
CONFIG_CRYPTO_CRC32C=y
|
|
||||||
CONFIG_CRYPTO_DEFLATE=y
|
|
||||||
CONFIG_CRYPTO_DRBG=y
|
|
||||||
CONFIG_CRYPTO_DRBG_HMAC=y
|
|
||||||
CONFIG_CRYPTO_DRBG_MENU=y
|
|
||||||
CONFIG_CRYPTO_HASH_INFO=y
|
|
||||||
CONFIG_CRYPTO_HMAC=y
|
|
||||||
CONFIG_CRYPTO_JITTERENTROPY=y
|
|
||||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
|
||||||
CONFIG_CRYPTO_LIB_SHA256=y
|
|
||||||
CONFIG_CRYPTO_LZO=y
|
|
||||||
CONFIG_CRYPTO_RNG=y
|
|
||||||
CONFIG_CRYPTO_RNG2=y
|
|
||||||
CONFIG_CRYPTO_RNG_DEFAULT=y
|
|
||||||
CONFIG_CRYPTO_SEQIV=y
|
|
||||||
CONFIG_CRYPTO_SHA256=y
|
|
||||||
CONFIG_CRYPTO_SHA512=y
|
|
||||||
CONFIG_CRYPTO_ZSTD=y
|
|
||||||
CONFIG_DCACHE_WORD_ACCESS=y
|
|
||||||
CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
|
|
||||||
CONFIG_DEBUG_MEMORY_INIT=y
|
|
||||||
CONFIG_DEBUG_USER=y
|
|
||||||
CONFIG_DMADEVICES=y
|
|
||||||
CONFIG_DMA_CMA=y
|
|
||||||
CONFIG_DMA_ENGINE=y
|
|
||||||
CONFIG_DMA_OF=y
|
|
||||||
CONFIG_DMA_OPS=y
|
|
||||||
CONFIG_DMA_REMAP=y
|
|
||||||
CONFIG_DMA_SHARED_BUFFER=y
|
|
||||||
CONFIG_DNOTIFY=y
|
|
||||||
CONFIG_DRM=y
|
|
||||||
CONFIG_DRM_ATMEL_HLCDC=y
|
|
||||||
CONFIG_DRM_BRIDGE=y
|
|
||||||
CONFIG_DRM_DP_AUX_BUS=y
|
|
||||||
CONFIG_DRM_FBDEV_EMULATION=y
|
|
||||||
CONFIG_DRM_FBDEV_OVERALLOC=100
|
|
||||||
CONFIG_DRM_GEM_CMA_HELPER=y
|
|
||||||
CONFIG_DRM_KMS_CMA_HELPER=y
|
|
||||||
CONFIG_DRM_KMS_HELPER=y
|
|
||||||
CONFIG_DRM_PANEL=y
|
|
||||||
CONFIG_DRM_PANEL_BRIDGE=y
|
|
||||||
CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y
|
|
||||||
CONFIG_DRM_PANEL_SIMPLE=y
|
|
||||||
CONFIG_DTC=y
|
|
||||||
CONFIG_DVB_CORE=y
|
|
||||||
CONFIG_EDAC_ATOMIC_SCRUB=y
|
|
||||||
CONFIG_EDAC_SUPPORT=y
|
|
||||||
CONFIG_EEPROM_AT24=y
|
|
||||||
CONFIG_ELF_CORE=y
|
|
||||||
CONFIG_EXT4_FS=y
|
|
||||||
CONFIG_FAT_FS=y
|
|
||||||
CONFIG_FB=y
|
|
||||||
CONFIG_FB_CFB_COPYAREA=y
|
|
||||||
CONFIG_FB_CFB_FILLRECT=y
|
|
||||||
CONFIG_FB_CFB_IMAGEBLIT=y
|
|
||||||
CONFIG_FB_CMDLINE=y
|
|
||||||
CONFIG_FB_DEFERRED_IO=y
|
|
||||||
CONFIG_FB_SYS_COPYAREA=y
|
|
||||||
CONFIG_FB_SYS_FILLRECT=y
|
|
||||||
CONFIG_FB_SYS_FOPS=y
|
|
||||||
CONFIG_FB_SYS_IMAGEBLIT=y
|
|
||||||
CONFIG_FIXED_PHY=y
|
|
||||||
CONFIG_FIX_EARLYCON_MEM=y
|
|
||||||
CONFIG_FORCE_MAX_ZONEORDER=15
|
|
||||||
CONFIG_FREEZER=y
|
|
||||||
CONFIG_FS_IOMAP=y
|
|
||||||
CONFIG_FS_MBCACHE=y
|
|
||||||
CONFIG_FWNODE_MDIO=y
|
|
||||||
CONFIG_FW_CACHE=y
|
|
||||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
|
||||||
CONFIG_GENERIC_ALLOCATOR=y
|
|
||||||
CONFIG_GENERIC_BUG=y
|
|
||||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
|
||||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
|
||||||
CONFIG_GENERIC_CPU_VULNERABILITIES=y
|
|
||||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
|
||||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
|
||||||
CONFIG_GENERIC_IDLE_POLL_SETUP=y
|
|
||||||
CONFIG_GENERIC_IRQ_CHIP=y
|
|
||||||
CONFIG_GENERIC_IRQ_MULTI_HANDLER=y
|
|
||||||
CONFIG_GENERIC_IRQ_SHOW=y
|
|
||||||
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
|
|
||||||
CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y
|
|
||||||
CONFIG_GENERIC_PCI_IOMAP=y
|
|
||||||
CONFIG_GENERIC_PINCONF=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_GENERIC_VDSO_32=y
|
|
||||||
CONFIG_GLOB=y
|
|
||||||
CONFIG_GPIOLIB_IRQCHIP=y
|
|
||||||
CONFIG_GPIO_CDEV=y
|
|
||||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
|
||||||
# CONFIG_HARDEN_BRANCH_HISTORY is not set
|
|
||||||
# CONFIG_HARDEN_BRANCH_PREDICTOR is not set
|
|
||||||
CONFIG_HARDIRQS_SW_RESEND=y
|
|
||||||
CONFIG_HAS_DMA=y
|
|
||||||
CONFIG_HAS_IOMEM=y
|
|
||||||
CONFIG_HAS_IOPORT_MAP=y
|
|
||||||
CONFIG_HAVE_SMP=y
|
|
||||||
CONFIG_HDMI=y
|
|
||||||
CONFIG_HID=y
|
|
||||||
CONFIG_HID_GENERIC=y
|
|
||||||
CONFIG_HW_RANDOM=y
|
|
||||||
CONFIG_HW_RANDOM_ATMEL=y
|
|
||||||
CONFIG_HZ_FIXED=0
|
|
||||||
CONFIG_I2C=y
|
|
||||||
CONFIG_I2C_ALGOBIT=y
|
|
||||||
CONFIG_I2C_AT91=y
|
|
||||||
# CONFIG_I2C_AT91_SLAVE_EXPERIMENTAL is not set
|
|
||||||
CONFIG_I2C_BOARDINFO=y
|
|
||||||
CONFIG_I2C_CHARDEV=y
|
|
||||||
CONFIG_I2C_COMPAT=y
|
|
||||||
CONFIG_I2C_GPIO=y
|
|
||||||
CONFIG_I2C_HELPER_AUTO=y
|
|
||||||
CONFIG_IIO=y
|
|
||||||
CONFIG_IIO_BUFFER=y
|
|
||||||
CONFIG_IIO_KFIFO_BUF=y
|
|
||||||
CONFIG_IIO_TRIGGER=y
|
|
||||||
CONFIG_IIO_TRIGGERED_BUFFER=y
|
|
||||||
CONFIG_INITRAMFS_SOURCE=""
|
|
||||||
CONFIG_INPUT=y
|
|
||||||
CONFIG_INPUT_EVDEV=y
|
|
||||||
CONFIG_INPUT_KEYBOARD=y
|
|
||||||
CONFIG_INPUT_LEDS=y
|
|
||||||
CONFIG_INPUT_TOUCHSCREEN=y
|
|
||||||
CONFIG_IRQCHIP=y
|
|
||||||
CONFIG_IRQ_DOMAIN=y
|
|
||||||
CONFIG_IRQ_FORCED_THREADING=y
|
|
||||||
CONFIG_IRQ_WORK=y
|
|
||||||
CONFIG_JBD2=y
|
|
||||||
# CONFIG_JFFS2_FS is not set
|
|
||||||
CONFIG_KCMP=y
|
|
||||||
CONFIG_KERNEL_GZIP=y
|
|
||||||
# CONFIG_KERNEL_XZ is not set
|
|
||||||
CONFIG_KEXEC=y
|
|
||||||
CONFIG_KEXEC_CORE=y
|
|
||||||
CONFIG_KEYBOARD_GPIO=y
|
|
||||||
CONFIG_KEYBOARD_QT1070=y
|
|
||||||
CONFIG_LEDS_GPIO=y
|
|
||||||
CONFIG_LEDS_PWM=y
|
|
||||||
CONFIG_LEDS_TRIGGER_CPU=y
|
|
||||||
CONFIG_LEDS_TRIGGER_GPIO=y
|
|
||||||
CONFIG_LIBFDT=y
|
|
||||||
CONFIG_LOCALVERSION_AUTO=y
|
|
||||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
|
||||||
CONFIG_LOG_BUF_SHIFT=16
|
|
||||||
CONFIG_LZO_COMPRESS=y
|
|
||||||
CONFIG_LZO_DECOMPRESS=y
|
|
||||||
CONFIG_MACB=y
|
|
||||||
CONFIG_MACB_USE_HWSTAMP=y
|
|
||||||
CONFIG_MAGIC_SYSRQ=y
|
|
||||||
CONFIG_MDIO_BUS=y
|
|
||||||
CONFIG_MDIO_DEVICE=y
|
|
||||||
CONFIG_MDIO_DEVRES=y
|
|
||||||
CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
|
|
||||||
CONFIG_MEDIA_ATTACH=y
|
|
||||||
CONFIG_MEDIA_CAMERA_SUPPORT=y
|
|
||||||
CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
|
|
||||||
CONFIG_MEDIA_PLATFORM_SUPPORT=y
|
|
||||||
CONFIG_MEDIA_RADIO_SUPPORT=y
|
|
||||||
CONFIG_MEDIA_SDR_SUPPORT=y
|
|
||||||
CONFIG_MEDIA_SUPPORT=y
|
|
||||||
CONFIG_MEDIA_TEST_SUPPORT=y
|
|
||||||
CONFIG_MEDIA_TUNER=y
|
|
||||||
CONFIG_MEDIA_USB_SUPPORT=y
|
|
||||||
CONFIG_MEMFD_CREATE=y
|
|
||||||
CONFIG_MEMORY=y
|
|
||||||
CONFIG_MEMORY_ISOLATION=y
|
|
||||||
CONFIG_MFD_ACT8945A=y
|
|
||||||
CONFIG_MFD_AT91_USART=y
|
|
||||||
CONFIG_MFD_ATMEL_FLEXCOM=y
|
|
||||||
CONFIG_MFD_ATMEL_HLCDC=y
|
|
||||||
CONFIG_MFD_ATMEL_SMC=y
|
|
||||||
CONFIG_MFD_CORE=y
|
|
||||||
CONFIG_MFD_SYSCON=y
|
|
||||||
CONFIG_MICREL_PHY=y
|
|
||||||
CONFIG_MIGHT_HAVE_CACHE_L2X0=y
|
|
||||||
CONFIG_MIGRATION=y
|
|
||||||
CONFIG_MMC=y
|
|
||||||
CONFIG_MMC_ATMELMCI=y
|
|
||||||
CONFIG_MMC_BLOCK=y
|
|
||||||
CONFIG_MMC_SDHCI=y
|
|
||||||
CONFIG_MMC_SDHCI_OF_AT91=y
|
|
||||||
CONFIG_MMC_SDHCI_PLTFM=y
|
|
||||||
CONFIG_MODULES_USE_ELF_REL=y
|
|
||||||
# CONFIG_MTD_CFI_AMDSTD is not set
|
|
||||||
# CONFIG_MTD_CFI_INTELEXT is not set
|
|
||||||
CONFIG_MTD_CMDLINE_PARTS=y
|
|
||||||
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
|
|
||||||
CONFIG_MTD_SPI_NOR=y
|
|
||||||
CONFIG_MTD_UBI=y
|
|
||||||
CONFIG_MTD_UBI_BEB_LIMIT=20
|
|
||||||
# CONFIG_MTD_UBI_BLOCK is not set
|
|
||||||
CONFIG_MTD_UBI_FASTMAP=y
|
|
||||||
CONFIG_MTD_UBI_WL_THRESHOLD=4096
|
|
||||||
CONFIG_NEED_DMA_MAP_STATE=y
|
|
||||||
CONFIG_NEED_PER_CPU_KM=y
|
|
||||||
# CONFIG_NEON is not set
|
|
||||||
CONFIG_NET_PTP_CLASSIFY=y
|
|
||||||
CONFIG_NET_SELFTESTS=y
|
|
||||||
CONFIG_NLS=y
|
|
||||||
CONFIG_NLS_CODEPAGE_437=y
|
|
||||||
CONFIG_NLS_CODEPAGE_850=y
|
|
||||||
CONFIG_NLS_ISO8859_1=y
|
|
||||||
CONFIG_NLS_UTF8=y
|
|
||||||
CONFIG_NO_HZ_COMMON=y
|
|
||||||
CONFIG_NO_HZ_IDLE=y
|
|
||||||
CONFIG_NVMEM=y
|
|
||||||
# CONFIG_NVMEM_MICROCHIP_OTPC is not set
|
|
||||||
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_OLD_SIGACTION=y
|
|
||||||
CONFIG_OLD_SIGSUSPEND3=y
|
|
||||||
CONFIG_OUTER_CACHE=y
|
|
||||||
CONFIG_OUTER_CACHE_SYNC=y
|
|
||||||
CONFIG_PAGE_OFFSET=0xC0000000
|
|
||||||
# CONFIG_PARTITION_ADVANCED is not set
|
|
||||||
CONFIG_PERF_USE_VMALLOC=y
|
|
||||||
CONFIG_PGTABLE_LEVELS=2
|
|
||||||
CONFIG_PHYLIB=y
|
|
||||||
CONFIG_PHYLINK=y
|
|
||||||
CONFIG_PINCTRL=y
|
|
||||||
CONFIG_PINCTRL_AT91=y
|
|
||||||
CONFIG_PINCTRL_AT91PIO4=y
|
|
||||||
# CONFIG_PINCTRL_SINGLE is not set
|
|
||||||
CONFIG_PM=y
|
|
||||||
CONFIG_PM_CLK=y
|
|
||||||
CONFIG_PM_SLEEP=y
|
|
||||||
CONFIG_POWER_RESET=y
|
|
||||||
CONFIG_POWER_RESET_AT91_POWEROFF=y
|
|
||||||
CONFIG_POWER_RESET_AT91_RESET=y
|
|
||||||
CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC=y
|
|
||||||
CONFIG_POWER_SUPPLY=y
|
|
||||||
CONFIG_PPS=y
|
|
||||||
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
|
|
||||||
CONFIG_PRINTK_TIME=y
|
|
||||||
CONFIG_PROC_VMCORE=y
|
|
||||||
CONFIG_PTP_1588_CLOCK=y
|
|
||||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
|
||||||
CONFIG_PWM=y
|
|
||||||
CONFIG_PWM_ATMEL=y
|
|
||||||
CONFIG_PWM_ATMEL_HLCDC_PWM=y
|
|
||||||
CONFIG_PWM_ATMEL_TCB=y
|
|
||||||
CONFIG_PWM_SYSFS=y
|
|
||||||
CONFIG_RATIONAL=y
|
|
||||||
CONFIG_REGMAP=y
|
|
||||||
CONFIG_REGMAP_I2C=y
|
|
||||||
CONFIG_REGMAP_MMIO=y
|
|
||||||
CONFIG_REGMAP_SPI=y
|
|
||||||
CONFIG_REGULATOR=y
|
|
||||||
CONFIG_REGULATOR_ACT8865=y
|
|
||||||
CONFIG_REGULATOR_ACT8945A=y
|
|
||||||
CONFIG_REGULATOR_FIXED_VOLTAGE=y
|
|
||||||
CONFIG_RTC_CLASS=y
|
|
||||||
CONFIG_RTC_DRV_AT91RM9200=y
|
|
||||||
# CONFIG_RTC_DRV_AT91SAM9 is not set
|
|
||||||
# CONFIG_RTC_DRV_CMOS is not set
|
|
||||||
CONFIG_RTC_I2C_AND_SPI=y
|
|
||||||
CONFIG_SAMA5D4_WATCHDOG=y
|
|
||||||
CONFIG_SCSI=y
|
|
||||||
CONFIG_SCSI_COMMON=y
|
|
||||||
# CONFIG_SCSI_LOWLEVEL is not set
|
|
||||||
# CONFIG_SERIAL_8250 is not set
|
|
||||||
CONFIG_SERIAL_ATMEL=y
|
|
||||||
CONFIG_SERIAL_ATMEL_CONSOLE=y
|
|
||||||
CONFIG_SERIAL_ATMEL_PDC=y
|
|
||||||
# CONFIG_SERIAL_ATMEL_TTYAT is not set
|
|
||||||
CONFIG_SERIAL_MCTRL_GPIO=y
|
|
||||||
CONFIG_SGL_ALLOC=y
|
|
||||||
CONFIG_SG_POOL=y
|
|
||||||
CONFIG_SND=y
|
|
||||||
CONFIG_SND_ARM=y
|
|
||||||
# CONFIG_SND_AT73C213 is not set
|
|
||||||
# CONFIG_SND_AT91_SOC_SAM9G20_WM8731 is not set
|
|
||||||
# CONFIG_SND_AT91_SOC_SAM9X5_WM8731 is not set
|
|
||||||
CONFIG_SND_ATMEL_SOC=y
|
|
||||||
CONFIG_SND_ATMEL_SOC_CLASSD=y
|
|
||||||
CONFIG_SND_ATMEL_SOC_DMA=y
|
|
||||||
CONFIG_SND_ATMEL_SOC_I2S=y
|
|
||||||
CONFIG_SND_ATMEL_SOC_PDC=y
|
|
||||||
# CONFIG_SND_ATMEL_SOC_PDMIC is not set
|
|
||||||
CONFIG_SND_ATMEL_SOC_SSC=y
|
|
||||||
CONFIG_SND_ATMEL_SOC_SSC_DMA=y
|
|
||||||
# CONFIG_SND_ATMEL_SOC_SSC_PDC is not set
|
|
||||||
# CONFIG_SND_ATMEL_SOC_TSE850_PCM5142 is not set
|
|
||||||
CONFIG_SND_ATMEL_SOC_WM8904=y
|
|
||||||
# CONFIG_SND_COMPRESS_OFFLOAD is not set
|
|
||||||
CONFIG_SND_DMAENGINE_PCM=y
|
|
||||||
CONFIG_SND_JACK=y
|
|
||||||
CONFIG_SND_JACK_INPUT_DEV=y
|
|
||||||
# CONFIG_SND_MCHP_SOC_I2S_MCC is not set
|
|
||||||
# CONFIG_SND_MCHP_SOC_SPDIFRX is not set
|
|
||||||
# CONFIG_SND_MCHP_SOC_SPDIFTX is not set
|
|
||||||
CONFIG_SND_PCM=y
|
|
||||||
CONFIG_SND_PCM_TIMER=y
|
|
||||||
CONFIG_SND_SOC=y
|
|
||||||
CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y
|
|
||||||
CONFIG_SND_SOC_I2C_AND_SPI=y
|
|
||||||
CONFIG_SND_SOC_MIKROE_PROTO=y
|
|
||||||
CONFIG_SND_SOC_WM8731=y
|
|
||||||
CONFIG_SND_SOC_WM8904=y
|
|
||||||
CONFIG_SND_SPI=y
|
|
||||||
CONFIG_SND_SUPPORT_OLD_API=y
|
|
||||||
CONFIG_SND_TIMER=y
|
|
||||||
CONFIG_SOC_BUS=y
|
|
||||||
CONFIG_SOC_SAMA5=y
|
|
||||||
CONFIG_SOC_SAMA5D2=y
|
|
||||||
CONFIG_SOC_SAMA5D3=y
|
|
||||||
CONFIG_SOC_SAMA5D4=y
|
|
||||||
# CONFIG_SOC_SAMA7G5 is not set
|
|
||||||
CONFIG_SOC_SAM_V7=y
|
|
||||||
CONFIG_SOUND=y
|
|
||||||
CONFIG_SOUND_OSS_CORE=y
|
|
||||||
CONFIG_SPARSE_IRQ=y
|
|
||||||
CONFIG_SPI=y
|
|
||||||
# CONFIG_SPI_AT91_USART is not set
|
|
||||||
CONFIG_SPI_ATMEL=y
|
|
||||||
CONFIG_SPI_ATMEL_QUADSPI=y
|
|
||||||
CONFIG_SPI_BITBANG=y
|
|
||||||
CONFIG_SPI_GPIO=y
|
|
||||||
CONFIG_SPI_MASTER=y
|
|
||||||
CONFIG_SPI_MEM=y
|
|
||||||
# CONFIG_SQUASHFS is not set
|
|
||||||
CONFIG_SRAM=y
|
|
||||||
CONFIG_SRAM_EXEC=y
|
|
||||||
CONFIG_SRCU=y
|
|
||||||
# CONFIG_STANDALONE is not set
|
|
||||||
CONFIG_SUSPEND=y
|
|
||||||
CONFIG_SUSPEND_FREEZER=y
|
|
||||||
CONFIG_SWPHY=y
|
|
||||||
# CONFIG_SWP_EMULATE is not set
|
|
||||||
CONFIG_SYNC_FILE=y
|
|
||||||
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
|
|
||||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
|
||||||
CONFIG_TIMER_OF=y
|
|
||||||
CONFIG_TIMER_PROBE=y
|
|
||||||
CONFIG_TINY_SRCU=y
|
|
||||||
CONFIG_TOUCHSCREEN_ATMEL_MXT=y
|
|
||||||
CONFIG_UACCESS_WITH_MEMCPY=y
|
|
||||||
CONFIG_UBIFS_FS=y
|
|
||||||
CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
|
|
||||||
CONFIG_UNWINDER_ARM=y
|
|
||||||
CONFIG_USB=y
|
|
||||||
CONFIG_USB_ACM=y
|
|
||||||
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
|
|
||||||
# CONFIG_USB_AT91 is not set
|
|
||||||
# CONFIG_USB_ATMEL_USBA is not set
|
|
||||||
CONFIG_USB_COMMON=y
|
|
||||||
CONFIG_USB_EHCI_HCD=y
|
|
||||||
CONFIG_USB_EHCI_HCD_AT91=y
|
|
||||||
# CONFIG_USB_EHCI_HCD_PLATFORM is not set
|
|
||||||
# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
|
|
||||||
CONFIG_USB_GADGET=y
|
|
||||||
CONFIG_USB_HID=y
|
|
||||||
CONFIG_USB_OHCI_HCD=y
|
|
||||||
CONFIG_USB_OHCI_HCD_AT91=y
|
|
||||||
CONFIG_USB_OHCI_HCD_PLATFORM=y
|
|
||||||
# CONFIG_USB_PWC is not set
|
|
||||||
CONFIG_USB_SERIAL=y
|
|
||||||
# CONFIG_USB_SERIAL_CONSOLE is not set
|
|
||||||
CONFIG_USB_SERIAL_FTDI_SIO=y
|
|
||||||
CONFIG_USB_SERIAL_PL2303=y
|
|
||||||
CONFIG_USB_STORAGE=y
|
|
||||||
CONFIG_USB_SUPPORT=y
|
|
||||||
CONFIG_USE_OF=y
|
|
||||||
CONFIG_V4L_PLATFORM_DRIVERS=y
|
|
||||||
CONFIG_VFAT_FS=y
|
|
||||||
CONFIG_VFP=y
|
|
||||||
CONFIG_VFPv3=y
|
|
||||||
CONFIG_VIDEOMODE_HELPERS=y
|
|
||||||
# CONFIG_VIDEO_CPIA2 is not set
|
|
||||||
CONFIG_VIDEO_DEV=y
|
|
||||||
CONFIG_VIDEO_V4L2=y
|
|
||||||
CONFIG_VIDEO_V4L2_I2C=y
|
|
||||||
CONFIG_VM_EVENT_COUNTERS=y
|
|
||||||
CONFIG_WATCHDOG_CORE=y
|
|
||||||
# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
|
|
||||||
CONFIG_XXHASH=y
|
|
||||||
CONFIG_ZBOOT_ROM_BSS=0x0
|
|
||||||
CONFIG_ZBOOT_ROM_TEXT=0x0
|
|
||||||
CONFIG_ZLIB_DEFLATE=y
|
|
||||||
CONFIG_ZLIB_INFLATE=y
|
|
||||||
CONFIG_ZSTD_COMPRESS=y
|
|
||||||
CONFIG_ZSTD_DECOMPRESS=y
|
|
@ -1,406 +0,0 @@
|
|||||||
CONFIG_ALIGNMENT_TRAP=y
|
|
||||||
# CONFIG_ALLOW_DEV_COREDUMP is not set
|
|
||||||
CONFIG_ARCH_32BIT_OFF_T=y
|
|
||||||
CONFIG_ARCH_AT91=y
|
|
||||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
|
||||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
|
||||||
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
|
|
||||||
CONFIG_ARCH_MULTIPLATFORM=y
|
|
||||||
CONFIG_ARCH_MULTI_V6_V7=y
|
|
||||||
CONFIG_ARCH_MULTI_V7=y
|
|
||||||
CONFIG_ARCH_NR_GPIO=0
|
|
||||||
CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
|
|
||||||
CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
|
|
||||||
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
|
|
||||||
CONFIG_ARCH_SPARSEMEM_ENABLE=y
|
|
||||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
|
||||||
CONFIG_ARM=y
|
|
||||||
CONFIG_ARM_CRYPTO=y
|
|
||||||
CONFIG_ARM_GIC=y
|
|
||||||
CONFIG_ARM_HAS_SG_CHAIN=y
|
|
||||||
CONFIG_ARM_L1_CACHE_SHIFT=6
|
|
||||||
CONFIG_ARM_L1_CACHE_SHIFT_6=y
|
|
||||||
# CONFIG_ARM_PATCH_IDIV is not set
|
|
||||||
CONFIG_ARM_PATCH_PHYS_VIRT=y
|
|
||||||
CONFIG_ARM_THUMB=y
|
|
||||||
CONFIG_ARM_UNWIND=y
|
|
||||||
CONFIG_ARM_VIRT_EXT=y
|
|
||||||
# CONFIG_AT91SAM9X_WATCHDOG is not set
|
|
||||||
# CONFIG_AT91_ADC is not set
|
|
||||||
CONFIG_AT91_SAMA5D2_ADC=y
|
|
||||||
CONFIG_AT91_SOC_ID=y
|
|
||||||
# CONFIG_AT91_SOC_SFR is not set
|
|
||||||
CONFIG_ATMEL_CLOCKSOURCE_TCB=y
|
|
||||||
# CONFIG_ATMEL_EBI is not set
|
|
||||||
CONFIG_ATMEL_SDRAMC=y
|
|
||||||
CONFIG_ATMEL_TCB_CLKSRC=y
|
|
||||||
# CONFIG_AT_HDMAC is not set
|
|
||||||
CONFIG_AT_XDMAC=y
|
|
||||||
CONFIG_AUTO_ZRELADDR=y
|
|
||||||
CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y
|
|
||||||
CONFIG_BLK_DEV_LOOP=y
|
|
||||||
CONFIG_BLK_DEV_RAM=y
|
|
||||||
CONFIG_BLK_DEV_RAM_COUNT=1
|
|
||||||
CONFIG_BLK_DEV_RAM_SIZE=8192
|
|
||||||
CONFIG_BLK_DEV_SD=y
|
|
||||||
# CONFIG_CACHE_L2X0 is not set
|
|
||||||
CONFIG_CAN=y
|
|
||||||
CONFIG_CLKSRC_MMIO=y
|
|
||||||
CONFIG_CLONE_BACKWARDS=y
|
|
||||||
CONFIG_CMA=y
|
|
||||||
CONFIG_CMA_ALIGNMENT=9
|
|
||||||
CONFIG_CMA_AREAS=7
|
|
||||||
# CONFIG_CMA_DEBUG is not set
|
|
||||||
# CONFIG_CMA_DEBUGFS is not set
|
|
||||||
CONFIG_CMA_SIZE_MBYTES=256
|
|
||||||
# CONFIG_CMA_SIZE_SEL_MAX is not set
|
|
||||||
CONFIG_CMA_SIZE_SEL_MBYTES=y
|
|
||||||
# CONFIG_CMA_SIZE_SEL_MIN is not set
|
|
||||||
# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
|
|
||||||
# CONFIG_CMA_SYSFS is not set
|
|
||||||
CONFIG_CMDLINE="console=ttyS0,115200 earlyprintk nocache ignore_loglevel"
|
|
||||||
CONFIG_CMDLINE_FROM_BOOTLOADER=y
|
|
||||||
CONFIG_COMMON_CLK=y
|
|
||||||
CONFIG_COMMON_CLK_AT91=y
|
|
||||||
# CONFIG_COMPACTION is not set
|
|
||||||
CONFIG_COMPAT_32BIT_TIME=y
|
|
||||||
CONFIG_CONFIGFS_FS=y
|
|
||||||
CONFIG_CONSOLE_TRANSLATIONS=y
|
|
||||||
CONFIG_CONTIG_ALLOC=y
|
|
||||||
CONFIG_CPUFREQ_DT=y
|
|
||||||
CONFIG_CPUFREQ_DT_PLATDEV=y
|
|
||||||
CONFIG_CPU_32v6K=y
|
|
||||||
CONFIG_CPU_32v7=y
|
|
||||||
CONFIG_CPU_ABRT_EV7=y
|
|
||||||
CONFIG_CPU_CACHE_V7=y
|
|
||||||
CONFIG_CPU_CACHE_VIPT=y
|
|
||||||
CONFIG_CPU_COPY_V6=y
|
|
||||||
CONFIG_CPU_CP15=y
|
|
||||||
CONFIG_CPU_CP15_MMU=y
|
|
||||||
CONFIG_CPU_FREQ=y
|
|
||||||
CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE=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_HAS_ASID=y
|
|
||||||
CONFIG_CPU_PABRT_V7=y
|
|
||||||
CONFIG_CPU_SPECTRE=y
|
|
||||||
# CONFIG_CPU_SW_DOMAIN_PAN is not set
|
|
||||||
CONFIG_CPU_THUMB_CAPABLE=y
|
|
||||||
CONFIG_CPU_TLB_V7=y
|
|
||||||
CONFIG_CPU_V7=y
|
|
||||||
CONFIG_CRC16=y
|
|
||||||
CONFIG_CRC_CCITT=y
|
|
||||||
CONFIG_CRC_ITU_T=y
|
|
||||||
CONFIG_CRYPTO_CMAC=y
|
|
||||||
CONFIG_CRYPTO_CRC32C=y
|
|
||||||
CONFIG_CRYPTO_DEFLATE=y
|
|
||||||
CONFIG_CRYPTO_DRBG=y
|
|
||||||
CONFIG_CRYPTO_DRBG_HMAC=y
|
|
||||||
CONFIG_CRYPTO_DRBG_MENU=y
|
|
||||||
CONFIG_CRYPTO_ECB=y
|
|
||||||
CONFIG_CRYPTO_ECC=y
|
|
||||||
CONFIG_CRYPTO_ECDH=y
|
|
||||||
CONFIG_CRYPTO_HMAC=y
|
|
||||||
CONFIG_CRYPTO_JITTERENTROPY=y
|
|
||||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
|
||||||
CONFIG_CRYPTO_LIB_SHA256=y
|
|
||||||
CONFIG_CRYPTO_LZO=y
|
|
||||||
CONFIG_CRYPTO_RNG=y
|
|
||||||
CONFIG_CRYPTO_RNG2=y
|
|
||||||
CONFIG_CRYPTO_RNG_DEFAULT=y
|
|
||||||
CONFIG_CRYPTO_SHA256=y
|
|
||||||
CONFIG_CRYPTO_SHA512=y
|
|
||||||
CONFIG_DCACHE_WORD_ACCESS=y
|
|
||||||
CONFIG_DEBUG_AT91_SAMA7G5_FLEXCOM3=y
|
|
||||||
CONFIG_DEBUG_AT91_UART=y
|
|
||||||
CONFIG_DEBUG_LL=y
|
|
||||||
CONFIG_DEBUG_LL_INCLUDE="debug/at91.S"
|
|
||||||
CONFIG_DEBUG_UART_PHYS=0xe1824200
|
|
||||||
CONFIG_DEBUG_UART_VIRT=0xe0824200
|
|
||||||
# CONFIG_DEBUG_UNCOMPRESS is not set
|
|
||||||
CONFIG_DEBUG_USER=y
|
|
||||||
CONFIG_DEVTMPFS=y
|
|
||||||
CONFIG_DEVTMPFS_MOUNT=y
|
|
||||||
CONFIG_DMADEVICES=y
|
|
||||||
CONFIG_DMATEST=y
|
|
||||||
CONFIG_DMA_CMA=y
|
|
||||||
CONFIG_DMA_ENGINE=y
|
|
||||||
CONFIG_DMA_ENGINE_RAID=y
|
|
||||||
CONFIG_DMA_OF=y
|
|
||||||
CONFIG_DMA_OPS=y
|
|
||||||
CONFIG_DMA_REMAP=y
|
|
||||||
CONFIG_DTC=y
|
|
||||||
CONFIG_DUMMY_CONSOLE=y
|
|
||||||
CONFIG_EARLY_PRINTK=y
|
|
||||||
CONFIG_EDAC_ATOMIC_SCRUB=y
|
|
||||||
CONFIG_EDAC_SUPPORT=y
|
|
||||||
CONFIG_EEPROM_AT24=y
|
|
||||||
# CONFIG_EFI_PARTITION is not set
|
|
||||||
CONFIG_EXT4_FS=y
|
|
||||||
CONFIG_FANOTIFY=y
|
|
||||||
CONFIG_FAT_FS=y
|
|
||||||
CONFIG_FIXED_PHY=y
|
|
||||||
CONFIG_FIX_EARLYCON_MEM=y
|
|
||||||
CONFIG_FORCE_MAX_ZONEORDER=15
|
|
||||||
CONFIG_FS_IOMAP=y
|
|
||||||
CONFIG_FS_MBCACHE=y
|
|
||||||
CONFIG_FWNODE_MDIO=y
|
|
||||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
|
||||||
CONFIG_GENERIC_ALLOCATOR=y
|
|
||||||
CONFIG_GENERIC_BUG=y
|
|
||||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
|
||||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
|
||||||
CONFIG_GENERIC_CPU_VULNERABILITIES=y
|
|
||||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
|
||||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
|
||||||
CONFIG_GENERIC_IDLE_POLL_SETUP=y
|
|
||||||
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
|
|
||||||
CONFIG_GENERIC_IRQ_MULTI_HANDLER=y
|
|
||||||
CONFIG_GENERIC_IRQ_SHOW=y
|
|
||||||
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
|
|
||||||
CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y
|
|
||||||
CONFIG_GENERIC_PCI_IOMAP=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_GENERIC_VDSO_32=y
|
|
||||||
CONFIG_GLOB=y
|
|
||||||
CONFIG_GPIOLIB_IRQCHIP=y
|
|
||||||
CONFIG_GPIO_CDEV=y
|
|
||||||
CONFIG_GRACE_PERIOD=y
|
|
||||||
CONFIG_HANDLE_DOMAIN_IRQ=y
|
|
||||||
# CONFIG_HARDEN_BRANCH_HISTORY is not set
|
|
||||||
# CONFIG_HARDEN_BRANCH_PREDICTOR is not set
|
|
||||||
CONFIG_HARDIRQS_SW_RESEND=y
|
|
||||||
CONFIG_HAS_DMA=y
|
|
||||||
CONFIG_HAS_IOMEM=y
|
|
||||||
CONFIG_HAS_IOPORT_MAP=y
|
|
||||||
CONFIG_HAVE_SMP=y
|
|
||||||
CONFIG_HW_CONSOLE=y
|
|
||||||
CONFIG_HW_RANDOM=y
|
|
||||||
CONFIG_HZ_FIXED=0
|
|
||||||
CONFIG_I2C=y
|
|
||||||
CONFIG_I2C_AT91=y
|
|
||||||
# CONFIG_I2C_AT91_SLAVE_EXPERIMENTAL is not set
|
|
||||||
CONFIG_I2C_BOARDINFO=y
|
|
||||||
CONFIG_I2C_CHARDEV=y
|
|
||||||
CONFIG_IIO=y
|
|
||||||
CONFIG_IIO_BUFFER=y
|
|
||||||
CONFIG_IIO_CONFIGFS=y
|
|
||||||
# CONFIG_IIO_HRTIMER_TRIGGER is not set
|
|
||||||
CONFIG_IIO_KFIFO_BUF=y
|
|
||||||
CONFIG_IIO_SW_TRIGGER=y
|
|
||||||
# CONFIG_IIO_TIGHTLOOP_TRIGGER is not set
|
|
||||||
CONFIG_IIO_TRIGGER=y
|
|
||||||
CONFIG_IIO_TRIGGERED_BUFFER=y
|
|
||||||
CONFIG_INITRAMFS_SOURCE=""
|
|
||||||
CONFIG_INPUT=y
|
|
||||||
CONFIG_IP_PNP=y
|
|
||||||
# CONFIG_IP_PNP_BOOTP is not set
|
|
||||||
CONFIG_IP_PNP_DHCP=y
|
|
||||||
# CONFIG_IP_PNP_RARP is not set
|
|
||||||
CONFIG_IRQCHIP=y
|
|
||||||
CONFIG_IRQ_DOMAIN=y
|
|
||||||
CONFIG_IRQ_DOMAIN_HIERARCHY=y
|
|
||||||
CONFIG_IRQ_FORCED_THREADING=y
|
|
||||||
CONFIG_IRQ_WORK=y
|
|
||||||
CONFIG_JBD2=y
|
|
||||||
CONFIG_LEDS_GPIO=y
|
|
||||||
CONFIG_LIBFDT=y
|
|
||||||
CONFIG_LOCKD=y
|
|
||||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
|
||||||
CONFIG_LOG_BUF_SHIFT=16
|
|
||||||
CONFIG_LSM="N"
|
|
||||||
CONFIG_LZO_COMPRESS=y
|
|
||||||
CONFIG_LZO_DECOMPRESS=y
|
|
||||||
CONFIG_MACB=y
|
|
||||||
CONFIG_MACB_USE_HWSTAMP=y
|
|
||||||
CONFIG_MDIO_BUS=y
|
|
||||||
CONFIG_MDIO_DEVICE=y
|
|
||||||
CONFIG_MDIO_DEVRES=y
|
|
||||||
CONFIG_MEDIA_CAMERA_SUPPORT=y
|
|
||||||
CONFIG_MEDIA_CONTROLLER=y
|
|
||||||
CONFIG_MEDIA_PLATFORM_SUPPORT=y
|
|
||||||
CONFIG_MEDIA_SUPPORT=y
|
|
||||||
CONFIG_MEDIA_SUPPORT_FILTER=y
|
|
||||||
CONFIG_MEMFD_CREATE=y
|
|
||||||
CONFIG_MEMORY=y
|
|
||||||
CONFIG_MEMORY_ISOLATION=y
|
|
||||||
CONFIG_MESSAGE_LOGLEVEL_DEFAULT=7
|
|
||||||
CONFIG_MFD_AT91_USART=y
|
|
||||||
CONFIG_MFD_ATMEL_FLEXCOM=y
|
|
||||||
CONFIG_MFD_CORE=y
|
|
||||||
CONFIG_MFD_SYSCON=y
|
|
||||||
CONFIG_MICREL_PHY=y
|
|
||||||
CONFIG_MICROCHIP_PIT64B=y
|
|
||||||
CONFIG_MIGHT_HAVE_CACHE_L2X0=y
|
|
||||||
CONFIG_MIGRATION=y
|
|
||||||
CONFIG_MMC=y
|
|
||||||
# CONFIG_MMC_ATMELMCI is not set
|
|
||||||
CONFIG_MMC_BLOCK=y
|
|
||||||
CONFIG_MMC_SDHCI=y
|
|
||||||
CONFIG_MMC_SDHCI_OF_AT91=y
|
|
||||||
CONFIG_MMC_SDHCI_PLTFM=y
|
|
||||||
CONFIG_MODULES_USE_ELF_REL=y
|
|
||||||
CONFIG_MODULE_FORCE_LOAD=y
|
|
||||||
CONFIG_MODULE_FORCE_UNLOAD=y
|
|
||||||
CONFIG_MTD_CMDLINE_PARTS=y
|
|
||||||
CONFIG_NEED_DMA_MAP_STATE=y
|
|
||||||
CONFIG_NEED_PER_CPU_KM=y
|
|
||||||
CONFIG_NEON=y
|
|
||||||
CONFIG_NET_PTP_CLASSIFY=y
|
|
||||||
CONFIG_NET_SELFTESTS=y
|
|
||||||
CONFIG_NET_SWITCHDEV=y
|
|
||||||
CONFIG_NFS_FS=y
|
|
||||||
CONFIG_NLS=y
|
|
||||||
CONFIG_NLS_CODEPAGE_437=y
|
|
||||||
CONFIG_NLS_CODEPAGE_850=y
|
|
||||||
CONFIG_NLS_ISO8859_1=y
|
|
||||||
CONFIG_NLS_UTF8=y
|
|
||||||
CONFIG_NO_HZ_COMMON=y
|
|
||||||
CONFIG_NO_HZ_IDLE=y
|
|
||||||
CONFIG_NVMEM=y
|
|
||||||
# CONFIG_NVMEM_MICROCHIP_OTPC is not set
|
|
||||||
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_OLD_SIGACTION=y
|
|
||||||
CONFIG_OLD_SIGSUSPEND3=y
|
|
||||||
CONFIG_PAGE_OFFSET=0xC0000000
|
|
||||||
CONFIG_PCCARD=y
|
|
||||||
CONFIG_PERF_USE_VMALLOC=y
|
|
||||||
CONFIG_PGTABLE_LEVELS=2
|
|
||||||
CONFIG_PHYLIB=y
|
|
||||||
CONFIG_PHYLINK=y
|
|
||||||
CONFIG_PINCTRL=y
|
|
||||||
CONFIG_PINCTRL_AT91=y
|
|
||||||
CONFIG_PINCTRL_AT91PIO4=y
|
|
||||||
CONFIG_PM_OPP=y
|
|
||||||
CONFIG_POWER_RESET=y
|
|
||||||
# CONFIG_POWER_RESET_AT91_POWEROFF is not set
|
|
||||||
CONFIG_POWER_RESET_AT91_RESET=y
|
|
||||||
CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC=y
|
|
||||||
CONFIG_PPS=y
|
|
||||||
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
|
|
||||||
CONFIG_PRINTK_TIME=y
|
|
||||||
CONFIG_PTP_1588_CLOCK=y
|
|
||||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
|
||||||
CONFIG_PWM=y
|
|
||||||
CONFIG_PWM_ATMEL=y
|
|
||||||
CONFIG_PWM_SYSFS=y
|
|
||||||
CONFIG_RATIONAL=y
|
|
||||||
CONFIG_REGMAP=y
|
|
||||||
CONFIG_REGMAP_I2C=y
|
|
||||||
CONFIG_REGMAP_MMIO=y
|
|
||||||
CONFIG_REGMAP_SPI=y
|
|
||||||
CONFIG_REGULATOR=y
|
|
||||||
CONFIG_REGULATOR_FIXED_VOLTAGE=y
|
|
||||||
CONFIG_REGULATOR_MCP16502=y
|
|
||||||
CONFIG_ROOT_NFS=y
|
|
||||||
CONFIG_RTC_CLASS=y
|
|
||||||
CONFIG_RTC_DRV_AT91RM9200=y
|
|
||||||
CONFIG_RTC_DRV_AT91SAM9=y
|
|
||||||
CONFIG_RTC_I2C_AND_SPI=y
|
|
||||||
CONFIG_RTC_MC146818_LIB=y
|
|
||||||
# CONFIG_RUNTIME_TESTING_MENU is not set
|
|
||||||
CONFIG_SAMA5D4_WATCHDOG=y
|
|
||||||
CONFIG_SCSI=y
|
|
||||||
CONFIG_SCSI_COMMON=y
|
|
||||||
# CONFIG_SERIAL_8250 is not set
|
|
||||||
CONFIG_SERIAL_ATMEL=y
|
|
||||||
CONFIG_SERIAL_ATMEL_CONSOLE=y
|
|
||||||
CONFIG_SERIAL_ATMEL_PDC=y
|
|
||||||
# CONFIG_SERIAL_ATMEL_TTYAT is not set
|
|
||||||
CONFIG_SERIAL_MCTRL_GPIO=y
|
|
||||||
CONFIG_SGL_ALLOC=y
|
|
||||||
CONFIG_SG_POOL=y
|
|
||||||
CONFIG_SND=y
|
|
||||||
CONFIG_SND_ATMEL_SOC=y
|
|
||||||
# CONFIG_SND_ATMEL_SOC_CLASSD is not set
|
|
||||||
# CONFIG_SND_ATMEL_SOC_I2S is not set
|
|
||||||
# CONFIG_SND_ATMEL_SOC_PDMIC is not set
|
|
||||||
# CONFIG_SND_COMPRESS_OFFLOAD is not set
|
|
||||||
CONFIG_SND_DMAENGINE_PCM=y
|
|
||||||
CONFIG_SND_JACK=y
|
|
||||||
CONFIG_SND_JACK_INPUT_DEV=y
|
|
||||||
CONFIG_SND_MCHP_SOC_I2S_MCC=y
|
|
||||||
CONFIG_SND_MCHP_SOC_SPDIFRX=y
|
|
||||||
CONFIG_SND_MCHP_SOC_SPDIFTX=y
|
|
||||||
CONFIG_SND_PCM=y
|
|
||||||
CONFIG_SND_SIMPLE_CARD=y
|
|
||||||
CONFIG_SND_SIMPLE_CARD_UTILS=y
|
|
||||||
CONFIG_SND_SOC=y
|
|
||||||
CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y
|
|
||||||
CONFIG_SND_SOC_I2C_AND_SPI=y
|
|
||||||
# CONFIG_SND_SOC_MIKROE_PROTO is not set
|
|
||||||
CONFIG_SND_SOC_PCM5102A=y
|
|
||||||
CONFIG_SND_SOC_SPDIF=y
|
|
||||||
CONFIG_SOC_BUS=y
|
|
||||||
# CONFIG_SOC_SAMA5D2 is not set
|
|
||||||
# CONFIG_SOC_SAMA5D3 is not set
|
|
||||||
# CONFIG_SOC_SAMA5D4 is not set
|
|
||||||
CONFIG_SOC_SAMA7=y
|
|
||||||
CONFIG_SOC_SAMA7G5=y
|
|
||||||
CONFIG_SOC_SAM_V7=y
|
|
||||||
CONFIG_SOUND=y
|
|
||||||
CONFIG_SOUND_OSS_CORE=y
|
|
||||||
CONFIG_SPARSE_IRQ=y
|
|
||||||
CONFIG_SPI=y
|
|
||||||
# CONFIG_SPI_AT91_USART is not set
|
|
||||||
CONFIG_SPI_ATMEL=y
|
|
||||||
# CONFIG_SPI_ATMEL_QUADSPI is not set
|
|
||||||
CONFIG_SPI_MASTER=y
|
|
||||||
CONFIG_SPI_MEM=y
|
|
||||||
CONFIG_SRCU=y
|
|
||||||
CONFIG_STACKTRACE=y
|
|
||||||
# CONFIG_STANDALONE is not set
|
|
||||||
CONFIG_SUNRPC=y
|
|
||||||
# CONFIG_SWAP is not set
|
|
||||||
CONFIG_SWPHY=y
|
|
||||||
# CONFIG_SWP_EMULATE is not set
|
|
||||||
CONFIG_SYSFS_DEPRECATED=y
|
|
||||||
CONFIG_SYSFS_DEPRECATED_V2=y
|
|
||||||
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
|
|
||||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
|
||||||
CONFIG_TIMER_OF=y
|
|
||||||
CONFIG_TIMER_PROBE=y
|
|
||||||
CONFIG_TINY_SRCU=y
|
|
||||||
CONFIG_UACCESS_WITH_MEMCPY=y
|
|
||||||
CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
|
|
||||||
CONFIG_UNWINDER_ARM=y
|
|
||||||
CONFIG_USE_OF=y
|
|
||||||
CONFIG_V4L_PLATFORM_DRIVERS=y
|
|
||||||
CONFIG_VFAT_FS=y
|
|
||||||
CONFIG_VFP=y
|
|
||||||
CONFIG_VFPv3=y
|
|
||||||
# CONFIG_VIDEO_ATMEL_XISC is not set
|
|
||||||
CONFIG_VIDEO_DEV=y
|
|
||||||
CONFIG_VIDEO_V4L2=y
|
|
||||||
CONFIG_VIDEO_V4L2_I2C=y
|
|
||||||
CONFIG_VIDEO_V4L2_SUBDEV_API=y
|
|
||||||
CONFIG_VT=y
|
|
||||||
CONFIG_VT_CONSOLE=y
|
|
||||||
# CONFIG_VT_HW_CONSOLE_BINDING is not set
|
|
||||||
CONFIG_WATCHDOG_CORE=y
|
|
||||||
CONFIG_ZBOOT_ROM_BSS=0x0
|
|
||||||
CONFIG_ZBOOT_ROM_TEXT=0x0
|
|
||||||
CONFIG_ZLIB_DEFLATE=y
|
|
||||||
CONFIG_ZLIB_INFLATE=y
|
|
@ -103,7 +103,7 @@ it on BCM4708 family.
|
|||||||
if (xhci->quirks & XHCI_NEC_HOST)
|
if (xhci->quirks & XHCI_NEC_HOST)
|
||||||
--- a/drivers/usb/host/xhci.h
|
--- a/drivers/usb/host/xhci.h
|
||||||
+++ b/drivers/usb/host/xhci.h
|
+++ b/drivers/usb/host/xhci.h
|
||||||
@@ -1907,6 +1907,7 @@ struct xhci_hcd {
|
@@ -1912,6 +1912,7 @@ struct xhci_hcd {
|
||||||
#define XHCI_RESET_TO_DEFAULT BIT_ULL(44)
|
#define XHCI_RESET_TO_DEFAULT BIT_ULL(44)
|
||||||
#define XHCI_ZHAOXIN_TRB_FETCH BIT_ULL(45)
|
#define XHCI_ZHAOXIN_TRB_FETCH BIT_ULL(45)
|
||||||
#define XHCI_ZHAOXIN_HOST BIT_ULL(46)
|
#define XHCI_ZHAOXIN_HOST BIT_ULL(46)
|
||||||
|
@ -1,87 +0,0 @@
|
|||||||
From: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
||||||
Date: Thu, 11 Apr 2024 13:28:59 +0200
|
|
||||||
Subject: [PATCH] netfilter: flowtable: validate pppoe header
|
|
||||||
|
|
||||||
Ensure there is sufficient room to access the protocol field of the
|
|
||||||
PPPoe header. Validate it once before the flowtable lookup, then use a
|
|
||||||
helper function to access protocol field.
|
|
||||||
|
|
||||||
Reported-by: syzbot+b6f07e1c07ef40199081@syzkaller.appspotmail.com
|
|
||||||
Fixes: 72efd585f714 ("netfilter: flowtable: add pppoe support")
|
|
||||||
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
||||||
---
|
|
||||||
|
|
||||||
--- a/include/net/netfilter/nf_flow_table.h
|
|
||||||
+++ b/include/net/netfilter/nf_flow_table.h
|
|
||||||
@@ -335,7 +335,7 @@ int nf_flow_rule_route_ipv6(struct net *
|
|
||||||
int nf_flow_table_offload_init(void);
|
|
||||||
void nf_flow_table_offload_exit(void);
|
|
||||||
|
|
||||||
-static inline __be16 nf_flow_pppoe_proto(const struct sk_buff *skb)
|
|
||||||
+static inline __be16 __nf_flow_pppoe_proto(const struct sk_buff *skb)
|
|
||||||
{
|
|
||||||
__be16 proto;
|
|
||||||
|
|
||||||
@@ -351,6 +351,16 @@ static inline __be16 nf_flow_pppoe_proto
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
+static inline bool nf_flow_pppoe_proto(struct sk_buff *skb, __be16 *inner_proto)
|
|
||||||
+{
|
|
||||||
+ if (!pskb_may_pull(skb, PPPOE_SES_HLEN))
|
|
||||||
+ return false;
|
|
||||||
+
|
|
||||||
+ *inner_proto = __nf_flow_pppoe_proto(skb);
|
|
||||||
+
|
|
||||||
+ return true;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
#define NF_FLOW_TABLE_STAT_INC(net, count) __this_cpu_inc((net)->ft.stat->count)
|
|
||||||
#define NF_FLOW_TABLE_STAT_DEC(net, count) __this_cpu_dec((net)->ft.stat->count)
|
|
||||||
#define NF_FLOW_TABLE_STAT_INC_ATOMIC(net, count) \
|
|
||||||
--- a/net/netfilter/nf_flow_table_inet.c
|
|
||||||
+++ b/net/netfilter/nf_flow_table_inet.c
|
|
||||||
@@ -21,7 +21,8 @@ nf_flow_offload_inet_hook(void *priv, st
|
|
||||||
proto = veth->h_vlan_encapsulated_proto;
|
|
||||||
break;
|
|
||||||
case htons(ETH_P_PPP_SES):
|
|
||||||
- proto = nf_flow_pppoe_proto(skb);
|
|
||||||
+ if (!nf_flow_pppoe_proto(skb, &proto))
|
|
||||||
+ return NF_ACCEPT;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
proto = skb->protocol;
|
|
||||||
--- a/net/netfilter/nf_flow_table_ip.c
|
|
||||||
+++ b/net/netfilter/nf_flow_table_ip.c
|
|
||||||
@@ -273,10 +273,11 @@ static unsigned int nf_flow_xmit_xfrm(st
|
|
||||||
return NF_STOLEN;
|
|
||||||
}
|
|
||||||
|
|
||||||
-static bool nf_flow_skb_encap_protocol(const struct sk_buff *skb, __be16 proto,
|
|
||||||
+static bool nf_flow_skb_encap_protocol(struct sk_buff *skb, __be16 proto,
|
|
||||||
u32 *offset)
|
|
||||||
{
|
|
||||||
struct vlan_ethhdr *veth;
|
|
||||||
+ __be16 inner_proto;
|
|
||||||
|
|
||||||
switch (skb->protocol) {
|
|
||||||
case htons(ETH_P_8021Q):
|
|
||||||
@@ -287,7 +288,8 @@ static bool nf_flow_skb_encap_protocol(c
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case htons(ETH_P_PPP_SES):
|
|
||||||
- if (nf_flow_pppoe_proto(skb) == proto) {
|
|
||||||
+ if (nf_flow_pppoe_proto(skb, &inner_proto) &&
|
|
||||||
+ inner_proto == proto) {
|
|
||||||
*offset += PPPOE_SES_HLEN;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@@ -316,7 +318,7 @@ static void nf_flow_encap_pop(struct sk_
|
|
||||||
skb_reset_network_header(skb);
|
|
||||||
break;
|
|
||||||
case htons(ETH_P_PPP_SES):
|
|
||||||
- skb->protocol = nf_flow_pppoe_proto(skb);
|
|
||||||
+ skb->protocol = __nf_flow_pppoe_proto(skb);
|
|
||||||
skb_pull(skb, PPPOE_SES_HLEN);
|
|
||||||
skb_reset_network_header(skb);
|
|
||||||
break;
|
|
@ -1,24 +0,0 @@
|
|||||||
From: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
||||||
Date: Thu, 11 Apr 2024 13:29:00 +0200
|
|
||||||
Subject: [PATCH] netfilter: flowtable: incorrect pppoe tuple
|
|
||||||
|
|
||||||
pppoe traffic reaching ingress path does not match the flowtable entry
|
|
||||||
because the pppoe header is expected to be at the network header offset.
|
|
||||||
This bug causes a mismatch in the flow table lookup, so pppoe packets
|
|
||||||
enter the classical forwarding path.
|
|
||||||
|
|
||||||
Fixes: 72efd585f714 ("netfilter: flowtable: add pppoe support")
|
|
||||||
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
||||||
---
|
|
||||||
|
|
||||||
--- a/net/netfilter/nf_flow_table_ip.c
|
|
||||||
+++ b/net/netfilter/nf_flow_table_ip.c
|
|
||||||
@@ -157,7 +157,7 @@ static void nf_flow_tuple_encap(struct s
|
|
||||||
tuple->encap[i].proto = skb->protocol;
|
|
||||||
break;
|
|
||||||
case htons(ETH_P_PPP_SES):
|
|
||||||
- phdr = (struct pppoe_hdr *)skb_mac_header(skb);
|
|
||||||
+ phdr = (struct pppoe_hdr *)skb_network_header(skb);
|
|
||||||
tuple->encap[i].id = ntohs(phdr->sid);
|
|
||||||
tuple->encap[i].proto = skb->protocol;
|
|
||||||
break;
|
|
@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
@@ -1713,19 +1713,20 @@ mtk_wed_irq_set_mask(struct mtk_wed_devi
|
@@ -1709,19 +1709,20 @@ mtk_wed_irq_set_mask(struct mtk_wed_devi
|
||||||
int mtk_wed_flow_add(int index)
|
int mtk_wed_flow_add(int index)
|
||||||
{
|
{
|
||||||
struct mtk_wed_hw *hw = hw_list[index];
|
struct mtk_wed_hw *hw = hw_list[index];
|
||||||
@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1744,14 +1745,15 @@ void mtk_wed_flow_remove(int index)
|
@@ -1740,14 +1741,15 @@ void mtk_wed_flow_remove(int index)
|
||||||
{
|
{
|
||||||
struct mtk_wed_hw *hw = hw_list[index];
|
struct mtk_wed_hw *hw = hw_list[index];
|
||||||
|
|
||||||
|
@ -52,15 +52,15 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wdma_clr(dev, MTK_WDMA_GLO_CFG,
|
wdma_clr(dev, MTK_WDMA_GLO_CFG,
|
||||||
MTK_WDMA_GLO_CFG_RX_INFO3_PRERES);
|
MTK_WDMA_GLO_CFG_RX_INFO3_PRERES);
|
||||||
@@ -606,7 +606,7 @@ mtk_wed_stop(struct mtk_wed_device *dev)
|
@@ -606,7 +606,7 @@ mtk_wed_stop(struct mtk_wed_device *dev)
|
||||||
|
wdma_w32(dev, MTK_WDMA_INT_MASK, 0);
|
||||||
wdma_w32(dev, MTK_WDMA_INT_GRP2, 0);
|
wdma_w32(dev, MTK_WDMA_INT_GRP2, 0);
|
||||||
wed_w32(dev, MTK_WED_WPDMA_INT_MASK, 0);
|
|
||||||
|
|
||||||
- if (dev->hw->version == 1)
|
- if (dev->hw->version == 1)
|
||||||
+ if (mtk_wed_is_v1(dev->hw))
|
+ if (mtk_wed_is_v1(dev->hw))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wed_w32(dev, MTK_WED_EXT_INT_MASK1, 0);
|
wed_w32(dev, MTK_WED_EXT_INT_MASK1, 0);
|
||||||
@@ -625,7 +625,7 @@ mtk_wed_deinit(struct mtk_wed_device *de
|
@@ -624,7 +624,7 @@ mtk_wed_deinit(struct mtk_wed_device *de
|
||||||
MTK_WED_CTRL_WED_TX_BM_EN |
|
MTK_WED_CTRL_WED_TX_BM_EN |
|
||||||
MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
|
MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
wed_clr(dev, MTK_WED_CTRL,
|
wed_clr(dev, MTK_WED_CTRL,
|
||||||
@@ -731,7 +731,7 @@ mtk_wed_bus_init(struct mtk_wed_device *
|
@@ -730,7 +730,7 @@ mtk_wed_bus_init(struct mtk_wed_device *
|
||||||
static void
|
static void
|
||||||
mtk_wed_set_wpdma(struct mtk_wed_device *dev)
|
mtk_wed_set_wpdma(struct mtk_wed_device *dev)
|
||||||
{
|
{
|
||||||
@ -78,7 +78,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wed_w32(dev, MTK_WED_WPDMA_CFG_BASE, dev->wlan.wpdma_phys);
|
wed_w32(dev, MTK_WED_WPDMA_CFG_BASE, dev->wlan.wpdma_phys);
|
||||||
} else {
|
} else {
|
||||||
mtk_wed_bus_init(dev);
|
mtk_wed_bus_init(dev);
|
||||||
@@ -762,7 +762,7 @@ mtk_wed_hw_init_early(struct mtk_wed_dev
|
@@ -761,7 +761,7 @@ mtk_wed_hw_init_early(struct mtk_wed_dev
|
||||||
MTK_WED_WDMA_GLO_CFG_IDLE_DMAD_SUPPLY;
|
MTK_WED_WDMA_GLO_CFG_IDLE_DMAD_SUPPLY;
|
||||||
wed_m32(dev, MTK_WED_WDMA_GLO_CFG, mask, set);
|
wed_m32(dev, MTK_WED_WDMA_GLO_CFG, mask, set);
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
u32 offset = dev->hw->index ? 0x04000400 : 0;
|
u32 offset = dev->hw->index ? 0x04000400 : 0;
|
||||||
|
|
||||||
wdma_set(dev, MTK_WDMA_GLO_CFG,
|
wdma_set(dev, MTK_WDMA_GLO_CFG,
|
||||||
@@ -935,7 +935,7 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
@@ -934,7 +934,7 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
||||||
|
|
||||||
wed_w32(dev, MTK_WED_TX_BM_BUF_LEN, MTK_WED_PKT_SIZE);
|
wed_w32(dev, MTK_WED_TX_BM_BUF_LEN, MTK_WED_PKT_SIZE);
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wed_w32(dev, MTK_WED_TX_BM_TKID,
|
wed_w32(dev, MTK_WED_TX_BM_TKID,
|
||||||
FIELD_PREP(MTK_WED_TX_BM_TKID_START,
|
FIELD_PREP(MTK_WED_TX_BM_TKID_START,
|
||||||
dev->wlan.token_start) |
|
dev->wlan.token_start) |
|
||||||
@@ -968,7 +968,7 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
@@ -967,7 +967,7 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
||||||
|
|
||||||
mtk_wed_reset(dev, MTK_WED_RESET_TX_BM);
|
mtk_wed_reset(dev, MTK_WED_RESET_TX_BM);
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wed_set(dev, MTK_WED_CTRL,
|
wed_set(dev, MTK_WED_CTRL,
|
||||||
MTK_WED_CTRL_WED_TX_BM_EN |
|
MTK_WED_CTRL_WED_TX_BM_EN |
|
||||||
MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
|
MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
|
||||||
@@ -1218,7 +1218,7 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
@@ -1217,7 +1217,7 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
||||||
}
|
}
|
||||||
|
|
||||||
dev->init_done = false;
|
dev->init_done = false;
|
||||||
@ -114,7 +114,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!busy) {
|
if (!busy) {
|
||||||
@@ -1344,7 +1344,7 @@ mtk_wed_configure_irq(struct mtk_wed_dev
|
@@ -1343,7 +1343,7 @@ mtk_wed_configure_irq(struct mtk_wed_dev
|
||||||
MTK_WED_CTRL_WED_TX_BM_EN |
|
MTK_WED_CTRL_WED_TX_BM_EN |
|
||||||
MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
|
MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wed_w32(dev, MTK_WED_PCIE_INT_TRIGGER,
|
wed_w32(dev, MTK_WED_PCIE_INT_TRIGGER,
|
||||||
MTK_WED_PCIE_INT_TRIGGER_STATUS);
|
MTK_WED_PCIE_INT_TRIGGER_STATUS);
|
||||||
|
|
||||||
@@ -1417,7 +1417,7 @@ mtk_wed_dma_enable(struct mtk_wed_device
|
@@ -1416,7 +1416,7 @@ mtk_wed_dma_enable(struct mtk_wed_device
|
||||||
MTK_WDMA_GLO_CFG_RX_INFO1_PRERES |
|
MTK_WDMA_GLO_CFG_RX_INFO1_PRERES |
|
||||||
MTK_WDMA_GLO_CFG_RX_INFO2_PRERES);
|
MTK_WDMA_GLO_CFG_RX_INFO2_PRERES);
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wdma_set(dev, MTK_WDMA_GLO_CFG,
|
wdma_set(dev, MTK_WDMA_GLO_CFG,
|
||||||
MTK_WDMA_GLO_CFG_RX_INFO3_PRERES);
|
MTK_WDMA_GLO_CFG_RX_INFO3_PRERES);
|
||||||
} else {
|
} else {
|
||||||
@@ -1466,7 +1466,7 @@ mtk_wed_start(struct mtk_wed_device *dev
|
@@ -1465,7 +1465,7 @@ mtk_wed_start(struct mtk_wed_device *dev
|
||||||
|
|
||||||
mtk_wed_set_ext_int(dev, true);
|
mtk_wed_set_ext_int(dev, true);
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
u32 val = dev->wlan.wpdma_phys | MTK_PCIE_MIRROR_MAP_EN |
|
u32 val = dev->wlan.wpdma_phys | MTK_PCIE_MIRROR_MAP_EN |
|
||||||
FIELD_PREP(MTK_PCIE_MIRROR_MAP_WED_ID,
|
FIELD_PREP(MTK_PCIE_MIRROR_MAP_WED_ID,
|
||||||
dev->hw->index);
|
dev->hw->index);
|
||||||
@@ -1551,7 +1551,7 @@ mtk_wed_attach(struct mtk_wed_device *de
|
@@ -1550,7 +1550,7 @@ mtk_wed_attach(struct mtk_wed_device *de
|
||||||
}
|
}
|
||||||
|
|
||||||
mtk_wed_hw_init_early(dev);
|
mtk_wed_hw_init_early(dev);
|
||||||
@ -150,7 +150,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
regmap_update_bits(hw->hifsys, HIFSYS_DMA_AG_MAP,
|
regmap_update_bits(hw->hifsys, HIFSYS_DMA_AG_MAP,
|
||||||
BIT(hw->index), 0);
|
BIT(hw->index), 0);
|
||||||
} else {
|
} else {
|
||||||
@@ -1619,7 +1619,7 @@ static int
|
@@ -1618,7 +1618,7 @@ static int
|
||||||
mtk_wed_txfree_ring_setup(struct mtk_wed_device *dev, void __iomem *regs)
|
mtk_wed_txfree_ring_setup(struct mtk_wed_device *dev, void __iomem *regs)
|
||||||
{
|
{
|
||||||
struct mtk_wed_ring *ring = &dev->txfree_ring;
|
struct mtk_wed_ring *ring = &dev->txfree_ring;
|
||||||
@ -159,7 +159,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* For txfree event handling, the same DMA ring is shared between WED
|
* For txfree event handling, the same DMA ring is shared between WED
|
||||||
@@ -1677,7 +1677,7 @@ mtk_wed_irq_get(struct mtk_wed_device *d
|
@@ -1676,7 +1676,7 @@ mtk_wed_irq_get(struct mtk_wed_device *d
|
||||||
{
|
{
|
||||||
u32 val, ext_mask = MTK_WED_EXT_INT_STATUS_ERROR_MASK;
|
u32 val, ext_mask = MTK_WED_EXT_INT_STATUS_ERROR_MASK;
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
ext_mask |= MTK_WED_EXT_INT_STATUS_TX_DRV_R_RESP_ERR;
|
ext_mask |= MTK_WED_EXT_INT_STATUS_TX_DRV_R_RESP_ERR;
|
||||||
else
|
else
|
||||||
ext_mask |= MTK_WED_EXT_INT_STATUS_RX_FBUF_LO_TH |
|
ext_mask |= MTK_WED_EXT_INT_STATUS_RX_FBUF_LO_TH |
|
||||||
@@ -1844,7 +1844,7 @@ mtk_wed_setup_tc(struct mtk_wed_device *
|
@@ -1840,7 +1840,7 @@ mtk_wed_setup_tc(struct mtk_wed_device *
|
||||||
{
|
{
|
||||||
struct mtk_wed_hw *hw = wed->hw;
|
struct mtk_wed_hw *hw = wed->hw;
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@@ -1918,9 +1918,9 @@ void mtk_wed_add_hw(struct device_node *
|
@@ -1914,9 +1914,9 @@ void mtk_wed_add_hw(struct device_node *
|
||||||
hw->wdma = wdma;
|
hw->wdma = wdma;
|
||||||
hw->index = index;
|
hw->index = index;
|
||||||
hw->irq = irq;
|
hw->irq = irq;
|
||||||
|
@ -16,15 +16,15 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||||
@@ -606,7 +606,7 @@ mtk_wed_stop(struct mtk_wed_device *dev)
|
@@ -606,7 +606,7 @@ mtk_wed_stop(struct mtk_wed_device *dev)
|
||||||
|
wdma_w32(dev, MTK_WDMA_INT_MASK, 0);
|
||||||
wdma_w32(dev, MTK_WDMA_INT_GRP2, 0);
|
wdma_w32(dev, MTK_WDMA_INT_GRP2, 0);
|
||||||
wed_w32(dev, MTK_WED_WPDMA_INT_MASK, 0);
|
|
||||||
|
|
||||||
- if (mtk_wed_is_v1(dev->hw))
|
- if (mtk_wed_is_v1(dev->hw))
|
||||||
+ if (!mtk_wed_get_rx_capa(dev))
|
+ if (!mtk_wed_get_rx_capa(dev))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wed_w32(dev, MTK_WED_EXT_INT_MASK1, 0);
|
wed_w32(dev, MTK_WED_EXT_INT_MASK1, 0);
|
||||||
@@ -733,16 +733,21 @@ mtk_wed_set_wpdma(struct mtk_wed_device
|
@@ -732,16 +732,21 @@ mtk_wed_set_wpdma(struct mtk_wed_device
|
||||||
{
|
{
|
||||||
if (mtk_wed_is_v1(dev->hw)) {
|
if (mtk_wed_is_v1(dev->hw)) {
|
||||||
wed_w32(dev, MTK_WED_WPDMA_CFG_BASE, dev->wlan.wpdma_phys);
|
wed_w32(dev, MTK_WED_WPDMA_CFG_BASE, dev->wlan.wpdma_phys);
|
||||||
@ -55,7 +55,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -974,15 +979,17 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
@@ -973,15 +978,17 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
||||||
MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
|
MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
|
||||||
} else {
|
} else {
|
||||||
wed_clr(dev, MTK_WED_TX_TKID_CTRL, MTK_WED_TX_TKID_CTRL_PAUSE);
|
wed_clr(dev, MTK_WED_TX_TKID_CTRL, MTK_WED_TX_TKID_CTRL_PAUSE);
|
||||||
@ -82,7 +82,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
wed_clr(dev, MTK_WED_TX_BM_CTRL, MTK_WED_TX_BM_CTRL_PAUSE);
|
wed_clr(dev, MTK_WED_TX_BM_CTRL, MTK_WED_TX_BM_CTRL_PAUSE);
|
||||||
@@ -1354,8 +1361,6 @@ mtk_wed_configure_irq(struct mtk_wed_dev
|
@@ -1353,8 +1360,6 @@ mtk_wed_configure_irq(struct mtk_wed_dev
|
||||||
|
|
||||||
wed_clr(dev, MTK_WED_WDMA_INT_CTRL, wdma_mask);
|
wed_clr(dev, MTK_WED_WDMA_INT_CTRL, wdma_mask);
|
||||||
} else {
|
} else {
|
||||||
@ -91,7 +91,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
/* initail tx interrupt trigger */
|
/* initail tx interrupt trigger */
|
||||||
wed_w32(dev, MTK_WED_WPDMA_INT_CTRL_TX,
|
wed_w32(dev, MTK_WED_WPDMA_INT_CTRL_TX,
|
||||||
MTK_WED_WPDMA_INT_CTRL_TX0_DONE_EN |
|
MTK_WED_WPDMA_INT_CTRL_TX0_DONE_EN |
|
||||||
@@ -1374,15 +1379,20 @@ mtk_wed_configure_irq(struct mtk_wed_dev
|
@@ -1373,15 +1378,20 @@ mtk_wed_configure_irq(struct mtk_wed_dev
|
||||||
FIELD_PREP(MTK_WED_WPDMA_INT_CTRL_TX_FREE_DONE_TRIG,
|
FIELD_PREP(MTK_WED_WPDMA_INT_CTRL_TX_FREE_DONE_TRIG,
|
||||||
dev->wlan.txfree_tbit));
|
dev->wlan.txfree_tbit));
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
wed_w32(dev, MTK_WED_WDMA_INT_CLR, wdma_mask);
|
wed_w32(dev, MTK_WED_WDMA_INT_CLR, wdma_mask);
|
||||||
wed_set(dev, MTK_WED_WDMA_INT_CTRL,
|
wed_set(dev, MTK_WED_WDMA_INT_CTRL,
|
||||||
@@ -1401,6 +1411,8 @@ mtk_wed_configure_irq(struct mtk_wed_dev
|
@@ -1400,6 +1410,8 @@ mtk_wed_configure_irq(struct mtk_wed_dev
|
||||||
static void
|
static void
|
||||||
mtk_wed_dma_enable(struct mtk_wed_device *dev)
|
mtk_wed_dma_enable(struct mtk_wed_device *dev)
|
||||||
{
|
{
|
||||||
@ -130,7 +130,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wed_set(dev, MTK_WED_WPDMA_INT_CTRL, MTK_WED_WPDMA_INT_CTRL_SUBRT_ADV);
|
wed_set(dev, MTK_WED_WPDMA_INT_CTRL, MTK_WED_WPDMA_INT_CTRL_SUBRT_ADV);
|
||||||
|
|
||||||
wed_set(dev, MTK_WED_GLO_CFG,
|
wed_set(dev, MTK_WED_GLO_CFG,
|
||||||
@@ -1420,33 +1432,33 @@ mtk_wed_dma_enable(struct mtk_wed_device
|
@@ -1419,33 +1431,33 @@ mtk_wed_dma_enable(struct mtk_wed_device
|
||||||
if (mtk_wed_is_v1(dev->hw)) {
|
if (mtk_wed_is_v1(dev->hw)) {
|
||||||
wdma_set(dev, MTK_WDMA_GLO_CFG,
|
wdma_set(dev, MTK_WDMA_GLO_CFG,
|
||||||
MTK_WDMA_GLO_CFG_RX_INFO3_PRERES);
|
MTK_WDMA_GLO_CFG_RX_INFO3_PRERES);
|
||||||
@ -186,7 +186,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1473,7 +1485,7 @@ mtk_wed_start(struct mtk_wed_device *dev
|
@@ -1472,7 +1484,7 @@ mtk_wed_start(struct mtk_wed_device *dev
|
||||||
|
|
||||||
val |= BIT(0) | (BIT(1) * !!dev->hw->index);
|
val |= BIT(0) | (BIT(1) * !!dev->hw->index);
|
||||||
regmap_write(dev->hw->mirror, dev->hw->index * 4, val);
|
regmap_write(dev->hw->mirror, dev->hw->index * 4, val);
|
||||||
@ -195,7 +195,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
/* driver set mid ready and only once */
|
/* driver set mid ready and only once */
|
||||||
wed_w32(dev, MTK_WED_EXT_INT_MASK1,
|
wed_w32(dev, MTK_WED_EXT_INT_MASK1,
|
||||||
MTK_WED_EXT_INT_STATUS_WPDMA_MID_RDY);
|
MTK_WED_EXT_INT_STATUS_WPDMA_MID_RDY);
|
||||||
@@ -1485,7 +1497,6 @@ mtk_wed_start(struct mtk_wed_device *dev
|
@@ -1484,7 +1496,6 @@ mtk_wed_start(struct mtk_wed_device *dev
|
||||||
|
|
||||||
if (mtk_wed_rro_cfg(dev))
|
if (mtk_wed_rro_cfg(dev))
|
||||||
return;
|
return;
|
||||||
@ -203,7 +203,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
mtk_wed_set_512_support(dev, dev->wlan.wcid_512);
|
mtk_wed_set_512_support(dev, dev->wlan.wcid_512);
|
||||||
@@ -1551,13 +1562,14 @@ mtk_wed_attach(struct mtk_wed_device *de
|
@@ -1550,13 +1561,14 @@ mtk_wed_attach(struct mtk_wed_device *de
|
||||||
}
|
}
|
||||||
|
|
||||||
mtk_wed_hw_init_early(dev);
|
mtk_wed_hw_init_early(dev);
|
||||||
|
@ -38,7 +38,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
static void
|
static void
|
||||||
wed_m32(struct mtk_wed_device *dev, u32 reg, u32 mask, u32 val)
|
wed_m32(struct mtk_wed_device *dev, u32 reg, u32 mask, u32 val)
|
||||||
{
|
{
|
||||||
@@ -747,7 +767,7 @@ mtk_wed_set_wpdma(struct mtk_wed_device
|
@@ -746,7 +766,7 @@ mtk_wed_set_wpdma(struct mtk_wed_device
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wed_w32(dev, MTK_WED_WPDMA_RX_GLO_CFG, dev->wlan.wpdma_rx_glo);
|
wed_w32(dev, MTK_WED_WPDMA_RX_GLO_CFG, dev->wlan.wpdma_rx_glo);
|
||||||
@ -47,7 +47,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -941,22 +961,10 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
@@ -940,22 +960,10 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
||||||
wed_w32(dev, MTK_WED_TX_BM_BUF_LEN, MTK_WED_PKT_SIZE);
|
wed_w32(dev, MTK_WED_TX_BM_BUF_LEN, MTK_WED_PKT_SIZE);
|
||||||
|
|
||||||
if (mtk_wed_is_v1(dev->hw)) {
|
if (mtk_wed_is_v1(dev->hw)) {
|
||||||
@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wed_w32(dev, MTK_WED_TX_BM_DYN_THR,
|
wed_w32(dev, MTK_WED_TX_BM_DYN_THR,
|
||||||
FIELD_PREP(MTK_WED_TX_BM_DYN_THR_LO_V2, 0) |
|
FIELD_PREP(MTK_WED_TX_BM_DYN_THR_LO_V2, 0) |
|
||||||
MTK_WED_TX_BM_DYN_THR_HI_V2);
|
MTK_WED_TX_BM_DYN_THR_HI_V2);
|
||||||
@@ -971,6 +979,11 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
@@ -970,6 +978,11 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
||||||
MTK_WED_TX_TKID_DYN_THR_HI);
|
MTK_WED_TX_TKID_DYN_THR_HI);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
mtk_wed_reset(dev, MTK_WED_RESET_TX_BM);
|
mtk_wed_reset(dev, MTK_WED_RESET_TX_BM);
|
||||||
|
|
||||||
if (mtk_wed_is_v1(dev->hw)) {
|
if (mtk_wed_is_v1(dev->hw)) {
|
||||||
@@ -1105,13 +1118,8 @@ mtk_wed_rx_reset(struct mtk_wed_device *
|
@@ -1104,13 +1117,8 @@ mtk_wed_rx_reset(struct mtk_wed_device *
|
||||||
if (ret) {
|
if (ret) {
|
||||||
mtk_wed_reset(dev, MTK_WED_RESET_WED_RX_DMA);
|
mtk_wed_reset(dev, MTK_WED_RESET_WED_RX_DMA);
|
||||||
} else {
|
} else {
|
||||||
@ -98,7 +98,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wed_w32(dev, MTK_WED_RESET_IDX, 0);
|
wed_w32(dev, MTK_WED_RESET_IDX, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1164,7 +1172,8 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
@@ -1163,7 +1171,8 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
||||||
if (busy) {
|
if (busy) {
|
||||||
mtk_wed_reset(dev, MTK_WED_RESET_WED_TX_DMA);
|
mtk_wed_reset(dev, MTK_WED_RESET_WED_TX_DMA);
|
||||||
} else {
|
} else {
|
||||||
@ -108,7 +108,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wed_w32(dev, MTK_WED_RESET_IDX, 0);
|
wed_w32(dev, MTK_WED_RESET_IDX, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1256,7 +1265,6 @@ static int
|
@@ -1255,7 +1264,6 @@ static int
|
||||||
mtk_wed_wdma_rx_ring_setup(struct mtk_wed_device *dev, int idx, int size,
|
mtk_wed_wdma_rx_ring_setup(struct mtk_wed_device *dev, int idx, int size,
|
||||||
bool reset)
|
bool reset)
|
||||||
{
|
{
|
||||||
@ -116,7 +116,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
struct mtk_wed_ring *wdma;
|
struct mtk_wed_ring *wdma;
|
||||||
|
|
||||||
if (idx >= ARRAY_SIZE(dev->rx_wdma))
|
if (idx >= ARRAY_SIZE(dev->rx_wdma))
|
||||||
@@ -1264,7 +1272,7 @@ mtk_wed_wdma_rx_ring_setup(struct mtk_we
|
@@ -1263,7 +1271,7 @@ mtk_wed_wdma_rx_ring_setup(struct mtk_we
|
||||||
|
|
||||||
wdma = &dev->rx_wdma[idx];
|
wdma = &dev->rx_wdma[idx];
|
||||||
if (!reset && mtk_wed_ring_alloc(dev, wdma, MTK_WED_WDMA_RING_SIZE,
|
if (!reset && mtk_wed_ring_alloc(dev, wdma, MTK_WED_WDMA_RING_SIZE,
|
||||||
@ -125,7 +125,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
wdma_w32(dev, MTK_WDMA_RING_RX(idx) + MTK_WED_RING_OFS_BASE,
|
wdma_w32(dev, MTK_WDMA_RING_RX(idx) + MTK_WED_RING_OFS_BASE,
|
||||||
@@ -1285,7 +1293,6 @@ static int
|
@@ -1284,7 +1292,6 @@ static int
|
||||||
mtk_wed_wdma_tx_ring_setup(struct mtk_wed_device *dev, int idx, int size,
|
mtk_wed_wdma_tx_ring_setup(struct mtk_wed_device *dev, int idx, int size,
|
||||||
bool reset)
|
bool reset)
|
||||||
{
|
{
|
||||||
@ -133,7 +133,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
struct mtk_wed_ring *wdma;
|
struct mtk_wed_ring *wdma;
|
||||||
|
|
||||||
if (idx >= ARRAY_SIZE(dev->tx_wdma))
|
if (idx >= ARRAY_SIZE(dev->tx_wdma))
|
||||||
@@ -1293,7 +1300,7 @@ mtk_wed_wdma_tx_ring_setup(struct mtk_we
|
@@ -1292,7 +1299,7 @@ mtk_wed_wdma_tx_ring_setup(struct mtk_we
|
||||||
|
|
||||||
wdma = &dev->tx_wdma[idx];
|
wdma = &dev->tx_wdma[idx];
|
||||||
if (!reset && mtk_wed_ring_alloc(dev, wdma, MTK_WED_WDMA_RING_SIZE,
|
if (!reset && mtk_wed_ring_alloc(dev, wdma, MTK_WED_WDMA_RING_SIZE,
|
||||||
@ -142,7 +142,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
wdma_w32(dev, MTK_WDMA_RING_TX(idx) + MTK_WED_RING_OFS_BASE,
|
wdma_w32(dev, MTK_WDMA_RING_TX(idx) + MTK_WED_RING_OFS_BASE,
|
||||||
@@ -1932,7 +1939,12 @@ void mtk_wed_add_hw(struct device_node *
|
@@ -1928,7 +1935,12 @@ void mtk_wed_add_hw(struct device_node *
|
||||||
hw->irq = irq;
|
hw->irq = irq;
|
||||||
hw->version = eth->soc->version;
|
hw->version = eth->soc->version;
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
hw->mirror = syscon_regmap_lookup_by_phandle(eth_np,
|
hw->mirror = syscon_regmap_lookup_by_phandle(eth_np,
|
||||||
"mediatek,pcie-mirror");
|
"mediatek,pcie-mirror");
|
||||||
hw->hifsys = syscon_regmap_lookup_by_phandle(eth_np,
|
hw->hifsys = syscon_regmap_lookup_by_phandle(eth_np,
|
||||||
@@ -1946,6 +1958,8 @@ void mtk_wed_add_hw(struct device_node *
|
@@ -1942,6 +1954,8 @@ void mtk_wed_add_hw(struct device_node *
|
||||||
regmap_write(hw->mirror, 0, 0);
|
regmap_write(hw->mirror, 0, 0);
|
||||||
regmap_write(hw->mirror, 4, 0);
|
regmap_write(hw->mirror, 4, 0);
|
||||||
}
|
}
|
||||||
|
@ -302,7 +302,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
mtk_wed_set_512_support(dev, false);
|
mtk_wed_set_512_support(dev, false);
|
||||||
@@ -652,6 +699,14 @@ mtk_wed_deinit(struct mtk_wed_device *de
|
@@ -651,6 +698,14 @@ mtk_wed_deinit(struct mtk_wed_device *de
|
||||||
MTK_WED_CTRL_RX_ROUTE_QM_EN |
|
MTK_WED_CTRL_RX_ROUTE_QM_EN |
|
||||||
MTK_WED_CTRL_WED_RX_BM_EN |
|
MTK_WED_CTRL_WED_RX_BM_EN |
|
||||||
MTK_WED_CTRL_RX_RRO_QM_EN);
|
MTK_WED_CTRL_RX_RRO_QM_EN);
|
||||||
@ -317,7 +317,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -701,21 +756,37 @@ mtk_wed_detach(struct mtk_wed_device *de
|
@@ -700,21 +755,37 @@ mtk_wed_detach(struct mtk_wed_device *de
|
||||||
mutex_unlock(&hw_lock);
|
mutex_unlock(&hw_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,7 +362,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
wed_w32(dev, MTK_WED_PCIE_INT_CTRL,
|
wed_w32(dev, MTK_WED_PCIE_INT_CTRL,
|
||||||
FIELD_PREP(MTK_WED_PCIE_INT_CTRL_POLL_EN, 2));
|
FIELD_PREP(MTK_WED_PCIE_INT_CTRL_POLL_EN, 2));
|
||||||
@@ -723,19 +794,9 @@ mtk_wed_bus_init(struct mtk_wed_device *
|
@@ -722,19 +793,9 @@ mtk_wed_bus_init(struct mtk_wed_device *
|
||||||
/* pcie interrupt control: pola/source selection */
|
/* pcie interrupt control: pola/source selection */
|
||||||
wed_set(dev, MTK_WED_PCIE_INT_CTRL,
|
wed_set(dev, MTK_WED_PCIE_INT_CTRL,
|
||||||
MTK_WED_PCIE_INT_CTRL_MSK_EN_POLA |
|
MTK_WED_PCIE_INT_CTRL_MSK_EN_POLA |
|
||||||
@ -385,7 +385,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MTK_WED_BUS_AXI:
|
case MTK_WED_BUS_AXI:
|
||||||
@@ -773,18 +834,19 @@ mtk_wed_set_wpdma(struct mtk_wed_device
|
@@ -772,18 +833,19 @@ mtk_wed_set_wpdma(struct mtk_wed_device
|
||||||
static void
|
static void
|
||||||
mtk_wed_hw_init_early(struct mtk_wed_device *dev)
|
mtk_wed_hw_init_early(struct mtk_wed_device *dev)
|
||||||
{
|
{
|
||||||
@ -412,7 +412,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wed_m32(dev, MTK_WED_WDMA_GLO_CFG, mask, set);
|
wed_m32(dev, MTK_WED_WDMA_GLO_CFG, mask, set);
|
||||||
|
|
||||||
if (mtk_wed_is_v1(dev->hw)) {
|
if (mtk_wed_is_v1(dev->hw)) {
|
||||||
@@ -932,11 +994,18 @@ mtk_wed_route_qm_hw_init(struct mtk_wed_
|
@@ -931,11 +993,18 @@ mtk_wed_route_qm_hw_init(struct mtk_wed_
|
||||||
}
|
}
|
||||||
|
|
||||||
/* configure RX_ROUTE_QM */
|
/* configure RX_ROUTE_QM */
|
||||||
@ -436,7 +436,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
/* enable RX_ROUTE_QM */
|
/* enable RX_ROUTE_QM */
|
||||||
wed_set(dev, MTK_WED_CTRL, MTK_WED_CTRL_RX_ROUTE_QM_EN);
|
wed_set(dev, MTK_WED_CTRL, MTK_WED_CTRL_RX_ROUTE_QM_EN);
|
||||||
}
|
}
|
||||||
@@ -949,22 +1018,30 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
@@ -948,22 +1017,30 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
||||||
|
|
||||||
dev->init_done = true;
|
dev->init_done = true;
|
||||||
mtk_wed_set_ext_int(dev, false);
|
mtk_wed_set_ext_int(dev, false);
|
||||||
@ -475,7 +475,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wed_w32(dev, MTK_WED_TX_BM_DYN_THR,
|
wed_w32(dev, MTK_WED_TX_BM_DYN_THR,
|
||||||
FIELD_PREP(MTK_WED_TX_BM_DYN_THR_LO_V2, 0) |
|
FIELD_PREP(MTK_WED_TX_BM_DYN_THR_LO_V2, 0) |
|
||||||
MTK_WED_TX_BM_DYN_THR_HI_V2);
|
MTK_WED_TX_BM_DYN_THR_HI_V2);
|
||||||
@@ -974,9 +1051,6 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
@@ -973,9 +1050,6 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
||||||
dev->tx_buf_ring.size / 128) |
|
dev->tx_buf_ring.size / 128) |
|
||||||
FIELD_PREP(MTK_WED_TX_TKID_CTRL_RSV_GRP_NUM,
|
FIELD_PREP(MTK_WED_TX_TKID_CTRL_RSV_GRP_NUM,
|
||||||
dev->tx_buf_ring.size / 128));
|
dev->tx_buf_ring.size / 128));
|
||||||
@ -485,7 +485,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
wed_w32(dev, dev->hw->soc->regmap.tx_bm_tkid,
|
wed_w32(dev, dev->hw->soc->regmap.tx_bm_tkid,
|
||||||
@@ -986,26 +1060,62 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
@@ -985,26 +1059,62 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
||||||
|
|
||||||
mtk_wed_reset(dev, MTK_WED_RESET_TX_BM);
|
mtk_wed_reset(dev, MTK_WED_RESET_TX_BM);
|
||||||
|
|
||||||
@ -561,7 +561,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1303,6 +1413,24 @@ mtk_wed_wdma_tx_ring_setup(struct mtk_we
|
@@ -1302,6 +1412,24 @@ mtk_wed_wdma_tx_ring_setup(struct mtk_we
|
||||||
dev->hw->soc->wdma_desc_size, true))
|
dev->hw->soc->wdma_desc_size, true))
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
@ -586,7 +586,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wdma_w32(dev, MTK_WDMA_RING_TX(idx) + MTK_WED_RING_OFS_BASE,
|
wdma_w32(dev, MTK_WDMA_RING_TX(idx) + MTK_WED_RING_OFS_BASE,
|
||||||
wdma->desc_phys);
|
wdma->desc_phys);
|
||||||
wdma_w32(dev, MTK_WDMA_RING_TX(idx) + MTK_WED_RING_OFS_COUNT,
|
wdma_w32(dev, MTK_WDMA_RING_TX(idx) + MTK_WED_RING_OFS_COUNT,
|
||||||
@@ -1368,6 +1496,9 @@ mtk_wed_configure_irq(struct mtk_wed_dev
|
@@ -1367,6 +1495,9 @@ mtk_wed_configure_irq(struct mtk_wed_dev
|
||||||
|
|
||||||
wed_clr(dev, MTK_WED_WDMA_INT_CTRL, wdma_mask);
|
wed_clr(dev, MTK_WED_WDMA_INT_CTRL, wdma_mask);
|
||||||
} else {
|
} else {
|
||||||
@ -596,7 +596,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
/* initail tx interrupt trigger */
|
/* initail tx interrupt trigger */
|
||||||
wed_w32(dev, MTK_WED_WPDMA_INT_CTRL_TX,
|
wed_w32(dev, MTK_WED_WPDMA_INT_CTRL_TX,
|
||||||
MTK_WED_WPDMA_INT_CTRL_TX0_DONE_EN |
|
MTK_WED_WPDMA_INT_CTRL_TX0_DONE_EN |
|
||||||
@@ -1420,33 +1551,60 @@ mtk_wed_dma_enable(struct mtk_wed_device
|
@@ -1419,33 +1550,60 @@ mtk_wed_dma_enable(struct mtk_wed_device
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -668,7 +668,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wed_clr(dev, MTK_WED_WPDMA_GLO_CFG,
|
wed_clr(dev, MTK_WED_WPDMA_GLO_CFG,
|
||||||
MTK_WED_WPDMA_GLO_CFG_TX_TKID_KEEP |
|
MTK_WED_WPDMA_GLO_CFG_TX_TKID_KEEP |
|
||||||
MTK_WED_WPDMA_GLO_CFG_TX_DMAD_DW3_PREV);
|
MTK_WED_WPDMA_GLO_CFG_TX_DMAD_DW3_PREV);
|
||||||
@@ -1458,11 +1616,22 @@ mtk_wed_dma_enable(struct mtk_wed_device
|
@@ -1457,11 +1615,22 @@ mtk_wed_dma_enable(struct mtk_wed_device
|
||||||
MTK_WED_WDMA_GLO_CFG_TX_DRV_EN |
|
MTK_WED_WDMA_GLO_CFG_TX_DRV_EN |
|
||||||
MTK_WED_WDMA_GLO_CFG_TX_DDONE_CHK);
|
MTK_WED_WDMA_GLO_CFG_TX_DDONE_CHK);
|
||||||
|
|
||||||
@ -693,7 +693,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
for (i = 0; i < MTK_WED_RX_QUEUES; i++)
|
for (i = 0; i < MTK_WED_RX_QUEUES; i++)
|
||||||
mtk_wed_check_wfdma_rx_fill(dev, i);
|
mtk_wed_check_wfdma_rx_fill(dev, i);
|
||||||
@@ -1502,6 +1671,12 @@ mtk_wed_start(struct mtk_wed_device *dev
|
@@ -1501,6 +1670,12 @@ mtk_wed_start(struct mtk_wed_device *dev
|
||||||
wed_r32(dev, MTK_WED_EXT_INT_MASK1);
|
wed_r32(dev, MTK_WED_EXT_INT_MASK1);
|
||||||
wed_r32(dev, MTK_WED_EXT_INT_MASK2);
|
wed_r32(dev, MTK_WED_EXT_INT_MASK2);
|
||||||
|
|
||||||
@ -706,7 +706,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
if (mtk_wed_rro_cfg(dev))
|
if (mtk_wed_rro_cfg(dev))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1553,6 +1728,7 @@ mtk_wed_attach(struct mtk_wed_device *de
|
@@ -1552,6 +1727,7 @@ mtk_wed_attach(struct mtk_wed_device *de
|
||||||
dev->irq = hw->irq;
|
dev->irq = hw->irq;
|
||||||
dev->wdma_idx = hw->index;
|
dev->wdma_idx = hw->index;
|
||||||
dev->version = hw->version;
|
dev->version = hw->version;
|
||||||
@ -714,7 +714,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
if (hw->eth->dma_dev == hw->eth->dev &&
|
if (hw->eth->dma_dev == hw->eth->dev &&
|
||||||
of_dma_is_coherent(hw->eth->dev->of_node))
|
of_dma_is_coherent(hw->eth->dev->of_node))
|
||||||
@@ -1620,6 +1796,23 @@ mtk_wed_tx_ring_setup(struct mtk_wed_dev
|
@@ -1619,6 +1795,23 @@ mtk_wed_tx_ring_setup(struct mtk_wed_dev
|
||||||
ring->reg_base = MTK_WED_RING_TX(idx);
|
ring->reg_base = MTK_WED_RING_TX(idx);
|
||||||
ring->wpdma = regs;
|
ring->wpdma = regs;
|
||||||
|
|
||||||
@ -738,7 +738,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
/* WED -> WPDMA */
|
/* WED -> WPDMA */
|
||||||
wpdma_tx_w32(dev, idx, MTK_WED_RING_OFS_BASE, ring->desc_phys);
|
wpdma_tx_w32(dev, idx, MTK_WED_RING_OFS_BASE, ring->desc_phys);
|
||||||
wpdma_tx_w32(dev, idx, MTK_WED_RING_OFS_COUNT, MTK_WED_TX_RING_SIZE);
|
wpdma_tx_w32(dev, idx, MTK_WED_RING_OFS_COUNT, MTK_WED_TX_RING_SIZE);
|
||||||
@@ -1694,15 +1887,13 @@ mtk_wed_rx_ring_setup(struct mtk_wed_dev
|
@@ -1693,15 +1886,13 @@ mtk_wed_rx_ring_setup(struct mtk_wed_dev
|
||||||
static u32
|
static u32
|
||||||
mtk_wed_irq_get(struct mtk_wed_device *dev, u32 mask)
|
mtk_wed_irq_get(struct mtk_wed_device *dev, u32 mask)
|
||||||
{
|
{
|
||||||
@ -759,7 +759,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
val = wed_r32(dev, MTK_WED_EXT_INT_STATUS);
|
val = wed_r32(dev, MTK_WED_EXT_INT_STATUS);
|
||||||
wed_w32(dev, MTK_WED_EXT_INT_STATUS, val);
|
wed_w32(dev, MTK_WED_EXT_INT_STATUS, val);
|
||||||
@@ -1943,6 +2134,9 @@ void mtk_wed_add_hw(struct device_node *
|
@@ -1939,6 +2130,9 @@ void mtk_wed_add_hw(struct device_node *
|
||||||
case 2:
|
case 2:
|
||||||
hw->soc = &mt7986_data;
|
hw->soc = &mt7986_data;
|
||||||
break;
|
break;
|
||||||
|
@ -56,7 +56,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1546,6 +1537,7 @@ mtk_wed_configure_irq(struct mtk_wed_dev
|
@@ -1545,6 +1536,7 @@ mtk_wed_configure_irq(struct mtk_wed_dev
|
||||||
wed_w32(dev, MTK_WED_INT_MASK, irq_mask);
|
wed_w32(dev, MTK_WED_INT_MASK, irq_mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
static void
|
static void
|
||||||
mtk_wed_dma_enable(struct mtk_wed_device *dev)
|
mtk_wed_dma_enable(struct mtk_wed_device *dev)
|
||||||
{
|
{
|
||||||
@@ -1633,8 +1625,26 @@ mtk_wed_dma_enable(struct mtk_wed_device
|
@@ -1632,8 +1624,26 @@ mtk_wed_dma_enable(struct mtk_wed_device
|
||||||
wdma_set(dev, MTK_WDMA_WRBK_TX_CFG, MTK_WDMA_WRBK_TX_CFG_WRBK_EN);
|
wdma_set(dev, MTK_WDMA_WRBK_TX_CFG, MTK_WDMA_WRBK_TX_CFG_WRBK_EN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
mtk_wed_tx_buffer_alloc(struct mtk_wed_device *dev)
|
mtk_wed_tx_buffer_alloc(struct mtk_wed_device *dev)
|
||||||
{
|
{
|
||||||
u32 desc_size = dev->hw->soc->tx_ring_desc_size;
|
u32 desc_size = dev->hw->soc->tx_ring_desc_size;
|
||||||
@@ -709,6 +840,7 @@ __mtk_wed_detach(struct mtk_wed_device *
|
@@ -708,6 +839,7 @@ __mtk_wed_detach(struct mtk_wed_device *
|
||||||
|
|
||||||
mtk_wdma_rx_reset(dev);
|
mtk_wdma_rx_reset(dev);
|
||||||
mtk_wed_reset(dev, MTK_WED_RESET_WED);
|
mtk_wed_reset(dev, MTK_WED_RESET_WED);
|
||||||
@ -256,7 +256,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
mtk_wed_free_tx_buffer(dev);
|
mtk_wed_free_tx_buffer(dev);
|
||||||
mtk_wed_free_tx_rings(dev);
|
mtk_wed_free_tx_rings(dev);
|
||||||
|
|
||||||
@@ -1129,23 +1261,6 @@ mtk_wed_ring_reset(struct mtk_wed_ring *
|
@@ -1128,23 +1260,6 @@ mtk_wed_ring_reset(struct mtk_wed_ring *
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
static int
|
static int
|
||||||
mtk_wed_rx_reset(struct mtk_wed_device *dev)
|
mtk_wed_rx_reset(struct mtk_wed_device *dev)
|
||||||
{
|
{
|
||||||
@@ -1692,6 +1807,7 @@ mtk_wed_start(struct mtk_wed_device *dev
|
@@ -1691,6 +1806,7 @@ mtk_wed_start(struct mtk_wed_device *dev
|
||||||
}
|
}
|
||||||
|
|
||||||
mtk_wed_set_512_support(dev, dev->wlan.wcid_512);
|
mtk_wed_set_512_support(dev, dev->wlan.wcid_512);
|
||||||
@ -288,7 +288,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
mtk_wed_dma_enable(dev);
|
mtk_wed_dma_enable(dev);
|
||||||
dev->running = true;
|
dev->running = true;
|
||||||
@@ -1748,6 +1864,10 @@ mtk_wed_attach(struct mtk_wed_device *de
|
@@ -1747,6 +1863,10 @@ mtk_wed_attach(struct mtk_wed_device *de
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -935,6 +1056,8 @@ mtk_wed_bus_init(struct mtk_wed_device *
|
@@ -934,6 +1055,8 @@ mtk_wed_bus_init(struct mtk_wed_device *
|
||||||
static void
|
static void
|
||||||
mtk_wed_set_wpdma(struct mtk_wed_device *dev)
|
mtk_wed_set_wpdma(struct mtk_wed_device *dev)
|
||||||
{
|
{
|
||||||
@ -182,7 +182,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
if (mtk_wed_is_v1(dev->hw)) {
|
if (mtk_wed_is_v1(dev->hw)) {
|
||||||
wed_w32(dev, MTK_WED_WPDMA_CFG_BASE, dev->wlan.wpdma_phys);
|
wed_w32(dev, MTK_WED_WPDMA_CFG_BASE, dev->wlan.wpdma_phys);
|
||||||
return;
|
return;
|
||||||
@@ -952,6 +1075,15 @@ mtk_wed_set_wpdma(struct mtk_wed_device
|
@@ -951,6 +1074,15 @@ mtk_wed_set_wpdma(struct mtk_wed_device
|
||||||
|
|
||||||
wed_w32(dev, MTK_WED_WPDMA_RX_GLO_CFG, dev->wlan.wpdma_rx_glo);
|
wed_w32(dev, MTK_WED_WPDMA_RX_GLO_CFG, dev->wlan.wpdma_rx_glo);
|
||||||
wed_w32(dev, dev->hw->soc->regmap.wpdma_rx_ring0, dev->wlan.wpdma_rx);
|
wed_w32(dev, dev->hw->soc->regmap.wpdma_rx_ring0, dev->wlan.wpdma_rx);
|
||||||
@ -198,7 +198,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1763,6 +1895,165 @@ mtk_wed_dma_enable(struct mtk_wed_device
|
@@ -1762,6 +1894,165 @@ mtk_wed_dma_enable(struct mtk_wed_device
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -364,7 +364,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
mtk_wed_start(struct mtk_wed_device *dev, u32 irq_mask)
|
mtk_wed_start(struct mtk_wed_device *dev, u32 irq_mask)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -2216,6 +2507,10 @@ void mtk_wed_add_hw(struct device_node *
|
@@ -2212,6 +2503,10 @@ void mtk_wed_add_hw(struct device_node *
|
||||||
.detach = mtk_wed_detach,
|
.detach = mtk_wed_detach,
|
||||||
.ppe_check = mtk_wed_ppe_check,
|
.ppe_check = mtk_wed_ppe_check,
|
||||||
.setup_tc = mtk_wed_setup_tc,
|
.setup_tc = mtk_wed_setup_tc,
|
||||||
|
@ -205,7 +205,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wdma_w32(dev, MTK_WDMA_RESET_IDX, MTK_WDMA_RESET_IDX_TX);
|
wdma_w32(dev, MTK_WDMA_RESET_IDX, MTK_WDMA_RESET_IDX_TX);
|
||||||
wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
|
wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
|
||||||
|
|
||||||
@@ -1406,13 +1570,33 @@ mtk_wed_rx_reset(struct mtk_wed_device *
|
@@ -1405,13 +1569,33 @@ mtk_wed_rx_reset(struct mtk_wed_device *
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -239,7 +239,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wed_w32(dev, MTK_WED_WPDMA_RX_D_RST_IDX,
|
wed_w32(dev, MTK_WED_WPDMA_RX_D_RST_IDX,
|
||||||
MTK_WED_WPDMA_RX_D_RST_CRX_IDX |
|
MTK_WED_WPDMA_RX_D_RST_CRX_IDX |
|
||||||
MTK_WED_WPDMA_RX_D_RST_DRV_IDX);
|
MTK_WED_WPDMA_RX_D_RST_DRV_IDX);
|
||||||
@@ -1440,23 +1624,52 @@ mtk_wed_rx_reset(struct mtk_wed_device *
|
@@ -1439,23 +1623,52 @@ mtk_wed_rx_reset(struct mtk_wed_device *
|
||||||
wed_w32(dev, MTK_WED_RROQM_RST_IDX, 0);
|
wed_w32(dev, MTK_WED_RROQM_RST_IDX, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,7 +298,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
mtk_wed_reset(dev, MTK_WED_RESET_WDMA_TX_DRV);
|
mtk_wed_reset(dev, MTK_WED_RESET_WDMA_TX_DRV);
|
||||||
|
|
||||||
/* reset wed rx dma */
|
/* reset wed rx dma */
|
||||||
@@ -1477,6 +1690,14 @@ mtk_wed_rx_reset(struct mtk_wed_device *
|
@@ -1476,6 +1689,14 @@ mtk_wed_rx_reset(struct mtk_wed_device *
|
||||||
MTK_WED_CTRL_WED_RX_BM_BUSY);
|
MTK_WED_CTRL_WED_RX_BM_BUSY);
|
||||||
mtk_wed_reset(dev, MTK_WED_RESET_RX_BM);
|
mtk_wed_reset(dev, MTK_WED_RESET_RX_BM);
|
||||||
|
|
||||||
@ -313,7 +313,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
/* wo change to enable state */
|
/* wo change to enable state */
|
||||||
val = MTK_WED_WO_STATE_ENABLE;
|
val = MTK_WED_WO_STATE_ENABLE;
|
||||||
ret = mtk_wed_mcu_send_msg(wo, MTK_WED_MODULE_ID_WO,
|
ret = mtk_wed_mcu_send_msg(wo, MTK_WED_MODULE_ID_WO,
|
||||||
@@ -1494,6 +1715,7 @@ mtk_wed_rx_reset(struct mtk_wed_device *
|
@@ -1493,6 +1714,7 @@ mtk_wed_rx_reset(struct mtk_wed_device *
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
mtk_wed_free_rx_buffer(dev);
|
mtk_wed_free_rx_buffer(dev);
|
||||||
@ -321,7 +321,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1527,15 +1749,41 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
@@ -1526,15 +1748,41 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
||||||
|
|
||||||
/* 2. reset WDMA rx DMA */
|
/* 2. reset WDMA rx DMA */
|
||||||
busy = !!mtk_wdma_rx_reset(dev);
|
busy = !!mtk_wdma_rx_reset(dev);
|
||||||
@ -364,7 +364,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
wed_w32(dev, MTK_WED_WDMA_RESET_IDX,
|
wed_w32(dev, MTK_WED_WDMA_RESET_IDX,
|
||||||
MTK_WED_WDMA_RESET_IDX_RX | MTK_WED_WDMA_RESET_IDX_DRV);
|
MTK_WED_WDMA_RESET_IDX_RX | MTK_WED_WDMA_RESET_IDX_DRV);
|
||||||
wed_w32(dev, MTK_WED_WDMA_RESET_IDX, 0);
|
wed_w32(dev, MTK_WED_WDMA_RESET_IDX, 0);
|
||||||
@@ -1551,8 +1799,13 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
@@ -1550,8 +1798,13 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
||||||
wed_clr(dev, MTK_WED_CTRL, MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
|
wed_clr(dev, MTK_WED_CTRL, MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
|
||||||
|
|
||||||
for (i = 0; i < 100; i++) {
|
for (i = 0; i < 100; i++) {
|
||||||
@ -380,7 +380,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1574,6 +1827,8 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
@@ -1573,6 +1826,8 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
||||||
mtk_wed_reset(dev, MTK_WED_RESET_WPDMA_INT_AGENT);
|
mtk_wed_reset(dev, MTK_WED_RESET_WPDMA_INT_AGENT);
|
||||||
mtk_wed_reset(dev, MTK_WED_RESET_WPDMA_TX_DRV);
|
mtk_wed_reset(dev, MTK_WED_RESET_WPDMA_TX_DRV);
|
||||||
mtk_wed_reset(dev, MTK_WED_RESET_WPDMA_RX_DRV);
|
mtk_wed_reset(dev, MTK_WED_RESET_WPDMA_RX_DRV);
|
||||||
@ -389,7 +389,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
} else {
|
} else {
|
||||||
wed_w32(dev, MTK_WED_WPDMA_RESET_IDX,
|
wed_w32(dev, MTK_WED_WPDMA_RESET_IDX,
|
||||||
MTK_WED_WPDMA_RESET_IDX_TX |
|
MTK_WED_WPDMA_RESET_IDX_TX |
|
||||||
@@ -1590,7 +1845,14 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
@@ -1589,7 +1844,14 @@ mtk_wed_reset_dma(struct mtk_wed_device
|
||||||
wed_w32(dev, MTK_WED_RESET_IDX, 0);
|
wed_w32(dev, MTK_WED_RESET_IDX, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,7 +405,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -1842,6 +2104,7 @@ mtk_wed_dma_enable(struct mtk_wed_device
|
@@ -1841,6 +2103,7 @@ mtk_wed_dma_enable(struct mtk_wed_device
|
||||||
MTK_WED_WPDMA_GLO_CFG_RX_DRV_UNS_VER_FORCE_4);
|
MTK_WED_WPDMA_GLO_CFG_RX_DRV_UNS_VER_FORCE_4);
|
||||||
|
|
||||||
wdma_set(dev, MTK_WDMA_PREF_RX_CFG, MTK_WDMA_PREF_RX_CFG_PREF_EN);
|
wdma_set(dev, MTK_WDMA_PREF_RX_CFG, MTK_WDMA_PREF_RX_CFG_PREF_EN);
|
||||||
@ -413,7 +413,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
wed_clr(dev, MTK_WED_WPDMA_GLO_CFG,
|
wed_clr(dev, MTK_WED_WPDMA_GLO_CFG,
|
||||||
@@ -1905,6 +2168,12 @@ mtk_wed_start_hw_rro(struct mtk_wed_devi
|
@@ -1904,6 +2167,12 @@ mtk_wed_start_hw_rro(struct mtk_wed_devi
|
||||||
if (!mtk_wed_get_rx_capa(dev) || !dev->wlan.hw_rro)
|
if (!mtk_wed_get_rx_capa(dev) || !dev->wlan.hw_rro)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
@@ -3003,13 +3003,25 @@ static void stmmac_tx_timer_arm(struct s
|
@@ -2988,13 +2988,25 @@ static void stmmac_tx_timer_arm(struct s
|
||||||
{
|
{
|
||||||
struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue];
|
struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue];
|
||||||
u32 tx_coal_timer = priv->tx_coal_timer[queue];
|
u32 tx_coal_timer = priv->tx_coal_timer[queue];
|
||||||
|
@ -18,7 +18,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
@@ -2551,9 +2551,13 @@ static void stmmac_bump_dma_threshold(st
|
@@ -2536,9 +2536,13 @@ static void stmmac_bump_dma_threshold(st
|
||||||
* @priv: driver private structure
|
* @priv: driver private structure
|
||||||
* @budget: napi budget limiting this functions packet handling
|
* @budget: napi budget limiting this functions packet handling
|
||||||
* @queue: TX queue index
|
* @queue: TX queue index
|
||||||
@ -33,7 +33,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
{
|
{
|
||||||
struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue];
|
struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue];
|
||||||
struct stmmac_txq_stats *txq_stats = &priv->xstats.txq_stats[queue];
|
struct stmmac_txq_stats *txq_stats = &priv->xstats.txq_stats[queue];
|
||||||
@@ -2713,7 +2717,7 @@ static int stmmac_tx_clean(struct stmmac
|
@@ -2698,7 +2702,7 @@ static int stmmac_tx_clean(struct stmmac
|
||||||
|
|
||||||
/* We still have pending packets, let's call for a new scheduling */
|
/* We still have pending packets, let's call for a new scheduling */
|
||||||
if (tx_q->dirty_tx != tx_q->cur_tx)
|
if (tx_q->dirty_tx != tx_q->cur_tx)
|
||||||
@ -42,7 +42,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
u64_stats_update_begin(&txq_stats->napi_syncp);
|
u64_stats_update_begin(&txq_stats->napi_syncp);
|
||||||
u64_stats_add(&txq_stats->napi.tx_packets, tx_packets);
|
u64_stats_add(&txq_stats->napi.tx_packets, tx_packets);
|
||||||
@@ -5605,6 +5609,7 @@ static int stmmac_napi_poll_tx(struct na
|
@@ -5590,6 +5594,7 @@ static int stmmac_napi_poll_tx(struct na
|
||||||
container_of(napi, struct stmmac_channel, tx_napi);
|
container_of(napi, struct stmmac_channel, tx_napi);
|
||||||
struct stmmac_priv *priv = ch->priv_data;
|
struct stmmac_priv *priv = ch->priv_data;
|
||||||
struct stmmac_txq_stats *txq_stats;
|
struct stmmac_txq_stats *txq_stats;
|
||||||
@ -50,7 +50,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
u32 chan = ch->index;
|
u32 chan = ch->index;
|
||||||
int work_done;
|
int work_done;
|
||||||
|
|
||||||
@@ -5613,7 +5618,7 @@ static int stmmac_napi_poll_tx(struct na
|
@@ -5598,7 +5603,7 @@ static int stmmac_napi_poll_tx(struct na
|
||||||
u64_stats_inc(&txq_stats->napi.poll);
|
u64_stats_inc(&txq_stats->napi.poll);
|
||||||
u64_stats_update_end(&txq_stats->napi_syncp);
|
u64_stats_update_end(&txq_stats->napi_syncp);
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
work_done = min(work_done, budget);
|
work_done = min(work_done, budget);
|
||||||
|
|
||||||
if (work_done < budget && napi_complete_done(napi, work_done)) {
|
if (work_done < budget && napi_complete_done(napi, work_done)) {
|
||||||
@@ -5624,6 +5629,10 @@ static int stmmac_napi_poll_tx(struct na
|
@@ -5609,6 +5614,10 @@ static int stmmac_napi_poll_tx(struct na
|
||||||
spin_unlock_irqrestore(&ch->lock, flags);
|
spin_unlock_irqrestore(&ch->lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
return work_done;
|
return work_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5632,6 +5641,7 @@ static int stmmac_napi_poll_rxtx(struct
|
@@ -5617,6 +5626,7 @@ static int stmmac_napi_poll_rxtx(struct
|
||||||
struct stmmac_channel *ch =
|
struct stmmac_channel *ch =
|
||||||
container_of(napi, struct stmmac_channel, rxtx_napi);
|
container_of(napi, struct stmmac_channel, rxtx_napi);
|
||||||
struct stmmac_priv *priv = ch->priv_data;
|
struct stmmac_priv *priv = ch->priv_data;
|
||||||
@ -78,7 +78,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
int rx_done, tx_done, rxtx_done;
|
int rx_done, tx_done, rxtx_done;
|
||||||
struct stmmac_rxq_stats *rxq_stats;
|
struct stmmac_rxq_stats *rxq_stats;
|
||||||
struct stmmac_txq_stats *txq_stats;
|
struct stmmac_txq_stats *txq_stats;
|
||||||
@@ -5647,7 +5657,7 @@ static int stmmac_napi_poll_rxtx(struct
|
@@ -5632,7 +5642,7 @@ static int stmmac_napi_poll_rxtx(struct
|
||||||
u64_stats_inc(&txq_stats->napi.poll);
|
u64_stats_inc(&txq_stats->napi.poll);
|
||||||
u64_stats_update_end(&txq_stats->napi_syncp);
|
u64_stats_update_end(&txq_stats->napi_syncp);
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
tx_done = min(tx_done, budget);
|
tx_done = min(tx_done, budget);
|
||||||
|
|
||||||
rx_done = stmmac_rx_zc(priv, budget, chan);
|
rx_done = stmmac_rx_zc(priv, budget, chan);
|
||||||
@@ -5672,6 +5682,10 @@ static int stmmac_napi_poll_rxtx(struct
|
@@ -5657,6 +5667,10 @@ static int stmmac_napi_poll_rxtx(struct
|
||||||
spin_unlock_irqrestore(&ch->lock, flags);
|
spin_unlock_irqrestore(&ch->lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -3021,15 +3021,6 @@ static void mt753x_phylink_mac_link_down
|
@@ -3037,15 +3037,6 @@ static void mt753x_phylink_mac_link_down
|
||||||
mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
|
mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port,
|
static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port,
|
||||||
unsigned int mode,
|
unsigned int mode,
|
||||||
phy_interface_t interface,
|
phy_interface_t interface,
|
||||||
@@ -3117,8 +3108,6 @@ mt7531_cpu_port_config(struct dsa_switch
|
@@ -3133,8 +3124,6 @@ mt7531_cpu_port_config(struct dsa_switch
|
||||||
return ret;
|
return ret;
|
||||||
mt7530_write(priv, MT7530_PMCR_P(port),
|
mt7530_write(priv, MT7530_PMCR_P(port),
|
||||||
PMCR_CPU_PORT_SETTING(priv->id));
|
PMCR_CPU_PORT_SETTING(priv->id));
|
||||||
|
@ -46,7 +46,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2343,24 +2343,40 @@ mt7530_free_irq_common(struct mt7530_pri
|
@@ -2345,24 +2345,40 @@ mt7530_free_irq_common(struct mt7530_pri
|
||||||
static void
|
static void
|
||||||
mt7530_free_irq(struct mt7530_priv *priv)
|
mt7530_free_irq(struct mt7530_priv *priv)
|
||||||
{
|
{
|
||||||
@ -92,7 +92,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
bus->priv = priv;
|
bus->priv = priv;
|
||||||
bus->name = KBUILD_MODNAME "-mii";
|
bus->name = KBUILD_MODNAME "-mii";
|
||||||
snprintf(bus->id, MII_BUS_ID_SIZE, KBUILD_MODNAME "-%d", idx++);
|
snprintf(bus->id, MII_BUS_ID_SIZE, KBUILD_MODNAME "-%d", idx++);
|
||||||
@@ -2371,16 +2387,18 @@ mt7530_setup_mdio(struct mt7530_priv *pr
|
@@ -2373,16 +2389,18 @@ mt7530_setup_mdio(struct mt7530_priv *pr
|
||||||
bus->parent = dev;
|
bus->parent = dev;
|
||||||
bus->phy_mask = ~ds->phys_mii_mask;
|
bus->phy_mask = ~ds->phys_mii_mask;
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
/* Add the CPU port to the CPU port bitmap for MT7531 and the switch on
|
/* Add the CPU port to the CPU port bitmap for MT7531 and the switch on
|
||||||
* the MT7988 SoC. Trapped frames will be forwarded to the CPU port that
|
* the MT7988 SoC. Trapped frames will be forwarded to the CPU port that
|
||||||
* is affine to the inbound user port.
|
* is affine to the inbound user port.
|
||||||
@@ -3289,6 +3285,36 @@ static int mt753x_set_mac_eee(struct dsa
|
@@ -3305,6 +3301,36 @@ static int mt753x_set_mac_eee(struct dsa
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
static int mt7988_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
|
static int mt7988_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
@@ -3344,6 +3370,7 @@ const struct dsa_switch_ops mt7530_switc
|
@@ -3360,6 +3386,7 @@ const struct dsa_switch_ops mt7530_switc
|
||||||
.phylink_mac_link_up = mt753x_phylink_mac_link_up,
|
.phylink_mac_link_up = mt753x_phylink_mac_link_up,
|
||||||
.get_mac_eee = mt753x_get_mac_eee,
|
.get_mac_eee = mt753x_get_mac_eee,
|
||||||
.set_mac_eee = mt753x_set_mac_eee,
|
.set_mac_eee = mt753x_set_mac_eee,
|
||||||
@ -96,7 +96,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.h
|
--- a/drivers/net/dsa/mt7530.h
|
||||||
+++ b/drivers/net/dsa/mt7530.h
|
+++ b/drivers/net/dsa/mt7530.h
|
||||||
@@ -41,8 +41,8 @@ enum mt753x_id {
|
@@ -45,8 +45,8 @@ enum mt753x_id {
|
||||||
#define UNU_FFP(x) (((x) & 0xff) << 8)
|
#define UNU_FFP(x) (((x) & 0xff) << 8)
|
||||||
#define UNU_FFP_MASK UNU_FFP(~0)
|
#define UNU_FFP_MASK UNU_FFP(~0)
|
||||||
#define CPU_EN BIT(7)
|
#define CPU_EN BIT(7)
|
||||||
@ -107,7 +107,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
#define MIRROR_EN BIT(3)
|
#define MIRROR_EN BIT(3)
|
||||||
#define MIRROR_PORT(x) ((x) & 0x7)
|
#define MIRROR_PORT(x) ((x) & 0x7)
|
||||||
#define MIRROR_MASK 0x7
|
#define MIRROR_MASK 0x7
|
||||||
@@ -785,6 +785,7 @@ struct mt753x_info {
|
@@ -790,6 +790,7 @@ struct mt753x_info {
|
||||||
* @irq_domain: IRQ domain of the switch irq_chip
|
* @irq_domain: IRQ domain of the switch irq_chip
|
||||||
* @irq_enable: IRQ enable bits, synced to SYS_INT_EN
|
* @irq_enable: IRQ enable bits, synced to SYS_INT_EN
|
||||||
* @create_sgmii: Pointer to function creating SGMII PCS instance(s)
|
* @create_sgmii: Pointer to function creating SGMII PCS instance(s)
|
||||||
@ -115,7 +115,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
*/
|
*/
|
||||||
struct mt7530_priv {
|
struct mt7530_priv {
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
@@ -811,6 +812,7 @@ struct mt7530_priv {
|
@@ -816,6 +817,7 @@ struct mt7530_priv {
|
||||||
struct irq_domain *irq_domain;
|
struct irq_domain *irq_domain;
|
||||||
u32 irq_enable;
|
u32 irq_enable;
|
||||||
int (*create_sgmii)(struct mt7530_priv *priv, bool dual_sgmii);
|
int (*create_sgmii)(struct mt7530_priv *priv, bool dual_sgmii);
|
||||||
|
@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.h
|
--- a/drivers/net/dsa/mt7530.h
|
||||||
+++ b/drivers/net/dsa/mt7530.h
|
+++ b/drivers/net/dsa/mt7530.h
|
||||||
@@ -708,7 +708,7 @@ struct mt7530_port {
|
@@ -713,7 +713,7 @@ struct mt7530_port {
|
||||||
|
|
||||||
/* Port 5 interface select definitions */
|
/* Port 5 interface select definitions */
|
||||||
enum p5_interface_select {
|
enum p5_interface_select {
|
||||||
@ -34,7 +34,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
P5_INTF_SEL_PHY_P0,
|
P5_INTF_SEL_PHY_P0,
|
||||||
P5_INTF_SEL_PHY_P4,
|
P5_INTF_SEL_PHY_P4,
|
||||||
P5_INTF_SEL_GMAC5,
|
P5_INTF_SEL_GMAC5,
|
||||||
@@ -801,7 +801,7 @@ struct mt7530_priv {
|
@@ -806,7 +806,7 @@ struct mt7530_priv {
|
||||||
bool mcm;
|
bool mcm;
|
||||||
phy_interface_t p6_interface;
|
phy_interface_t p6_interface;
|
||||||
phy_interface_t p5_interface;
|
phy_interface_t p5_interface;
|
||||||
|
@ -100,7 +100,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
default:
|
default:
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
@@ -2685,6 +2671,12 @@ mt7531_setup(struct dsa_switch *ds)
|
@@ -2694,6 +2680,12 @@ mt7531_setup(struct dsa_switch *ds)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
/* all MACs must be forced link-down before sw reset */
|
/* all MACs must be forced link-down before sw reset */
|
||||||
for (i = 0; i < MT7530_NUM_PORTS; i++)
|
for (i = 0; i < MT7530_NUM_PORTS; i++)
|
||||||
mt7530_write(priv, MT7530_PMCR_P(i), MT7531_FORCE_LNK);
|
mt7530_write(priv, MT7530_PMCR_P(i), MT7531_FORCE_LNK);
|
||||||
@@ -2694,21 +2686,18 @@ mt7531_setup(struct dsa_switch *ds)
|
@@ -2703,21 +2695,18 @@ mt7531_setup(struct dsa_switch *ds)
|
||||||
SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST |
|
SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST |
|
||||||
SYS_CTRL_REG_RST);
|
SYS_CTRL_REG_RST);
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
mt7530_rmw(priv, MT7531_GPIO_MODE0, MT7531_GPIO0_MASK,
|
mt7530_rmw(priv, MT7531_GPIO_MODE0, MT7531_GPIO0_MASK,
|
||||||
MT7531_GPIO0_INTERRUPT);
|
MT7531_GPIO0_INTERRUPT);
|
||||||
@@ -2768,11 +2757,6 @@ static void mt7530_mac_port_get_caps(str
|
@@ -2784,11 +2773,6 @@ static void mt7530_mac_port_get_caps(str
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
static void mt7531_mac_port_get_caps(struct dsa_switch *ds, int port,
|
static void mt7531_mac_port_get_caps(struct dsa_switch *ds, int port,
|
||||||
struct phylink_config *config)
|
struct phylink_config *config)
|
||||||
{
|
{
|
||||||
@@ -2785,7 +2769,7 @@ static void mt7531_mac_port_get_caps(str
|
@@ -2801,7 +2785,7 @@ static void mt7531_mac_port_get_caps(str
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5: /* 2nd cpu port supports either rgmii or sgmii/8023z */
|
case 5: /* 2nd cpu port supports either rgmii or sgmii/8023z */
|
||||||
@ -162,7 +162,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
phy_interface_set_rgmii(config->supported_interfaces);
|
phy_interface_set_rgmii(config->supported_interfaces);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2852,7 +2836,7 @@ static int mt7531_rgmii_setup(struct mt7
|
@@ -2868,7 +2852,7 @@ static int mt7531_rgmii_setup(struct mt7
|
||||||
{
|
{
|
||||||
u32 val;
|
u32 val;
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
dev_err(priv->dev, "RGMII mode is not available for port %d\n",
|
dev_err(priv->dev, "RGMII mode is not available for port %d\n",
|
||||||
port);
|
port);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@@ -3095,7 +3079,7 @@ mt7531_cpu_port_config(struct dsa_switch
|
@@ -3111,7 +3095,7 @@ mt7531_cpu_port_config(struct dsa_switch
|
||||||
|
|
||||||
switch (port) {
|
switch (port) {
|
||||||
case 5:
|
case 5:
|
||||||
@ -180,7 +180,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
interface = PHY_INTERFACE_MODE_RGMII;
|
interface = PHY_INTERFACE_MODE_RGMII;
|
||||||
else
|
else
|
||||||
interface = PHY_INTERFACE_MODE_2500BASEX;
|
interface = PHY_INTERFACE_MODE_2500BASEX;
|
||||||
@@ -3247,7 +3231,7 @@ mt753x_setup(struct dsa_switch *ds)
|
@@ -3263,7 +3247,7 @@ mt753x_setup(struct dsa_switch *ds)
|
||||||
mt7530_free_irq_common(priv);
|
mt7530_free_irq_common(priv);
|
||||||
|
|
||||||
if (priv->create_sgmii) {
|
if (priv->create_sgmii) {
|
||||||
@ -191,7 +191,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
--- a/drivers/net/dsa/mt7530.h
|
--- a/drivers/net/dsa/mt7530.h
|
||||||
+++ b/drivers/net/dsa/mt7530.h
|
+++ b/drivers/net/dsa/mt7530.h
|
||||||
@@ -712,7 +712,6 @@ enum p5_interface_select {
|
@@ -717,7 +717,6 @@ enum p5_interface_select {
|
||||||
P5_INTF_SEL_PHY_P0,
|
P5_INTF_SEL_PHY_P0,
|
||||||
P5_INTF_SEL_PHY_P4,
|
P5_INTF_SEL_PHY_P4,
|
||||||
P5_INTF_SEL_GMAC5,
|
P5_INTF_SEL_GMAC5,
|
||||||
@ -199,7 +199,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct mt7530_priv;
|
struct mt7530_priv;
|
||||||
@@ -781,6 +780,8 @@ struct mt753x_info {
|
@@ -786,6 +785,8 @@ struct mt753x_info {
|
||||||
* registers
|
* registers
|
||||||
* @p6_interface Holding the current port 6 interface
|
* @p6_interface Holding the current port 6 interface
|
||||||
* @p5_intf_sel: Holding the current port 5 interface select
|
* @p5_intf_sel: Holding the current port 5 interface select
|
||||||
@ -208,7 +208,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
* @irq: IRQ number of the switch
|
* @irq: IRQ number of the switch
|
||||||
* @irq_domain: IRQ domain of the switch irq_chip
|
* @irq_domain: IRQ domain of the switch irq_chip
|
||||||
* @irq_enable: IRQ enable bits, synced to SYS_INT_EN
|
* @irq_enable: IRQ enable bits, synced to SYS_INT_EN
|
||||||
@@ -802,6 +803,7 @@ struct mt7530_priv {
|
@@ -807,6 +808,7 @@ struct mt7530_priv {
|
||||||
phy_interface_t p6_interface;
|
phy_interface_t p6_interface;
|
||||||
phy_interface_t p5_interface;
|
phy_interface_t p5_interface;
|
||||||
enum p5_interface_select p5_intf_sel;
|
enum p5_interface_select p5_intf_sel;
|
||||||
@ -216,7 +216,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
u8 mirror_rx;
|
u8 mirror_rx;
|
||||||
u8 mirror_tx;
|
u8 mirror_tx;
|
||||||
struct mt7530_port ports[MT7530_NUM_PORTS];
|
struct mt7530_port ports[MT7530_NUM_PORTS];
|
||||||
@@ -811,7 +813,7 @@ struct mt7530_priv {
|
@@ -816,7 +818,7 @@ struct mt7530_priv {
|
||||||
int irq;
|
int irq;
|
||||||
struct irq_domain *irq_domain;
|
struct irq_domain *irq_domain;
|
||||||
u32 irq_enable;
|
u32 irq_enable;
|
||||||
|
@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2735,12 +2735,14 @@ static void mt7530_mac_port_get_caps(str
|
@@ -2751,12 +2751,14 @@ static void mt7530_mac_port_get_caps(str
|
||||||
struct phylink_config *config)
|
struct phylink_config *config)
|
||||||
{
|
{
|
||||||
switch (port) {
|
switch (port) {
|
||||||
@ -54,7 +54,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
phy_interface_set_rgmii(config->supported_interfaces);
|
phy_interface_set_rgmii(config->supported_interfaces);
|
||||||
__set_bit(PHY_INTERFACE_MODE_MII,
|
__set_bit(PHY_INTERFACE_MODE_MII,
|
||||||
config->supported_interfaces);
|
config->supported_interfaces);
|
||||||
@@ -2748,7 +2750,8 @@ static void mt7530_mac_port_get_caps(str
|
@@ -2764,7 +2766,8 @@ static void mt7530_mac_port_get_caps(str
|
||||||
config->supported_interfaces);
|
config->supported_interfaces);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
__set_bit(PHY_INTERFACE_MODE_RGMII,
|
__set_bit(PHY_INTERFACE_MODE_RGMII,
|
||||||
config->supported_interfaces);
|
config->supported_interfaces);
|
||||||
__set_bit(PHY_INTERFACE_MODE_TRGMII,
|
__set_bit(PHY_INTERFACE_MODE_TRGMII,
|
||||||
@@ -2763,19 +2766,24 @@ static void mt7531_mac_port_get_caps(str
|
@@ -2779,19 +2782,24 @@ static void mt7531_mac_port_get_caps(str
|
||||||
struct mt7530_priv *priv = ds->priv;
|
struct mt7530_priv *priv = ds->priv;
|
||||||
|
|
||||||
switch (port) {
|
switch (port) {
|
||||||
@ -92,7 +92,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
__set_bit(PHY_INTERFACE_MODE_SGMII,
|
__set_bit(PHY_INTERFACE_MODE_SGMII,
|
||||||
config->supported_interfaces);
|
config->supported_interfaces);
|
||||||
__set_bit(PHY_INTERFACE_MODE_1000BASEX,
|
__set_bit(PHY_INTERFACE_MODE_1000BASEX,
|
||||||
@@ -2794,11 +2802,13 @@ static void mt7988_mac_port_get_caps(str
|
@@ -2810,11 +2818,13 @@ static void mt7988_mac_port_get_caps(str
|
||||||
phy_interface_zero(config->supported_interfaces);
|
phy_interface_zero(config->supported_interfaces);
|
||||||
|
|
||||||
switch (port) {
|
switch (port) {
|
||||||
@ -107,7 +107,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
case 6:
|
case 6:
|
||||||
__set_bit(PHY_INTERFACE_MODE_INTERNAL,
|
__set_bit(PHY_INTERFACE_MODE_INTERNAL,
|
||||||
config->supported_interfaces);
|
config->supported_interfaces);
|
||||||
@@ -2962,12 +2972,12 @@ mt753x_phylink_mac_config(struct dsa_swi
|
@@ -2978,12 +2988,12 @@ mt753x_phylink_mac_config(struct dsa_swi
|
||||||
u32 mcr_cur, mcr_new;
|
u32 mcr_cur, mcr_new;
|
||||||
|
|
||||||
switch (port) {
|
switch (port) {
|
||||||
@ -122,7 +122,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
if (priv->p5_interface == state->interface)
|
if (priv->p5_interface == state->interface)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2977,7 +2987,7 @@ mt753x_phylink_mac_config(struct dsa_swi
|
@@ -2993,7 +3003,7 @@ mt753x_phylink_mac_config(struct dsa_swi
|
||||||
if (priv->p5_intf_sel != P5_DISABLED)
|
if (priv->p5_intf_sel != P5_DISABLED)
|
||||||
priv->p5_interface = state->interface;
|
priv->p5_interface = state->interface;
|
||||||
break;
|
break;
|
||||||
|
@ -52,7 +52,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2523,16 +2523,15 @@ mt7530_setup(struct dsa_switch *ds)
|
@@ -2529,16 +2529,15 @@ mt7530_setup(struct dsa_switch *ds)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* Setup port 5 */
|
/* Setup port 5 */
|
||||||
@ -75,7 +75,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
for_each_child_of_node(dn, mac_np) {
|
for_each_child_of_node(dn, mac_np) {
|
||||||
if (!of_device_is_compatible(mac_np,
|
if (!of_device_is_compatible(mac_np,
|
||||||
"mediatek,eth-mac"))
|
"mediatek,eth-mac"))
|
||||||
@@ -2563,6 +2562,8 @@ mt7530_setup(struct dsa_switch *ds)
|
@@ -2569,6 +2568,8 @@ mt7530_setup(struct dsa_switch *ds)
|
||||||
of_node_put(phy_node);
|
of_node_put(phy_node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_GPIOLIB
|
#ifdef CONFIG_GPIOLIB
|
||||||
@@ -2573,8 +2574,6 @@ mt7530_setup(struct dsa_switch *ds)
|
@@ -2579,8 +2580,6 @@ mt7530_setup(struct dsa_switch *ds)
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_GPIOLIB */
|
#endif /* CONFIG_GPIOLIB */
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
default:
|
default:
|
||||||
dev_err(ds->dev, "Unsupported p5_intf_sel %d\n",
|
dev_err(ds->dev, "Unsupported p5_intf_sel %d\n",
|
||||||
priv->p5_intf_sel);
|
priv->p5_intf_sel);
|
||||||
@@ -2528,8 +2525,6 @@ mt7530_setup(struct dsa_switch *ds)
|
@@ -2534,8 +2531,6 @@ mt7530_setup(struct dsa_switch *ds)
|
||||||
* Set priv->p5_intf_sel to the appropriate value if PHY muxing
|
* Set priv->p5_intf_sel to the appropriate value if PHY muxing
|
||||||
* is detected.
|
* is detected.
|
||||||
*/
|
*/
|
||||||
@ -49,7 +49,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
for_each_child_of_node(dn, mac_np) {
|
for_each_child_of_node(dn, mac_np) {
|
||||||
if (!of_device_is_compatible(mac_np,
|
if (!of_device_is_compatible(mac_np,
|
||||||
"mediatek,eth-mac"))
|
"mediatek,eth-mac"))
|
||||||
@@ -2561,7 +2556,9 @@ mt7530_setup(struct dsa_switch *ds)
|
@@ -2567,7 +2562,9 @@ mt7530_setup(struct dsa_switch *ds)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
switch (interface) {
|
switch (interface) {
|
||||||
case PHY_INTERFACE_MODE_RGMII:
|
case PHY_INTERFACE_MODE_RGMII:
|
||||||
trgint = 0;
|
trgint = 0;
|
||||||
@@ -2456,6 +2449,12 @@ mt7530_setup(struct dsa_switch *ds)
|
@@ -2458,6 +2451,12 @@ mt7530_setup(struct dsa_switch *ds)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2810,11 +2814,10 @@ mt7530_mac_config(struct dsa_switch *ds,
|
@@ -2826,11 +2830,10 @@ mt7530_mac_config(struct dsa_switch *ds,
|
||||||
{
|
{
|
||||||
struct mt7530_priv *priv = ds->priv;
|
struct mt7530_priv *priv = ds->priv;
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
static void
|
static void
|
||||||
mt7531_pll_setup(struct mt7530_priv *priv)
|
mt7531_pll_setup(struct mt7530_priv *priv)
|
||||||
{
|
{
|
||||||
@@ -2801,14 +2789,6 @@ static void mt7988_mac_port_get_caps(str
|
@@ -2817,14 +2805,6 @@ static void mt7988_mac_port_get_caps(str
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
mt7530_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
|
mt7530_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
|
||||||
phy_interface_t interface)
|
phy_interface_t interface)
|
||||||
{
|
{
|
||||||
@@ -2973,8 +2953,6 @@ mt753x_phylink_mac_config(struct dsa_swi
|
@@ -2989,8 +2969,6 @@ mt753x_phylink_mac_config(struct dsa_swi
|
||||||
if (priv->p6_interface == state->interface)
|
if (priv->p6_interface == state->interface)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
if (mt753x_mac_config(ds, port, mode, state) < 0)
|
if (mt753x_mac_config(ds, port, mode, state) < 0)
|
||||||
goto unsupported;
|
goto unsupported;
|
||||||
|
|
||||||
@@ -3291,11 +3269,6 @@ mt753x_conduit_state_change(struct dsa_s
|
@@ -3307,11 +3285,6 @@ mt753x_conduit_state_change(struct dsa_s
|
||||||
mt7530_rmw(priv, MT7530_MFC, CPU_EN | CPU_PORT_MASK, val);
|
mt7530_rmw(priv, MT7530_MFC, CPU_EN | CPU_PORT_MASK, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
static int mt7988_setup(struct dsa_switch *ds)
|
static int mt7988_setup(struct dsa_switch *ds)
|
||||||
{
|
{
|
||||||
struct mt7530_priv *priv = ds->priv;
|
struct mt7530_priv *priv = ds->priv;
|
||||||
@@ -3359,7 +3332,6 @@ const struct mt753x_info mt753x_table[]
|
@@ -3375,7 +3348,6 @@ const struct mt753x_info mt753x_table[]
|
||||||
.phy_write_c22 = mt7530_phy_write_c22,
|
.phy_write_c22 = mt7530_phy_write_c22,
|
||||||
.phy_read_c45 = mt7530_phy_read_c45,
|
.phy_read_c45 = mt7530_phy_read_c45,
|
||||||
.phy_write_c45 = mt7530_phy_write_c45,
|
.phy_write_c45 = mt7530_phy_write_c45,
|
||||||
@ -91,7 +91,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
.mac_port_get_caps = mt7530_mac_port_get_caps,
|
.mac_port_get_caps = mt7530_mac_port_get_caps,
|
||||||
.mac_port_config = mt7530_mac_config,
|
.mac_port_config = mt7530_mac_config,
|
||||||
},
|
},
|
||||||
@@ -3371,7 +3343,6 @@ const struct mt753x_info mt753x_table[]
|
@@ -3387,7 +3359,6 @@ const struct mt753x_info mt753x_table[]
|
||||||
.phy_write_c22 = mt7530_phy_write_c22,
|
.phy_write_c22 = mt7530_phy_write_c22,
|
||||||
.phy_read_c45 = mt7530_phy_read_c45,
|
.phy_read_c45 = mt7530_phy_read_c45,
|
||||||
.phy_write_c45 = mt7530_phy_write_c45,
|
.phy_write_c45 = mt7530_phy_write_c45,
|
||||||
@ -99,7 +99,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
.mac_port_get_caps = mt7530_mac_port_get_caps,
|
.mac_port_get_caps = mt7530_mac_port_get_caps,
|
||||||
.mac_port_config = mt7530_mac_config,
|
.mac_port_config = mt7530_mac_config,
|
||||||
},
|
},
|
||||||
@@ -3383,7 +3354,6 @@ const struct mt753x_info mt753x_table[]
|
@@ -3399,7 +3370,6 @@ const struct mt753x_info mt753x_table[]
|
||||||
.phy_write_c22 = mt7531_ind_c22_phy_write,
|
.phy_write_c22 = mt7531_ind_c22_phy_write,
|
||||||
.phy_read_c45 = mt7531_ind_c45_phy_read,
|
.phy_read_c45 = mt7531_ind_c45_phy_read,
|
||||||
.phy_write_c45 = mt7531_ind_c45_phy_write,
|
.phy_write_c45 = mt7531_ind_c45_phy_write,
|
||||||
@ -107,7 +107,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
.cpu_port_config = mt7531_cpu_port_config,
|
.cpu_port_config = mt7531_cpu_port_config,
|
||||||
.mac_port_get_caps = mt7531_mac_port_get_caps,
|
.mac_port_get_caps = mt7531_mac_port_get_caps,
|
||||||
.mac_port_config = mt7531_mac_config,
|
.mac_port_config = mt7531_mac_config,
|
||||||
@@ -3396,7 +3366,6 @@ const struct mt753x_info mt753x_table[]
|
@@ -3412,7 +3382,6 @@ const struct mt753x_info mt753x_table[]
|
||||||
.phy_write_c22 = mt7531_ind_c22_phy_write,
|
.phy_write_c22 = mt7531_ind_c22_phy_write,
|
||||||
.phy_read_c45 = mt7531_ind_c45_phy_read,
|
.phy_read_c45 = mt7531_ind_c45_phy_read,
|
||||||
.phy_write_c45 = mt7531_ind_c45_phy_write,
|
.phy_write_c45 = mt7531_ind_c45_phy_write,
|
||||||
@ -115,7 +115,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
.cpu_port_config = mt7988_cpu_port_config,
|
.cpu_port_config = mt7988_cpu_port_config,
|
||||||
.mac_port_get_caps = mt7988_mac_port_get_caps,
|
.mac_port_get_caps = mt7988_mac_port_get_caps,
|
||||||
.mac_port_config = mt7988_mac_config,
|
.mac_port_config = mt7988_mac_config,
|
||||||
@@ -3426,9 +3395,8 @@ mt7530_probe_common(struct mt7530_priv *
|
@@ -3442,9 +3411,8 @@ mt7530_probe_common(struct mt7530_priv *
|
||||||
/* Sanity check if these required device operations are filled
|
/* Sanity check if these required device operations are filled
|
||||||
* properly.
|
* properly.
|
||||||
*/
|
*/
|
||||||
@ -129,7 +129,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.h
|
--- a/drivers/net/dsa/mt7530.h
|
||||||
+++ b/drivers/net/dsa/mt7530.h
|
+++ b/drivers/net/dsa/mt7530.h
|
||||||
@@ -729,8 +729,6 @@ struct mt753x_pcs {
|
@@ -734,8 +734,6 @@ struct mt753x_pcs {
|
||||||
* @phy_write_c22: Holding the way writing PHY port using C22
|
* @phy_write_c22: Holding the way writing PHY port using C22
|
||||||
* @phy_read_c45: Holding the way reading PHY port using C45
|
* @phy_read_c45: Holding the way reading PHY port using C45
|
||||||
* @phy_write_c45: Holding the way writing PHY port using C45
|
* @phy_write_c45: Holding the way writing PHY port using C45
|
||||||
@ -138,7 +138,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
* @phy_mode_supported: Check if the PHY type is being supported on a certain
|
* @phy_mode_supported: Check if the PHY type is being supported on a certain
|
||||||
* port
|
* port
|
||||||
* @mac_port_validate: Holding the way to set addition validate type for a
|
* @mac_port_validate: Holding the way to set addition validate type for a
|
||||||
@@ -751,7 +749,6 @@ struct mt753x_info {
|
@@ -756,7 +754,6 @@ struct mt753x_info {
|
||||||
int regnum);
|
int regnum);
|
||||||
int (*phy_write_c45)(struct mt7530_priv *priv, int port, int devad,
|
int (*phy_write_c45)(struct mt7530_priv *priv, int port, int devad,
|
||||||
int regnum, u16 val);
|
int regnum, u16 val);
|
||||||
|
@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2774,7 +2774,7 @@ static void mt7988_mac_port_get_caps(str
|
@@ -2790,7 +2790,7 @@ static void mt7988_mac_port_get_caps(str
|
||||||
|
|
||||||
switch (port) {
|
switch (port) {
|
||||||
/* Ports which are connected to switch PHYs. There is no MII pinout. */
|
/* Ports which are connected to switch PHYs. There is no MII pinout. */
|
||||||
|
@ -27,7 +27,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2770,8 +2770,6 @@ static void mt7531_mac_port_get_caps(str
|
@@ -2786,8 +2786,6 @@ static void mt7531_mac_port_get_caps(str
|
||||||
static void mt7988_mac_port_get_caps(struct dsa_switch *ds, int port,
|
static void mt7988_mac_port_get_caps(struct dsa_switch *ds, int port,
|
||||||
struct phylink_config *config)
|
struct phylink_config *config)
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2853,17 +2853,6 @@ static bool mt753x_is_mac_port(u32 port)
|
@@ -2869,17 +2869,6 @@ static bool mt753x_is_mac_port(u32 port)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -51,7 +51,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
|
mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
|
||||||
phy_interface_t interface)
|
phy_interface_t interface)
|
||||||
{
|
{
|
||||||
@@ -2903,6 +2892,9 @@ mt753x_mac_config(struct dsa_switch *ds,
|
@@ -2919,6 +2908,9 @@ mt753x_mac_config(struct dsa_switch *ds,
|
||||||
{
|
{
|
||||||
struct mt7530_priv *priv = ds->priv;
|
struct mt7530_priv *priv = ds->priv;
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
return priv->info->mac_port_config(ds, port, mode, state->interface);
|
return priv->info->mac_port_config(ds, port, mode, state->interface);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3366,7 +3358,6 @@ const struct mt753x_info mt753x_table[]
|
@@ -3382,7 +3374,6 @@ const struct mt753x_info mt753x_table[]
|
||||||
.phy_write_c45 = mt7531_ind_c45_phy_write,
|
.phy_write_c45 = mt7531_ind_c45_phy_write,
|
||||||
.cpu_port_config = mt7988_cpu_port_config,
|
.cpu_port_config = mt7988_cpu_port_config,
|
||||||
.mac_port_get_caps = mt7988_mac_port_get_caps,
|
.mac_port_get_caps = mt7988_mac_port_get_caps,
|
||||||
@ -69,7 +69,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
EXPORT_SYMBOL_GPL(mt753x_table);
|
EXPORT_SYMBOL_GPL(mt753x_table);
|
||||||
@@ -3394,8 +3385,7 @@ mt7530_probe_common(struct mt7530_priv *
|
@@ -3410,8 +3401,7 @@ mt7530_probe_common(struct mt7530_priv *
|
||||||
* properly.
|
* properly.
|
||||||
*/
|
*/
|
||||||
if (!priv->info->sw_setup || !priv->info->phy_read_c22 ||
|
if (!priv->info->sw_setup || !priv->info->phy_read_c22 ||
|
||||||
|
@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2252,7 +2252,7 @@ mt7530_setup_irq(struct mt7530_priv *pri
|
@@ -2254,7 +2254,7 @@ mt7530_setup_irq(struct mt7530_priv *pri
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This register must be set for MT7530 to properly fire interrupts */
|
/* This register must be set for MT7530 to properly fire interrupts */
|
||||||
|
@ -22,7 +22,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2648,14 +2648,12 @@ mt7531_setup(struct dsa_switch *ds)
|
@@ -2657,14 +2657,12 @@ mt7531_setup(struct dsa_switch *ds)
|
||||||
val = mt7530_read(priv, MT7531_TOP_SIG_SR);
|
val = mt7530_read(priv, MT7531_TOP_SIG_SR);
|
||||||
priv->p5_sgmii = !!(val & PAD_DUAL_SGMII_EN);
|
priv->p5_sgmii = !!(val & PAD_DUAL_SGMII_EN);
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2784,7 +2784,7 @@ static void mt7988_mac_port_get_caps(str
|
@@ -2800,7 +2800,7 @@ static void mt7988_mac_port_get_caps(str
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
mt7530_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
|
mt7530_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
|
||||||
phy_interface_t interface)
|
phy_interface_t interface)
|
||||||
{
|
{
|
||||||
@@ -2794,22 +2794,14 @@ mt7530_mac_config(struct dsa_switch *ds,
|
@@ -2810,22 +2810,14 @@ mt7530_mac_config(struct dsa_switch *ds,
|
||||||
mt7530_setup_port5(priv->ds, interface);
|
mt7530_setup_port5(priv->ds, interface);
|
||||||
else if (port == 6)
|
else if (port == 6)
|
||||||
mt7530_setup_port6(priv->ds, interface);
|
mt7530_setup_port6(priv->ds, interface);
|
||||||
@ -71,7 +71,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
val = mt7530_read(priv, MT7531_CLKGEN_CTRL);
|
val = mt7530_read(priv, MT7531_CLKGEN_CTRL);
|
||||||
val |= GP_CLK_EN;
|
val |= GP_CLK_EN;
|
||||||
val &= ~GP_MODE_MASK;
|
val &= ~GP_MODE_MASK;
|
||||||
@@ -2837,20 +2829,14 @@ static int mt7531_rgmii_setup(struct mt7
|
@@ -2853,20 +2845,14 @@ static int mt7531_rgmii_setup(struct mt7
|
||||||
case PHY_INTERFACE_MODE_RGMII_ID:
|
case PHY_INTERFACE_MODE_RGMII_ID:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -95,7 +95,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
|
mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
|
||||||
phy_interface_t interface)
|
phy_interface_t interface)
|
||||||
{
|
{
|
||||||
@@ -2858,42 +2844,21 @@ mt7531_mac_config(struct dsa_switch *ds,
|
@@ -2874,42 +2860,21 @@ mt7531_mac_config(struct dsa_switch *ds,
|
||||||
struct phy_device *phydev;
|
struct phy_device *phydev;
|
||||||
struct dsa_port *dp;
|
struct dsa_port *dp;
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct phylink_pcs *
|
static struct phylink_pcs *
|
||||||
@@ -2922,17 +2887,11 @@ mt753x_phylink_mac_config(struct dsa_swi
|
@@ -2938,17 +2903,11 @@ mt753x_phylink_mac_config(struct dsa_swi
|
||||||
u32 mcr_cur, mcr_new;
|
u32 mcr_cur, mcr_new;
|
||||||
|
|
||||||
switch (port) {
|
switch (port) {
|
||||||
@ -162,7 +162,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
if (priv->p5_intf_sel != P5_DISABLED)
|
if (priv->p5_intf_sel != P5_DISABLED)
|
||||||
priv->p5_interface = state->interface;
|
priv->p5_interface = state->interface;
|
||||||
@@ -2941,16 +2900,10 @@ mt753x_phylink_mac_config(struct dsa_swi
|
@@ -2957,16 +2916,10 @@ mt753x_phylink_mac_config(struct dsa_swi
|
||||||
if (priv->p6_interface == state->interface)
|
if (priv->p6_interface == state->interface)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port));
|
mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port));
|
||||||
@@ -3033,7 +2986,6 @@ mt7531_cpu_port_config(struct dsa_switch
|
@@ -3049,7 +3002,6 @@ mt7531_cpu_port_config(struct dsa_switch
|
||||||
struct mt7530_priv *priv = ds->priv;
|
struct mt7530_priv *priv = ds->priv;
|
||||||
phy_interface_t interface;
|
phy_interface_t interface;
|
||||||
int speed;
|
int speed;
|
||||||
@ -188,7 +188,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
switch (port) {
|
switch (port) {
|
||||||
case 5:
|
case 5:
|
||||||
@@ -3058,9 +3010,8 @@ mt7531_cpu_port_config(struct dsa_switch
|
@@ -3074,9 +3026,8 @@ mt7531_cpu_port_config(struct dsa_switch
|
||||||
else
|
else
|
||||||
speed = SPEED_1000;
|
speed = SPEED_1000;
|
||||||
|
|
||||||
@ -202,7 +202,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
mt753x_phylink_mac_link_up(ds, port, MLO_AN_FIXED, interface, NULL,
|
mt753x_phylink_mac_link_up(ds, port, MLO_AN_FIXED, interface, NULL,
|
||||||
--- a/drivers/net/dsa/mt7530.h
|
--- a/drivers/net/dsa/mt7530.h
|
||||||
+++ b/drivers/net/dsa/mt7530.h
|
+++ b/drivers/net/dsa/mt7530.h
|
||||||
@@ -755,9 +755,9 @@ struct mt753x_info {
|
@@ -760,9 +760,9 @@ struct mt753x_info {
|
||||||
void (*mac_port_validate)(struct dsa_switch *ds, int port,
|
void (*mac_port_validate)(struct dsa_switch *ds, int port,
|
||||||
phy_interface_t interface,
|
phy_interface_t interface,
|
||||||
unsigned long *supported);
|
unsigned long *supported);
|
||||||
|
@ -92,10 +92,10 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
- priv->p6_interface = PHY_INTERFACE_MODE_NA;
|
- priv->p6_interface = PHY_INTERFACE_MODE_NA;
|
||||||
-
|
-
|
||||||
mt753x_trap_frames(priv);
|
if ((val & HWTRAP_XTAL_MASK) == HWTRAP_XTAL_40MHZ)
|
||||||
|
mt7530_pll_setup(priv);
|
||||||
|
|
||||||
/* Enable and reset MIB counters */
|
@@ -2477,9 +2465,7 @@ mt7530_setup(struct dsa_switch *ds)
|
||||||
@@ -2474,9 +2462,7 @@ mt7530_setup(struct dsa_switch *ds)
|
|
||||||
mt7530_set(priv, MT7530_PSC_P(i), SA_DIS);
|
mt7530_set(priv, MT7530_PSC_P(i), SA_DIS);
|
||||||
|
|
||||||
if (dsa_is_cpu_port(ds, i)) {
|
if (dsa_is_cpu_port(ds, i)) {
|
||||||
@ -106,7 +106,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
} else {
|
} else {
|
||||||
mt7530_port_disable(ds, i);
|
mt7530_port_disable(ds, i);
|
||||||
|
|
||||||
@@ -2580,9 +2566,7 @@ mt7531_setup_common(struct dsa_switch *d
|
@@ -2586,9 +2572,7 @@ mt7531_setup_common(struct dsa_switch *d
|
||||||
mt7530_set(priv, MT7531_DBG_CNT(i), MT7531_DIS_CLR);
|
mt7530_set(priv, MT7531_DBG_CNT(i), MT7531_DIS_CLR);
|
||||||
|
|
||||||
if (dsa_is_cpu_port(ds, i)) {
|
if (dsa_is_cpu_port(ds, i)) {
|
||||||
@ -117,7 +117,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
} else {
|
} else {
|
||||||
mt7530_port_disable(ds, i);
|
mt7530_port_disable(ds, i);
|
||||||
|
|
||||||
@@ -2671,10 +2655,6 @@ mt7531_setup(struct dsa_switch *ds)
|
@@ -2680,10 +2664,6 @@ mt7531_setup(struct dsa_switch *ds)
|
||||||
mt7530_rmw(priv, MT7531_GPIO_MODE0, MT7531_GPIO0_MASK,
|
mt7530_rmw(priv, MT7531_GPIO_MODE0, MT7531_GPIO0_MASK,
|
||||||
MT7531_GPIO0_INTERRUPT);
|
MT7531_GPIO0_INTERRUPT);
|
||||||
|
|
||||||
@ -125,10 +125,10 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
- priv->p5_interface = PHY_INTERFACE_MODE_NA;
|
- priv->p5_interface = PHY_INTERFACE_MODE_NA;
|
||||||
- priv->p6_interface = PHY_INTERFACE_MODE_NA;
|
- priv->p6_interface = PHY_INTERFACE_MODE_NA;
|
||||||
-
|
-
|
||||||
/* Enable PHY core PLL, since phy_device has not yet been created
|
/* Enable Energy-Efficient Ethernet (EEE) and PHY core PLL, since
|
||||||
* provided for phy_[read,write]_mmd_indirect is called, we provide
|
* phy_device has not yet been created provided for
|
||||||
* our own mt7531_ind_mmd_phy_[read,write] to complete this
|
* phy_[read,write]_mmd_indirect is called, we provide our own
|
||||||
@@ -2886,26 +2866,9 @@ mt753x_phylink_mac_config(struct dsa_swi
|
@@ -2902,26 +2882,9 @@ mt753x_phylink_mac_config(struct dsa_swi
|
||||||
struct mt7530_priv *priv = ds->priv;
|
struct mt7530_priv *priv = ds->priv;
|
||||||
u32 mcr_cur, mcr_new;
|
u32 mcr_cur, mcr_new;
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port));
|
mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port));
|
||||||
mcr_new = mcr_cur;
|
mcr_new = mcr_cur;
|
||||||
mcr_new &= ~PMCR_LINK_SETTINGS_MASK;
|
mcr_new &= ~PMCR_LINK_SETTINGS_MASK;
|
||||||
@@ -2941,17 +2904,10 @@ static void mt753x_phylink_mac_link_up(s
|
@@ -2957,17 +2920,10 @@ static void mt753x_phylink_mac_link_up(s
|
||||||
|
|
||||||
mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK;
|
mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK;
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
mcr |= PMCR_FORCE_SPEED_1000;
|
mcr |= PMCR_FORCE_SPEED_1000;
|
||||||
break;
|
break;
|
||||||
case SPEED_100:
|
case SPEED_100:
|
||||||
@@ -2969,6 +2925,7 @@ static void mt753x_phylink_mac_link_up(s
|
@@ -2985,6 +2941,7 @@ static void mt753x_phylink_mac_link_up(s
|
||||||
if (mode == MLO_AN_PHY && phydev && phy_init_eee(phydev, false) >= 0) {
|
if (mode == MLO_AN_PHY && phydev && phy_init_eee(phydev, false) >= 0) {
|
||||||
switch (speed) {
|
switch (speed) {
|
||||||
case SPEED_1000:
|
case SPEED_1000:
|
||||||
@ -184,7 +184,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
mcr |= PMCR_FORCE_EEE1G;
|
mcr |= PMCR_FORCE_EEE1G;
|
||||||
break;
|
break;
|
||||||
case SPEED_100:
|
case SPEED_100:
|
||||||
@@ -2980,61 +2937,6 @@ static void mt753x_phylink_mac_link_up(s
|
@@ -2996,61 +2953,6 @@ static void mt753x_phylink_mac_link_up(s
|
||||||
mt7530_set(priv, MT7530_PMCR_P(port), mcr);
|
mt7530_set(priv, MT7530_PMCR_P(port), mcr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,7 +246,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
static void mt753x_phylink_get_caps(struct dsa_switch *ds, int port,
|
static void mt753x_phylink_get_caps(struct dsa_switch *ds, int port,
|
||||||
struct phylink_config *config)
|
struct phylink_config *config)
|
||||||
{
|
{
|
||||||
@@ -3293,7 +3195,6 @@ const struct mt753x_info mt753x_table[]
|
@@ -3309,7 +3211,6 @@ const struct mt753x_info mt753x_table[]
|
||||||
.phy_write_c22 = mt7531_ind_c22_phy_write,
|
.phy_write_c22 = mt7531_ind_c22_phy_write,
|
||||||
.phy_read_c45 = mt7531_ind_c45_phy_read,
|
.phy_read_c45 = mt7531_ind_c45_phy_read,
|
||||||
.phy_write_c45 = mt7531_ind_c45_phy_write,
|
.phy_write_c45 = mt7531_ind_c45_phy_write,
|
||||||
@ -254,7 +254,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
.mac_port_get_caps = mt7531_mac_port_get_caps,
|
.mac_port_get_caps = mt7531_mac_port_get_caps,
|
||||||
.mac_port_config = mt7531_mac_config,
|
.mac_port_config = mt7531_mac_config,
|
||||||
},
|
},
|
||||||
@@ -3305,7 +3206,6 @@ const struct mt753x_info mt753x_table[]
|
@@ -3321,7 +3222,6 @@ const struct mt753x_info mt753x_table[]
|
||||||
.phy_write_c22 = mt7531_ind_c22_phy_write,
|
.phy_write_c22 = mt7531_ind_c22_phy_write,
|
||||||
.phy_read_c45 = mt7531_ind_c45_phy_read,
|
.phy_read_c45 = mt7531_ind_c45_phy_read,
|
||||||
.phy_write_c45 = mt7531_ind_c45_phy_write,
|
.phy_write_c45 = mt7531_ind_c45_phy_write,
|
||||||
@ -264,7 +264,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
};
|
};
|
||||||
--- a/drivers/net/dsa/mt7530.h
|
--- a/drivers/net/dsa/mt7530.h
|
||||||
+++ b/drivers/net/dsa/mt7530.h
|
+++ b/drivers/net/dsa/mt7530.h
|
||||||
@@ -336,13 +336,6 @@ enum mt7530_vlan_port_acc_frm {
|
@@ -340,13 +340,6 @@ enum mt7530_vlan_port_acc_frm {
|
||||||
PMCR_TX_FC_EN | PMCR_RX_FC_EN | \
|
PMCR_TX_FC_EN | PMCR_RX_FC_EN | \
|
||||||
PMCR_FORCE_FDX | PMCR_FORCE_LNK | \
|
PMCR_FORCE_FDX | PMCR_FORCE_LNK | \
|
||||||
PMCR_FORCE_EEE1G | PMCR_FORCE_EEE100)
|
PMCR_FORCE_EEE1G | PMCR_FORCE_EEE100)
|
||||||
@ -278,7 +278,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
#define MT7530_PMEEECR_P(x) (0x3004 + (x) * 0x100)
|
#define MT7530_PMEEECR_P(x) (0x3004 + (x) * 0x100)
|
||||||
#define WAKEUP_TIME_1000(x) (((x) & 0xFF) << 24)
|
#define WAKEUP_TIME_1000(x) (((x) & 0xFF) << 24)
|
||||||
@@ -749,7 +742,6 @@ struct mt753x_info {
|
@@ -754,7 +747,6 @@ struct mt753x_info {
|
||||||
int regnum);
|
int regnum);
|
||||||
int (*phy_write_c45)(struct mt7530_priv *priv, int port, int devad,
|
int (*phy_write_c45)(struct mt7530_priv *priv, int port, int devad,
|
||||||
int regnum, u16 val);
|
int regnum, u16 val);
|
||||||
@ -286,7 +286,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
void (*mac_port_get_caps)(struct dsa_switch *ds, int port,
|
void (*mac_port_get_caps)(struct dsa_switch *ds, int port,
|
||||||
struct phylink_config *config);
|
struct phylink_config *config);
|
||||||
void (*mac_port_validate)(struct dsa_switch *ds, int port,
|
void (*mac_port_validate)(struct dsa_switch *ds, int port,
|
||||||
@@ -775,7 +767,6 @@ struct mt753x_info {
|
@@ -780,7 +772,6 @@ struct mt753x_info {
|
||||||
* @ports: Holding the state among ports
|
* @ports: Holding the state among ports
|
||||||
* @reg_mutex: The lock for protecting among process accessing
|
* @reg_mutex: The lock for protecting among process accessing
|
||||||
* registers
|
* registers
|
||||||
@ -294,7 +294,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
* @p5_intf_sel: Holding the current port 5 interface select
|
* @p5_intf_sel: Holding the current port 5 interface select
|
||||||
* @p5_sgmii: Flag for distinguishing if port 5 of the MT7531 switch
|
* @p5_sgmii: Flag for distinguishing if port 5 of the MT7531 switch
|
||||||
* has got SGMII
|
* has got SGMII
|
||||||
@@ -797,8 +788,6 @@ struct mt7530_priv {
|
@@ -802,8 +793,6 @@ struct mt7530_priv {
|
||||||
const struct mt753x_info *info;
|
const struct mt753x_info *info;
|
||||||
unsigned int id;
|
unsigned int id;
|
||||||
bool mcm;
|
bool mcm;
|
||||||
|
@ -18,7 +18,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2831,16 +2831,6 @@ mt7531_mac_config(struct dsa_switch *ds,
|
@@ -2847,16 +2847,6 @@ mt7531_mac_config(struct dsa_switch *ds,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
static struct phylink_pcs *
|
static struct phylink_pcs *
|
||||||
mt753x_phylink_mac_select_pcs(struct dsa_switch *ds, int port,
|
mt753x_phylink_mac_select_pcs(struct dsa_switch *ds, int port,
|
||||||
phy_interface_t interface)
|
phy_interface_t interface)
|
||||||
@@ -2866,8 +2856,8 @@ mt753x_phylink_mac_config(struct dsa_swi
|
@@ -2882,8 +2872,8 @@ mt753x_phylink_mac_config(struct dsa_swi
|
||||||
struct mt7530_priv *priv = ds->priv;
|
struct mt7530_priv *priv = ds->priv;
|
||||||
u32 mcr_cur, mcr_new;
|
u32 mcr_cur, mcr_new;
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -3009,17 +3009,9 @@ static int
|
@@ -3025,17 +3025,9 @@ static int
|
||||||
mt753x_setup(struct dsa_switch *ds)
|
mt753x_setup(struct dsa_switch *ds)
|
||||||
{
|
{
|
||||||
struct mt7530_priv *priv = ds->priv;
|
struct mt7530_priv *priv = ds->priv;
|
||||||
@ -40,7 +40,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@@ -3031,6 +3023,14 @@ mt753x_setup(struct dsa_switch *ds)
|
@@ -3047,6 +3039,14 @@ mt753x_setup(struct dsa_switch *ds)
|
||||||
if (ret && priv->irq)
|
if (ret && priv->irq)
|
||||||
mt7530_free_irq_common(priv);
|
mt7530_free_irq_common(priv);
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
mutex_unlock(&priv->reg_mutex);
|
mutex_unlock(&priv->reg_mutex);
|
||||||
}
|
}
|
||||||
@@ -2454,6 +2452,12 @@ mt7530_setup(struct dsa_switch *ds)
|
@@ -2457,6 +2455,12 @@ mt7530_setup(struct dsa_switch *ds)
|
||||||
mt7530_mib_reset(ds);
|
mt7530_mib_reset(ds);
|
||||||
|
|
||||||
for (i = 0; i < MT7530_NUM_PORTS; i++) {
|
for (i = 0; i < MT7530_NUM_PORTS; i++) {
|
||||||
@ -53,7 +53,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
/* Disable forwarding by default on all ports */
|
/* Disable forwarding by default on all ports */
|
||||||
mt7530_rmw(priv, MT7530_PCR_P(i), PCR_MATRIX_MASK,
|
mt7530_rmw(priv, MT7530_PCR_P(i), PCR_MATRIX_MASK,
|
||||||
PCR_MATRIX_CLR);
|
PCR_MATRIX_CLR);
|
||||||
@@ -2556,6 +2560,12 @@ mt7531_setup_common(struct dsa_switch *d
|
@@ -2562,6 +2566,12 @@ mt7531_setup_common(struct dsa_switch *d
|
||||||
UNU_FFP_MASK);
|
UNU_FFP_MASK);
|
||||||
|
|
||||||
for (i = 0; i < MT7530_NUM_PORTS; i++) {
|
for (i = 0; i < MT7530_NUM_PORTS; i++) {
|
||||||
|
@ -45,7 +45,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2864,23 +2864,13 @@ mt753x_phylink_mac_config(struct dsa_swi
|
@@ -2880,23 +2880,13 @@ mt753x_phylink_mac_config(struct dsa_swi
|
||||||
const struct phylink_link_state *state)
|
const struct phylink_link_state *state)
|
||||||
{
|
{
|
||||||
struct mt7530_priv *priv = ds->priv;
|
struct mt7530_priv *priv = ds->priv;
|
||||||
@ -72,7 +72,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
static void mt753x_phylink_mac_link_down(struct dsa_switch *ds, int port,
|
static void mt753x_phylink_mac_link_down(struct dsa_switch *ds, int port,
|
||||||
--- a/drivers/net/dsa/mt7530.h
|
--- a/drivers/net/dsa/mt7530.h
|
||||||
+++ b/drivers/net/dsa/mt7530.h
|
+++ b/drivers/net/dsa/mt7530.h
|
||||||
@@ -329,8 +329,6 @@ enum mt7530_vlan_port_acc_frm {
|
@@ -333,8 +333,6 @@ enum mt7530_vlan_port_acc_frm {
|
||||||
MT7531_FORCE_DPX | \
|
MT7531_FORCE_DPX | \
|
||||||
MT7531_FORCE_RX_FC | \
|
MT7531_FORCE_RX_FC | \
|
||||||
MT7531_FORCE_TX_FC)
|
MT7531_FORCE_TX_FC)
|
||||||
|
@ -79,7 +79,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2389,6 +2389,12 @@ mt7530_setup(struct dsa_switch *ds)
|
@@ -2391,6 +2391,12 @@ mt7530_setup(struct dsa_switch *ds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,74 +0,0 @@
|
|||||||
From fa14c96eab3ec5b7cb44b06c0a54a851849a9810 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <arinc.unal@arinc9.com>
|
|
||||||
Date: Wed, 20 Mar 2024 23:45:30 +0300
|
|
||||||
Subject: [PATCH 29/30] net: dsa: mt7530: fix improper frames on all 25MHz and
|
|
||||||
40MHz XTAL MT7530
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
The MT7530 switch after reset initialises with a core clock frequency that
|
|
||||||
works with a 25MHz XTAL connected to it. For 40MHz XTAL, the core clock
|
|
||||||
frequency must be set to 500MHz.
|
|
||||||
|
|
||||||
The mt7530_pll_setup() function is responsible of setting the core clock
|
|
||||||
frequency. Currently, it runs on MT7530 with 25MHz and 40MHz XTAL. This
|
|
||||||
causes MT7530 switch with 25MHz XTAL to egress and ingress frames
|
|
||||||
improperly.
|
|
||||||
|
|
||||||
Introduce a check to run it only on MT7530 with 40MHz XTAL.
|
|
||||||
|
|
||||||
The core clock frequency is set by writing to a switch PHY's register.
|
|
||||||
Access to the PHY's register is done via the MDIO bus the switch is also
|
|
||||||
on. Therefore, it works only when the switch makes switch PHYs listen on
|
|
||||||
the MDIO bus the switch is on. This is controlled either by the state of
|
|
||||||
the ESW_P1_LED_1 pin after reset deassertion or modifying bit 5 of the
|
|
||||||
modifiable trap register.
|
|
||||||
|
|
||||||
When ESW_P1_LED_1 is pulled high, PHY indirect access is used. That means
|
|
||||||
accessing PHY registers via the PHY indirect access control register of the
|
|
||||||
switch.
|
|
||||||
|
|
||||||
When ESW_P1_LED_1 is pulled low, PHY direct access is used. That means
|
|
||||||
accessing PHY registers via the MDIO bus the switch is on.
|
|
||||||
|
|
||||||
For MT7530 switch with 40MHz XTAL on a board with ESW_P1_LED_1 pulled high,
|
|
||||||
the core clock frequency won't be set to 500MHz, causing the switch to
|
|
||||||
egress and ingress frames improperly.
|
|
||||||
|
|
||||||
Run mt7530_pll_setup() after PHY direct access is set on the modifiable
|
|
||||||
trap register.
|
|
||||||
|
|
||||||
With these two changes, all MT7530 switches with 25MHz and 40MHz, and
|
|
||||||
P1_LED_1 pulled high or low, will egress and ingress frames properly.
|
|
||||||
|
|
||||||
Link: https://github.com/BPI-SINOVOIP/BPI-R2-bsp/blob/4a5dd143f2172ec97a2872fa29c7c4cd520f45b5/linux-mt/drivers/net/ethernet/mediatek/gsw_mt7623.c#L1039
|
|
||||||
Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")
|
|
||||||
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
|
|
||||||
Link: https://lore.kernel.org/r/20240320-for-net-mt7530-fix-25mhz-xtal-with-direct-phy-access-v1-1-d92f605f1160@arinc9.com
|
|
||||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|
||||||
---
|
|
||||||
drivers/net/dsa/mt7530.c | 5 +++--
|
|
||||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
|
||||||
@@ -2435,8 +2435,6 @@ mt7530_setup(struct dsa_switch *ds)
|
|
||||||
SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST |
|
|
||||||
SYS_CTRL_REG_RST);
|
|
||||||
|
|
||||||
- mt7530_pll_setup(priv);
|
|
||||||
-
|
|
||||||
/* Lower Tx driving for TRGMII path */
|
|
||||||
for (i = 0; i < NUM_TRGMII_CTRL; i++)
|
|
||||||
mt7530_write(priv, MT7530_TRGMII_TD_ODT(i),
|
|
||||||
@@ -2452,6 +2450,9 @@ mt7530_setup(struct dsa_switch *ds)
|
|
||||||
val |= MHWTRAP_MANUAL;
|
|
||||||
mt7530_write(priv, MT7530_MHWTRAP, val);
|
|
||||||
|
|
||||||
+ if ((val & HWTRAP_XTAL_MASK) == HWTRAP_XTAL_40MHZ)
|
|
||||||
+ mt7530_pll_setup(priv);
|
|
||||||
+
|
|
||||||
mt753x_trap_frames(priv);
|
|
||||||
|
|
||||||
/* Enable and reset MIB counters */
|
|
@ -139,7 +139,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2389,12 +2389,6 @@ mt7530_setup(struct dsa_switch *ds)
|
@@ -2391,12 +2391,6 @@ mt7530_setup(struct dsa_switch *ds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,92 +0,0 @@
|
|||||||
From ef972fc9f5743da589ce9546dd565d6c56e679b8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <arinc.unal@arinc9.com>
|
|
||||||
Date: Mon, 8 Apr 2024 10:08:53 +0300
|
|
||||||
Subject: [PATCH 1/2] net: dsa: mt7530: fix enabling EEE on MT7531 switch on
|
|
||||||
all boards
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
The commit 40b5d2f15c09 ("net: dsa: mt7530: Add support for EEE features")
|
|
||||||
brought EEE support but did not enable EEE on MT7531 switch MACs. EEE is
|
|
||||||
enabled on MT7531 switch MACs by pulling the LAN2LED0 pin low on the board
|
|
||||||
(bootstrapping), unsetting the EEE_DIS bit on the trap register, or setting
|
|
||||||
the internal EEE switch bit on the CORE_PLL_GROUP4 register. Thanks to
|
|
||||||
SkyLake Huang (黃啟澤) from MediaTek for providing information on the
|
|
||||||
internal EEE switch bit.
|
|
||||||
|
|
||||||
There are existing boards that were not designed to pull the pin low.
|
|
||||||
Because of that, the EEE status currently depends on the board design.
|
|
||||||
|
|
||||||
The EEE_DIS bit on the trap pertains to the LAN2LED0 pin which is usually
|
|
||||||
used to control an LED. Once the bit is unset, the pin will be low. That
|
|
||||||
will make the active low LED turn on. The pin is controlled by the switch
|
|
||||||
PHY. It seems that the PHY controls the pin in the way that it inverts the
|
|
||||||
pin state. That means depending on the wiring of the LED connected to
|
|
||||||
LAN2LED0 on the board, the LED may be on without an active link.
|
|
||||||
|
|
||||||
To not cause this unwanted behaviour whilst enabling EEE on all boards, set
|
|
||||||
the internal EEE switch bit on the CORE_PLL_GROUP4 register.
|
|
||||||
|
|
||||||
My testing on MT7531 shows a certain amount of traffic loss when EEE is
|
|
||||||
enabled. That said, I haven't come across a board that enables EEE. So
|
|
||||||
enable EEE on the switch MACs but disable EEE advertisement on the switch
|
|
||||||
PHYs. This way, we don't change the behaviour of the majority of the boards
|
|
||||||
that have this switch. The mediatek-ge PHY driver already disables EEE
|
|
||||||
advertisement on the switch PHYs but my testing shows that it is somehow
|
|
||||||
enabled afterwards. Disabling EEE advertisement before the PHY driver
|
|
||||||
initialises keeps it off.
|
|
||||||
|
|
||||||
With this change, EEE can now be enabled using ethtool.
|
|
||||||
|
|
||||||
Fixes: 40b5d2f15c09 ("net: dsa: mt7530: Add support for EEE features")
|
|
||||||
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
|
|
||||||
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
|
|
||||||
---
|
|
||||||
drivers/net/dsa/mt7530.c | 17 ++++++++++++-----
|
|
||||||
drivers/net/dsa/mt7530.h | 1 +
|
|
||||||
2 files changed, 13 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
|
||||||
@@ -2666,18 +2666,25 @@ mt7531_setup(struct dsa_switch *ds)
|
|
||||||
mt7530_rmw(priv, MT7531_GPIO_MODE0, MT7531_GPIO0_MASK,
|
|
||||||
MT7531_GPIO0_INTERRUPT);
|
|
||||||
|
|
||||||
- /* Enable PHY core PLL, since phy_device has not yet been created
|
|
||||||
- * provided for phy_[read,write]_mmd_indirect is called, we provide
|
|
||||||
- * our own mt7531_ind_mmd_phy_[read,write] to complete this
|
|
||||||
- * function.
|
|
||||||
+ /* Enable Energy-Efficient Ethernet (EEE) and PHY core PLL, since
|
|
||||||
+ * phy_device has not yet been created provided for
|
|
||||||
+ * phy_[read,write]_mmd_indirect is called, we provide our own
|
|
||||||
+ * mt7531_ind_mmd_phy_[read,write] to complete this function.
|
|
||||||
*/
|
|
||||||
val = mt7531_ind_c45_phy_read(priv, MT753X_CTRL_PHY_ADDR,
|
|
||||||
MDIO_MMD_VEND2, CORE_PLL_GROUP4);
|
|
||||||
- val |= MT7531_PHY_PLL_BYPASS_MODE;
|
|
||||||
+ val |= MT7531_RG_SYSPLL_DMY2 | MT7531_PHY_PLL_BYPASS_MODE;
|
|
||||||
val &= ~MT7531_PHY_PLL_OFF;
|
|
||||||
mt7531_ind_c45_phy_write(priv, MT753X_CTRL_PHY_ADDR, MDIO_MMD_VEND2,
|
|
||||||
CORE_PLL_GROUP4, val);
|
|
||||||
|
|
||||||
+ /* Disable EEE advertisement on the switch PHYs. */
|
|
||||||
+ for (i = MT753X_CTRL_PHY_ADDR;
|
|
||||||
+ i < MT753X_CTRL_PHY_ADDR + MT7530_NUM_PHYS; i++) {
|
|
||||||
+ mt7531_ind_c45_phy_write(priv, i, MDIO_MMD_AN, MDIO_AN_EEE_ADV,
|
|
||||||
+ 0);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
mt7531_setup_common(ds);
|
|
||||||
|
|
||||||
/* Setup VLAN ID 0 for VLAN-unaware bridges */
|
|
||||||
--- a/drivers/net/dsa/mt7530.h
|
|
||||||
+++ b/drivers/net/dsa/mt7530.h
|
|
||||||
@@ -621,6 +621,7 @@ enum mt7531_clk_skew {
|
|
||||||
#define RG_SYSPLL_DDSFBK_EN BIT(12)
|
|
||||||
#define RG_SYSPLL_BIAS_EN BIT(11)
|
|
||||||
#define RG_SYSPLL_BIAS_LPF_EN BIT(10)
|
|
||||||
+#define MT7531_RG_SYSPLL_DMY2 BIT(6)
|
|
||||||
#define MT7531_PHY_PLL_OFF BIT(5)
|
|
||||||
#define MT7531_PHY_PLL_BYPASS_MODE BIT(4)
|
|
||||||
|
|
@ -19,7 +19,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2850,28 +2850,34 @@ mt7531_mac_config(struct dsa_switch *ds,
|
@@ -2858,28 +2858,34 @@ mt7531_mac_config(struct dsa_switch *ds,
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct phylink_pcs *
|
static struct phylink_pcs *
|
||||||
@ -60,7 +60,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
|
|
||||||
if ((port == 5 || port == 6) && priv->info->mac_port_config)
|
if ((port == 5 || port == 6) && priv->info->mac_port_config)
|
||||||
priv->info->mac_port_config(ds, port, mode, state->interface);
|
priv->info->mac_port_config(ds, port, mode, state->interface);
|
||||||
@@ -2881,23 +2887,25 @@ mt753x_phylink_mac_config(struct dsa_swi
|
@@ -2889,23 +2895,25 @@ mt753x_phylink_mac_config(struct dsa_swi
|
||||||
mt7530_set(priv, MT7530_PMCR_P(port), PMCR_EXT_PHY);
|
mt7530_set(priv, MT7530_PMCR_P(port), PMCR_EXT_PHY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
u32 mcr;
|
u32 mcr;
|
||||||
|
|
||||||
mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK;
|
mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK;
|
||||||
@@ -2932,7 +2940,7 @@ static void mt753x_phylink_mac_link_up(s
|
@@ -2940,7 +2948,7 @@ static void mt753x_phylink_mac_link_up(s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void mt753x_phylink_get_caps(struct dsa_switch *ds, int port,
|
static void mt753x_phylink_get_caps(struct dsa_switch *ds, int port,
|
||||||
@@ -3152,16 +3160,19 @@ const struct dsa_switch_ops mt7530_switc
|
@@ -3160,16 +3168,19 @@ const struct dsa_switch_ops mt7530_switc
|
||||||
.port_mirror_add = mt753x_port_mirror_add,
|
.port_mirror_add = mt753x_port_mirror_add,
|
||||||
.port_mirror_del = mt753x_port_mirror_del,
|
.port_mirror_del = mt753x_port_mirror_del,
|
||||||
.phylink_get_caps = mt753x_phylink_get_caps,
|
.phylink_get_caps = mt753x_phylink_get_caps,
|
||||||
@ -125,7 +125,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|||||||
const struct mt753x_info mt753x_table[] = {
|
const struct mt753x_info mt753x_table[] = {
|
||||||
[ID_MT7621] = {
|
[ID_MT7621] = {
|
||||||
.id = ID_MT7621,
|
.id = ID_MT7621,
|
||||||
@@ -3239,6 +3250,7 @@ mt7530_probe_common(struct mt7530_priv *
|
@@ -3247,6 +3258,7 @@ mt7530_probe_common(struct mt7530_priv *
|
||||||
priv->dev = dev;
|
priv->dev = dev;
|
||||||
priv->ds->priv = priv;
|
priv->ds->priv = priv;
|
||||||
priv->ds->ops = &mt7530_switch_ops;
|
priv->ds->ops = &mt7530_switch_ops;
|
||||||
|
@ -1,70 +0,0 @@
|
|||||||
From d4097ddef078a113643a6dcde01e99741f852adb Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <arinc.unal@arinc9.com>
|
|
||||||
Date: Sat, 13 Apr 2024 16:01:39 +0300
|
|
||||||
Subject: [PATCH 2/5] net: dsa: mt7530: fix mirroring frames received on local
|
|
||||||
port
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
This switch intellectual property provides a bit on the ARL global control
|
|
||||||
register which controls allowing mirroring frames which are received on the
|
|
||||||
local port (monitor port). This bit is unset after reset.
|
|
||||||
|
|
||||||
This ability must be enabled to fully support the port mirroring feature on
|
|
||||||
this switch intellectual property.
|
|
||||||
|
|
||||||
Therefore, this patch fixes the traffic not being reflected on a port,
|
|
||||||
which would be configured like below:
|
|
||||||
|
|
||||||
tc qdisc add dev swp0 clsact
|
|
||||||
|
|
||||||
tc filter add dev swp0 ingress matchall skip_sw \
|
|
||||||
action mirred egress mirror dev swp0
|
|
||||||
|
|
||||||
As a side note, this configuration provides the hairpinning feature for a
|
|
||||||
single port.
|
|
||||||
|
|
||||||
Fixes: 37feab6076aa ("net: dsa: mt7530: add support for port mirroring")
|
|
||||||
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
|
|
||||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
||||||
---
|
|
||||||
drivers/net/dsa/mt7530.c | 6 ++++++
|
|
||||||
drivers/net/dsa/mt7530.h | 4 ++++
|
|
||||||
2 files changed, 10 insertions(+)
|
|
||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
|
||||||
@@ -2480,6 +2480,9 @@ mt7530_setup(struct dsa_switch *ds)
|
|
||||||
PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* Allow mirroring frames received on the local port (monitor port). */
|
|
||||||
+ mt7530_set(priv, MT753X_AGC, LOCAL_EN);
|
|
||||||
+
|
|
||||||
/* Setup VLAN ID 0 for VLAN-unaware bridges */
|
|
||||||
ret = mt7530_setup_vlan0(priv);
|
|
||||||
if (ret)
|
|
||||||
@@ -2591,6 +2594,9 @@ mt7531_setup_common(struct dsa_switch *d
|
|
||||||
PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* Allow mirroring frames received on the local port (monitor port). */
|
|
||||||
+ mt7530_set(priv, MT753X_AGC, LOCAL_EN);
|
|
||||||
+
|
|
||||||
/* Flush the FDB table */
|
|
||||||
ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, NULL);
|
|
||||||
if (ret < 0)
|
|
||||||
--- a/drivers/net/dsa/mt7530.h
|
|
||||||
+++ b/drivers/net/dsa/mt7530.h
|
|
||||||
@@ -32,6 +32,10 @@ enum mt753x_id {
|
|
||||||
#define SYSC_REG_RSTCTRL 0x34
|
|
||||||
#define RESET_MCM BIT(2)
|
|
||||||
|
|
||||||
+/* Register for ARL global control */
|
|
||||||
+#define MT753X_AGC 0xc
|
|
||||||
+#define LOCAL_EN BIT(7)
|
|
||||||
+
|
|
||||||
/* Registers to mac forward control for unknown frames */
|
|
||||||
#define MT7530_MFC 0x10
|
|
||||||
#define BC_FFP(x) (((x) & 0xff) << 24)
|
|
@ -1,49 +0,0 @@
|
|||||||
From 019a17a5e76940ea86114838d1d638d4dc8d3750 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <arinc.unal@arinc9.com>
|
|
||||||
Date: Sat, 13 Apr 2024 16:01:40 +0300
|
|
||||||
Subject: [PATCH 3/5] net: dsa: mt7530: fix port mirroring for MT7988 SoC
|
|
||||||
switch
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
The "MT7988A Wi-Fi 7 Generation Router Platform: Datasheet (Open Version)
|
|
||||||
v0.1" document shows bits 16 to 18 as the MIRROR_PORT field of the CPU
|
|
||||||
forward control register. Currently, the MT7530 DSA subdriver configures
|
|
||||||
bits 0 to 2 of the CPU forward control register which breaks the port
|
|
||||||
mirroring feature for the MT7988 SoC switch.
|
|
||||||
|
|
||||||
Fix this by using the MT7531_MIRROR_PORT_GET() and MT7531_MIRROR_PORT_SET()
|
|
||||||
macros which utilise the correct bits.
|
|
||||||
|
|
||||||
Fixes: 110c18bfed41 ("net: dsa: mt7530: introduce driver for MT7988 built-in switch")
|
|
||||||
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
|
|
||||||
Acked-by: Daniel Golle <daniel@makrotopia.org>
|
|
||||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
||||||
---
|
|
||||||
drivers/net/dsa/mt7530.c | 10 ++++++----
|
|
||||||
1 file changed, 6 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
|
||||||
@@ -1883,14 +1883,16 @@ mt7530_port_vlan_del(struct dsa_switch *
|
|
||||||
|
|
||||||
static int mt753x_mirror_port_get(unsigned int id, u32 val)
|
|
||||||
{
|
|
||||||
- return (id == ID_MT7531) ? MT7531_MIRROR_PORT_GET(val) :
|
|
||||||
- MIRROR_PORT(val);
|
|
||||||
+ return (id == ID_MT7531 || id == ID_MT7988) ?
|
|
||||||
+ MT7531_MIRROR_PORT_GET(val) :
|
|
||||||
+ MIRROR_PORT(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int mt753x_mirror_port_set(unsigned int id, u32 val)
|
|
||||||
{
|
|
||||||
- return (id == ID_MT7531) ? MT7531_MIRROR_PORT_SET(val) :
|
|
||||||
- MIRROR_PORT(val);
|
|
||||||
+ return (id == ID_MT7531 || id == ID_MT7988) ?
|
|
||||||
+ MT7531_MIRROR_PORT_SET(val) :
|
|
||||||
+ MIRROR_PORT(val);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int mt753x_port_mirror_add(struct dsa_switch *ds, int port,
|
|
@ -6707,6 +6707,7 @@ CONFIG_SND_X86=y
|
|||||||
# CONFIG_SPI_BCM2835 is not set
|
# CONFIG_SPI_BCM2835 is not set
|
||||||
# CONFIG_SPI_BCM63XX_HSSPI is not set
|
# CONFIG_SPI_BCM63XX_HSSPI is not set
|
||||||
# CONFIG_SPI_BCM_QSPI is not set
|
# CONFIG_SPI_BCM_QSPI is not set
|
||||||
|
# CONFIG_SPI_BCMBCA_HSSPI is not set
|
||||||
# CONFIG_SPI_BITBANG is not set
|
# CONFIG_SPI_BITBANG is not set
|
||||||
# CONFIG_SPI_BUTTERFLY is not set
|
# CONFIG_SPI_BUTTERFLY is not set
|
||||||
# CONFIG_SPI_CADENCE is not set
|
# CONFIG_SPI_CADENCE is not set
|
||||||
|
@ -43,7 +43,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
|
|||||||
|
|
||||||
#define QUECTEL_VENDOR_ID 0x2c7c
|
#define QUECTEL_VENDOR_ID 0x2c7c
|
||||||
/* These Quectel products use Quectel's vendor ID */
|
/* These Quectel products use Quectel's vendor ID */
|
||||||
@@ -1152,6 +1157,11 @@ static const struct usb_device_id option
|
@@ -1156,6 +1161,11 @@ static const struct usb_device_id option
|
||||||
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */
|
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */
|
||||||
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000), /* SIMCom SIM5218 */
|
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000), /* SIMCom SIM5218 */
|
||||||
.driver_info = NCTRL(0) | NCTRL(1) | NCTRL(2) | NCTRL(3) | RSVD(4) },
|
.driver_info = NCTRL(0) | NCTRL(1) | NCTRL(2) | NCTRL(3) | RSVD(4) },
|
||||||
@ -55,7 +55,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
|
|||||||
/* Quectel products using Qualcomm vendor ID */
|
/* Quectel products using Qualcomm vendor ID */
|
||||||
{ USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)},
|
{ USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)},
|
||||||
{ USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20),
|
{ USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20),
|
||||||
@@ -1193,6 +1203,11 @@ static const struct usb_device_id option
|
@@ -1197,6 +1207,11 @@ static const struct usb_device_id option
|
||||||
.driver_info = ZLP },
|
.driver_info = ZLP },
|
||||||
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),
|
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),
|
||||||
.driver_info = RSVD(4) },
|
.driver_info = RSVD(4) },
|
||||||
|
@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|||||||
|
|
||||||
--- a/net/bridge/br_input.c
|
--- a/net/bridge/br_input.c
|
||||||
+++ b/net/bridge/br_input.c
|
+++ b/net/bridge/br_input.c
|
||||||
@@ -239,6 +239,9 @@ static void __br_handle_local_finish(str
|
@@ -244,6 +244,9 @@ static void __br_handle_local_finish(str
|
||||||
/* note: already called with rcu_read_lock */
|
/* note: already called with rcu_read_lock */
|
||||||
static int br_handle_local_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
|
static int br_handle_local_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
@ -25,7 +25,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|||||||
__br_handle_local_finish(skb);
|
__br_handle_local_finish(skb);
|
||||||
|
|
||||||
/* return 1 to signal the okfn() was called so it's ok to use the skb */
|
/* return 1 to signal the okfn() was called so it's ok to use the skb */
|
||||||
@@ -408,6 +411,17 @@ forward:
|
@@ -415,6 +418,17 @@ forward:
|
||||||
goto defer_stp_filtering;
|
goto defer_stp_filtering;
|
||||||
|
|
||||||
switch (p->state) {
|
switch (p->state) {
|
||||||
|
@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|||||||
|
|
||||||
--- a/net/netfilter/nf_tables_api.c
|
--- a/net/netfilter/nf_tables_api.c
|
||||||
+++ b/net/netfilter/nf_tables_api.c
|
+++ b/net/netfilter/nf_tables_api.c
|
||||||
@@ -8260,7 +8260,7 @@ static int nft_register_flowtable_net_ho
|
@@ -8268,7 +8268,7 @@ static int nft_register_flowtable_net_ho
|
||||||
err = flowtable->data.type->setup(&flowtable->data,
|
err = flowtable->data.type->setup(&flowtable->data,
|
||||||
hook->ops.dev,
|
hook->ops.dev,
|
||||||
FLOW_BLOCK_BIND);
|
FLOW_BLOCK_BIND);
|
||||||
|
@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|||||||
if (!(p->flags & BR_BCAST_FLOOD) && skb->dev != br->dev)
|
if (!(p->flags & BR_BCAST_FLOOD) && skb->dev != br->dev)
|
||||||
--- a/net/bridge/br_input.c
|
--- a/net/bridge/br_input.c
|
||||||
+++ b/net/bridge/br_input.c
|
+++ b/net/bridge/br_input.c
|
||||||
@@ -362,6 +362,8 @@ static rx_handler_result_t br_handle_fra
|
@@ -367,6 +367,8 @@ static rx_handler_result_t br_handle_fra
|
||||||
fwd_mask |= p->group_fwd_mask;
|
fwd_mask |= p->group_fwd_mask;
|
||||||
switch (dest[5]) {
|
switch (dest[5]) {
|
||||||
case 0x00: /* Bridge Group Address */
|
case 0x00: /* Bridge Group Address */
|
||||||
|
@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|||||||
#endif /* __LINUX_USB_PCI_QUIRKS_H */
|
#endif /* __LINUX_USB_PCI_QUIRKS_H */
|
||||||
--- a/include/linux/usb/hcd.h
|
--- a/include/linux/usb/hcd.h
|
||||||
+++ b/include/linux/usb/hcd.h
|
+++ b/include/linux/usb/hcd.h
|
||||||
@@ -484,7 +484,14 @@ extern int usb_hcd_pci_probe(struct pci_
|
@@ -485,7 +485,14 @@ extern int usb_hcd_pci_probe(struct pci_
|
||||||
extern void usb_hcd_pci_remove(struct pci_dev *dev);
|
extern void usb_hcd_pci_remove(struct pci_dev *dev);
|
||||||
extern void usb_hcd_pci_shutdown(struct pci_dev *dev);
|
extern void usb_hcd_pci_shutdown(struct pci_dev *dev);
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
|
|||||||
/*
|
/*
|
||||||
* We need to store the untouched command line for future reference.
|
* We need to store the untouched command line for future reference.
|
||||||
* We also need to store the touched command line since the parameter
|
* We also need to store the touched command line since the parameter
|
||||||
@@ -896,6 +919,7 @@ void start_kernel(void)
|
@@ -898,6 +921,7 @@ void start_kernel(void)
|
||||||
pr_notice("%s", linux_banner);
|
pr_notice("%s", linux_banner);
|
||||||
early_security_init();
|
early_security_init();
|
||||||
setup_arch(&command_line);
|
setup_arch(&command_line);
|
||||||
|
@ -136,7 +136,7 @@ Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
|
|||||||
#include <net/dst.h>
|
#include <net/dst.h>
|
||||||
#include <net/sock.h>
|
#include <net/sock.h>
|
||||||
#include <net/checksum.h>
|
#include <net/checksum.h>
|
||||||
@@ -4812,6 +4816,9 @@ static const u8 skb_ext_type_len[] = {
|
@@ -4823,6 +4827,9 @@ static const u8 skb_ext_type_len[] = {
|
||||||
#if IS_ENABLED(CONFIG_MCTP_FLOWS)
|
#if IS_ENABLED(CONFIG_MCTP_FLOWS)
|
||||||
[SKB_EXT_MCTP] = SKB_EXT_CHUNKSIZEOF(struct mctp_flow),
|
[SKB_EXT_MCTP] = SKB_EXT_CHUNKSIZEOF(struct mctp_flow),
|
||||||
#endif
|
#endif
|
||||||
|
@ -177,7 +177,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
|||||||
#include <linux/bootconfig.h>
|
#include <linux/bootconfig.h>
|
||||||
#include <linux/console.h>
|
#include <linux/console.h>
|
||||||
#include <linux/nmi.h>
|
#include <linux/nmi.h>
|
||||||
@@ -930,6 +931,17 @@ void start_kernel(void)
|
@@ -932,6 +933,17 @@ void start_kernel(void)
|
||||||
pr_notice("Kernel command line: %s\n", saved_command_line);
|
pr_notice("Kernel command line: %s\n", saved_command_line);
|
||||||
/* parameters may set static keys */
|
/* parameters may set static keys */
|
||||||
jump_label_init();
|
jump_label_init();
|
||||||
|
@ -11,6 +11,7 @@ INITRAMFS_EXTRA_FILES:=
|
|||||||
FEATURES:=cpiogz ext4 ramdisk squashfs targz
|
FEATURES:=cpiogz ext4 ramdisk squashfs targz
|
||||||
|
|
||||||
KERNEL_PATCHVER:=6.1
|
KERNEL_PATCHVER:=6.1
|
||||||
|
KERNEL_TESTING_PATCHVER:=6.6
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/target.mk
|
include $(INCLUDE_DIR)/target.mk
|
||||||
|
|
||||||
|
285
target/linux/malta/config-6.6
Normal file
285
target/linux/malta/config-6.6
Normal file
@ -0,0 +1,285 @@
|
|||||||
|
CONFIG_ARCH_32BIT_OFF_T=y
|
||||||
|
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||||
|
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
|
||||||
|
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
|
||||||
|
CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
|
||||||
|
CONFIG_ARCH_MMAP_RND_BITS_MAX=15
|
||||||
|
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15
|
||||||
|
CONFIG_ATA=y
|
||||||
|
CONFIG_ATA_PIIX=y
|
||||||
|
CONFIG_BLK_DEV_BSG=y
|
||||||
|
CONFIG_BLK_DEV_BSGLIB=y
|
||||||
|
CONFIG_BLK_DEV_BSG_COMMON=y
|
||||||
|
# CONFIG_BLK_DEV_INITRD is not set
|
||||||
|
CONFIG_BLK_DEV_LOOP=y
|
||||||
|
CONFIG_BLK_DEV_RAM=y
|
||||||
|
CONFIG_BLK_DEV_RAM_COUNT=16
|
||||||
|
CONFIG_BLK_DEV_RAM_SIZE=4096
|
||||||
|
CONFIG_BLK_DEV_SD=y
|
||||||
|
CONFIG_BLK_MQ_PCI=y
|
||||||
|
CONFIG_BOARD_SCACHE=y
|
||||||
|
CONFIG_BOOT_ELF32=y
|
||||||
|
CONFIG_BUFFER_HEAD=y
|
||||||
|
CONFIG_BUILTIN_DTB=y
|
||||||
|
CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5"
|
||||||
|
CONFIG_CC_NO_ARRAY_BOUNDS=y
|
||||||
|
CONFIG_CEVT_R4K=y
|
||||||
|
CONFIG_CLKBLD_I8253=y
|
||||||
|
CONFIG_CLKEVT_I8253=y
|
||||||
|
CONFIG_CLKSRC_I8253=y
|
||||||
|
CONFIG_CLKSRC_MIPS_GIC=y
|
||||||
|
CONFIG_CLOCKSOURCE_WATCHDOG=y
|
||||||
|
CONFIG_CLOCKSOURCE_WATCHDOG_MAX_SKEW_US=100
|
||||||
|
CONFIG_CLONE_BACKWARDS=y
|
||||||
|
CONFIG_COMMON_CLK=y
|
||||||
|
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
|
||||||
|
CONFIG_COMPAT_32BIT_TIME=y
|
||||||
|
CONFIG_CONSOLE_TRANSLATIONS=y
|
||||||
|
CONFIG_CONTEXT_TRACKING=y
|
||||||
|
CONFIG_CONTEXT_TRACKING_IDLE=y
|
||||||
|
CONFIG_CPU_GENERIC_DUMP_TLB=y
|
||||||
|
CONFIG_CPU_HAS_PREFETCH=y
|
||||||
|
# CONFIG_CPU_HAS_SMARTMIPS is not set
|
||||||
|
CONFIG_CPU_HAS_SYNC=y
|
||||||
|
# CONFIG_CPU_MICROMIPS is not set
|
||||||
|
# CONFIG_CPU_MIPS32 is not set
|
||||||
|
# CONFIG_CPU_MIPS32_3_5_FEATURES is not set
|
||||||
|
# CONFIG_CPU_MIPS32_R1 is not set
|
||||||
|
# CONFIG_CPU_MIPS32_R2 is not set
|
||||||
|
# CONFIG_CPU_MIPS32_R5 is not set
|
||||||
|
# CONFIG_CPU_MIPS32_R5_FEATURES is not set
|
||||||
|
# CONFIG_CPU_MIPS32_R6 is not set
|
||||||
|
# CONFIG_CPU_MIPS64_R1 is not set
|
||||||
|
# CONFIG_CPU_MIPS64_R2 is not set
|
||||||
|
# CONFIG_CPU_MIPS64_R6 is not set
|
||||||
|
# CONFIG_CPU_MIPSR1 is not set
|
||||||
|
# CONFIG_CPU_MIPSR2 is not set
|
||||||
|
# CONFIG_CPU_MIPSR2_IRQ_EI is not set
|
||||||
|
# CONFIG_CPU_MIPSR2_IRQ_VI is not set
|
||||||
|
CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
|
||||||
|
# CONFIG_CPU_NEVADA is not set
|
||||||
|
CONFIG_CPU_R4K_CACHE_TLB=y
|
||||||
|
# CONFIG_CPU_RM7000 is not set
|
||||||
|
CONFIG_CPU_RMAP=y
|
||||||
|
CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
|
||||||
|
CONFIG_CPU_SUPPORTS_HIGHMEM=y
|
||||||
|
CONFIG_CRC16=y
|
||||||
|
CONFIG_CRYPTO_CRC32=y
|
||||||
|
CONFIG_CRYPTO_CRC32C=y
|
||||||
|
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||||
|
CONFIG_CRYPTO_LIB_GF128MUL=y
|
||||||
|
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=2
|
||||||
|
CONFIG_CRYPTO_LIB_SHA1=y
|
||||||
|
CONFIG_CRYPTO_LIB_UTILS=y
|
||||||
|
CONFIG_CSRC_R4K=y
|
||||||
|
CONFIG_DMA_NONCOHERENT=y
|
||||||
|
CONFIG_DNOTIFY=y
|
||||||
|
CONFIG_DTC=y
|
||||||
|
CONFIG_DUMMY_CONSOLE=y
|
||||||
|
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
|
||||||
|
CONFIG_EXT4_FS=y
|
||||||
|
CONFIG_F2FS_FS=y
|
||||||
|
CONFIG_FS_IOMAP=y
|
||||||
|
CONFIG_FS_MBCACHE=y
|
||||||
|
CONFIG_FS_POSIX_ACL=y
|
||||||
|
CONFIG_FUNCTION_ALIGNMENT=0
|
||||||
|
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||||
|
CONFIG_FW_LOADER_SYSFS=y
|
||||||
|
CONFIG_GCC11_NO_ARRAY_BOUNDS=y
|
||||||
|
CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND=y
|
||||||
|
CONFIG_GENERIC_ATOMIC64=y
|
||||||
|
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||||
|
CONFIG_GENERIC_CMOS_UPDATE=y
|
||||||
|
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||||
|
CONFIG_GENERIC_GETTIMEOFDAY=y
|
||||||
|
CONFIG_GENERIC_IDLE_POLL_SETUP=y
|
||||||
|
CONFIG_GENERIC_IOMAP=y
|
||||||
|
CONFIG_GENERIC_IRQ_CHIP=y
|
||||||
|
CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
|
||||||
|
CONFIG_GENERIC_IRQ_SHOW=y
|
||||||
|
CONFIG_GENERIC_ISA_DMA=y
|
||||||
|
CONFIG_GENERIC_LIB_ASHLDI3=y
|
||||||
|
CONFIG_GENERIC_LIB_ASHRDI3=y
|
||||||
|
CONFIG_GENERIC_LIB_CMPDI2=y
|
||||||
|
CONFIG_GENERIC_LIB_LSHRDI3=y
|
||||||
|
CONFIG_GENERIC_LIB_UCMPDI2=y
|
||||||
|
CONFIG_GENERIC_PCI_IOMAP=y
|
||||||
|
CONFIG_GENERIC_SCHED_CLOCK=y
|
||||||
|
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||||
|
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||||
|
CONFIG_GLOB=y
|
||||||
|
CONFIG_GPIO_CDEV=y
|
||||||
|
CONFIG_HARDWARE_WATCHPOINTS=y
|
||||||
|
CONFIG_HAS_DMA=y
|
||||||
|
CONFIG_HAS_IOMEM=y
|
||||||
|
CONFIG_HAS_IOPORT=y
|
||||||
|
CONFIG_HAS_IOPORT_MAP=y
|
||||||
|
CONFIG_HW_CONSOLE=y
|
||||||
|
CONFIG_I8253=y
|
||||||
|
CONFIG_I8253_LOCK=y
|
||||||
|
CONFIG_I8259=y
|
||||||
|
CONFIG_INPUT=y
|
||||||
|
CONFIG_INPUT_MOUSEDEV=y
|
||||||
|
CONFIG_INPUT_MOUSEDEV_PSAUX=y
|
||||||
|
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
|
||||||
|
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
|
||||||
|
CONFIG_IRQCHIP=y
|
||||||
|
CONFIG_IRQ_DOMAIN=y
|
||||||
|
CONFIG_IRQ_DOMAIN_HIERARCHY=y
|
||||||
|
CONFIG_IRQ_FORCED_THREADING=y
|
||||||
|
CONFIG_IRQ_MIPS_CPU=y
|
||||||
|
CONFIG_IRQ_WORK=y
|
||||||
|
CONFIG_ISA_DMA_API=y
|
||||||
|
CONFIG_JBD2=y
|
||||||
|
CONFIG_JFFS2_FS_POSIX_ACL=y
|
||||||
|
CONFIG_JFFS2_FS_SECURITY=y
|
||||||
|
CONFIG_KALLSYMS=y
|
||||||
|
CONFIG_KERNEL_GZIP=y
|
||||||
|
# CONFIG_KERNEL_XZ is not set
|
||||||
|
CONFIG_LIBFDT=y
|
||||||
|
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||||
|
CONFIG_MD=y
|
||||||
|
CONFIG_MFD_SYSCON=y
|
||||||
|
CONFIG_MIGRATION=y
|
||||||
|
CONFIG_MIPS=y
|
||||||
|
CONFIG_MIPS_ASID_BITS=8
|
||||||
|
CONFIG_MIPS_ASID_SHIFT=0
|
||||||
|
CONFIG_MIPS_BONITO64=y
|
||||||
|
CONFIG_MIPS_CLOCK_VSYSCALL=y
|
||||||
|
CONFIG_MIPS_CM=y
|
||||||
|
CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y
|
||||||
|
CONFIG_MIPS_CPC=y
|
||||||
|
CONFIG_MIPS_CPU_SCACHE=y
|
||||||
|
CONFIG_MIPS_EXTERNAL_TIMER=y
|
||||||
|
CONFIG_MIPS_GIC=y
|
||||||
|
CONFIG_MIPS_L1_CACHE_SHIFT=6
|
||||||
|
CONFIG_MIPS_L1_CACHE_SHIFT_6=y
|
||||||
|
CONFIG_MIPS_MALTA=y
|
||||||
|
CONFIG_MIPS_MSC=y
|
||||||
|
CONFIG_MIPS_MT=y
|
||||||
|
CONFIG_MIPS_MT_FPAFF=y
|
||||||
|
CONFIG_MIPS_MT_SMP=y
|
||||||
|
CONFIG_MIPS_NO_APPENDED_DTB=y
|
||||||
|
CONFIG_MIPS_NR_CPU_NR_MAP=2
|
||||||
|
CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y
|
||||||
|
CONFIG_MMU_LAZY_TLB_REFCOUNT=y
|
||||||
|
CONFIG_MODULES_USE_ELF_REL=y
|
||||||
|
CONFIG_MODULE_FORCE_UNLOAD=y
|
||||||
|
CONFIG_MTD_CFI_STAA=y
|
||||||
|
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
|
||||||
|
CONFIG_NEED_DMA_MAP_STATE=y
|
||||||
|
CONFIG_NEED_SRCU_NMI_SAFE=y
|
||||||
|
CONFIG_NET_EGRESS=y
|
||||||
|
CONFIG_NET_FLOW_LIMIT=y
|
||||||
|
CONFIG_NET_INGRESS=y
|
||||||
|
CONFIG_NET_XGRESS=y
|
||||||
|
CONFIG_NLS=y
|
||||||
|
CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
|
||||||
|
CONFIG_NO_HZ=y
|
||||||
|
CONFIG_NO_HZ_COMMON=y
|
||||||
|
CONFIG_NO_HZ_IDLE=y
|
||||||
|
CONFIG_NR_CPUS=2
|
||||||
|
CONFIG_NVMEM=y
|
||||||
|
CONFIG_NVMEM_LAYOUTS=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_PADATA=y
|
||||||
|
CONFIG_PAGE_POOL=y
|
||||||
|
CONFIG_PAGE_SIZE_LESS_THAN_256KB=y
|
||||||
|
CONFIG_PAGE_SIZE_LESS_THAN_64KB=y
|
||||||
|
# CONFIG_PARTITION_ADVANCED is not set
|
||||||
|
CONFIG_PATA_LEGACY=y
|
||||||
|
CONFIG_PATA_TIMINGS=y
|
||||||
|
CONFIG_PCI=y
|
||||||
|
CONFIG_PCI_DOMAINS=y
|
||||||
|
CONFIG_PCI_DRIVERS_LEGACY=y
|
||||||
|
CONFIG_PCI_GT64XXX_PCI0=y
|
||||||
|
CONFIG_PCSPKR_PLATFORM=y
|
||||||
|
CONFIG_PERF_USE_VMALLOC=y
|
||||||
|
CONFIG_PGTABLE_LEVELS=2
|
||||||
|
CONFIG_POWER_RESET=y
|
||||||
|
CONFIG_POWER_RESET_PIIX4_POWEROFF=y
|
||||||
|
CONFIG_POWER_RESET_SYSCON=y
|
||||||
|
CONFIG_PREEMPT_NONE_BUILD=y
|
||||||
|
CONFIG_PROC_PAGE_MONITOR=y
|
||||||
|
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
||||||
|
CONFIG_QFMT_V2=y
|
||||||
|
CONFIG_QUEUED_RWLOCKS=y
|
||||||
|
CONFIG_QUEUED_SPINLOCKS=y
|
||||||
|
CONFIG_QUOTA=y
|
||||||
|
CONFIG_QUOTACTL=y
|
||||||
|
CONFIG_QUOTA_TREE=y
|
||||||
|
CONFIG_RANDSTRUCT_NONE=y
|
||||||
|
CONFIG_RATIONAL=y
|
||||||
|
CONFIG_REGMAP=y
|
||||||
|
CONFIG_REGMAP_MMIO=y
|
||||||
|
CONFIG_RELAY=y
|
||||||
|
CONFIG_RFS_ACCEL=y
|
||||||
|
CONFIG_RPS=y
|
||||||
|
CONFIG_RTC_CLASS=y
|
||||||
|
CONFIG_RTC_MC146818_LIB=y
|
||||||
|
CONFIG_SATA_HOST=y
|
||||||
|
CONFIG_SCSI=y
|
||||||
|
CONFIG_SCSI_COMMON=y
|
||||||
|
CONFIG_SECCOMP=y
|
||||||
|
CONFIG_SECCOMP_FILTER=y
|
||||||
|
CONFIG_SERIAL_8250_NR_UARTS=4
|
||||||
|
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
|
||||||
|
CONFIG_SERIAL_MCTRL_GPIO=y
|
||||||
|
CONFIG_SERIO=y
|
||||||
|
CONFIG_SERIO_SERPORT=y
|
||||||
|
CONFIG_SG_POOL=y
|
||||||
|
CONFIG_SMP=y
|
||||||
|
CONFIG_SMP_UP=y
|
||||||
|
CONFIG_SOCK_RX_QUEUE_MAPPING=y
|
||||||
|
CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y
|
||||||
|
CONFIG_SWAP_IO_SPACE=y
|
||||||
|
CONFIG_SYNC_R4K=y
|
||||||
|
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||||
|
CONFIG_SYS_HAS_CPU_MIPS32_R1=y
|
||||||
|
CONFIG_SYS_HAS_CPU_MIPS32_R2=y
|
||||||
|
CONFIG_SYS_HAS_CPU_MIPS32_R3_5=y
|
||||||
|
CONFIG_SYS_HAS_CPU_MIPS32_R5=y
|
||||||
|
CONFIG_SYS_HAS_CPU_MIPS32_R6=y
|
||||||
|
CONFIG_SYS_HAS_CPU_MIPS64_R1=y
|
||||||
|
CONFIG_SYS_HAS_CPU_MIPS64_R2=y
|
||||||
|
CONFIG_SYS_HAS_CPU_MIPS64_R6=y
|
||||||
|
CONFIG_SYS_HAS_CPU_NEVADA=y
|
||||||
|
CONFIG_SYS_HAS_CPU_RM7000=y
|
||||||
|
CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
|
||||||
|
CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
|
||||||
|
CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
|
||||||
|
CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
|
||||||
|
CONFIG_SYS_SUPPORTS_HIGHMEM=y
|
||||||
|
CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
|
||||||
|
CONFIG_SYS_SUPPORTS_MICROMIPS=y
|
||||||
|
CONFIG_SYS_SUPPORTS_MIPS16=y
|
||||||
|
CONFIG_SYS_SUPPORTS_MIPS_CPS=y
|
||||||
|
CONFIG_SYS_SUPPORTS_MULTITHREADING=y
|
||||||
|
CONFIG_SYS_SUPPORTS_RELOCATABLE=y
|
||||||
|
CONFIG_SYS_SUPPORTS_SCHED_SMT=y
|
||||||
|
CONFIG_SYS_SUPPORTS_SMARTMIPS=y
|
||||||
|
CONFIG_SYS_SUPPORTS_SMP=y
|
||||||
|
CONFIG_SYS_SUPPORTS_VPE_LOADER=y
|
||||||
|
CONFIG_SYS_SUPPORTS_ZBOOT=y
|
||||||
|
CONFIG_TARGET_ISA_REV=1
|
||||||
|
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||||
|
CONFIG_TIMER_OF=y
|
||||||
|
CONFIG_TIMER_PROBE=y
|
||||||
|
CONFIG_TREE_RCU=y
|
||||||
|
CONFIG_TREE_SRCU=y
|
||||||
|
CONFIG_USB_SUPPORT=y
|
||||||
|
CONFIG_USE_OF=y
|
||||||
|
CONFIG_VM_EVENT_COUNTERS=y
|
||||||
|
CONFIG_VT=y
|
||||||
|
CONFIG_VT_CONSOLE=y
|
||||||
|
CONFIG_VT_HW_CONSOLE_BINDING=y
|
||||||
|
CONFIG_VXFS_FS=y
|
||||||
|
CONFIG_WAR_ICACHE_REFILLS=y
|
||||||
|
CONFIG_XPS=y
|
||||||
|
CONFIG_ZBOOT_LOAD_ADDRESS=0x0
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user