From 8a32dd94497b6bcb94fa0682a1e684cecbca724e Mon Sep 17 00:00:00 2001 From: N-Storm Date: Mon, 2 Dec 2024 03:41:04 +0300 Subject: [PATCH] Removed deprecated things, updated README --- .../workflows/BPI-r4_build-selfhosted.yaml | 103 --------------- .github/workflows/BPI-r4_build.yaml | 14 --- .github/workflows/MTK-SDK-21_02.yaml | 81 ------------ .github/workflows/MTK-SDK-MASTER.yaml | 92 -------------- BPI-r4/files/etc/rc.local | 7 -- BPI-r4/files/etc/ssh/sshd_config | 118 ------------------ .../etc/ssh/sshd_config.d/ssh_hardening.conf | 13 -- BPI-r4/files/etc/uci-defaults/999-QOL_config | 2 - README.md | 19 +-- patches/BPI-r4/999-01_32k_ppe.patch | 26 ---- patches/BPI-r4/999-02_prefetch.patch | 55 -------- patches/BPI-r4/999-03_pp_xdp.patch | 14 --- patches/BPI-r4/sfp_autoneg_off.patch | 13 -- 13 files changed, 1 insertion(+), 556 deletions(-) delete mode 100644 .github/workflows/BPI-r4_build-selfhosted.yaml delete mode 100644 .github/workflows/MTK-SDK-21_02.yaml delete mode 100644 .github/workflows/MTK-SDK-MASTER.yaml delete mode 100644 BPI-r4/files/etc/rc.local delete mode 100644 BPI-r4/files/etc/ssh/sshd_config delete mode 100644 BPI-r4/files/etc/ssh/sshd_config.d/ssh_hardening.conf delete mode 100644 BPI-r4/files/etc/uci-defaults/999-QOL_config delete mode 100644 patches/BPI-r4/999-01_32k_ppe.patch delete mode 100644 patches/BPI-r4/999-02_prefetch.patch delete mode 100644 patches/BPI-r4/999-03_pp_xdp.patch delete mode 100644 patches/BPI-r4/sfp_autoneg_off.patch diff --git a/.github/workflows/BPI-r4_build-selfhosted.yaml b/.github/workflows/BPI-r4_build-selfhosted.yaml deleted file mode 100644 index 819e51ad..00000000 --- a/.github/workflows/BPI-r4_build-selfhosted.yaml +++ /dev/null @@ -1,103 +0,0 @@ -name: OpenWrt for Mediatek_mt7988a_bpi-r4 and release - -on: - workflow_dispatch: - -env: - REMOTE_REPOSITORY: glassd00r/openwrt - REMOTE_BRANCH: main - CONFIG_FILE: bpi-r4-mda.config - MTK_PPE_ENTRIES_SHIFT_PATCH: 999-01_32k_ppe.patch - PREFETCH_PATCH: 999-02_prefetch.patch - PP_XDP_PATCH: 999-03_pp_xdp.patch - CUSTOM_FILES_PATH: files/ - RELEASE_PREFIX: Mediatek_mt7988a_bpi-r4 - -jobs: - build: - name: Build OpenWrt - runs-on: self-hosted - steps: - - name: Install dependencies - run: | - sudo apt update - sudo apt full-upgrade -y - sudo apt install -y build-essential clang flex bison g++ gawk gcc-multilib g++-multilib gettext git libncurses5-dev libssl-dev python3-setuptools rsync swig unzip zlib1g-dev file wget - - name: Checkout remote repository - uses: actions/checkout@v4 - with: - repository: ${{ env.REMOTE_REPOSITORY }} - ref: ${{ env.REMOTE_BRANCH }} - - name: Checkout current repository - uses: actions/checkout@v4 - with: - path: "custom_repo" - - name: Update and install feeds - run: | - ./scripts/feeds update -a - ./scripts/feeds install -a - - name: Apply 32K PPE Patch - run: | - mv custom_repo/patches/BPI-r4/${{ env.MTK_PPE_ENTRIES_SHIFT_PATCH }} target/linux/mediatek/patches-6.6/${{ env.MTK_PPE_ENTRIES_SHIFT_PATCH }} - cd target/linux/mediatek/patches-6.6 - git apply ${{ env.MTK_PPE_ENTRIES_SHIFT_PATCH }} - - name: Apply PREFETCH Patch - run: | - mv custom_repo/patches/BPI-r4/${{ env.PREFETCH_PATCH }} target/linux/mediatek/patches-6.6/${{ env.PREFETCH_PATCH }} - cd target/linux/mediatek/patches-6.6 - git apply ${{ env.PREFETCH_PATCH }} - - name: Apply PP_XDP Patch - run: | - mv custom_repo/patches/BPI-r4/${{ env.PP_XDP_PATCH }} target/linux/mediatek/patches-6.6/${{ env.PP_XDP_PATCH }} - cd target/linux/mediatek/patches-6.6 - git apply ${{ env.PP_XDP_PATCH }} - - name: Configure firmware image - run: | - mv custom_repo/${{ env.CONFIG_FILE }} .config - make defconfig - - name: Include custom files - run: | - mkdir -p ${{ env.CUSTOM_FILES_PATH }} - mv custom_repo/BPI-r4/${{ env.CUSTOM_FILES_PATH }}* ${{ env.CUSTOM_FILES_PATH }} - - name: Download dependencies - run: make -j$(($(nproc)+1)) download - - name: Build the firmware image - run: make -j$(($(nproc)+1)) world - - name: Package output - run: tar -cvf bpi_r4-images.tar bin/targets/mediatek/filogic - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: bpi_r4-images - path: bpi_r4-images.tar - - release: - name: Create release - needs: [build] - if: needs.build.result == 'success' - runs-on: self-hosted - steps: - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: bpi_r4-images - - name: Extract artifacts - run: tar xf bpi_r4-images.tar - - name: Get current date - run: echo "RELEASE_DATE=$(date +%F)" >> $GITHUB_ENV - - name: Create release - uses: softprops/action-gh-release@master - with: - files: bin/targets/mediatek/filogic/* - tag_name: ${{ env.RELEASE_PREFIX }}-${{ env.RELEASE_DATE }} - name: Openwrt BPI-r4 ${{ env.RELEASE_DATE }} - body: | - Updated prebuilt images for ${{ env.RELEASE_DATE }} - Build Commit: ${{ needs.check_commits.outputs.latest_commit_sha }} - - name: Clean up old releases - uses: dev-drprasad/delete-older-releases@master - with: - keep_latest: 5 - delete_tags: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/BPI-r4_build.yaml b/.github/workflows/BPI-r4_build.yaml index b470e717..4f0b8896 100644 --- a/.github/workflows/BPI-r4_build.yaml +++ b/.github/workflows/BPI-r4_build.yaml @@ -10,10 +10,6 @@ env: REMOTE_REPOSITORY: N-Storm/openwrt REMOTE_BRANCH: bananapi4 CONFIG_FILE: config-nstorm-bananapi-bpi-r4 - MTK_PPE_ENTRIES_SHIFT_PATCH: 999-01_32k_ppe.patch - PREFETCH_PATCH: 999-02_prefetch.patch - PP_XDP_PATCH: 999-03_pp_xdp.patch - CUSTOM_FILES_PATH: files/ RELEASE_PREFIX: nstorm-bpi-r4 jobs: @@ -33,11 +29,6 @@ jobs: repository: ${{ env.REMOTE_REPOSITORY }} ref: ${{ env.REMOTE_BRANCH }} - - name: Checkout current repository - uses: actions/checkout@v4 - with: - path: "custom_repo" - - name: Update and install feeds run: | ./scripts/feeds update -a @@ -48,11 +39,6 @@ jobs: cat ${{ env.CONFIG_FILE }} > .config make defconfig - - name: Include custom files - run: | - mkdir -p ${{ env.CUSTOM_FILES_PATH }} - mv custom_repo/BPI-r4/${{ env.CUSTOM_FILES_PATH }}* ${{ env.CUSTOM_FILES_PATH }} - - name: Try to fetch dependencies cache uses: actions/cache/restore@v4 with: diff --git a/.github/workflows/MTK-SDK-21_02.yaml b/.github/workflows/MTK-SDK-21_02.yaml deleted file mode 100644 index 498dc2c3..00000000 --- a/.github/workflows/MTK-SDK-21_02.yaml +++ /dev/null @@ -1,81 +0,0 @@ -name: MTK_SDK 21.02 for bpi-r4 and release - -on: - workflow_dispatch: - -env: - REMOTE_REPOSITORY: padavanonly/immortalwrt-mt798x - REMOTE_BRANCH: mt7988 - CONFIG_FILE: mtk-sdk-2102.config - CUSTOM_FILES_PATH: files/ - RELEASE_PREFIX: Mediatek_SDK_2102 - -jobs: - build: - name: Build OpenWrt - runs-on: ubuntu-22.04 - steps: - - name: Install dependencies - run: | - sudo apt update - sudo apt full-upgrade -y - sudo apt install -y build-essential clang flex bison g++ gawk gcc-multilib g++-multilib gettext git libncurses-dev libssl-dev python3-distutils rsync unzip zlib1g-dev file wget - - name: Checkout remote repository - uses: actions/checkout@v4 - with: - repository: ${{ env.REMOTE_REPOSITORY }} - ref: ${{ env.REMOTE_BRANCH }} - - name: Checkout current repository - uses: actions/checkout@v4 - with: - path: "custom_repo" - - name: Update and install feeds - run: | - ./scripts/feeds update -a - ./scripts/feeds install -a - - name: Configure firmware image - run: | - mv custom_repo/${{ env.CONFIG_FILE }} .config - make defconfig - - name: Download dependencies - run: make -j$(($(nproc)+1)) download - - name: Build the firmware image - run: make -j$(($(nproc)+1)) world - - name: Package output - run: tar -cvf mtk_bpi_r4-images.tar bin/targets/mediatek/mt7988 - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: mtk_bpi_r4-images - path: mtk_bpi_r4-images.tar - - release: - name: Create release - needs: [build] - if: needs.build.result == 'success' - runs-on: ubuntu-22.04 - steps: - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: mtk_bpi_r4-images - - name: Extract artifacts - run: tar xf mtk_bpi_r4-images.tar - - name: Get current date - run: echo "RELEASE_DATE=$(date +%F)" >> $GITHUB_ENV - - name: Create release - uses: softprops/action-gh-release@master - with: - files: bin/targets/mediatek/mt7988/* - tag_name: ${{ env.RELEASE_PREFIX }}-${{ env.RELEASE_DATE }} - name: MTK_SDK_21.02 BPI-r4 ${{ env.RELEASE_DATE }} - body: | - Updated prebuilt images for ${{ env.RELEASE_DATE }} - Build Commit: ${{ needs.check_commits.outputs.latest_commit_sha }} - - name: Clean up old releases - uses: dev-drprasad/delete-older-releases@master - with: - keep_latest: 5 - delete_tags: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/MTK-SDK-MASTER.yaml b/.github/workflows/MTK-SDK-MASTER.yaml deleted file mode 100644 index a2d5ee12..00000000 --- a/.github/workflows/MTK-SDK-MASTER.yaml +++ /dev/null @@ -1,92 +0,0 @@ -name: MTK_SDK Master for bpi-r4 and release -on: - workflow_dispatch: - -env: - REMOTE_REPOSITORY: openwrt/openwrt - CONFIG_FILE: mtk-sdk.config - CUSTOM_FILES_PATH: files/ - RELEASE_PREFIX: Mediatek_SDK - -jobs: - build: - name: Build OpenWrt - runs-on: ubuntu-24.04 - steps: - - name: Install dependencies - run: | - sudo apt update - sudo apt install -y \ - build-essential clang flex bison g++ gawk \ - gcc-multilib g++-multilib gettext git libncurses5-dev libssl-dev \ - python3-setuptools rsync swig unzip zlib1g-dev file wget - sudo apt full-upgrade -y - - name: Checkout remote repository - uses: actions/checkout@v4 - with: - repository: ${{ env.REMOTE_REPOSITORY }} - ref: ${{ env.REMOTE_BRANCH }} - - name: Checkout current repository - uses: actions/checkout@v4 - with: - path: "custom_repo" - - name: Update and install feeds - run: | - echo "src-git mtk_openwrt_feed https://git01.mediatek.com/openwrt/feeds/mtk-openwrt-feeds" >> feeds.conf.default - ./scripts/feeds update -a - ./scripts/feeds install -a - - name: Apply MediaTek OpenWrt files and patches - shell: bash {0} - run: | - cp -af ./feeds/mtk_openwrt_feed/master/files/* . - for file in $(find ./feeds/mtk_openwrt_feed/master/patches-base -name "*.patch" | sort); do patch -f -p1 -i ${file}; done - - name: Configure firmware image - run: | - mv custom_repo/${{ env.CONFIG_FILE }} .config - make defconfig - - name: Include custom files - run: | - mkdir -p ${{ env.CUSTOM_FILES_PATH }} - mv custom_repo/BPI-r4/${{ env.CUSTOM_FILES_PATH }}* ${{ env.CUSTOM_FILES_PATH }} - - name: Download dependencies - run: make -j $(($(nproc)+1)) download - - name: Build the firmware image - run: make -j $(($(nproc)+1)) world - - name: Package output - run: tar -cvf bpi_r4-images.tar bin/targets/mediatek/filogic - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: bpi_r4-images - path: bpi_r4-images.tar - - release: - name: Create release - needs: [build] - if: needs.build.result == 'success' - runs-on: ubuntu-24.04 - steps: - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: bpi_r4-images - - name: Extract artifacts - run: tar xf bpi_r4-images.tar - - name: Get current date - run: echo "RELEASE_DATE=$(date +%F)" >> $GITHUB_ENV - - name: Create release - uses: softprops/action-gh-release@master - with: - files: bin/targets/mediatek/filogic/* - tag_name: ${{ env.RELEASE_PREFIX }}-${{ env.RELEASE_DATE }} - name: MTK_SDK BPI-r4 ${{ env.RELEASE_DATE }} - body: | - Updated prebuilt images for ${{ env.RELEASE_DATE }} - Build Commit: ${{ needs.check_commits.outputs.latest_commit_sha }} - - name: Clean up old releases - uses: dev-drprasad/delete-older-releases@master - with: - keep_latest: 5 - delete_tags: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/BPI-r4/files/etc/rc.local b/BPI-r4/files/etc/rc.local deleted file mode 100644 index 97662a17..00000000 --- a/BPI-r4/files/etc/rc.local +++ /dev/null @@ -1,7 +0,0 @@ -# Put your custom commands here that should be executed once -# the system init finished. By default this file does nothing. - -awk '$5 >= 3071' /etc/ssh/moduli > /etc/ssh/moduli.safe -mv /etc/ssh/moduli.safe /etc/ssh/moduli - -exit 0 diff --git a/BPI-r4/files/etc/ssh/sshd_config b/BPI-r4/files/etc/ssh/sshd_config deleted file mode 100644 index 4526f83f..00000000 --- a/BPI-r4/files/etc/ssh/sshd_config +++ /dev/null @@ -1,118 +0,0 @@ -# $OpenBSD: sshd_config,v 1.104 2021/07/02 05:11:21 dtucker Exp $ - -# This is the sshd server system-wide configuration file. See -# sshd_config(5) for more information. - -# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin - -# The strategy used for options in the default sshd_config shipped with -# OpenSSH is to specify options with their default value where -# possible, but leave them commented. Uncommented options override the -# default value. - -Include /etc/ssh/sshd_config.d/*.conf - -#Port 22 -#AddressFamily any -#ListenAddress 0.0.0.0 -#ListenAddress :: - -HostKey /etc/ssh/ssh_host_rsa_key -#HostKey /etc/ssh/ssh_host_ecdsa_key -HostKey /etc/ssh/ssh_host_ed25519_key - -# Ciphers and keying -#RekeyLimit default none - -# Logging -#SyslogFacility AUTH -#LogLevel INFO - -# Authentication: - -#LoginGraceTime 2m -PermitRootLogin yes -#StrictModes yes -#MaxAuthTries 6 -#MaxSessions 10 - -#PubkeyAuthentication yes - -# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 -# but this is overridden so installations will only check .ssh/authorized_keys -AuthorizedKeysFile .ssh/authorized_keys - -#AuthorizedPrincipalsFile none - -#AuthorizedKeysCommand none -#AuthorizedKeysCommandUser nobody - -# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts -#HostbasedAuthentication no -# Change to yes if you don't trust ~/.ssh/known_hosts for -# HostbasedAuthentication -#IgnoreUserKnownHosts no -# Don't read the user's ~/.rhosts and ~/.shosts files -#IgnoreRhosts yes - -# To disable tunneled clear text passwords, change to no here! -#PasswordAuthentication yes -#PermitEmptyPasswords no - -# Change to no to disable s/key passwords -#KbdInteractiveAuthentication yes - -# Kerberos options -#KerberosAuthentication no -#KerberosOrLocalPasswd yes -#KerberosTicketCleanup yes -#KerberosGetAFSToken no - -# GSSAPI options -#GSSAPIAuthentication no -#GSSAPICleanupCredentials yes - -# Set this to 'yes' to enable PAM authentication, account processing, -# and session processing. If this is enabled, PAM authentication will -# be allowed through the KbdInteractiveAuthentication and -# PasswordAuthentication. Depending on your PAM configuration, -# PAM authentication via KbdInteractiveAuthentication may bypass -# the setting of "PermitRootLogin prohibit-password". -# If you just want the PAM account and session checks to run without -# PAM authentication, then enable this but set PasswordAuthentication -# and KbdInteractiveAuthentication to 'no'. -#UsePAM no - -#AllowAgentForwarding yes -#AllowTcpForwarding yes -#GatewayPorts no -#X11Forwarding no -#X11DisplayOffset 10 -#X11UseLocalhost yes -#PermitTTY yes -#PrintMotd yes -#PrintLastLog yes -#TCPKeepAlive yes -#PermitUserEnvironment no -#Compression delayed -#ClientAliveInterval 0 -#ClientAliveCountMax 3 -#UseDNS no -#PidFile /var/run/sshd.pid -#MaxStartups 10:30:100 -#PermitTunnel no -#ChrootDirectory none -#VersionAddendum none - -# no default banner path -#Banner none - -# override default of no subsystems -Subsystem sftp /usr/lib/sftp-server - -# Example of overriding settings on a per-user basis -#Match User anoncvs -# X11Forwarding no -# AllowTcpForwarding no -# PermitTTY no -# ForceCommand cvs server diff --git a/BPI-r4/files/etc/ssh/sshd_config.d/ssh_hardening.conf b/BPI-r4/files/etc/ssh/sshd_config.d/ssh_hardening.conf deleted file mode 100644 index c2ba9e7e..00000000 --- a/BPI-r4/files/etc/ssh/sshd_config.d/ssh_hardening.conf +++ /dev/null @@ -1,13 +0,0 @@ -KexAlgorithms sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512 - -Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr - -MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com - -HostKeyAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256 - -CASignatureAlgorithms sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256 - -HostbasedAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256 - -PubkeyAcceptedAlgorithms sk-ssh-ed25519-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256 diff --git a/BPI-r4/files/etc/uci-defaults/999-QOL_config b/BPI-r4/files/etc/uci-defaults/999-QOL_config deleted file mode 100644 index 3a2a7e21..00000000 --- a/BPI-r4/files/etc/uci-defaults/999-QOL_config +++ /dev/null @@ -1,2 +0,0 @@ -uci -q batch << EOI -EOI diff --git a/README.md b/README.md index 52895749..301d4bd0 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,12 @@ # BananaPI BPI-R4 OpenWRT Builder -This project automates the process of building OpenWrt firmware images for the BananaPI BPI-R4 with BPI-R4-NIC-BE14 WiFi 7 NIC. The build process incorporates various optimizations, hardening options, and quality-of-life enhancements. - -## Features - -[TODO] +This project automates the process of building OpenWrt firmware images for the BananaPI BPI-R4 with BPI-R4-NIC-BE14 WiFi 7 NIC from this repo: https://github.com/N-Storm/openwrt/tree/bananapi4 ## Build Process The build process is automated using GitHub Actions... [TODO] -## Configuration - -The project utilizes a custom configuration file [`bpi-r4-mda.config`](bpi-r4-mda.config) to specify the desired settings for the firmware build. This file includes various options such as target platform, compiler optimizations, package selections, and more. - -## SSH Hardening - -To enhance the security of SSH connections, the project includes a hardened SSH configuration. The configuration is derived from recommendations by [SSH-Audit](https://github.com/jtesta/ssh-audit) and the [BSI](https://www.bsi.bund.de/), it specifies strong key exchange algorithms, ciphers, message authentication codes (MACs), host key algorithms, and public key algorithms. This ensures that only secure and up-to-date algorithms are used for SSH communication. - - -## Contributing - -Contributions to this project are welcome. If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository. - ## Acknowledgements - The OpenWrt project for providing the foundation for this firmware build. diff --git a/patches/BPI-r4/999-01_32k_ppe.patch b/patches/BPI-r4/999-01_32k_ppe.patch deleted file mode 100644 index 1171b1e6..00000000 --- a/patches/BPI-r4/999-01_32k_ppe.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 06748d507c7b2b431761f21dd71b4ec4f7841c90 Mon Sep 17 00:00:00 2001 -From: Elad Yifee -Date: Sun, 16 Jun 2024 16:26:48 +0300 -Subject: [PATCH] change ppe entries num to 32K - -Signed-off-by: Elad Yifee ---- - drivers/net/ethernet/mediatek/mtk_ppe.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.h b/drivers/net/ethernet/mediatek/mtk_ppe.h -index 691806bca372..6db85d897fa9 100644 ---- a/drivers/net/ethernet/mediatek/mtk_ppe.h -+++ b/drivers/net/ethernet/mediatek/mtk_ppe.h -@@ -8,7 +8,7 @@ - #include - #include - --#define MTK_PPE_ENTRIES_SHIFT 4 -+#define MTK_PPE_ENTRIES_SHIFT 5 - #define MTK_PPE_ENTRIES (1024 << MTK_PPE_ENTRIES_SHIFT) - #define MTK_PPE_HASH_MASK (MTK_PPE_ENTRIES - 1) - #define MTK_PPE_WAIT_TIMEOUT_US 1000000 --- -2.45.1 - diff --git a/patches/BPI-r4/999-02_prefetch.patch b/patches/BPI-r4/999-02_prefetch.patch deleted file mode 100644 index f776be31..00000000 --- a/patches/BPI-r4/999-02_prefetch.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 16ca427cf4c3..4d0052dbe3f4 100644 ---- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c -+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1963,6 +1963,7 @@ static u32 mtk_xdp_run(struct mtk_eth *eth, struct mtk_rx_ring *ring, - if (!prog) - goto out; - -+ net_prefetchw(xdp->data_hard_start); - act = bpf_prog_run_xdp(prog, xdp); - switch (act) { - case XDP_PASS: -@@ -2038,6 +2039,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, - - idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size); - rxd = ring->dma + idx * eth->soc->rx.desc_size; -+ prefetch(rxd); - data = ring->data[idx]; - - if (!mtk_rx_get_desc(eth, &trxd, rxd)) -@@ -2105,6 +2107,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, - if (ret != XDP_PASS) - goto skip_rx; - -+ net_prefetch(xdp.data_meta); - skb = napi_build_skb(data, PAGE_SIZE); - if (unlikely(!skb)) { - page_pool_put_full_page(ring->page_pool, -@@ -2113,6 +2116,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, - goto skip_rx; - } - -+ net_prefetchw(skb->data); - skb_reserve(skb, xdp.data - xdp.data_hard_start); - skb_put(skb, xdp.data_end - xdp.data); - skb_mark_for_recycle(skb); -@@ -2143,6 +2147,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, - dma_unmap_single(eth->dma_dev, ((u64)trxd.rxd1 | addr64), - ring->buf_size, DMA_FROM_DEVICE); - -+ net_prefetch(data + NET_SKB_PAD + NET_IP_ALIGN); - skb = napi_build_skb(data, ring->frag_size); - if (unlikely(!skb)) { - netdev->stats.rx_dropped++; -@@ -2150,7 +2155,8 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, - goto skip_rx; - } - -- skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN); -+ net_prefetchw(skb->data); -+ skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN); - skb_put(skb, pktlen); - } - - diff --git a/patches/BPI-r4/999-03_pp_xdp.patch b/patches/BPI-r4/999-03_pp_xdp.patch deleted file mode 100644 index 0d04bf55..00000000 --- a/patches/BPI-r4/999-03_pp_xdp.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -index 4d0052dbe3f4..2d1a48287c73 100644 ---- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c -+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2644,7 +2644,7 @@ static int mtk_rx_alloc(struct mtk_eth *eth, int ring_no, int rx_flag) - if (!ring->data) - return -ENOMEM; - -- if (mtk_page_pool_enabled(eth)) { -+ if (mtk_page_pool_enabled(eth) && rcu_access_pointer(eth->prog)) { - struct page_pool *pp; - - pp = mtk_create_page_pool(eth, &ring->xdp_q, ring_no, - diff --git a/patches/BPI-r4/sfp_autoneg_off.patch b/patches/BPI-r4/sfp_autoneg_off.patch deleted file mode 100644 index bfd60979..00000000 --- a/patches/BPI-r4/sfp_autoneg_off.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c -index db39dec7f2471c..7769469668bfa6 100644 ---- a/drivers/net/phy/sfp-bus.c -+++ b/drivers/net/phy/sfp-bus.c -@@ -335,7 +335,7 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id, - } - } - -- phylink_set(modes, Autoneg); -+ phylink_clear(modes, Autoneg); - phylink_set(modes, Pause); - phylink_set(modes, Asym_Pause); -