diff --git a/.github/workflows/Openwrt-AutoBuild.yml b/.github/workflows/Openwrt-AutoBuild.yml index d365455b70ee..e4d736f8e167 100644 --- a/.github/workflows/Openwrt-AutoBuild.yml +++ b/.github/workflows/Openwrt-AutoBuild.yml @@ -12,7 +12,7 @@ on: repository_dispatch: env: - REPO_TOKEN: ${{ secrets.REPO_TOKEN }} + REPO_TOKEN: ${{ secrets.TOKEN_KIDDIN9 }} PPPOE_USERNAME: ${{ secrets.PPPOE_USERNAME }} PPPOE_PASSWD: ${{ secrets.PPPOE_PASSWD }} SCKEY: ${{ secrets.SCKEY }} @@ -61,7 +61,7 @@ jobs: echo "UPLOAD_FIRMWARE_FOR_RELEASE=${UPLOAD_FIRMWARE_FOR_RELEASE}" >> $GITHUB_ENV echo "UPLOAD_FIRMWARE_TO_COWTRANSFER=${UPLOAD_FIRMWARE_TO_COWTRANSFER}" >> $GITHUB_ENV echo "UPLOAD_FIRMWARE_TO_WETRANSFER=${UPLOAD_FIRMWARE_TO_WETRANSFER}" >> $GITHUB_ENV - sed -i "1a REPO_TOKEN=${{ secrets.REPO_TOKEN }}" ${GITHUB_WORKSPACE}/devices/common/diy.sh + sed -i "1a REPO_TOKEN=${{ secrets.TOKEN_KIDDIN9 }}" ${GITHUB_WORKSPACE}/devices/common/diy.sh sed -i "1a TARGET=${{matrix.target}}" ${GITHUB_WORKSPACE}/devices/common/diy.sh if [ ${{matrix.target}} == "x86_64" ]; then echo "ARCH=linux/amd64" >> $GITHUB_ENV @@ -103,11 +103,11 @@ jobs: - name: Trigger Packages Update continue-on-error: true run: | - status=$(curl -H "Authorization: token ${{ secrets.REPO_TOKEN }} -s "https://api.github.com/repos/kiddin9/openwrt-packages/actions/runs" | jq -r '.workflow_runs[0].status') + status=$(curl -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }} -s "https://api.github.com/repos/kiddin9/openwrt-packages/actions/runs" | jq -r '.workflow_runs[0].status') if [[ "$status" == "completed" ]]; then curl -X POST https://api.github.com/repos/kiddin9/openwrt-packages/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ --data '{"event_type": "update"}' fi @@ -150,7 +150,7 @@ jobs: cd - elif [[ ! "${{ env.REPO_BRANCH }}" && "$REPO_URL" == "https://github.com/openwrt/openwrt" ]]; then REPO_BRANCH="$((curl -gs -H 'Content-Type: application/json' \ - -H "Authorization: Bearer ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: Bearer ${{ secrets.TOKEN_KIDDIN9 }}" \ -X POST -d '{ "query": "query {repository(owner: \"openwrt\", name: \"openwrt\") {refs(refPrefix: \"refs/tags/\", last: 4, orderBy: {field: TAG_COMMIT_DATE, direction: ASC}) {edges {node {name}}}}}"}' https://api.github.com/graphql) | jq -r '.data.repository.refs.edges[].node.name' | grep v23 | tail -n 1)" git clone $REPO_URL -b $REPO_BRANCH openwrt elif [[ ! "${{ env.REPO_BRANCH }}" ]]; then @@ -214,13 +214,6 @@ jobs: CONFIG_CRYPTO_CHACHA20POLY1305=y \ CONFIG_FAT_DEFAULT_IOCHARSET="utf8" \ ' `find target/linux -path "target/linux/*/config-*"` - - - name: Default PPPOE Setting - if: env.PPPOE_USERNAME && env.PPPOE_PASSWD - run: | - sed -i '$i uci set network.wan.username=${{ env.PPPOE_USERNAME }}' openwrt/package/*/*/my-default-settings/files/etc/uci-defaults/95-default-settings - sed -i '$i uci set network.wan.password=${{ env.PPPOE_PASSWD }}' openwrt/package/*/*/my-default-settings/files/etc/uci-defaults/95-default-settings - sed -i '$i uci commit network' openwrt/package/*/*/my-default-settings/files/etc/uci-defaults/95-default-settings - name: Defconfig run: | @@ -291,9 +284,17 @@ jobs: echo "NOTICE=请分配不少于1G的存储容量" >> $GITHUB_ENV fi + - name: Upload firmware for artifact + uses: actions/upload-artifact@main + continue-on-error: true + if: env.UPLOAD_FIRMWARE_FOR_ARTIFACT == 'true' + with: + name: ${{ env.VERSION }}_${{matrix.target}} + path: | + openwrt/bin/targets/ + - name: Deploy imagebuilder to server uses: easingthemes/ssh-deploy@main - continue-on-error: true if: env.SSH_PRIVATE_KEY && ! contains(github.event.action, 'noser') with: SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} @@ -304,15 +305,6 @@ jobs: REMOTE_USER: root TARGET: "/www/wwwroot/op.supes.top/releases/tmp/" - - name: Upload firmware for artifact - uses: actions/upload-artifact@main - continue-on-error: true - if: env.UPLOAD_FIRMWARE_FOR_ARTIFACT == 'true' - with: - name: ${{ env.VERSION }}_${{matrix.target}} - path: | - openwrt/bin/targets/ - - name: Upload firmware to cowtransfer if: env.UPLOAD_FIRMWARE_TO_COWTRANSFER == 'true' continue-on-error: true @@ -349,7 +341,7 @@ jobs: continue-on-error: true if: env.REPO_TOKEN && env.UPLOAD_FIRMWARE_FOR_RELEASE == 'true' env: - GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} + GITHUB_TOKEN: ${{ secrets.TOKEN_KIDDIN9 }} with: files: "${{ env.FIRMWARE }}/*" name: ${{ env.date2 }} ${{matrix.target}} ${{ env.EMOJI }} @@ -407,4 +399,4 @@ jobs: keep_latest: 15 delete_tags: true env: - GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} + GITHUB_TOKEN: ${{ secrets.TOKEN_KIDDIN9 }} diff --git a/.github/workflows/repo-dispatcher.yml b/.github/workflows/repo-dispatcher.yml index f32a10f7d030..b36ec6ada2dc 100644 --- a/.github/workflows/repo-dispatcher.yml +++ b/.github/workflows/repo-dispatcher.yml @@ -22,7 +22,7 @@ on: default: '' env: - REPO_TOKEN: ${{ secrets.REPO_TOKEN }} + TOKEN_KIDDIN9: ${{ secrets.TOKEN_KIDDIN9 }} TZ: Asia/Shanghai jobs: @@ -50,13 +50,13 @@ jobs: - name: Trigger Packages Update run: | - gitdate=$(curl -H "Authorization: token ${{ secrets.REPO_TOKEN }}" -s "https://api.github.com/repos/kiddin9/openwrt-packages/actions/runs" | jq -r '.workflow_runs[0].created_at') + gitdate=$(curl -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" -s "https://api.github.com/repos/kiddin9/openwrt-packages/actions/runs" | jq -r '.workflow_runs[0].created_at') gitdate=$(date -d "$gitdate" +%s) now=$(date -d "$(date)" +%s) if [[ $(expr $gitdate + 120) < $now ]]; then curl -X POST https://api.github.com/repos/kiddin9/openwrt-packages/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ --data '{"event_type": "update"}' fi @@ -66,140 +66,140 @@ jobs: curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "x86_64 ${{ github.event.inputs.param }}", "client_payload": {"target": "x86_64"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "x86_generic ${{ github.event.inputs.param }}", "client_payload": {"target": "x86_generic"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "rockchip_armv8 ${{ github.event.inputs.param }}", "client_payload": {"target": "rockchip_armv8"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ + -d '{"event_type": "rockchip_rk3588_armv8 ${{ github.event.inputs.param }}", "client_payload": {"target": "rockchip_rk3588_armv8"}}' + curl \ + -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ + -H "Accept: application/vnd.github.everest-preview+json" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "bcm27xx_bcm2711 ${{ github.event.inputs.param }}", "client_payload": {"target": "bcm27xx_bcm2711"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "bcm27xx_bcm2710 ${{ github.event.inputs.param }}", "client_payload": {"target": "bcm27xx_bcm2710"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "bcm27xx_bcm2709 ${{ github.event.inputs.param }}", "client_payload": {"target": "bcm27xx_bcm2709"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "bcm27xx_bcm2708 ${{ github.event.inputs.param }}", "client_payload": {"target": "bcm27xx_bcm2708"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "armsr_armv8 ${{ github.event.inputs.param }}", "client_payload": {"target": "armsr_armv8"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "mediatek_mt7622 ${{ github.event.inputs.param }}", "client_payload": {"target": "mediatek_mt7622"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "mediatek_filogic ${{ github.event.inputs.param }}", "client_payload": {"target": "mediatek_filogic"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "mediatek_mt7981 ${{ github.event.inputs.param }}", "client_payload": {"target": "mediatek_mt7981"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "ipq50xx_arm ${{ github.event.inputs.param }}", "client_payload": {"target": "ipq50xx_arm"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ - -d '{"event_type": "mediatek_mt7986 ${{ github.event.inputs.param }}", "client_payload": {"target": "mediatek_mt7986"}}' - curl \ - -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ - -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "ramips_mt7621 ${{ github.event.inputs.param }}", "client_payload": {"target": "ramips_mt7621"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "ramips_mt7620 ${{ github.event.inputs.param }}", "client_payload": {"target": "ramips_mt7620"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "ramips_mt76x8 ${{ github.event.inputs.param }}", "client_payload": {"target": "ramips_mt76x8"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "ipq807x_generic ${{ github.event.inputs.param }}", "client_payload": {"target": "ipq807x_generic"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "ipq40xx_generic ${{ github.event.inputs.param }}", "client_payload": {"target": "ipq40xx_generic"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "kirkwood_generic ${{ github.event.inputs.param }}", "client_payload": {"target": "kirkwood_generic"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "ipq806x_generic ${{ github.event.inputs.param }}", "client_payload": {"target": "ipq806x_generic"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "ipq807x_ipq60xx ${{ github.event.inputs.param }}", "client_payload": {"target": "ipq807x_ipq60xx"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "meson_meson8b ${{ github.event.inputs.param }}", "client_payload": {"target": "meson_meson8b"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "ipq60xx_generic ${{ github.event.inputs.param }}", "client_payload": {"target": "ipq60xx_generic"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "mvebu_cortexa9 ${{ github.event.inputs.param }}", "client_payload": {"target": "mvebu_cortexa9"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "bcm53xx ${{ github.event.inputs.param }}", "client_payload": {"target": "bcm53xx"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "sunxi_cortexa53 ${{ github.event.inputs.param }}", "client_payload": {"target": "sunxi_cortexa53"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "sunxi_cortexa7 ${{ github.event.inputs.param }}", "client_payload": {"target": "sunxi_cortexa7"}}' curl \ -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ - -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \ + -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \ -d '{"event_type": "ath79_nand ${{ github.event.inputs.param }}", "client_payload": {"target": "ath79_nand"}}' diff --git a/devices/armsr_armv8/patches/rootfs.patch b/devices/armsr_armv8/patches/rootfs.patch index 5a6db549ddec..2cd1fc29c249 100644 --- a/devices/armsr_armv8/patches/rootfs.patch +++ b/devices/armsr_armv8/patches/rootfs.patch @@ -18,7 +18,7 @@ $(call Device/Export,$$(KDIR_KERNEL_IMAGE),$(1)) $(BIN_DIR)/$$(KERNEL_IMAGE): $$(KDIR_KERNEL_IMAGE) - cp $$^ $$@ -+ cp generic-kernel.bin $$@ ++ cp $(KDIR)/generic-kernel.bin $$@ ifndef IB ifdef CONFIG_IB install: $$(KDIR_KERNEL_IMAGE) @@ -36,7 +36,7 @@ IMAGES-y += combined.img endif ifeq ($(CONFIG_VMDK_IMAGES),y) -@@ -115,4 +113,20 @@ define Device/generic +@@ -115,4 +113,21 @@ define Device/generic endef TARGET_DEVICES += generic @@ -50,9 +50,10 @@ + if [ "$(PROFILE_SANITIZED)" == "box" ]; then \ + export BIN_DIR=$(BIN_DIR); \ + export DATE=$(DATE); \ -+ cd /www/wwwroot/op.supes.top/bcache/armsr/armv8/amlogic-s9xxx-openwrt; \ -+ . ../modify_amlogic.sh; \ -+ ./make -k 5.15.100 -b $(MORE) -s $(shell echo $$(($(ROOTFS_PARTSIZE)/1024/1024))) || true; \ ++ export MORE=$(MORE); \ ++ export ROOTFS_PARTSIZE=$(shell echo $$(($(ROOTFS_PARTSIZE)/1024/1024))); \ ++ cd /data/packit/amlogic-s9xxx-openwrt; \ ++ . ~/packit/packit_amlogic.sh; \ + fi +endef + diff --git a/devices/common/patches/LINUX_VERSION.patch b/devices/common/patches/LINUX_VERSION.patch new file mode 100644 index 000000000000..7398f57f4346 --- /dev/null +++ b/devices/common/patches/LINUX_VERSION.patch @@ -0,0 +1,19 @@ +--- a/Makefile ++++ b/Makefile +@@ -33,6 +33,7 @@ ifneq ($(OPENWRT_BUILD),1) + include $(TOPDIR)/include/toplevel.mk + else + include rules.mk ++ include $(INCLUDE_DIR)/target.mk + include $(INCLUDE_DIR)/depends.mk + include $(INCLUDE_DIR)/subdir.mk + include target/Makefile +@@ -131,6 +132,8 @@ world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp- + $(_SINGLE)$(SUBMAKE) -r package/index + $(_SINGLE)$(SUBMAKE) -r json_overview_image_info + $(_SINGLE)$(SUBMAKE) -r checksum ++ cp $(BIN_DIR)/packages/Packages.manifest $(BIN_DIR)/ ++ mv $(BIN_DIR)/packages $(BIN_DIR)/$(LINUX_VERSION) 2>/dev/null + ifneq ($(CONFIG_CCACHE),) + $(STAGING_DIR_HOST)/bin/ccache -s + endif diff --git a/devices/common/patches/targets.patch b/devices/common/patches/targets.patch index c11577494dc0..ef39698b2283 100644 --- a/devices/common/patches/targets.patch +++ b/devices/common/patches/targets.patch @@ -1,23 +1,3 @@ ---- a/Makefile -+++ b/Makefile -@@ -40,6 +40,7 @@ else - include tools/Makefile - include toolchain/Makefile - -+include $(INCLUDE_DIR)/target.mk - $(toolchain/stamp-compile): $(tools/stamp-compile) $(if $(CONFIG_BUILDBOT),toolchain_rebuild_check) - $(target/stamp-compile): $(toolchain/stamp-compile) $(tools/stamp-compile) $(BUILD_DIR)/.prepared - $(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup) -@@ -131,6 +132,8 @@ world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp- - $(_SINGLE)$(SUBMAKE) -r package/index - $(_SINGLE)$(SUBMAKE) -r json_overview_image_info - $(_SINGLE)$(SUBMAKE) -r checksum -+ cp $(BIN_DIR)/packages/Packages.manifest $(BIN_DIR)/ -+ mv $(BIN_DIR)/packages $(BIN_DIR)/$(LINUX_VERSION) 2>/dev/null - ifneq ($(CONFIG_CCACHE),) - $(STAGING_DIR_HOST)/bin/ccache -s - endif - --- a/include/target.mk +++ b/include/target.mk @@ -53,10 +53,10 @@ DEFAULT_PACKAGES.nas:=\ diff --git a/devices/ipq60xx_generic/diy.sh b/devices/ipq60xx_generic/diy.sh index 086af4088927..ca7da5213e66 100644 --- a/devices/ipq60xx_generic/diy.sh +++ b/devices/ipq60xx_generic/diy.sh @@ -3,9 +3,5 @@ shopt -s extglob svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/ipq60xx target/linux/ipq60xx -git clone https://github.com/robimarko/nss-packages package/nss-packages -svn co https://github.com/coolsnowwolf/lede/trunk/package/qca package/nss-packages/qca -mv -f package/nss-packages/qca/nss/* package/nss-packages/qca/ -rm -rf package/nss-packages/qca/qca-ssdk package/nss-packages/qca/qca-nss-dp package/nss-packages/qca/qca-*-64 package/nss-packages/qca/nss +svn co https://github.com/coolsnowwolf/lede/trunk/package/qca package/qca -sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += kmod-qca-nss-dp kmod-qca-nss-drv kmod-qca-nss-drv-pppoe nss-firmware-ipq6018 qca-nss-ecm/' target/linux/ipq60xx/Makefile diff --git a/devices/ipq806x_generic/.config b/devices/ipq806x_generic/.config index fff6e8e89107..2d1122e30e62 100644 --- a/devices/ipq806x_generic/.config +++ b/devices/ipq806x_generic/.config @@ -14,6 +14,8 @@ CONFIG_TARGET_DEVICE_ipq806x_generic_DEVICE_tplink_c2600=y CONFIG_TARGET_DEVICE_ipq806x_generic_DEVICE_tplink_vr2600v=y CONFIG_TARGET_DEVICE_ipq806x_generic_DEVICE_buffalo_wxr-2533dhp=y +CONFIG_PACKAGE_MAC80211_NSS_SUPPORT=y + CONFIG_PACKAGE_luci-ssl=y # uhttpd服务 diff --git a/devices/ipq806x_generic/diy.sh b/devices/ipq806x_generic/diy.sh index 588bbd3b6289..0005aa3b7abd 100644 --- a/devices/ipq806x_generic/diy.sh +++ b/devices/ipq806x_generic/diy.sh @@ -4,11 +4,9 @@ shopt -s extglob SHELL_FOLDER=$(dirname $(readlink -f "$0")) -git clone https://github.com/robimarko/nss-packages package/nss-packages -svn co https://github.com/coolsnowwolf/lede/trunk/package/qca package/nss-packages/qca -mv -f package/nss-packages/qca/nss/* package/nss-packages/qca/ -rm -rf package/nss-packages/qca/qca-ssdk package/nss-packages/qca/qca-nss-dp package/nss-packages/qca/qca-*-64 package/nss-packages/qca/nss +git clone https://github.com/qosmio/nss-packages package/nss-packages -sed -i "/DEPENDS:/d" package/nss-packages/qca/qca-nss-drv/Makefile +#rm -rf target/linux/ipq806x +#svn co https://github.com/APCCV/OpenWRT-23.05.0-rc1-NSS/trunk/target/linux/ipq806x target/linux/ipq806x -sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += kmod-qca-nss-drv kmod-qca-nss-ecm-standard kmod-qca-nss-gmac kmod-qca-nss-drv-pppoe kmod-qca-mcs/' target/linux/ipq806x/Makefile \ No newline at end of file +#sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += kmod-qca-nss-drv kmod-qca-nss-drv-qdisc kmod-qca-nss-ecm-standard kmod-qca-nss-gmac kmod-qca-nss-drv-pppoe kmod-qca-nss-drv-pptp kmod-nss-ifb qca-nss-crypto qca-nss-drv-igs/' target/linux/ipq806x/Makefile \ No newline at end of file diff --git a/devices/ipq806x_generic/patches/mac80211-NSS.patch b/devices/ipq806x_generic/patches/mac80211-NSS.patch new file mode 100644 index 000000000000..04dbfc4f2376 --- /dev/null +++ b/devices/ipq806x_generic/patches/mac80211-NSS.patch @@ -0,0 +1,415 @@ +From fc0a9dd3c5f4e6a545b98239affd1d1e3f8c55ca Mon Sep 17 00:00:00 2001 +From: ACwifidude +Date: Fri, 30 Sep 2022 11:33:18 -0500 +Subject: [PATCH] ipq806x: NSS Hardware Offloading mac80211 support + +--- + package/kernel/mac80211/Makefile | 22 +- + .../subsys/999-mac80211-NSS-support.patch | 292 ++++++++++++++++++ + 2 files changed, 310 insertions(+), 4 deletions(-) + create mode 100644 package/kernel/mac80211/patches/subsys/999-mac80211-NSS-support.patch + +diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile +index 248b48c3c15..d1840c91758 100644 +--- a/package/kernel/mac80211/Makefile ++++ b/package/kernel/mac80211/Makefile +@@ -78,6 +78,7 @@ config-$(CONFIG_PACKAGE_CFG80211_TESTMODE) += NL80211_TESTMODE + + config-$(call config_package,mac80211) += MAC80211 + config-$(CONFIG_PACKAGE_MAC80211_MESH) += MAC80211_MESH ++config-$(CONFIG_PACKAGE_MAC80211_NSS_SUPPORT) += MAC80211_NSS_SUPPORT + + include ath.mk + include broadcom.mk +@@ -121,7 +122,7 @@ define KernelPackage/mac80211 + $(call KernelPackage/mac80211/Default) + TITLE:=Linux 802.11 Wireless Networking Stack + # +kmod-crypto-cmac is a runtime only dependency of net/mac80211/aes_cmac.c +- DEPENDS+= +kmod-cfg80211 +kmod-crypto-cmac +kmod-crypto-ccm +kmod-crypto-gcm +hostapd-common ++ DEPENDS+= +kmod-cfg80211 +kmod-crypto-cmac +kmod-crypto-ccm +kmod-crypto-gcm +hostapd-common +PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv + KCONFIG:=\ + CONFIG_AVERAGE=y + FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko +@@ -132,6 +133,16 @@ endef + define KernelPackage/mac80211/config + if PACKAGE_kmod-mac80211 + ++ if PACKAGE_kmod-qca-nss-drv ++ config PACKAGE_MAC80211_NSS_SUPPORT ++ bool "Enable NSS support for IPQ platform" ++ default y ++ help ++ This option enables support for NSS in boards ++ like Netgear R7800. ++ endif ++ ++ + config PACKAGE_MAC80211_DEBUGFS + bool "Export mac80211 internals in DebugFS" + select KERNEL_DEBUG_FS +@@ -273,9 +284,12 @@ ifeq ($(BUILD_VARIANT),smallbuffers) + C_DEFINES+= -DCONFIG_ATH10K_SMALLBUFFERS + endif + +-MAKE_OPTS:= \ +- $(subst -C $(LINUX_DIR),-C "$(PKG_BUILD_DIR)",$(KERNEL_MAKEOPTS)) \ +- EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include $(IREMAP_CFLAGS) $(C_DEFINES)" \ ++C_DEFINES+= -DSTANDALONE_CT ++ ++MAKE_OPTS:= -C "$(PKG_BUILD_DIR)" \ ++ $(KERNEL_MAKE_FLAGS) \ ++ EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include $(IREMAP_CFLAGS) $(C_DEFINES) \ ++ -I$(STAGING_DIR)/usr/include/qca-nss-drv" \ + KLIB_BUILD="$(LINUX_DIR)" \ + MODPROBE=true \ + KLIB=$(TARGET_MODULES_DIR) \ +diff --git a/package/kernel/mac80211/patches/subsys/999-mac80211-NSS-support.patch b/package/kernel/mac80211/patches/subsys/999-mac80211-NSS-support.patch +new file mode 100644 +index 00000000000..a0c1720c71a +--- /dev/null ++++ b/package/kernel/mac80211/patches/subsys/999-mac80211-NSS-support.patch +@@ -0,0 +1,344 @@ ++--- a/net/mac80211/Kconfig +++++ b/net/mac80211/Kconfig ++@@ -19,6 +19,13 @@ comment "CFG80211 needs to be enabled fo ++ ++ if MAC80211 != n ++ +++config MAC80211_NSS_SUPPORT +++ bool "Enable NSS support for IPQ platform" +++ default n +++ ---help--- +++ This option enables support for NSS in boards +++ like AP148. +++ ++ config MAC80211_HAS_RC ++ bool ++ ++--- a/local-symbols +++++ b/local-symbols ++@@ -39,6 +39,7 @@ LIB80211_CRYPT_CCMP= ++ LIB80211_CRYPT_TKIP= ++ LIB80211_DEBUG= ++ MAC80211= +++MAC80211_NSS_SUPPORT= ++ MAC80211_HAS_RC= ++ MAC80211_RC_MINSTREL= ++ MAC80211_RC_DEFAULT_MINSTREL= ++--- a/net/mac80211/ieee80211_i.h +++++ b/net/mac80211/ieee80211_i.h ++@@ -36,6 +36,10 @@ ++ ++ extern const struct cfg80211_ops mac80211_config_ops; ++ +++#ifdef CPTCFG_MAC80211_NSS_SUPPORT +++#include +++#endif +++ ++ struct ieee80211_local; ++ ++ /* Maximum number of broadcast/multicast frames to buffer when some of the ++@@ -1097,6 +1101,12 @@ struct ieee80211_sub_if_data { ++ } debugfs; ++ #endif ++ +++#ifdef CPTCFG_MAC80211_NSS_SUPPORT +++ struct nss_virt_if_handle *nssctx; +++ struct sk_buff_head rx_queue; +++ struct work_struct rx_work; +++#endif +++ ++ /* must be last, dynamically sized area in this! */ ++ struct ieee80211_vif vif; ++ }; ++--- a/net/mac80211/iface.c +++++ b/net/mac80211/iface.c ++@@ -15,6 +15,7 @@ ++ #include ++ #include ++ #include +++#include ++ #include ++ #include ++ #include ++@@ -27,6 +28,12 @@ ++ #include "wme.h" ++ #include "rate.h" ++ +++#ifdef CPTCFG_MAC80211_NSS_SUPPORT +++bool nss_redirect = true; +++module_param(nss_redirect, bool, 0644); +++MODULE_PARM_DESC(nss_redirect, "module param to enable NSS Redirect; 1-enable, 0-disable"); +++#endif +++ ++ /** ++ * DOC: Interface list locking ++ * ++@@ -439,6 +446,64 @@ static int ieee80211_open(struct net_dev ++ return err; ++ } ++ +++#ifdef CPTCFG_MAC80211_NSS_SUPPORT +++/* This callback is registered for nss redirect to receive packet exceptioned from nss in Rx path. +++ * When packet does not match any of the ecm rules is redirected back here. +++ */ +++void receive_from_nss(struct net_device *dev, struct sk_buff *sk_buff, struct napi_struct *napi) +++{ +++ struct net_device *netdev; +++ struct sk_buff *skb; +++ struct ieee80211_sub_if_data *sdata; +++ +++ if (!dev) { +++ kfree(sk_buff); +++ return; +++ } +++ +++ netdev = (struct net_device *)dev; +++ sdata = netdev_priv(netdev); +++ if (sdata->dev != dev) { +++ kfree(sk_buff); +++ return; +++ } +++ skb = (struct sk_buff *)sk_buff; +++ skb->dev = netdev; +++ skb->protocol = eth_type_trans(skb, netdev); +++ napi_gro_receive(napi, skb); +++} +++ +++static int ieee80211_create_nss_virtif(struct ieee80211_sub_if_data *sdata, struct net_device *dev) +++{ +++ if (sdata->nssctx != NULL) { +++ sdata_err(sdata, "Cannot create a NSS virtual interface. Already exists[n2h:%d, h2n:%d]!\n", +++ sdata->nssctx->if_num_n2h, sdata->nssctx->if_num_h2n); +++ return 1; +++ } +++ +++ sdata->nssctx = NULL; +++ if (nss_redirect) { +++ sdata->nssctx = nss_virt_if_create_sync(dev); +++ if (sdata->nssctx) { +++ sdata_info(sdata, "Created a NSS virtual interface\n"); +++ nss_virt_if_register(sdata->nssctx, receive_from_nss, sdata->dev); +++ } +++ else +++ sdata_err(sdata, "Failed to create a NSS virtual interface\n"); +++ } +++ +++ return 0; +++} +++ +++static void ieee80211_destroy_nss_virtif(struct ieee80211_sub_if_data *sdata) +++{ +++ if (sdata->nssctx) { +++ nss_virt_if_destroy_sync(sdata->nssctx); +++ sdata_info(sdata, "Destroyed NSS virtual interface\n"); +++ } +++} +++#endif +++ ++ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_down) ++ { ++ struct ieee80211_local *local = sdata->local; ++@@ -800,8 +865,24 @@ static void ieee80211_teardown_sdata(str ++ ieee80211_link_stop(&sdata->deflink); ++ } ++ +++#ifdef CPTCFG_MAC80211_NSS_SUPPORT +++static int ieee80211_init(struct net_device *dev) +++{ +++ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); +++ +++ ieee80211_create_nss_virtif(sdata, dev); +++ +++ return 0; +++} +++#endif +++ ++ static void ieee80211_uninit(struct net_device *dev) ++ { +++#ifdef CPTCFG_MAC80211_NSS_SUPPORT +++ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); +++ +++ ieee80211_destroy_nss_virtif(sdata); +++#endif ++ ieee80211_teardown_sdata(IEEE80211_DEV_TO_SUB_IF(dev)); ++ } ++ ++@@ -814,6 +895,9 @@ ieee80211_get_stats64(struct net_device ++ static const struct net_device_ops ieee80211_dataif_ops = { ++ .ndo_open = ieee80211_open, ++ .ndo_stop = ieee80211_stop, +++#ifdef CPTCFG_MAC80211_NSS_SUPPORT +++ .ndo_init = ieee80211_init, +++#endif ++ .ndo_uninit = ieee80211_uninit, ++ .ndo_start_xmit = ieee80211_subif_start_xmit, ++ .ndo_set_rx_mode = ieee80211_set_multicast_list, ++--- a/net/mac80211/rx.c +++++ b/net/mac80211/rx.c ++@@ -33,6 +33,60 @@ ++ #include "wme.h" ++ #include "rate.h" ++ +++#ifdef CPTCFG_MAC80211_NSS_SUPPORT +++extern bool nss_redirect; +++ +++#define case_rtn_string(val) case val: return #val +++ +++static const char *nss_tx_status_str(nss_tx_status_t status) +++{ +++ switch (status) { +++ case_rtn_string(NSS_TX_SUCCESS); +++ case_rtn_string(NSS_TX_FAILURE); +++ case_rtn_string(NSS_TX_FAILURE_QUEUE); +++ case_rtn_string(NSS_TX_FAILURE_NOT_READY); +++ case_rtn_string(NSS_TX_FAILURE_TOO_LARGE); +++ case_rtn_string(NSS_TX_FAILURE_TOO_SHORT); +++ case_rtn_string(NSS_TX_FAILURE_NOT_SUPPORTED); +++ case_rtn_string(NSS_TX_FAILURE_BAD_PARAM); +++ case_rtn_string(NSS_TX_FAILURE_NOT_ENABLED); +++ case_rtn_string(NSS_TX_FAILURE_SYNC_BAD_PARAM); +++ case_rtn_string(NSS_TX_FAILURE_SYNC_TIMEOUT); +++ case_rtn_string(NSS_TX_FAILURE_SYNC_FW_ERR); +++ default: +++ return "Unknown NSS TX status"; +++ } +++} +++ +++static void netif_rx_nss(struct ieee80211_rx_data *rx, +++ struct sk_buff *skb) +++{ +++ struct ieee80211_sub_if_data *sdata = rx->sdata; +++ int ret; +++ +++ if (!sdata->nssctx) +++ goto out; +++ +++ /* NSS expects ethernet header in skb data so resetting here */ +++ skb_push(skb, ETH_HLEN); +++ ret = nss_virt_if_tx_buf(sdata->nssctx, skb); +++ if (ret) { +++ if (net_ratelimit()) { +++ sdata_err(sdata, "NSS TX failed with error: %s\n", +++ nss_tx_status_str(ret)); +++ } +++ goto out; +++ } +++ +++ return; +++out: +++ if (rx->list) +++ list_add_tail(&skb->list, rx->list); +++ else +++ netif_receive_skb(skb); +++} +++#endif +++ ++ /* ++ * monitor mode reception ++ * ++@@ -2635,10 +2689,16 @@ static void ieee80211_deliver_skb_to_loc ++ ether_addr_copy(ehdr->h_dest, sdata->vif.addr); ++ ++ /* deliver to local stack */ +++#ifdef CPTCFG_MAC80211_NSS_SUPPORT +++ if (likely(nss_redirect)) { +++ netif_rx_nss(rx, skb); +++ } +++#else ++ if (rx->list) ++ list_add_tail(&skb->list, rx->list); ++ else ++ netif_receive_skb(skb); +++#endif ++ } ++ } ++ ++--- a/net/mac80211/tx.c +++++ b/net/mac80211/tx.c ++@@ -36,6 +36,11 @@ ++ #include "wme.h" ++ #include "rate.h" ++ +++#ifdef CPTCFG_MAC80211_NSS_SUPPORT +++#include +++#include +++#endif +++ ++ /* misc utils */ ++ ++ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx, ++@@ -1729,6 +1734,16 @@ static bool ieee80211_tx_frags(struct ie ++ return true; ++ } ++ } else { +++#ifdef CPTCFG_MAC80211_NSS_SUPPORT +++ if (skb_queue_len(&local->pending[q]) >= 1000) { +++ spin_unlock_irqrestore( +++ &local->queue_stop_reason_lock, +++ flags); +++ ieee80211_purge_tx_queue(&local->hw, +++ skbs); +++ return false; +++ } +++#endif ++ ++ /* ++ * Since queue is stopped, queue up frames for ++@@ -4448,6 +4463,35 @@ static void ieee80211_mlo_multicast_tx(s ++ kfree_skb(skb); ++ } ++ +++#ifdef CPTCFG_MAC80211_NSS_SUPPORT +++void ieee80211_xmit_nss_fixup(struct sk_buff *skb, +++ struct net_device *dev) +++{ +++ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); +++ +++ /* Packets from NSS does not have valid protocol, priority and other +++ * network stack values. Derive required parameters (priority +++ * and network_header) from payload for QoS header. +++ * XXX: Here the assumption is that packet are in 802.3 format. +++ * As of now priority is handled only for IPv4 and IPv6. +++ */ +++ +++ if (sdata->nssctx && likely(!skb->protocol)) { +++ skb_set_network_header(skb, 14); +++ switch (((struct ethhdr *)skb->data)->h_proto) { +++ case htons(ETH_P_IP): +++ skb->priority = (ipv4_get_dsfield(ip_hdr(skb)) & +++ 0xfc) >> 5; +++ break; +++ case htons(ETH_P_IPV6): +++ skb->priority = (ipv6_get_dsfield(ipv6_hdr(skb)) & +++ 0xfc) >> 5; +++ break; +++ } +++ } +++} +++#endif +++ ++ /** ++ * ieee80211_subif_start_xmit - netif start_xmit function for 802.3 vifs ++ * @skb: packet to be sent ++@@ -4461,6 +4505,10 @@ netdev_tx_t ieee80211_subif_start_xmit(s ++ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); ++ const struct ethhdr *eth = (void *)skb->data; ++ +++#ifdef CPTCFG_MAC80211_NSS_SUPPORT +++ ieee80211_xmit_nss_fixup(skb, dev); +++#endif +++ ++ if (likely(!is_multicast_ether_addr(eth->h_dest))) ++ goto normal; ++ ++@@ -4646,6 +4694,10 @@ netdev_tx_t ieee80211_subif_start_xmit_8 ++ struct ieee80211_key *key; ++ struct sta_info *sta; ++ +++#ifdef CPTCFG_MAC80211_NSS_SUPPORT +++ ieee80211_xmit_nss_fixup(skb, dev); +++#endif +++ ++ if (unlikely(!ieee80211_sdata_running(sdata) || skb->len < ETH_HLEN)) { ++ kfree_skb(skb); ++ return NETDEV_TX_OK; diff --git a/devices/ipq807x_generic/diy.sh b/devices/ipq807x_generic/diy.sh index 27f6e5b5c67a..ab430b1e83d1 100644 --- a/devices/ipq807x_generic/diy.sh +++ b/devices/ipq807x_generic/diy.sh @@ -3,12 +3,9 @@ shopt -s extglob SHELL_FOLDER=$(dirname $(readlink -f "$0")) -git clone https://github.com/robimarko/nss-packages package/nss-packages -svn co https://github.com/coolsnowwolf/lede/trunk/package/qca package/nss-packages/qca -mv -f package/nss-packages/qca/nss/* package/nss-packages/qca/ -rm -rf package/nss-packages/qca/qca-ssdk package/nss-packages/qca/qca-nss-dp package/nss-packages/qca/qca-*-64 package/nss-packages/qca/nss +#git clone https://github.com/qosmio/nss-packages package/nss-packages -sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += kmod-qca-nss-dp kmod-qca-nss-drv kmod-qca-nss-drv-pppoe kmod-qca-nss-ecm kmod-qca-nss-drv-bridge-mgr kmod-qca-nss-drv-vlan-mgr nss-firmware-ipq8074/' target/linux/ipq807x/Makefile +#sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += kmod-qca-nss-dp kmod-qca-nss-drv kmod-qca-nss-drv-pppoe kmod-qca-nss-ecm kmod-qca-nss-drv-bridge-mgr kmod-qca-nss-drv-vlan-mgr nss-firmware-ipq8074/' target/linux/ipq807x/Makefile sh -c "curl -sfL https://github.com/robimarko/openwrt/commit/23fa931934151f72c1655ffa62ff1a979575f07e.patch | patch -d './' -p1 --forward" diff --git a/devices/kirkwood_generic/.config b/devices/kirkwood_generic/.config index 08fc9100611e..fc1e36dbeee1 100644 --- a/devices/kirkwood_generic/.config +++ b/devices/kirkwood_generic/.config @@ -2,11 +2,15 @@ CONFIG_TARGET_kirkwood=y CONFIG_TARGET_kirkwood_generic=y CONFIG_TARGET_MULTI_PROFILE=y -CONFIG_TARGET_DEVICE_kirkwood_DEVICE_linksys_e4200-v2=y -CONFIG_TARGET_DEVICE_kirkwood_DEVICE_linksys_ea4500=y -CONFIG_TARGET_DEVICE_kirkwood_DEVICE_linksys_ea3500=y -CONFIG_TARGET_DEVICE_kirkwood_DEVICE_checkpoint_l-50=y -CONFIG_TARGET_DEVICE_kirkwood_DEVICE_netgear_readynas-duo-v2=y + +CONFIG_TARGET_DEVICE_kirkwood_generic_DEVICE_linksys_e4200-v2=y +CONFIG_TARGET_DEVICE_kirkwood_generic_DEVICE_linksys_ea3500=y +CONFIG_TARGET_DEVICE_kirkwood_generic_DEVICE_linksys_ea4500=y +CONFIG_TARGET_DEVICE_kirkwood_generic_DEVICE_netgear_readynas-duo-v2=y +CONFIG_TARGET_DEVICE_kirkwood_generic_DEVICE_seagate_blackarmor-nas220=y +CONFIG_TARGET_DEVICE_kirkwood_generic_DEVICE_seagate_dockstar=y +CONFIG_TARGET_DEVICE_kirkwood_generic_DEVICE_seagate_goflexhome=y +CONFIG_TARGET_DEVICE_kirkwood_generic_DEVICE_seagate_goflexnet=y CONFIG_PACKAGE_luci-ssl=y # uhttpd服务 diff --git a/devices/mediatek_filogic/.config b/devices/mediatek_filogic/.config index ca4e2d51c600..fe4bc9d295b7 100644 --- a/devices/mediatek_filogic/.config +++ b/devices/mediatek_filogic/.config @@ -10,5 +10,6 @@ CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_tplink_tl-xdr6088=y CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_glinet_gl-mt3000=y CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_h3c_magic-nx30-pro=y CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_xiaomi_mi-router-wr30u-112m-nmbm=y -CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_xiaomi_redmi-router-ax6000-ubootmod=y +CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_xiaomi_redmi-router-ax6000=y +CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_qihoo_360t7=y CONFIG_PACKAGE_luci-ssl=y # uhttpd服务 diff --git a/devices/mediatek_filogic/diy.sh b/devices/mediatek_filogic/diy.sh index 639d217dc893..b77ecec590c9 100644 --- a/devices/mediatek_filogic/diy.sh +++ b/devices/mediatek_filogic/diy.sh @@ -3,4 +3,5 @@ shopt -s extglob sed -i "/mt7986_xiaomi_redmi-router-ax6000 /d" package/boot/uboot-mediatek/Makefile -sed -i "/mt7981_h3c_magic-nx30-pro /d" package/boot/uboot-mediatek/Makefile \ No newline at end of file +sed -i "/mt7981_h3c_magic-nx30-pro /d" package/boot/uboot-mediatek/Makefile +sed -i "/mt7981_qihoo_360t7 /d" package/boot/uboot-mediatek/Makefile \ No newline at end of file diff --git a/devices/mediatek_filogic/patches/360t7.patch b/devices/mediatek_filogic/patches/360t7.patch new file mode 100644 index 000000000000..8262caa44ead --- /dev/null +++ b/devices/mediatek_filogic/patches/360t7.patch @@ -0,0 +1,67 @@ +--- a/target/linux/mediatek/dts/mt7981b-qihoo-360t7.dts ++++ b/target/linux/mediatek/dts/mt7981b-qihoo-360t7.dts +@@ -100,6 +100,10 @@ + spi-tx-buswidth = <4>; + spi-rx-buswidth = <4>; + ++ mediatek,nmbm; ++ mediatek,bmt-max-ratio = <1>; ++ mediatek,bmt-max-reserved-blocks = <64>; ++ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; +@@ -147,7 +151,7 @@ + + partition@7300000 { + label = "log"; +- reg = <0x7300000 0x0700000>; ++ reg = <0x7300000 0x0400000>; + read-only; + }; + }; + +--- a/target/linux/mediatek/image/filogic.mk ++++ b/target/linux/mediatek/image/filogic.mk +@@ -320,19 +320,12 @@ define Device/qihoo_360t7 + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 ++ IMAGE_SIZE := 36864k + KERNEL_IN_UBI := 1 +- UBOOTENV_IN_UBI := 1 +- IMAGES := sysupgrade.itb +- KERNEL_INITRAMFS_SUFFIX := -recovery.itb +- KERNEL := kernel-bin | gzip +- KERNEL_INITRAMFS := kernel-bin | lzma | \ +- fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k +- IMAGE/sysupgrade.itb := append-kernel | \ +- fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata ++ IMAGES += factory.bin ++ IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE) ++ IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware +- ARTIFACTS := preloader.bin bl31-uboot.fip +- ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3 +- ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot qihoo_360t7 + endef + TARGET_DEVICES += qihoo_360t7 + +--- a/package/boot/uboot-envtools/files/mediatek_filogic ++++ b/package/boot/uboot-envtools/files/mediatek_filogic +@@ -53,8 +53,12 @@ xiaomi,redmi-router-ax6000-stock) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000" + ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000" + ;; ++qihoo,360t7) ++ ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x20000" "0x20000" "1" ++ ;; ++h3c,magic-nx30-pro) ++ ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x80000" "0x20000" "4" ++ ;; +-h3c,magic-nx30-pro|\ +-qihoo,360t7|\ + tplink,tl-xdr4288|\ + tplink,tl-xdr6086|\ + tplink,tl-xdr6088|\ + diff --git a/devices/mediatek_filogic/patches/ax6000.patch b/devices/mediatek_filogic/patches/ax6000.patch index 3678633f0b15..d311f5a54e77 100644 --- a/devices/mediatek_filogic/patches/ax6000.patch +++ b/devices/mediatek_filogic/patches/ax6000.patch @@ -1,96 +1,111 @@ --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk -@@ -384,29 +384,18 @@ TARGET_DEVICES += xiaomi_redmi-router-ax6000-stock - - define Device/xiaomi_redmi-router-ax6000-ubootmod - DEVICE_VENDOR := Xiaomi -- DEVICE_MODEL := Redmi Router AX6000 (OpenWrt U-Boot layout) -+ DEVICE_MODEL := Redmi Router AX6000 (不死U-Boot) - DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000-ubootmod - DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-leds-ws2812b kmod-mt7986-firmware mt7986-wo-firmware -- KERNEL_INITRAMFS_SUFFIX := -recovery.itb -- IMAGES := sysupgrade.itb - UBINIZE_OPTS := -E 5 - BLOCKSIZE := 128k - PAGESIZE := 2048 -- KERNEL_IN_UBI := 1 -- UBOOTENV_IN_UBI := 1 -- KERNEL := kernel-bin | gzip -- KERNEL_INITRAMFS := kernel-bin | lzma | \ -- fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k -- IMAGE/sysupgrade.itb := append-kernel | \ -- fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata -- ARTIFACTS := preloader.bin bl31-uboot.fip -- ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr4 -- ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot xiaomi_redmi-router-ax6000 - ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) -- ARTIFACTS += initramfs-factory.ubi -- ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-recovery.itb | ubinize-kernel -+ ARTIFACTS := initramfs-factory.ubi -+ ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-kernel.bin | ubinize-kernel - endif -+ IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +@@ -442,6 +442,24 @@ endif endef - TARGET_DEVICES += xiaomi_redmi-router-ax6000-ubootmod + TARGET_DEVICES += xiaomi_mi-router-wr30u-ubootmod ++define Device/xiaomi_redmi-router-ax6000 ++ DEVICE_VENDOR := Xiaomi ++ DEVICE_MODEL := Redmi Router AX6000 ++ DEVICE_DTS := mt7986a-xiaomi-redmi-router-ax6000 ++ DEVICE_DTS_DIR := ../dts ++ DEVICE_PACKAGES := kmod-leds-ws2812b kmod-mt7986-firmware mt7986-wo-firmware ++ SUPPORTED_DEVICES := xiaomi,redmi-router-ax6000 ++ UBINIZE_OPTS := -E 5 ++ BLOCKSIZE := 128k ++ PAGESIZE := 2048 ++ IMAGE_SIZE := 112640k ++ KERNEL_IN_UBI := 1 ++ IMAGES += factory.bin ++ IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE) ++ IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata ++endef ++TARGET_DEVICES += xiaomi_redmi-router-ax6000 ++ + define Device/xiaomi_redmi-router-ax6000-stock + DEVICE_VENDOR := Xiaomi + DEVICE_MODEL := Redmi Router AX6000 (stock layout) --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic -@@ -47,7 +47,8 @@ mercusys,mr90x-v1) - netgear,wax220) - ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x20000" "0x20000" - ;; --xiaomi,redmi-router-ax6000-stock) -+xiaomi,redmi-router-ax6000-stock|\ -+xiaomi,redmi-router-ax6000-ubootmod) - ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000" - ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000" +@@ -67,6 +66,9 @@ xiaomi,redmi-router-ax6000-ubootmod) + ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x20000" "1" + ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x20000" "1" ;; -@@ -55,8 +56,7 @@ h3c,magic-nx30-pro|\ - qihoo,360t7|\ - tplink,tl-xdr4288|\ - tplink,tl-xdr6086|\ --tplink,tl-xdr6088|\ --xiaomi,redmi-router-ax6000-ubootmod) -+tplink,tl-xdr6088) - . /lib/upgrade/nand.sh - local envubi=$(nand_find_ubi ubi) - local envdev=/dev/$(nand_find_volume $envubi ubootenv) ++xiaomi,redmi-router-ax6000) ++ ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x10000" "0x20000" "1" ++ ;; + zyxel,ex5601-t0) + local envdev=/dev/mtd$(find_mtd_index "u-boot-env") + ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x40000" "2" ---- a/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000-ubootmod.dts -+++ b/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000-ubootmod.dts -@@ -4,13 +4,31 @@ - #include "mt7986a-xiaomi-redmi-router-ax6000.dtsi" - - / { -- model = "Xiaomi Redmi Router AX6000 (OpenWrt U-Boot layout)"; -+ model = "Xiaomi Redmi Router AX6000 (不死U-Boot)"; - compatible = "xiaomi,redmi-router-ax6000-ubootmod", "mediatek,mt7986a"; - }; - +new file mode 100644 +index 0000000000000..759baae3aeb18 +--- /dev/null ++++ b/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dts +@@ -0,0 +1,32 @@ ++// SPDX-License-Identifier: (GPL-2.0 OR MIT) ++ ++/dts-v1/; ++#include "mt7986a-xiaomi-redmi-router-ax6000.dtsi" ++ ++/ { ++ model = "Xiaomi Redmi Router AX6000"; ++ compatible = "xiaomi,redmi-router-ax6000-ubootmod", "mediatek,mt7986a"; ++}; ++ +&spi_nand_flash { + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; +}; + - &partitions { - partition@580000 { -+ label = "crash"; -+ reg = <0x580000 0x40000>; -+ read-only; -+ }; ++&partitions { ++ partition@580000 { ++ label = "crash"; ++ reg = <0x580000 0x40000>; ++ }; + -+ partition@5c0000 { -+ label = "crash_log"; -+ reg = <0x5c0000 0x40000>; -+ read-only; -+ }; ++ partition@5c0000 { ++ label = "crash_log"; ++ reg = <0x5c0000 0x40000>; ++ }; + -+ partition@600000 { - label = "ubi"; -- reg = <0x580000 0x7a80000>; -+ reg = <0x600000 0x6e00000>; - }; - }; ++ partition@600000 { ++ label = "ubi"; ++ reg = <0x600000 0x6e00000>; ++ }; ++}; + +--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh ++++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +@@ -95,6 +95,7 @@ platform_do_upgrade() { + tplink,tl-xdr6088|\ + xiaomi,mi-router-wr30u-112m-nmbm|\ + xiaomi,mi-router-wr30u-ubootmod|\ ++ xiaomi,redmi-router-ax6000|\ + xiaomi,redmi-router-ax6000-ubootmod) + CI_KERNPART="fit" + nand_do_upgrade "$1" + +--- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds ++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +@@ -26,6 +26,7 @@ xiaomi,mi-router-wr30u-ubootmod) + ucidef_set_led_netdev "wan" "wan" "blue:network" "wan" + ;; + xiaomi,redmi-router-ax6000-stock|\ ++xiaomi,redmi-router-ax6000|\ + xiaomi,redmi-router-ax6000-ubootmod) + ucidef_set_led_netdev "wan" "wan" "rgb:network" "wan" + ;; + +--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network ++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +@@ -56,6 +56,7 @@ mediatek_setup_interfaces() + xiaomi,mi-router-wr30u-stock|\ + xiaomi,mi-router-wr30u-ubootmod|\ + xiaomi,redmi-router-ax6000-stock|\ ++ xiaomi,redmi-router-ax6000|\ + xiaomi,redmi-router-ax6000-ubootmod) + ucidef_set_interfaces_lan_wan "lan2 lan3 lan4" wan + ;; \ No newline at end of file diff --git a/devices/mediatek_filogic/patches/nx30.patch b/devices/mediatek_filogic/patches/nx30.patch index 10e279d60f13..2c4353cbbc7c 100644 --- a/devices/mediatek_filogic/patches/nx30.patch +++ b/devices/mediatek_filogic/patches/nx30.patch @@ -1,350 +1,36 @@ -From e78d1a06c8a47be9ea5a306bfb43f3d7ceb89646 Mon Sep 17 00:00:00 2001 -From: Chukun Pan -Date: Sun, 21 May 2023 23:00:16 +0800 -Subject: [PATCH] mediatek: filogic: add H3C Magic NX30 Pro support - -Hardware specification: - SoC: MediaTek MT7981B 2x A53 - Flash: W25N01GVZEIG 128MB - RAM: NT5CB128M16JR-FL 256MB - Ethernet: 4x 10/100/1000 Mbps - Switch: MediaTek MT7531AE - WiFi: MediaTek MT7976C - Button: Reset, WPS - Power: DC 12V 1A - -Flash instructions: - 1. PC run command: "telnet 192.168.124.1 99" - Username: H3C, password is the web login - password of the router. - 2. Download preloader.bin and bl31-uboot.fip - 3. PC run command: "python3 -m http.server 80" - 4. Download files in the telnet window: - "wget http://192.168.124.xx/xxx.bin" - Replace xx with your PC's IP and - the preloader.bin and bl31-uboot.fip. - 5. Flushing openwrt's uboot: - "mtd write xxx-preloader.bin BL2" - "mtd write xxx-bl31-uboot.fip FIP" - 6. Connect to the router via the Lan port, - set a static ip of your PC. - (ip 192.168.1.254, gateway 192.168.1.1) - 7. Download initramfs image, reboot router, - waiting for tftp recovery to complete. - 8. After openwrt boots up, perform sysupgrade. - -Note: - 1. The u-boot-env partition on mtd is empty, - OEM stores their env on ubi:u-boot-env. - 2. Back up all mtd partitions before flashing. - -Signed-off-by: Chukun Pan ---- - .../dts/mt7981b-h3c-magic-nx30-pro.dts | 239 ++++++++++++++++++ - .../filogic/base-files/etc/board.d/02_network | 8 + - .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 5 + - .../base-files/lib/upgrade/platform.sh | 1 + - target/linux/mediatek/image/filogic.mk | 25 ++ - 5 files changed, 278 insertions(+) - create mode 100644 target/linux/mediatek/dts/mt7981b-h3c-magic-nx30-pro.dts - -diff --git a/target/linux/mediatek/dts/mt7981b-h3c-magic-nx30-pro.dts b/target/linux/mediatek/dts/mt7981b-h3c-magic-nx30-pro.dts -new file mode 100644 -index 0000000000000..358365adba44b ---- /dev/null +--- a/target/linux/mediatek/dts/mt7981b-h3c-magic-nx30-pro.dts +++ b/target/linux/mediatek/dts/mt7981b-h3c-magic-nx30-pro.dts -@@ -0,0 +1,213 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT -+ -+/dts-v1/; -+#include -+#include -+ -+#include "mt7981.dtsi" -+ -+/ { -+ model = "H3C Magic NX30 Pro"; -+ compatible = "h3c,magic-nx30-pro", "mediatek,mt7981"; -+ -+ aliases { -+ serial0 = &uart0; -+ led-boot = &led_status_green; -+ led-failsafe = &led_status_red; -+ led-running = &led_status_green; -+ led-upgrade = &led_status_red; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ memory { -+ reg = <0 0x40000000 0 0x10000000>; -+ }; -+ -+ gpio-keys { -+ compatible = "gpio-keys"; -+ -+ reset { -+ label = "reset"; -+ linux,code = ; -+ gpios = <&pio 1 GPIO_ACTIVE_LOW>; -+ }; -+ -+ wps { -+ label = "wps"; -+ linux,code = ; -+ gpios = <&pio 0 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ led_status_green: green { -+ label = "green:status"; -+ gpios = <&pio 4 GPIO_ACTIVE_LOW>; -+ }; -+ -+ led_status_red: red { -+ label = "red:status"; -+ gpios = <&pio 5 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+}; -+ -+ð { -+ status = "okay"; -+ -+ gmac0: mac@0 { -+ compatible = "mediatek,eth-mac"; -+ reg = <0>; -+ phy-mode = "2500base-x"; -+ -+ fixed-link { -+ speed = <2500>; -+ full-duplex; -+ pause; -+ }; -+ }; -+ -+ gmac1: mac@1 { -+ compatible = "mediatek,eth-mac"; -+ reg = <1>; -+ phy-mode = "gmii"; -+ phy-handle = <&int_gbe_phy>; -+ }; -+}; -+ -+&mdio_bus { -+ switch: switch@0 { -+ compatible = "mediatek,mt7531"; -+ reg = <31>; -+ reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; -+ interrupt-controller; -+ #interrupt-cells = <1>; -+ interrupt-parent = <&pio>; -+ interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; -+ }; -+}; -+ -+&spi0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&spi0_flash_pins>; -+ status = "okay"; -+ -+ spi_nand@0 { -+ compatible = "spi-nand"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ reg = <0>; -+ -+ spi-max-frequency = <52000000>; -+ spi-tx-buswidth = <4>; -+ spi-rx-buswidth = <4>; -+ -+ partitions { -+ compatible = "fixed-partitions"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ -+ partition@0 { -+ label = "BL2"; -+ reg = <0x0000000 0x0100000>; -+ read-only; -+ }; -+ -+ partition@100000 { -+ label = "u-boot-env"; -+ reg = <0x0100000 0x0080000>; -+ }; -+ -+ factory: partition@180000 { -+ label = "Factory"; -+ reg = <0x0180000 0x0200000>; -+ read-only; -+ }; -+ -+ partition@380000 { -+ label = "FIP"; -+ reg = <0x0380000 0x0200000>; -+ read-only; -+ }; -+ -+ partition@580000 { -+ label = "ubi"; -+ reg = <0x0580000 0x04000000>; -+ }; -+ }; -+ }; -+}; -+ -+&switch { -+ ports { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ port@0 { -+ reg = <0>; -+ label = "lan1"; -+ }; -+ -+ port@1 { -+ reg = <1>; -+ label = "lan2"; -+ }; -+ -+ port@2 { -+ reg = <2>; -+ label = "lan3"; -+ }; -+ -+ port@6 { -+ reg = <6>; -+ ethernet = <&gmac0>; -+ phy-mode = "2500base-x"; -+ -+ fixed-link { -+ speed = <2500>; -+ full-duplex; -+ pause; -+ }; -+ }; -+ }; -+}; -+ -+&pio { -+ spi0_flash_pins: spi0-pins { -+ mux { -+ function = "spi"; -+ groups = "spi0", "spi0_wp_hold"; -+ }; -+ -+ conf-pu { -+ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; -+ drive-strength = <8>; -+ mediatek,pull-up-adv = <0>; /* bias-disable */ -+ }; -+ -+ conf-pd { -+ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; -+ drive-strength = <8>; -+ mediatek,pull-up-adv = <0>; /* bias-disable */ -+ }; -+ }; -+}; -+ -+&uart0 { -+ status = "okay"; -+}; -+ -+&watchdog { -+ status = "okay"; -+}; -+ -+&wifi { -+ status = "okay"; +@@ -107,6 +107,10 @@ + spi-tx-buswidth = <4>; + spi-rx-buswidth = <4>; + ++ mediatek,nmbm; ++ mediatek,bmt-max-ratio = <1>; ++ mediatek,bmt-max-reserved-blocks = <64>; + -+ mediatek,mtd-eeprom = <&factory 0x0>; -+}; -diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network -index c05c5d25e4621..6abc81a0b0561 100644 ---- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network -+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network -@@ -23,6 +23,9 @@ - glinet,gl-mt3000) - ucidef_set_interfaces_lan_wan eth1 eth0 - ;; -+ h3c,magic-nx30-pro) -+ ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" eth1 -+ ;; - mediatek,mt7986a-rfb) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan6" "eth1 wan" - ;; -@@ -69,6 +72,11 @@ - bananapi,bpi-r3) - wan_mac=$(macaddr_add $(cat /sys/class/net/eth0/address) 1) - ;; -+ h3c,magic-nx30-pro) -+ wan_mac=$(mtd_get_mac_ascii pdt_data_1 ethaddr) -+ lan_mac=$(macaddr_add "$wan_mac" 1) -+ label_mac=$wan_mac -+ ;; - netgear,wax220) - lan_mac=$(mtd_get_mac_ascii u-boot-env mac) - label_mac=$lan_mac -diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac -index 4b7047eec5e5a..ab23b100444ce 100644 ---- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac -+++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac -@@ -32,6 +32,11 @@ - [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress - [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress - ;; -+ h3c,magic-nx30-pro) -+ addr=$(mtd_get_mac_ascii pdt_data_1 ethaddr) -+ [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress -+ [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress -+ ;; - netgear,wax220) - hw_mac_addr=$(mtd_get_mac_ascii u-boot-env mac) - [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; -diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh -index 11c2c5c66439d..186abfa5a8d82 100755 ---- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh -+++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh -@@ -74,6 +74,7 @@ platform_do_upgrade() { - CI_UBIPART="ubi0" - nand_do_upgrade "$1" - ;; -+ h3c,magic-nx30-pro|\ - qihoo,360t7|\ - tplink,tl-xdr4288|\ - tplink,tl-xdr6086|\ -diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk -index fd83b9d4416f9..2ace305140b2e 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk -@@ -176,6 +176,21 @@ define Device/glinet_gl-mt3000 - endef - TARGET_DEVICES += glinet_gl-mt3000 - -+define Device/h3c_magic-nx30-pro -+ DEVICE_VENDOR := H3C -+ DEVICE_MODEL := Magic NX30 Pro -+ DEVICE_DTS := mt7981b-h3c-magic-nx30-pro -+ DEVICE_DTS_DIR := ../dts -+ UBINIZE_OPTS := -E 5 -+ BLOCKSIZE := 128k -+ PAGESIZE := 2048 -+ KERNEL_IN_UBI := 1 -+ IMAGE_SIZE := 65536k +@@ -208,19 +208,9 @@ define Device/h3c_magic-nx30-pro + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_IN_UBI := 1 +- UBOOTENV_IN_UBI := 1 + IMAGE_SIZE := 65536k +- IMAGES := sysupgrade.itb +- KERNEL_INITRAMFS_SUFFIX := -recovery.itb +- KERNEL := kernel-bin | gzip +- KERNEL_INITRAMFS := kernel-bin | lzma | \ +- fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k +- IMAGE/sysupgrade.itb := append-kernel | \ +- fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata -+ DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware -+endef -+TARGET_DEVICES += h3c_magic-nx30-pro -+ - define Device/netgear_wax220 - DEVICE_VENDOR := Netgear - DEVICE_MODEL := WAX220 + DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware +- ARTIFACTS := preloader.bin bl31-uboot.fip +- ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3 +- ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot h3c_magic-nx30-pro + endef + TARGET_DEVICES += h3c_magic-nx30-pro diff --git a/devices/mediatek_filogic/settings.ini b/devices/mediatek_filogic/settings.ini index 2d3d6fc2aaf9..62141d1ba61b 100644 --- a/devices/mediatek_filogic/settings.ini +++ b/devices/mediatek_filogic/settings.ini @@ -1,2 +1,2 @@ REPO_URL="https://github.com/openwrt/openwrt" -REPO_BRANCH="openwrt-23.05" +REPO_BRANCH="main" diff --git a/devices/mediatek_mt7981/.config b/devices/mediatek_mt7981/.config index 7de320713f16..40da32f658c7 100644 --- a/devices/mediatek_mt7981/.config +++ b/devices/mediatek_mt7981/.config @@ -4,7 +4,6 @@ CONFIG_TARGET_MULTI_PROFILE=y CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_glinet_gl-mt2500=y CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_glinet_gl-x3000=y CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_glinet_gl-xe3000=y -CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_mt7981-360-t7-108M=y CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_livinet_zr-3020=y CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_cetron_ct3003=y CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_jcg_q30=y diff --git a/devices/mediatek_mt7981/patches/targets.patch b/devices/mediatek_mt7981/patches/targets.patch index ff2e375b1bc3..9a14e0c6d720 100644 --- a/devices/mediatek_mt7981/patches/targets.patch +++ b/devices/mediatek_mt7981/patches/targets.patch @@ -1,6 +1,6 @@ --- a/include/target.mk +++ b/include/target.mk -@@ -46,28 +46,27 @@ DEFAULT_PACKAGES.router:=\ +@@ -46,27 +46,27 @@ DEFAULT_PACKAGES.router:=\ dnsmasq-full \ firewall \ iptables \ @@ -22,7 +22,6 @@ - kmod-nf-nathelper-extra \ - luci \ - luci-app-filetransfer \ -- luci-app-turboacc \ - luci-compat \ - luci-lib-base \ - luci-lib-fs \ diff --git a/devices/rockchip_armv8/patches/pico3399.patch b/devices/rockchip_armv8/patches/pico3399.patch new file mode 100644 index 000000000000..b692cde4ca81 --- /dev/null +++ b/devices/rockchip_armv8/patches/pico3399.patch @@ -0,0 +1,1546 @@ +From f847e36bfe9d24f6bd86dc52ebf17f0025118cd6 Mon Sep 17 00:00:00 2001 +From: icevel +Date: Wed, 1 Feb 2023 17:20:59 +0800 +Subject: [PATCH] add support + +--- + package/boot/uboot-rockchip/Makefile | 12 + + ...99-Add-support-for-rockchip-pico3399.patch | 749 ++++++++++++++++++ + .../armv8/base-files/etc/board.d/02_network | 1 + + .../boot/dts/rockchip/rk3399-pico3399.dts | 668 ++++++++++++++++ + target/linux/rockchip/image/armv8.mk | 10 + + ...99-add-support-for-rockchip-pico3399.patch | 11 + + ...99-add-support-for-rockchip-pico3399.patch | 11 + + 7 files changed, 1462 insertions(+) + create mode 100644 package/boot/uboot-rockchip/patches/308-rockchip-rk3399-Add-support-for-rockchip-pico3399.patch + create mode 100644 target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3399-pico3399.dts + create mode 100644 target/linux/rockchip/patches-5.15/213-rockchip-rk3399-add-support-for-rockchip-pico3399.patch + create mode 100644 target/linux/rockchip/patches-6.1/213-rockchip-rk3399-add-support-for-rockchip-pico3399.patch + +diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile +index 69ce25dae..283f4821b 100644 +--- a/package/boot/uboot-rockchip/Makefile ++++ b/package/boot/uboot-rockchip/Makefile +@@ -157,6 +157,17 @@ define U-Boot/rocktech-mpc1903-rk3399 + USE_RKBIN:=1 + endef + ++define U-Boot/rockchip-pico3399-rk3399 ++ BUILD_SUBTARGET:=armv8 ++ NAME:=rockchip pico3399 ++ BUILD_DEVICES:= \ ++ rockchip_pico3399 ++ DEPENDS:=+PACKAGE_u-boot-rockchip-pico3399-rk3399:arm-trusted-firmware-rk3399 ++ PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip-vendor ++ ATF:=rk3399_bl31_v1.35.elf ++ USE_RKBIN:=1 ++endef ++ + # RK3568 boards + + define U-Boot/mrkaio-m68s-rk3568 +@@ -254,6 +265,7 @@ UBOOT_TARGETS := \ + rockpro64-rk3399 \ + rongpin-king3399-rk3399 \ + rocktech-mpc1903-rk3399 \ ++ rockchip-pico3399-rk3399 \ + nanopi-r2c-rk3328 \ + nanopi-r2s-rk3328 \ + orangepi-r1-plus-rk3328 \ +diff --git a/package/boot/uboot-rockchip/patches/308-rockchip-rk3399-Add-support-for-rockchip-pico3399.patch b/package/boot/uboot-rockchip/patches/308-rockchip-rk3399-Add-support-for-rockchip-pico3399.patch +new file mode 100644 +index 000000000..fb5c48240 +--- /dev/null ++++ b/package/boot/uboot-rockchip/patches/308-rockchip-rk3399-Add-support-for-rockchip-pico3399.patch +@@ -0,0 +1,749 @@ ++--- a/arch/arm/dts/Makefile +++++ b/arch/arm/dts/Makefile ++@@ -165,6 +165,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \ ++ rk3399-rock-pi-4b.dtb \ ++ rk3399-rock-pi-4c.dtb \ ++ rk3399-rock960.dtb \ +++ rk3399-pico3399.dtb \ ++ rk3399-mpc1903.dtb \ ++ rk3399-rockpro64.dtb \ ++ rk3399pro-rock-pi-n10.dtb ++ ++--- /dev/null +++++ b/arch/arm/dts/rk3399-pico3399.dts ++@@ -0,0 +1,668 @@ +++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +++/dts-v1/; +++#include +++#include +++#include "rk3399.dtsi" +++#include "rk3399-opp.dtsi" +++ +++/ { +++ model = "pico3399"; +++ compatible = "pico3399", "rockchip,rk3399"; +++ +++ chosen { +++ stdout-path = "serial2:1500000n8"; +++ }; +++ +++ clkin_gmac: external-gmac-clock { +++ compatible = "fixed-clock"; +++ clock-frequency = <125000000>; +++ clock-output-names = "clkin_gmac"; +++ #clock-cells = <0>; +++ }; +++ +++ leds { +++ compatible = "gpio-leds"; +++ pinctrl-names = "default"; +++ pinctrl-0 = <&user_led1>, <&user_led2>; +++ +++ user_led1 { +++ label = "blue:user1"; +++ gpios = <&gpio2 RK_PD3 0>; +++ linux,default-trigger = "heartbeat"; +++ }; +++ +++ user_led2 { +++ label = "blue:user2"; +++ gpios = <&gpio2 RK_PD4 0>; +++ linux,default-trigger = "mmc1"; +++ }; +++ }; +++ +++ vcc12v_dcin: dc-12v { +++ compatible = "regulator-fixed"; +++ regulator-name = "vcc12v_dcin"; +++ regulator-always-on; +++ regulator-boot-on; +++ regulator-min-microvolt = <12000000>; +++ regulator-max-microvolt = <12000000>; +++ }; +++ +++ vcc_sys: vcc-sys { +++ compatible = "regulator-fixed"; +++ regulator-name = "vcc_sys"; +++ regulator-min-microvolt = <5000000>; +++ regulator-max-microvolt = <5000000>; +++ regulator-always-on; +++ vin-supply = <&vcc12v_dcin>; +++ }; +++ +++ vcc_phy: vcc-phy-regulator { +++ compatible = "regulator-fixed"; +++ regulator-name = "vcc_phy"; +++ regulator-always-on; +++ regulator-boot-on; +++ }; +++ +++ vcc1v8_s0: vcc1v8-s0 { +++ compatible = "regulator-fixed"; +++ regulator-name = "vcc1v8_s0"; +++ regulator-min-microvolt = <1800000>; +++ regulator-max-microvolt = <1800000>; +++ regulator-always-on; +++ }; +++ +++ vcc3v3_sys: vcc3v3-sys { +++ compatible = "regulator-fixed"; +++ regulator-name = "vcc3v3_sys"; +++ regulator-min-microvolt = <3300000>; +++ regulator-max-microvolt = <3300000>; +++ regulator-always-on; +++ vin-supply = <&vcc_sys>; +++ }; +++ +++ vcc5v0_host: vcc5v0-host-regulator { +++ compatible = "regulator-fixed"; +++ //enable-active-high; +++ //gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; +++ //pinctrl-names = "default"; +++ //pinctrl-0 = <&host_vbus_drv>; +++ regulator-min-microvolt = <5000000>; +++ regulator-max-microvolt = <5000000>; +++ regulator-name = "vcc5v0_host"; +++ regulator-always-on; +++ vin-supply = <&vcc_sys>; +++ }; +++ +++ vcc5v0_typec: vcc5v0-typec-regulator { +++ compatible = "regulator-fixed"; +++ //enable-active-high; +++ //gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>; +++ //pinctrl-names = "default"; +++ //pinctrl-0 = <&vcc5v0_typec_en>; +++ regulator-min-microvolt = <5000000>; +++ regulator-max-microvolt = <5000000>; +++ regulator-name = "vcc5v0_typec"; +++ regulator-always-on; +++ vin-supply = <&vcc_sys>; +++ }; +++ +++ vdd_log: vdd-log { +++ compatible = "pwm-regulator"; +++ pwms = <&pwm2 0 25000 0>; +++ pwm-supply = <&vcc_sys>; +++ regulator-name = "vdd_log"; +++ regulator-min-microvolt = <800000>; +++ regulator-max-microvolt = <1400000>; +++ regulator-always-on; +++ regulator-boot-on; +++ }; +++ vcc3v3_sd: vcc3v3-sd { +++ compatible = "regulator-fixed"; +++ enable-active-high; +++ gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>; +++ pinctrl-names = "default"; +++ pinctrl-0 = <&sdmmc0_pwr_h>; +++ regulator-always-on; +++ regulator-min-microvolt = <3300000>; +++ regulator-max-microvolt = <3300000>; +++ regulator-name = "vcc3v3_sd"; +++ vin-supply = <&vcc3v3_sys>; +++ }; +++}; +++ +++&cpu_l0 { +++ cpu-supply = <&vdd_cpu_l>; +++}; +++ +++&cpu_l1 { +++ cpu-supply = <&vdd_cpu_l>; +++}; +++ +++&cpu_l2 { +++ cpu-supply = <&vdd_cpu_l>; +++}; +++ +++&cpu_l3 { +++ cpu-supply = <&vdd_cpu_l>; +++}; +++ +++&cpu_b0 { +++ cpu-supply = <&vdd_cpu_b>; +++}; +++ +++&cpu_b1 { +++ cpu-supply = <&vdd_cpu_b>; +++}; +++ +++&emmc_phy { +++ status = "okay"; +++}; +++ +++&gmac { +++ assigned-clocks = <&cru SCLK_RMII_SRC>; +++ assigned-clock-parents = <&clkin_gmac>; +++ clock_in_out = "input"; +++ phy-supply = <&vcc_phy>; +++ phy-mode = "rgmii"; +++ pinctrl-names = "default"; +++ pinctrl-0 = <&rgmii_pins>; +++ snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>; +++ snps,reset-active-low; +++ snps,reset-delays-us = <0 10000 50000>; +++ tx_delay = <0x28>; +++ rx_delay = <0x11>; +++ status = "okay"; +++}; +++ +++&gpu { +++ status = "okay"; +++ mali-supply = <&vdd_gpu>; +++}; +++ +++&hdmi { +++ ddc-i2c-bus = <&i2c3>; +++ pinctrl-names = "default"; +++ pinctrl-0 = <&hdmi_cec>; +++ status = "okay"; +++}; +++ +++&hdmi_sound { +++ status = "okay"; +++}; +++ +++&i2c0 { +++ status = "okay"; +++ i2c-scl-rising-time-ns = <168>; +++ i2c-scl-falling-time-ns = <4>; +++ clock-frequency = <400000>; +++ +++ vdd_cpu_b: syr827@40 { +++ compatible = "silergy,syr827"; +++ reg = <0x40>; +++ regulator-compatible = "fan53555-reg"; +++ pinctrl-0 = <&vsel1_gpio>; +++ regulator-name = "vdd_cpu_b"; +++ regulator-min-microvolt = <712500>; +++ regulator-max-microvolt = <1500000>; +++ regulator-ramp-delay = <1000>; +++ fcs,suspend-voltage-selector = <1>; +++ regulator-always-on; +++ regulator-boot-on; +++ vin-supply = <&vcc_sys>; +++ regulator-state-mem { +++ regulator-off-in-suspend; +++ }; +++ }; +++ +++ vdd_gpu: syr828@41 { +++ compatible = "silergy,syr828"; +++ reg = <0x41>; +++ regulator-compatible = "fan53555-reg"; +++ pinctrl-0 = <&vsel2_gpio>; +++ regulator-name = "vdd_gpu"; +++ regulator-min-microvolt = <712500>; +++ regulator-max-microvolt = <1500000>; +++ regulator-ramp-delay = <1000>; +++ fcs,suspend-voltage-selector = <1>; +++ regulator-always-on; +++ regulator-boot-on; +++ vin-supply = <&vcc_sys>; +++ regulator-state-mem { +++ regulator-off-in-suspend; +++ }; +++ }; +++//pmic--TODO +++ rk808: pmic@1b { +++ compatible = "rockchip,rk808"; +++ reg = <0x1b>; +++ interrupt-parent = <&gpio1>; +++ interrupts = <21 IRQ_TYPE_LEVEL_LOW>; +++ pinctrl-names = "default"; +++ pinctrl-0 = <&pmic_int_l>; +++ rockchip,system-power-controller; +++ wakeup-source; +++ #clock-cells = <1>; +++ clock-output-names = "xin32k", "rtc_clko_wifi"; +++ +++ vcc1-supply = <&vcc_sys>; +++ vcc2-supply = <&vcc_sys>; +++ vcc3-supply = <&vcc_sys>; +++ vcc4-supply = <&vcc_sys>; +++ vcc6-supply = <&vcc3v3_sys>; +++ vcc7-supply = <&vcc3v3_sys>; +++ vcc8-supply = <&vcc3v3_sys>; +++ vcc9-supply = <&vcc3v3_sys>; +++ vcc10-supply = <&vcc3v3_sys>; +++ vcc11-supply = <&vcc3v3_sys>; +++ vcc12-supply = <&vcc3v3_sys>; +++ vddio-supply = <&vcc_1v8>; +++ +++ regulators { +++ vdd_center: DCDC_REG1 { +++ regulator-name = "vdd_center"; +++ regulator-min-microvolt = <750000>; +++ regulator-max-microvolt = <1350000>; +++ regulator-ramp-delay = <6001>; +++ regulator-always-on; +++ regulator-boot-on; +++ regulator-state-mem { +++ regulator-off-in-suspend; +++ }; +++ }; +++ +++ vdd_cpu_l: DCDC_REG2 { +++ regulator-name = "vdd_cpu_l"; +++ regulator-min-microvolt = <750000>; +++ regulator-max-microvolt = <1350000>; +++ regulator-ramp-delay = <6001>; +++ regulator-always-on; +++ regulator-boot-on; +++ regulator-state-mem { +++ regulator-off-in-suspend; +++ }; +++ }; +++ +++ vcc_ddr: DCDC_REG3 { +++ regulator-name = "vcc_ddr"; +++ regulator-always-on; +++ regulator-boot-on; +++ regulator-state-mem { +++ regulator-on-in-suspend; +++ }; +++ }; +++ +++ vcc_1v8: DCDC_REG4 { +++ regulator-name = "vcc_1v8"; +++ regulator-min-microvolt = <1800000>; +++ regulator-max-microvolt = <1800000>; +++ regulator-always-on; +++ regulator-boot-on; +++ regulator-state-mem { +++ regulator-on-in-suspend; +++ regulator-suspend-microvolt = <1800000>; +++ }; +++ }; +++ +++ vcc1v8_dvp: LDO_REG1 { +++ regulator-name = "vcc1v8_dvp"; +++ regulator-min-microvolt = <1800000>; +++ regulator-max-microvolt = <1800000>; +++ regulator-always-on; +++ regulator-boot-on; +++ regulator-state-mem { +++ regulator-on-in-suspend; +++ regulator-suspend-microvolt = <1800000>; +++ }; +++ }; +++ +++ vcc3v0_tp: LDO_REG2 { +++ regulator-name = "vcc3v0_tp"; +++ regulator-min-microvolt = <3000000>; +++ regulator-max-microvolt = <3000000>; +++ regulator-always-on; +++ regulator-boot-on; +++ regulator-state-mem { +++ regulator-on-in-suspend; +++ regulator-suspend-microvolt = <3000000>; +++ }; +++ }; +++ +++ vcc1v8_pmu: LDO_REG3 { +++ regulator-name = "vcc1v8_pmu"; +++ regulator-min-microvolt = <1800000>; +++ regulator-max-microvolt = <1800000>; +++ regulator-always-on; +++ regulator-boot-on; +++ regulator-state-mem { +++ regulator-on-in-suspend; +++ regulator-suspend-microvolt = <1800000>; +++ }; +++ }; +++ +++ vcc_sd: LDO_REG4 { +++ regulator-name = "vcc_sd"; +++ regulator-min-microvolt = <1800000>; +++ regulator-max-microvolt = <3300000>; +++ regulator-always-on; +++ regulator-boot-on; +++ regulator-state-mem { +++ regulator-on-in-suspend; +++ regulator-suspend-microvolt = <3300000>; +++ }; +++ }; +++ +++ vcca3v0_codec: LDO_REG5 { +++ regulator-name = "vcca3v0_codec"; +++ regulator-min-microvolt = <3000000>; +++ regulator-max-microvolt = <3000000>; +++ regulator-always-on; +++ regulator-boot-on; +++ regulator-state-mem { +++ regulator-on-in-suspend; +++ regulator-suspend-microvolt = <3000000>; +++ }; +++ }; +++ +++ vcc_1v5: LDO_REG6 { +++ regulator-name = "vcc_1v5"; +++ regulator-min-microvolt = <1500000>; +++ regulator-max-microvolt = <1500000>; +++ regulator-always-on; +++ regulator-boot-on; +++ regulator-state-mem { +++ regulator-on-in-suspend; +++ regulator-suspend-microvolt = <1500000>; +++ }; +++ }; +++ +++ vcca1v8_codec: LDO_REG7 { +++ regulator-name = "vcca1v8_codec"; +++ regulator-min-microvolt = <1800000>; +++ regulator-max-microvolt = <1800000>; +++ regulator-always-on; +++ regulator-boot-on; +++ regulator-state-mem { +++ regulator-on-in-suspend; +++ regulator-suspend-microvolt = <1800000>; +++ }; +++ }; +++ +++ vcc_3v0: LDO_REG8 { +++ regulator-name = "vcc_3v0"; +++ regulator-min-microvolt = <3000000>; +++ regulator-max-microvolt = <3000000>; +++ regulator-always-on; +++ regulator-boot-on; +++ regulator-state-mem { +++ regulator-on-in-suspend; +++ regulator-suspend-microvolt = <3000000>; +++ }; +++ }; +++ +++ vcc3v3_s3: SWITCH_REG1 { +++ regulator-name = "vcc3v3_s3"; +++ regulator-always-on; +++ regulator-boot-on; +++ regulator-state-mem { +++ regulator-on-in-suspend; +++ }; +++ }; +++ +++ vcc3v3_s0: SWITCH_REG2 { +++ regulator-name = "vcc3v3_s0"; +++ regulator-always-on; +++ regulator-boot-on; +++ regulator-state-mem { +++ regulator-on-in-suspend; +++ }; +++ }; +++ }; +++ }; +++}; +++ +++&i2c1 { +++ i2c-scl-rising-time-ns = <300>; +++ i2c-scl-falling-time-ns = <15>; +++ status = "disabled"; +++}; +++ +++&i2c3 { +++ i2c-scl-rising-time-ns = <450>; +++ i2c-scl-falling-time-ns = <15>; +++ status = "disabled"; +++}; +++ +++&i2c4 { +++ i2c-scl-rising-time-ns = <600>; +++ i2c-scl-falling-time-ns = <40>; +++ status = "disabled"; +++}; +++ +++&i2s0 { +++ rockchip,playback-channels = <8>; +++ rockchip,capture-channels = <8>; +++ status = "disabled"; +++}; +++ +++&i2s1 { +++ rockchip,playback-channels = <2>; +++ rockchip,capture-channels = <2>; +++ status = "disabled"; +++}; +++ +++&i2s2 { +++ status = "disabled"; +++}; +++ +++&io_domains { +++ status = "okay"; +++ audio-supply = <&vcc1v8_s0>; +++ bt656-supply = <&vcc1v8_s0>; +++ gpio1830-supply = <&vcc_3v0>; +++ sdmmc-supply = <&vcc_sd>; +++}; +++ +++&pmu_io_domains { +++ status = "okay"; +++ pmu1830-supply = <&vcc_1v8>; +++}; +++ +++&pinctrl { +++ +++ sdmmc_pwren: sdmmc-pwren { +++ rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; +++ }; +++ +++ gmac { +++ rgmii_sleep_pins: rgmii-sleep-pins { +++ rockchip,pins = +++ <3 RK_PB7 RK_FUNC_GPIO &pcfg_output_low>; +++ }; +++ }; +++ +++ leds { +++ user_led1: user_led1 { +++ rockchip,pins = +++ <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>; +++ }; +++ +++ user_led2: user_led2 { +++ rockchip,pins = +++ <2 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>; +++ }; +++ +++ }; +++ +++ pmic { +++ pmic_int_l: pmic-int-l { +++ rockchip,pins = +++ <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>; +++ }; +++ +++ vsel1_gpio: vsel1-gpio { +++ rockchip,pins = +++ <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>; +++ }; +++ +++ vsel2_gpio: vsel2-gpio { +++ rockchip,pins = +++ <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>; +++ }; +++ }; +++ sdmmc { +++ sdmmc0_det_l: sdmmc0-det-l { +++ rockchip,pins = <0 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>; +++ }; +++ +++ sdmmc0_pwr_h: sdmmc0-pwr-h { +++ rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; +++ }; +++ }; +++}; +++ +++&pwm0 { +++ status = "disabled"; +++}; +++ +++&pwm2 { +++ status = "disabled"; +++}; +++ +++&saradc { +++ vref-supply = <&vcc1v8_s0>; +++ status = "okay"; +++}; +++ +++&sdmmc { +++ bus-width = <4>; +++ cap-mmc-highspeed; +++ cap-sd-highspeed; +++ cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; +++ disable-wp; +++ max-frequency = <150000000>; +++ pinctrl-names = "default"; +++ pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>; +++ status = "okay"; +++}; +++/* +++&sdmmc { +++ clock-frequency = <150000000>; +++ clock-freq-min-max = <200000 150000000>; +++ supports-sd; +++ bus-width = <4>; +++ cap-mmc-highspeed; +++ cap-sd-highspeed; +++ disable-wp; +++ vqmmc-supply = <&vcc_sd>; +++ vmmc-supply = <&vcc3v3_sd>; +++ pinctrl-names = "default"; +++ pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc0_det_l &sdmmc_bus4>; +++ card-detect-delay = <800>; +++ sd-uhs-sdr104; +++ status = "okay"; +++ +++}; +++*/ +++&sdhci { +++ bus-width = <8>; +++ mmc-hs400-1_8v; +++ mmc-hs400-enhanced-strobe; +++ supports-emmc; +++ non-removable; +++ keep-power-in-suspend; +++ status = "okay"; +++}; +++ +++ +++&tcphy0 { +++ status = "okay"; +++}; +++ +++&tcphy1 { +++ status = "okay"; +++}; +++ +++&tsadc { +++ /* tshut mode 0:CRU 1:GPIO */ +++ rockchip,hw-tshut-mode = <1>; +++ /* tshut polarity 0:LOW 1:HIGH */ +++ rockchip,hw-tshut-polarity = <1>; +++ rockchip,hw-tshut-temp = <110000>; +++ status = "okay"; +++}; +++ +++&u2phy0 { +++ status = "okay"; +++ +++ u2phy0_host: host-port { +++ //phy-supply = <&vcc5v0_typec>; +++ status = "okay"; +++ }; +++ +++ u2phy0_otg: otg-port { +++ status = "okay"; +++ }; +++}; +++ +++&u2phy1 { +++ status = "okay"; +++ +++ u2phy1_host: host-port { +++ //phy-supply = <&vcc5v0_host>; +++ status = "okay"; +++ }; +++ +++ u2phy1_otg: otg-port { +++ status = "okay"; +++ }; +++}; +++ +++&uart0 { +++ status = "disabled"; +++}; +++ +++&uart2 { +++ status = "okay"; +++}; +++ +++&usb_host0_ehci { +++ status = "okay"; +++}; +++ +++&usb_host0_ohci { +++ status = "okay"; +++}; +++ +++&usb_host1_ehci { +++ status = "okay"; +++}; +++ +++&usb_host1_ohci { +++ status = "okay"; +++}; +++ +++&usbdrd3_0 { +++ status = "okay"; +++}; +++ +++&usbdrd_dwc3_0 { +++ status = "okay"; +++ dr_mode = "host"; +++}; +++ +++&usbdrd3_1 { +++ status = "okay"; +++}; +++ +++&usbdrd_dwc3_1 { +++ status = "okay"; +++ dr_mode = "host"; +++}; +++ +++&vopb { +++ status = "okay"; +++}; +++ +++&vopb_mmu { +++ status = "okay"; +++}; ++ ++--- /dev/null +++++ b/configs/rockchip-pico3399-rk3399_defconfig ++@@ -0,0 +1,63 @@ +++CONFIG_ARM=y +++CONFIG_SKIP_LOWLEVEL_INIT=y +++CONFIG_COUNTER_FREQUENCY=24000000 +++CONFIG_ARCH_ROCKCHIP=y +++CONFIG_SYS_TEXT_BASE=0x00200000 +++CONFIG_ENV_OFFSET=0x3F8000 +++CONFIG_ROCKCHIP_RK3399=y +++CONFIG_TARGET_EVB_RK3399=y +++CONFIG_NR_DRAM_BANKS=1 +++CONFIG_SYS_LOAD_ADDR=0x800800 +++CONFIG_DEBUG_UART_BASE=0xFF1A0000 +++CONFIG_DEBUG_UART_CLOCK=24000000 +++CONFIG_DEBUG_UART=y +++CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pico3399.dtb" +++CONFIG_DISPLAY_BOARDINFO_LATE=y +++# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set +++CONFIG_SPL_STACK_R=y +++CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 +++CONFIG_TPL=y +++CONFIG_CMD_BOOTZ=y +++CONFIG_CMD_GPT=y +++CONFIG_CMD_MMC=y +++CONFIG_CMD_USB=y +++# CONFIG_CMD_SETEXPR is not set +++CONFIG_CMD_TIME=y +++CONFIG_SPL_OF_CONTROL=y +++CONFIG_DEFAULT_DEVICE_TREE="rk3399-pico3399" +++CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" +++CONFIG_ENV_IS_IN_MMC=y +++CONFIG_SYS_RELOC_GD_ENV_ADDR=y +++CONFIG_ROCKCHIP_GPIO=y +++CONFIG_SYS_I2C_ROCKCHIP=y +++CONFIG_MMC_DW=y +++CONFIG_MMC_DW_ROCKCHIP=y +++CONFIG_MMC_SDHCI=y +++CONFIG_MMC_SDHCI_ROCKCHIP=y +++CONFIG_DM_ETH=y +++CONFIG_ETH_DESIGNWARE=y +++CONFIG_GMAC_ROCKCHIP=y +++CONFIG_PMIC_RK8XX=y +++CONFIG_REGULATOR_PWM=y +++CONFIG_REGULATOR_RK8XX=y +++CONFIG_PWM_ROCKCHIP=y +++CONFIG_BAUDRATE=1500000 +++CONFIG_DEBUG_UART_SHIFT=2 +++CONFIG_SYSRESET=y +++CONFIG_USB=y +++CONFIG_USB_XHCI_HCD=y +++CONFIG_USB_XHCI_DWC3=y +++CONFIG_USB_EHCI_HCD=y +++CONFIG_USB_EHCI_GENERIC=y +++CONFIG_USB_HOST_ETHER=y +++CONFIG_USB_ETHER_ASIX=y +++CONFIG_USB_ETHER_ASIX88179=y +++CONFIG_USB_ETHER_MCS7830=y +++CONFIG_USB_ETHER_RTL8152=y +++CONFIG_USB_ETHER_SMSC95XX=y +++CONFIG_DM_VIDEO=y +++CONFIG_DISPLAY=y +++CONFIG_VIDEO_ROCKCHIP=y +++CONFIG_DISPLAY_ROCKCHIP_HDMI=y +++CONFIG_SPL_TINY_MEMSET=y +++CONFIG_ERRNO_STR=y +diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network +index 8bdefcbb6..5c0aa413a 100755 +--- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network ++++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network +@@ -16,6 +16,7 @@ rockchip_setup_interfaces() + friendlyarm,nanopi-r4s|\ + friendlyarm,nanopi-r4se|\ + rocktech,mpc1903|\ ++ rockchip,pico3399|\ + sharevdi,guangmiao-g4c|\ + xunlong,orangepi-r1-plus|\ + xunlong,orangepi-r1-plus-lts) +diff --git a/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3399-pico3399.dts b/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3399-pico3399.dts +new file mode 100644 +index 000000000..f80f91e23 +--- /dev/null ++++ b/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3399-pico3399.dts +@@ -0,0 +1,668 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/dts-v1/; ++#include ++#include ++#include "rk3399.dtsi" ++#include "rk3399-opp.dtsi" ++ ++/ { ++ model = "pico3399"; ++ compatible = "pico3399", "rockchip,rk3399"; ++ ++ chosen { ++ stdout-path = "serial2:1500000n8"; ++ }; ++ ++ clkin_gmac: external-gmac-clock { ++ compatible = "fixed-clock"; ++ clock-frequency = <125000000>; ++ clock-output-names = "clkin_gmac"; ++ #clock-cells = <0>; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&user_led1>, <&user_led2>; ++ ++ user_led1 { ++ label = "blue:user1"; ++ gpios = <&gpio2 RK_PD3 0>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ ++ user_led2 { ++ label = "blue:user2"; ++ gpios = <&gpio2 RK_PD4 0>; ++ linux,default-trigger = "mmc1"; ++ }; ++ }; ++ ++ vcc12v_dcin: dc-12v { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc12v_dcin"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <12000000>; ++ regulator-max-microvolt = <12000000>; ++ }; ++ ++ vcc_sys: vcc-sys { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc_sys"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-always-on; ++ vin-supply = <&vcc12v_dcin>; ++ }; ++ ++ vcc_phy: vcc-phy-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc_phy"; ++ regulator-always-on; ++ regulator-boot-on; ++ }; ++ ++ vcc1v8_s0: vcc1v8-s0 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc1v8_s0"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++ }; ++ ++ vcc3v3_sys: vcc3v3-sys { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_sys"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-always-on; ++ vin-supply = <&vcc_sys>; ++ }; ++ ++ vcc5v0_host: vcc5v0-host-regulator { ++ compatible = "regulator-fixed"; ++ //enable-active-high; ++ //gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; ++ //pinctrl-names = "default"; ++ //pinctrl-0 = <&host_vbus_drv>; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-name = "vcc5v0_host"; ++ regulator-always-on; ++ vin-supply = <&vcc_sys>; ++ }; ++ ++ vcc5v0_typec: vcc5v0-typec-regulator { ++ compatible = "regulator-fixed"; ++ //enable-active-high; ++ //gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>; ++ //pinctrl-names = "default"; ++ //pinctrl-0 = <&vcc5v0_typec_en>; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-name = "vcc5v0_typec"; ++ regulator-always-on; ++ vin-supply = <&vcc_sys>; ++ }; ++ ++ vdd_log: vdd-log { ++ compatible = "pwm-regulator"; ++ pwms = <&pwm2 0 25000 0>; ++ pwm-supply = <&vcc_sys>; ++ regulator-name = "vdd_log"; ++ regulator-min-microvolt = <800000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-always-on; ++ regulator-boot-on; ++ }; ++ vcc3v3_sd: vcc3v3-sd { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc0_pwr_h>; ++ regulator-always-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc3v3_sd"; ++ vin-supply = <&vcc3v3_sys>; ++ }; ++}; ++ ++&cpu_l0 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_l1 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_l2 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_l3 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_b0 { ++ cpu-supply = <&vdd_cpu_b>; ++}; ++ ++&cpu_b1 { ++ cpu-supply = <&vdd_cpu_b>; ++}; ++ ++&emmc_phy { ++ status = "okay"; ++}; ++ ++&gmac { ++ assigned-clocks = <&cru SCLK_RMII_SRC>; ++ assigned-clock-parents = <&clkin_gmac>; ++ clock_in_out = "input"; ++ phy-supply = <&vcc_phy>; ++ phy-mode = "rgmii"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&rgmii_pins>; ++ snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>; ++ snps,reset-active-low; ++ snps,reset-delays-us = <0 10000 50000>; ++ tx_delay = <0x28>; ++ rx_delay = <0x11>; ++ status = "okay"; ++}; ++ ++&gpu { ++ status = "okay"; ++ mali-supply = <&vdd_gpu>; ++}; ++ ++&hdmi { ++ ddc-i2c-bus = <&i2c3>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hdmi_cec>; ++ status = "okay"; ++}; ++ ++&hdmi_sound { ++ status = "okay"; ++}; ++ ++&i2c0 { ++ status = "okay"; ++ i2c-scl-rising-time-ns = <168>; ++ i2c-scl-falling-time-ns = <4>; ++ clock-frequency = <400000>; ++ ++ vdd_cpu_b: syr827@40 { ++ compatible = "silergy,syr827"; ++ reg = <0x40>; ++ regulator-compatible = "fan53555-reg"; ++ pinctrl-0 = <&vsel1_gpio>; ++ regulator-name = "vdd_cpu_b"; ++ regulator-min-microvolt = <712500>; ++ regulator-max-microvolt = <1500000>; ++ regulator-ramp-delay = <1000>; ++ fcs,suspend-voltage-selector = <1>; ++ regulator-always-on; ++ regulator-boot-on; ++ vin-supply = <&vcc_sys>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_gpu: syr828@41 { ++ compatible = "silergy,syr828"; ++ reg = <0x41>; ++ regulator-compatible = "fan53555-reg"; ++ pinctrl-0 = <&vsel2_gpio>; ++ regulator-name = "vdd_gpu"; ++ regulator-min-microvolt = <712500>; ++ regulator-max-microvolt = <1500000>; ++ regulator-ramp-delay = <1000>; ++ fcs,suspend-voltage-selector = <1>; ++ regulator-always-on; ++ regulator-boot-on; ++ vin-supply = <&vcc_sys>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++//pmic--TODO ++ rk808: pmic@1b { ++ compatible = "rockchip,rk808"; ++ reg = <0x1b>; ++ interrupt-parent = <&gpio1>; ++ interrupts = <21 IRQ_TYPE_LEVEL_LOW>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pmic_int_l>; ++ rockchip,system-power-controller; ++ wakeup-source; ++ #clock-cells = <1>; ++ clock-output-names = "xin32k", "rtc_clko_wifi"; ++ ++ vcc1-supply = <&vcc_sys>; ++ vcc2-supply = <&vcc_sys>; ++ vcc3-supply = <&vcc_sys>; ++ vcc4-supply = <&vcc_sys>; ++ vcc6-supply = <&vcc3v3_sys>; ++ vcc7-supply = <&vcc3v3_sys>; ++ vcc8-supply = <&vcc3v3_sys>; ++ vcc9-supply = <&vcc3v3_sys>; ++ vcc10-supply = <&vcc3v3_sys>; ++ vcc11-supply = <&vcc3v3_sys>; ++ vcc12-supply = <&vcc3v3_sys>; ++ vddio-supply = <&vcc_1v8>; ++ ++ regulators { ++ vdd_center: DCDC_REG1 { ++ regulator-name = "vdd_center"; ++ regulator-min-microvolt = <750000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_cpu_l: DCDC_REG2 { ++ regulator-name = "vdd_cpu_l"; ++ regulator-min-microvolt = <750000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_ddr: DCDC_REG3 { ++ regulator-name = "vcc_ddr"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vcc_1v8: DCDC_REG4 { ++ regulator-name = "vcc_1v8"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ vcc1v8_dvp: LDO_REG1 { ++ regulator-name = "vcc1v8_dvp"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ vcc3v0_tp: LDO_REG2 { ++ regulator-name = "vcc3v0_tp"; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3000000>; ++ }; ++ }; ++ ++ vcc1v8_pmu: LDO_REG3 { ++ regulator-name = "vcc1v8_pmu"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ vcc_sd: LDO_REG4 { ++ regulator-name = "vcc_sd"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3300000>; ++ }; ++ }; ++ ++ vcca3v0_codec: LDO_REG5 { ++ regulator-name = "vcca3v0_codec"; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3000000>; ++ }; ++ }; ++ ++ vcc_1v5: LDO_REG6 { ++ regulator-name = "vcc_1v5"; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1500000>; ++ }; ++ }; ++ ++ vcca1v8_codec: LDO_REG7 { ++ regulator-name = "vcca1v8_codec"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ vcc_3v0: LDO_REG8 { ++ regulator-name = "vcc_3v0"; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3000000>; ++ }; ++ }; ++ ++ vcc3v3_s3: SWITCH_REG1 { ++ regulator-name = "vcc3v3_s3"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vcc3v3_s0: SWITCH_REG2 { ++ regulator-name = "vcc3v3_s0"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ }; ++ }; ++}; ++ ++&i2c1 { ++ i2c-scl-rising-time-ns = <300>; ++ i2c-scl-falling-time-ns = <15>; ++ status = "disabled"; ++}; ++ ++&i2c3 { ++ i2c-scl-rising-time-ns = <450>; ++ i2c-scl-falling-time-ns = <15>; ++ status = "disabled"; ++}; ++ ++&i2c4 { ++ i2c-scl-rising-time-ns = <600>; ++ i2c-scl-falling-time-ns = <40>; ++ status = "disabled"; ++}; ++ ++&i2s0 { ++ rockchip,playback-channels = <8>; ++ rockchip,capture-channels = <8>; ++ status = "disabled"; ++}; ++ ++&i2s1 { ++ rockchip,playback-channels = <2>; ++ rockchip,capture-channels = <2>; ++ status = "disabled"; ++}; ++ ++&i2s2 { ++ status = "disabled"; ++}; ++ ++&io_domains { ++ status = "okay"; ++ audio-supply = <&vcc1v8_s0>; ++ bt656-supply = <&vcc1v8_s0>; ++ gpio1830-supply = <&vcc_3v0>; ++ sdmmc-supply = <&vcc_sd>; ++}; ++ ++&pmu_io_domains { ++ status = "okay"; ++ pmu1830-supply = <&vcc_1v8>; ++}; ++ ++&pinctrl { ++ ++ sdmmc_pwren: sdmmc-pwren { ++ rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ gmac { ++ rgmii_sleep_pins: rgmii-sleep-pins { ++ rockchip,pins = ++ <3 RK_PB7 RK_FUNC_GPIO &pcfg_output_low>; ++ }; ++ }; ++ ++ leds { ++ user_led1: user_led1 { ++ rockchip,pins = ++ <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ user_led2: user_led2 { ++ rockchip,pins = ++ <2 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ }; ++ ++ pmic { ++ pmic_int_l: pmic-int-l { ++ rockchip,pins = ++ <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ ++ vsel1_gpio: vsel1-gpio { ++ rockchip,pins = ++ <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ ++ vsel2_gpio: vsel2-gpio { ++ rockchip,pins = ++ <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ }; ++ sdmmc { ++ sdmmc0_det_l: sdmmc0-det-l { ++ rockchip,pins = <0 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ ++ sdmmc0_pwr_h: sdmmc0-pwr-h { ++ rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++}; ++ ++&pwm0 { ++ status = "disabled"; ++}; ++ ++&pwm2 { ++ status = "disabled"; ++}; ++ ++&saradc { ++ vref-supply = <&vcc1v8_s0>; ++ status = "okay"; ++}; ++ ++&sdmmc { ++ bus-width = <4>; ++ cap-mmc-highspeed; ++ cap-sd-highspeed; ++ cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; ++ disable-wp; ++ max-frequency = <150000000>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>; ++ status = "okay"; ++}; ++/* ++&sdmmc { ++ clock-frequency = <150000000>; ++ clock-freq-min-max = <200000 150000000>; ++ supports-sd; ++ bus-width = <4>; ++ cap-mmc-highspeed; ++ cap-sd-highspeed; ++ disable-wp; ++ vqmmc-supply = <&vcc_sd>; ++ vmmc-supply = <&vcc3v3_sd>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc0_det_l &sdmmc_bus4>; ++ card-detect-delay = <800>; ++ sd-uhs-sdr104; ++ status = "okay"; ++ ++}; ++*/ ++&sdhci { ++ bus-width = <8>; ++ mmc-hs400-1_8v; ++ mmc-hs400-enhanced-strobe; ++ supports-emmc; ++ non-removable; ++ keep-power-in-suspend; ++ status = "okay"; ++}; ++ ++ ++&tcphy0 { ++ status = "okay"; ++}; ++ ++&tcphy1 { ++ status = "okay"; ++}; ++ ++&tsadc { ++ /* tshut mode 0:CRU 1:GPIO */ ++ rockchip,hw-tshut-mode = <1>; ++ /* tshut polarity 0:LOW 1:HIGH */ ++ rockchip,hw-tshut-polarity = <1>; ++ rockchip,hw-tshut-temp = <110000>; ++ status = "okay"; ++}; ++ ++&u2phy0 { ++ status = "okay"; ++ ++ u2phy0_host: host-port { ++ //phy-supply = <&vcc5v0_typec>; ++ status = "okay"; ++ }; ++ ++ u2phy0_otg: otg-port { ++ status = "okay"; ++ }; ++}; ++ ++&u2phy1 { ++ status = "okay"; ++ ++ u2phy1_host: host-port { ++ //phy-supply = <&vcc5v0_host>; ++ status = "okay"; ++ }; ++ ++ u2phy1_otg: otg-port { ++ status = "okay"; ++ }; ++}; ++ ++&uart0 { ++ status = "disabled"; ++}; ++ ++&uart2 { ++ status = "okay"; ++}; ++ ++&usb_host0_ehci { ++ status = "okay"; ++}; ++ ++&usb_host0_ohci { ++ status = "okay"; ++}; ++ ++&usb_host1_ehci { ++ status = "okay"; ++}; ++ ++&usb_host1_ohci { ++ status = "okay"; ++}; ++ ++&usbdrd3_0 { ++ status = "okay"; ++}; ++ ++&usbdrd_dwc3_0 { ++ status = "okay"; ++ dr_mode = "host"; ++}; ++ ++&usbdrd3_1 { ++ status = "okay"; ++}; ++ ++&usbdrd_dwc3_1 { ++ status = "okay"; ++ dr_mode = "host"; ++}; ++ ++&vopb { ++ status = "okay"; ++}; ++ ++&vopb_mmu { ++ status = "okay"; ++}; +diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk +index f15f8f26b..19d1eba72 100644 +--- a/target/linux/rockchip/image/armv8.mk ++++ b/target/linux/rockchip/image/armv8.mk +@@ -192,6 +192,16 @@ define Device/rocktech_mpc1903 + endef + TARGET_DEVICES += rocktech_mpc1903 + ++define Device/rockchip_pico3399 ++ DEVICE_VENDOR := rockchip ++ DEVICE_MODEL := pico3399 ++ SOC := rk3399 ++ UBOOT_DEVICE_NAME := rockchip-pico3399-rk3399 ++ IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-bin | gzip | append-metadata ++ DEVICE_PACKAGES := kmod-r8168 kmod-r8125 kmod-nvme -urngd ++endef ++TARGET_DEVICES += rockchip_pico3399 ++ + define Device/sharevdi_guangmiao-g4c + DEVICE_VENDOR := SHAREVDI + DEVICE_MODEL := GuangMiao G4C +diff --git a/target/linux/rockchip/patches-5.15/213-rockchip-rk3399-add-support-for-rockchip-pico3399.patch b/target/linux/rockchip/patches-5.15/213-rockchip-rk3399-add-support-for-rockchip-pico3399.patch +new file mode 100644 +index 000000000..ddfa7f575 +--- /dev/null ++++ b/target/linux/rockchip/patches-5.15/213-rockchip-rk3399-add-support-for-rockchip-pico3399.patch +@@ -0,0 +1,11 @@ ++--- a/arch/arm64/boot/dts/rockchip/Makefile +++++ b/arch/arm64/boot/dts/rockchip/Makefile ++@@ -53,6 +53,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-ro ++ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4b.dtb ++ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4c.dtb ++ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock960.dtb +++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pico3399.dtb ++ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-mpc1903.dtb ++ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rockpro64-v2.dtb ++ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rockpro64.dtb ++ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sapphire.dtb +diff --git a/target/linux/rockchip/patches-6.1/213-rockchip-rk3399-add-support-for-rockchip-pico3399.patch b/target/linux/rockchip/patches-6.1/213-rockchip-rk3399-add-support-for-rockchip-pico3399.patch +new file mode 100644 +index 000000000..da314d78d +--- /dev/null ++++ b/target/linux/rockchip/patches-6.1/213-rockchip-rk3399-add-support-for-rockchip-pico3399.patch +@@ -0,0 +1,11 @@ ++--- a/arch/arm64/boot/dts/rockchip/Makefile +++++ b/arch/arm64/boot/dts/rockchip/Makefile ++@@ -63,6 +63,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-ro ++ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4b-plus.dtb ++ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4c.dtb ++ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-king3399.dtb +++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pico3399.dtb ++ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-mpc1903.dtb ++ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock960.dtb ++ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rockpro64-v2.dtb ++ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rockpro64.dtb +网页知识图片视频音乐社交购物 \ No newline at end of file diff --git a/devices/rockchip_armv8/patches/r6s.patch b/devices/rockchip_armv8/patches/r6s.patch index 81061eadad72..e6e96dfbfaa7 100644 --- a/devices/rockchip_armv8/patches/r6s.patch +++ b/devices/rockchip_armv8/patches/r6s.patch @@ -35,8 +35,8 @@ --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network -@@ -19,9 +19,14 @@ rockchip_setup_interfaces() - rocktech,mpc1903|\ +@@ -21,9 +21,14 @@ rockchip_setup_interfaces() + sharevdi,h3399pc|\ sharevdi,guangmiao-g4c|\ xunlong,orangepi-r1-plus|\ - xunlong,orangepi-r1-plus-lts) @@ -48,11 +48,11 @@ + friendlyarm,nanopi-r6s) + ucidef_set_interfaces_lan_wan "eth1 eth0" "eth2" + ;; - hinlink,opc-h68k|\ - hinlink,opc-h69k) - ucidef_set_interfaces_lan_wan 'eth1 eth2 eth3' 'eth0' -@@ -51,10 +56,10 @@ generate_mac_from_mmc_cid() - echo "$(macaddr_unsetbit_mc "$(macaddr_setbit_la "${mac_base}")")" + fastrhino,r66s|\ + firefly,rk3568-roc-pc|\ + friendlyarm,nanopi-r5c|\ +@@ -45,10 +50,10 @@ rockchip_setup_interfaces() + esac } -nanopi_r4s_get_mac() @@ -64,7 +64,7 @@ local address if [ -f "$eeprom_path" ]; then -@@ -100,8 +105,12 @@ rockchip_setup_macs() +@@ -94,8 +99,12 @@ rockchip_setup_macs() ;; friendlyarm,nanopi-r4s|\ friendlyarm,nanopi-r4se) @@ -77,8 +77,8 @@ + wan_mac=$(nanopi_get_mac wan 6-0053) + lan_mac=$(nanopi_get_mac lan 6-0053) ;; - xunlong,orangepi-r1-plus|\ - xunlong,orangepi-r1-plus-lts) + friendlyarm,nanopi-r5c|\ + friendlyarm,nanopi-r5s|\ --- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds +++ a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds @@ -129,20 +129,18 @@ --- a/target/linux/rockchip/image/Makefile +++ b/target/linux/rockchip/image/Makefile -@@ -79,4 +79,17 @@ endif +@@ -79,4 +79,15 @@ endif include $(SUBTARGET).mk +define Image/Build -+ if [[ "$(PROFILE_SANITIZED)" == "friendlyarm_nanopi-r6s" || "$(PROFILE_SANITIZED)" == "friendlyarm_nanopi-r6c" || "$(PROFILE_SANITIZED)" == "friendlyarm_nanopc-t6" ]]; then \ ++ if [[ "$(PROFILE_SANITIZED)" == "$(PROFILE_SANITIZED)" == "friendlyarm_nanopc-t6" ]]; then \ + export IMG_PREFIX="$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))"; \ + export BIN_DIR=$(BIN_DIR); \ + export TOPDIR=$(TOPDIR); \ -+ cd /www/wwwroot/op.supes.top/bcache/rockchip/armv8/friendlywrt22-rk3588; \ -+ . ../modify_packit.sh; \ -+ ./build.sh sd-img; \ -+ [ "$(MORE)" == "eflasher" ] && ./build.sh emmc-img; \ -+ rm -rf $(BIN_DIR)/$(PROFILE_SANITIZED)-squashfs-sysupgrade.img.gz $(BIN_DIR)/images-for-eflasher; \ ++ export MORE=$(MORE); \ ++ cd /data/packit/friendlywrt22-rk3588; \ ++ . ~/packit/packit_nanopi.sh; \ + fi +endef +