Compare commits
241 Commits
v23.05.0-r
...
v23.05.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c26bcb108 | ||
|
|
842932a63d | ||
|
|
51bb178824 | ||
|
|
4637ba72b7 | ||
|
|
b38b5c4299 | ||
|
|
ce62536aca | ||
|
|
03e26f856f | ||
|
|
a00fc406b9 | ||
|
|
275f7e07ee | ||
|
|
65bf66f727 | ||
|
|
ce62c25c08 | ||
|
|
a58a86693f | ||
|
|
101988c61a | ||
|
|
b7e81d210b | ||
|
|
3d006f95f2 | ||
|
|
46385eb7f8 | ||
|
|
11a41bc4b2 | ||
|
|
f6a9f0c57b | ||
|
|
2285eb732a | ||
|
|
f5e9fd624d | ||
|
|
85d1b43be4 | ||
|
|
1cab0d74b3 | ||
|
|
c9e8453de7 | ||
|
|
2ef625e769 | ||
|
|
5106f554bb | ||
|
|
6fd16b0d27 | ||
|
|
6de0e0d01a | ||
|
|
bbfb920e99 | ||
|
|
f780cfb92f | ||
|
|
d3c193525e | ||
|
|
429715a237 | ||
|
|
b209f45640 | ||
|
|
04cde73d56 | ||
|
|
3223f31fd3 | ||
|
|
cfadbc090c | ||
|
|
7c43ced160 | ||
|
|
ec54022549 | ||
|
|
610ae4d344 | ||
|
|
8ed934f371 | ||
|
|
250ab7b7a5 | ||
|
|
592aacc3d9 | ||
|
|
65a10c8230 | ||
|
|
21e5db97c4 | ||
|
|
4ef8899c7a | ||
|
|
fdeb7d6dd0 | ||
|
|
21552a955a | ||
|
|
40203cdbde | ||
|
|
f34ccb10dd | ||
|
|
51b1d5950e | ||
|
|
b549880815 | ||
|
|
41f27bbb6d | ||
|
|
0dec0e0f19 | ||
|
|
20736013e9 | ||
|
|
066971615f | ||
|
|
b649b0bf71 | ||
|
|
e465592155 | ||
|
|
1157b8c1f1 | ||
|
|
89184b15cf | ||
|
|
25bb84e273 | ||
|
|
3f6e28e39c | ||
|
|
958817b1c3 | ||
|
|
16fcad47a4 | ||
|
|
6bb3c2eba8 | ||
|
|
eaf44c5696 | ||
|
|
220ab83cd1 | ||
|
|
ed6e13649d | ||
|
|
26164312b4 | ||
|
|
f1ea45f853 | ||
|
|
1d5d149330 | ||
|
|
b5817d14c9 | ||
|
|
fefa446127 | ||
|
|
07e9c27bde | ||
|
|
3d0a78add2 | ||
|
|
620721f642 | ||
|
|
982f859144 | ||
|
|
64ab02aff8 | ||
|
|
06efc8027f | ||
|
|
8ff9264177 | ||
|
|
269896fed0 | ||
|
|
aaa1286b89 | ||
|
|
5368066e9b | ||
|
|
525adac8ee | ||
|
|
c4c9f61331 | ||
|
|
9eec4eb268 | ||
|
|
6150df13a3 | ||
|
|
7bd682bc58 | ||
|
|
cd189cdefe | ||
|
|
a1e3ec0ff6 | ||
|
|
ba300c8a1c | ||
|
|
97980323ef | ||
|
|
07d4455cee | ||
|
|
74dbee1ea0 | ||
|
|
cdf7c3a16e | ||
|
|
6a1b92b024 | ||
|
|
75fe50defe | ||
|
|
263ef841d4 | ||
|
|
c53dda11a2 | ||
|
|
b63c6e3512 | ||
|
|
76a9b0e02a | ||
|
|
3826ebbd18 | ||
|
|
b00fcab13c | ||
|
|
6cdd9a6de4 | ||
|
|
37395ecb32 | ||
|
|
05331f0ef8 | ||
|
|
f7e4f8cbbf | ||
|
|
5bfa66bcf3 | ||
|
|
15f4d6b244 | ||
|
|
51adcb7cd2 | ||
|
|
d7e2468e13 | ||
|
|
c8d4694d2c | ||
|
|
fad08e8e23 | ||
|
|
c5441d24d9 | ||
|
|
f666723f6d | ||
|
|
e83384b87e | ||
|
|
e2780cbb2f | ||
|
|
6099d083a6 | ||
|
|
6c80c7533b | ||
|
|
b98b3d4296 | ||
|
|
6420851c0c | ||
|
|
ee3600a91e | ||
|
|
023f90fbc8 | ||
|
|
03cb2d63f4 | ||
|
|
58d57f7673 | ||
|
|
4afff7b8b5 | ||
|
|
1304234dd7 | ||
|
|
0da199f60c | ||
|
|
c0c4a9bce4 | ||
|
|
72f7f18d2b | ||
|
|
77061285e4 | ||
|
|
4245adf4e0 | ||
|
|
2ce5521bd2 | ||
|
|
0bc33a6505 | ||
|
|
86e852bcd0 | ||
|
|
bd4f415efa | ||
|
|
6637af95aa | ||
|
|
fadbec8857 | ||
|
|
6d65f5ea2b | ||
|
|
e26947993f | ||
|
|
4cbfbb2eda | ||
|
|
83e681e69e | ||
|
|
5b00873f5d | ||
|
|
76758a8694 | ||
|
|
130d5056c1 | ||
|
|
2a457dcd72 | ||
|
|
07e4352d80 | ||
|
|
3fff625542 | ||
|
|
e92cf0c46f | ||
|
|
b742216dc8 | ||
|
|
50690dd5cc | ||
|
|
7fe85ce1f2 | ||
|
|
02ed2b0271 | ||
|
|
186747a169 | ||
|
|
679f89ab65 | ||
|
|
ba9b93d913 | ||
|
|
0ba56ae446 | ||
|
|
1b7d48dc5f | ||
|
|
388d213392 | ||
|
|
782341458c | ||
|
|
849f0ea65c | ||
|
|
f4e4943d1a | ||
|
|
34d8a7f63f | ||
|
|
dee4e7b40c | ||
|
|
442f7406a9 | ||
|
|
39320d4b58 | ||
|
|
9349302bca | ||
|
|
912eded06c | ||
|
|
2d812f0b72 | ||
|
|
4c2f44c859 | ||
|
|
06ff4dd562 | ||
|
|
457a12a834 | ||
|
|
a684b512e5 | ||
|
|
2f30dec3cb | ||
|
|
fe1028e89c | ||
|
|
43e9cded06 | ||
|
|
eda1545e6e | ||
|
|
6019945e96 | ||
|
|
83bf45ea5c | ||
|
|
829196e1b1 | ||
|
|
09b9d732ec | ||
|
|
8b385a45a6 | ||
|
|
0d1859c258 | ||
|
|
5e3f86a101 | ||
|
|
90d5961751 | ||
|
|
6e09f88d29 | ||
|
|
6798f156f9 | ||
|
|
98d0ee9dbf | ||
|
|
a701e6e1c2 | ||
|
|
9720b094ae | ||
|
|
263583dc1e | ||
|
|
9af2ad5111 | ||
|
|
7e55f20c1f | ||
|
|
385a50f02d | ||
|
|
2dc284a79a | ||
|
|
c3be832427 | ||
|
|
d536f398eb | ||
|
|
3c8825e5f8 | ||
|
|
c79854e9fc | ||
|
|
c90005c58a | ||
|
|
5edeb1ee0c | ||
|
|
6897270491 | ||
|
|
10aee60361 | ||
|
|
6c60bbbc94 | ||
|
|
6577b550df | ||
|
|
0165daf569 | ||
|
|
3cc223243b | ||
|
|
a7449e5e95 | ||
|
|
0cb2ff5d08 | ||
|
|
cdc8470aec | ||
|
|
9df9126320 | ||
|
|
4f1a7e8897 | ||
|
|
b2d264dc68 | ||
|
|
a2ffbc8d16 | ||
|
|
d052d409a0 | ||
|
|
3967c26974 | ||
|
|
625d19c1e2 | ||
|
|
230c09d203 | ||
|
|
c8c1805100 | ||
|
|
ed370ec424 | ||
|
|
35d123adfe | ||
|
|
87ef305984 | ||
|
|
ffede121f8 | ||
|
|
5a9720945f | ||
|
|
88c12d6632 | ||
|
|
cf08db988b | ||
|
|
e685162a78 | ||
|
|
8bf25dba77 | ||
|
|
3c1721ae03 | ||
|
|
56827dac01 | ||
|
|
736e3b81aa | ||
|
|
f493987d13 | ||
|
|
b9c94686f7 | ||
|
|
104178a990 | ||
|
|
e74a4b509f | ||
|
|
d792d20832 | ||
|
|
7eda621404 | ||
|
|
f445c38263 | ||
|
|
16aecc12c2 | ||
|
|
99d9519bac | ||
|
|
9ed01992f3 | ||
|
|
e658eee813 | ||
|
|
b055769a48 |
4
.github/workflows/Dockerfile.tools
vendored
4
.github/workflows/Dockerfile.tools
vendored
@@ -1,4 +0,0 @@
|
||||
FROM ghcr.io/openwrt/buildbot/buildworker-v3.8.0:v2
|
||||
|
||||
COPY --chown=buildbot staging_dir/host /prebuilt_tools/staging_dir/host
|
||||
COPY --chown=buildbot build_dir/host /prebuilt_tools/build_dir/host
|
||||
72
.github/workflows/build-tools.yml
vendored
72
.github/workflows/build-tools.yml
vendored
@@ -1,72 +0,0 @@
|
||||
name: Build host tools
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
generate_prebuilt_artifacts:
|
||||
type: boolean
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build tools
|
||||
runs-on: ubuntu-latest
|
||||
container: ghcr.io/openwrt/buildbot/buildworker-v3.8.0:v2
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: openwrt
|
||||
|
||||
- name: Fix permission
|
||||
run: chown -R buildbot:buildbot openwrt
|
||||
|
||||
- name: Set configs for tools container
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
touch .config
|
||||
echo CONFIG_DEVEL=y >> .config
|
||||
echo CONFIG_AUTOREMOVE=y >> .config
|
||||
echo CONFIG_CCACHE=y >> .config
|
||||
|
||||
- name: Make prereq
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: make defconfig
|
||||
|
||||
- name: Build tools
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
|
||||
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: linux-buildbot-logs
|
||||
path: openwrt/logs
|
||||
|
||||
- name: Upload config
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: linux-buildbot-config
|
||||
path: openwrt/.config
|
||||
|
||||
- name: Archive prebuilt tools
|
||||
if: inputs.generate_prebuilt_artifacts == true
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: tar -cf tools.tar staging_dir/host build_dir/host
|
||||
|
||||
- name: Upload prebuilt tools
|
||||
if: inputs.generate_prebuilt_artifacts == true
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: linux-buildbot-prebuilt-tools
|
||||
path: openwrt/tools.tar
|
||||
retention-days: 1
|
||||
435
.github/workflows/build.yml
vendored
435
.github/workflows/build.yml
vendored
@@ -1,435 +0,0 @@
|
||||
name: Build sub target
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
secrets:
|
||||
coverity_api_token:
|
||||
inputs:
|
||||
target:
|
||||
required: true
|
||||
type: string
|
||||
subtarget:
|
||||
required: true
|
||||
type: string
|
||||
testing:
|
||||
type: boolean
|
||||
build_toolchain:
|
||||
type: boolean
|
||||
include_feeds:
|
||||
type: boolean
|
||||
build_full:
|
||||
type: boolean
|
||||
build_kernel:
|
||||
type: boolean
|
||||
build_all_modules:
|
||||
type: boolean
|
||||
build_all_kmods:
|
||||
type: boolean
|
||||
build_all_boards:
|
||||
type: boolean
|
||||
use_openwrt_container:
|
||||
type: boolean
|
||||
default: true
|
||||
coverity_project_name:
|
||||
type: string
|
||||
default: OpenWrt
|
||||
coverity_check_packages:
|
||||
type: string
|
||||
coverity_compiler_template_list:
|
||||
type: string
|
||||
default: >-
|
||||
arm-openwrt-linux-gcc
|
||||
coverity_force_compile_packages:
|
||||
type: string
|
||||
default: >-
|
||||
curl
|
||||
libnl
|
||||
mbedtls
|
||||
wolfssl
|
||||
openssl
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
setup_build:
|
||||
name: Setup build ${{ inputs.target }}/${{ inputs.subtarget }}
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
owner_lc: ${{ steps.lower_owner.outputs.owner_lc }}
|
||||
ccache_hash: ${{ steps.ccache_hash.outputs.ccache_hash }}
|
||||
container_tag: ${{ steps.determine_tools_container.outputs.container_tag }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set lower case owner name
|
||||
id: lower_owner
|
||||
run: |
|
||||
OWNER_LC=$(echo "${{ github.repository_owner }}" \
|
||||
| tr '[:upper:]' '[:lower:]')
|
||||
|
||||
if [ ${{ inputs.use_openwrt_container }} == "true" ]; then
|
||||
OWNER_LC=openwrt
|
||||
fi
|
||||
|
||||
echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Generate ccache hash
|
||||
id: ccache_hash
|
||||
run: |
|
||||
CCACHE_HASH=$(md5sum include/kernel-* | awk '{ print $1 }' \
|
||||
| md5sum | awk '{ print $1 }')
|
||||
echo "ccache_hash=$CCACHE_HASH" >> $GITHUB_OUTPUT
|
||||
|
||||
# Per branch tools container tag
|
||||
# By default stick to latest
|
||||
# For official test targetting openwrt stable branch
|
||||
# Get the branch or parse the tag and push dedicated tools containers
|
||||
# For local test to use the correct container for stable release testing
|
||||
# you need to use for the branch name a prefix of openwrt-[0-9][0-9].[0-9][0-9]-
|
||||
- name: Determine tools container tag
|
||||
id: determine_tools_container
|
||||
run: |
|
||||
CONTAINER_TAG=latest
|
||||
if [ -n "${{ github.base_ref }}" ]; then
|
||||
if echo "${{ github.base_ref }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then
|
||||
CONTAINER_TAG="${{ github.base_ref }}"
|
||||
fi
|
||||
elif [ ${{ github.ref_type }} == "branch" ]; then
|
||||
if echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then
|
||||
CONTAINER_TAG=${{ github.ref_name }}
|
||||
elif echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]-'; then
|
||||
CONTAINER_TAG="$(echo ${{ github.ref_name }} | sed 's/^\(openwrt-[0-9][0-9]\.[0-9][0-9]\)-.*/\1/')"
|
||||
fi
|
||||
elif [ ${{ github.ref_type }} == "tag" ]; then
|
||||
if echo "${{ github.ref_name }}" | grep -q -E '^v[0-9][0-9]\.[0-9][0-9]\..+'; then
|
||||
CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/^v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')"
|
||||
fi
|
||||
fi
|
||||
echo "Tools container to use tools:$CONTAINER_TAG"
|
||||
echo "container_tag=$CONTAINER_TAG" >> $GITHUB_OUTPUT
|
||||
|
||||
build:
|
||||
name: Build ${{ inputs.target }}/${{ inputs.subtarget }}
|
||||
needs: setup_build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/tools:${{ needs.setup_build.outputs.container_tag }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
|
||||
steps:
|
||||
- name: Checkout master directory
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: openwrt
|
||||
|
||||
- name: Checkout packages feed
|
||||
if: inputs.include_feeds == true
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: openwrt/packages
|
||||
path: openwrt/feeds/packages
|
||||
|
||||
- name: Checkout luci feed
|
||||
if: inputs.include_feeds == true
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: openwrt/luci
|
||||
path: openwrt/feeds/luci
|
||||
|
||||
- name: Checkout routing feed
|
||||
if: inputs.include_feeds == true
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: openwrt/routing
|
||||
path: openwrt/feeds/routing
|
||||
|
||||
- name: Checkout telephony feed
|
||||
if: inputs.include_feeds == true
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: openwrt/telephony
|
||||
path: openwrt/feeds/telephony
|
||||
|
||||
- name: Parse toolchain file
|
||||
if: inputs.build_toolchain == false
|
||||
id: parse-toolchain
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
TOOLCHAIN_PATH=snapshots
|
||||
|
||||
if [ -n "${{ github.base_ref }}" ]; then
|
||||
if echo "${{ github.base_ref }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then
|
||||
major_ver="$(echo ${{ github.base_ref }} | sed 's/^openwrt-/v/')"
|
||||
fi
|
||||
elif [ "${{ github.ref_type }}" = "branch" ]; then
|
||||
if echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then
|
||||
major_ver="$(echo ${{ github.ref_name }} | sed 's/^openwrt-/v/')"
|
||||
elif echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]-'; then
|
||||
major_ver="$(echo ${{ github.ref_name }} | sed 's/^openwrt-\([0-9][0-9]\.[0-9][0-9]\)-.*/v\1/')"
|
||||
fi
|
||||
elif [ "${{ github.ref_type }}" = "tag" ]; then
|
||||
if echo "${{ github.ref_name }}" | grep -q -E '^v[0-9][0-9]\.[0-9][0-9]\..+'; then
|
||||
major_ver="$(echo ${{ github.ref_name }} | sed 's/^\(v[0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$major_ver" ]; then
|
||||
git fetch --tags -f
|
||||
latest_tag="$(git tag --sort=-creatordate -l $major_ver* | head -n1)"
|
||||
if [ -n "$latest_tag" ]; then
|
||||
TOOLCHAIN_PATH=releases/$(echo $latest_tag | sed 's/^v//')
|
||||
fi
|
||||
fi
|
||||
|
||||
SUMS_FILE="https://downloads.cdn.openwrt.org/$TOOLCHAIN_PATH/targets/${{ inputs.target }}/${{ inputs.subtarget }}/sha256sums"
|
||||
if curl $SUMS_FILE | grep -q ".*openwrt-toolchain.*tar.xz"; then
|
||||
TOOLCHAIN_STRING="$( curl $SUMS_FILE | grep ".*openwrt-toolchain.*tar.xz")"
|
||||
TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p')
|
||||
|
||||
echo "toolchain-type=external_toolchain" >> $GITHUB_OUTPUT
|
||||
elif curl $SUMS_FILE | grep -q ".*openwrt-sdk.*tar.xz"; then
|
||||
TOOLCHAIN_STRING="$( curl $SUMS_FILE | grep ".*openwrt-sdk.*tar.xz")"
|
||||
TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-sdk.*\).tar.xz/\1/p')
|
||||
|
||||
echo "toolchain-type=external_sdk" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "toolchain-type=internal" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV"
|
||||
echo "TOOLCHAIN_PATH=$TOOLCHAIN_PATH" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Fix permission
|
||||
run: |
|
||||
chown -R buildbot:buildbot openwrt
|
||||
|
||||
- name: Prepare prebuilt tools
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
mkdir -p staging_dir build_dir
|
||||
ln -s /prebuilt_tools/staging_dir/host staging_dir/host
|
||||
ln -s /prebuilt_tools/build_dir/host build_dir/host
|
||||
|
||||
./scripts/ext-tools.sh --refresh
|
||||
|
||||
- name: Update & Install feeds
|
||||
if: inputs.include_feeds == true
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
./scripts/feeds update -a
|
||||
./scripts/feeds install -a
|
||||
|
||||
- name: Cache ccache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: openwrt/.ccache
|
||||
key: ccache-kernel-${{ inputs.target }}/${{ inputs.subtarget }}-${{ needs.setup_build.outputs.ccache_hash }}
|
||||
restore-keys: |
|
||||
ccache-kernel-${{ inputs.target }}/${{ inputs.subtarget }}-
|
||||
|
||||
- name: Download external toolchain/sdk
|
||||
if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type != 'internal'
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
wget -O - https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ inputs.target }}/${{ inputs.subtarget }}/${{ env.TOOLCHAIN_FILE }}.tar.xz \
|
||||
| tar --xz -xf -
|
||||
|
||||
- name: Configure testing kernel
|
||||
if: inputs.testing == true
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
echo CONFIG_TESTING_KERNEL=y >> .config
|
||||
|
||||
- name: Configure all kernel modules
|
||||
if: inputs.build_all_kmods == true
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
echo CONFIG_ALL_KMODS=y >> .config
|
||||
|
||||
- name: Configure all modules
|
||||
if: inputs.build_all_modules == true
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
echo CONFIG_ALL=y >> .config
|
||||
|
||||
- name: Configure all boards
|
||||
if: inputs.build_all_boards == true
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
echo CONFIG_TARGET_MULTI_PROFILE=y >> .config
|
||||
echo CONFIG_TARGET_PER_DEVICE_ROOTFS=y >> .config
|
||||
echo CONFIG_TARGET_ALL_PROFILES=y >> .config
|
||||
|
||||
- name: Configure external toolchain
|
||||
if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_toolchain'
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
echo CONFIG_DEVEL=y >> .config
|
||||
echo CONFIG_AUTOREMOVE=y >> .config
|
||||
echo CONFIG_CCACHE=y >> .config
|
||||
|
||||
./scripts/ext-toolchain.sh \
|
||||
--toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \
|
||||
--overwrite-config \
|
||||
--config ${{ inputs.target }}/${{ inputs.subtarget }}
|
||||
|
||||
- name: Adapt external sdk to external toolchain format
|
||||
if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_sdk'
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
TOOLCHAIN_DIR=${{ env.TOOLCHAIN_FILE }}/staging_dir/$(ls ${{ env.TOOLCHAIN_FILE }}/staging_dir | grep toolchain)
|
||||
TOOLCHAIN_BIN=$TOOLCHAIN_DIR/bin
|
||||
OPENWRT_DIR=$(pwd)
|
||||
|
||||
# Find target name from toolchain info.mk
|
||||
GNU_TARGET_NAME=$(cat $TOOLCHAIN_DIR/info.mk | grep TARGET_CROSS | sed 's/^TARGET_CROSS=\(.*\)-$/\1/')
|
||||
|
||||
cd $TOOLCHAIN_BIN
|
||||
|
||||
# Revert sdk wrapper scripts applied to all the bins
|
||||
for app in $(find . -name "*.bin"); do
|
||||
TARGET_APP=$(echo $app | sed 's/\.\/\.\(.*\)\.bin/\1/')
|
||||
rm $TARGET_APP
|
||||
mv .$TARGET_APP.bin $TARGET_APP
|
||||
done
|
||||
|
||||
# Setup the wrapper script in the sdk toolchain dir simulating an external toolchain build
|
||||
cp $OPENWRT_DIR/target/toolchain/files/wrapper.sh $GNU_TARGET_NAME-wrapper.sh
|
||||
for app in cc gcc g++ c++ cpp ld as ; do
|
||||
[ -f $GNU_TARGET_NAME-$app ] && mv $GNU_TARGET_NAME-$app $GNU_TARGET_NAME-$app.bin
|
||||
ln -sf $GNU_TARGET_NAME-wrapper.sh $GNU_TARGET_NAME-$app
|
||||
done
|
||||
|
||||
- name: Configure external toolchain with sdk
|
||||
if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_sdk'
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
echo CONFIG_DEVEL=y >> .config
|
||||
echo CONFIG_AUTOREMOVE=y >> .config
|
||||
echo CONFIG_CCACHE=y >> .config
|
||||
|
||||
./scripts/ext-toolchain.sh \
|
||||
--toolchain ${{ env.TOOLCHAIN_FILE }}/staging_dir/toolchain-* \
|
||||
--overwrite-config \
|
||||
--config ${{ inputs.target }}/${{ inputs.subtarget }}
|
||||
|
||||
- name: Configure internal toolchain
|
||||
if: inputs.build_toolchain == true || steps.parse-toolchain.outputs.toolchain-type == 'internal'
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
echo CONFIG_DEVEL=y >> .config
|
||||
echo CONFIG_AUTOREMOVE=y >> .config
|
||||
echo CONFIG_CCACHE=y >> .config
|
||||
|
||||
echo "CONFIG_TARGET_${{ inputs.target }}=y" >> .config
|
||||
echo "CONFIG_TARGET_${{ inputs.target }}_${{ inputs.subtarget }}=y" >> .config
|
||||
|
||||
make defconfig
|
||||
|
||||
- name: Show configuration
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: ./scripts/diffconfig.sh
|
||||
|
||||
- name: Build tools
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
|
||||
|
||||
- name: Build toolchain
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: make toolchain/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
|
||||
|
||||
- name: Build Kernel
|
||||
if: inputs.build_kernel == true
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: make target/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
|
||||
|
||||
- name: Build Kernel Kmods
|
||||
if: inputs.build_kernel == true
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: make package/linux/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
|
||||
|
||||
- name: Build everything
|
||||
if: inputs.build_full == true
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: make -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
|
||||
|
||||
- name: Coverity prepare toolchain
|
||||
if: inputs.coverity_check_packages != ''
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
wget -q https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.coverity_api_token }}&project=${{ inputs.coverity_project_name }}" -O coverity.tar.gz
|
||||
wget -q https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.coverity_api_token }}&project=${{ inputs.coverity_project_name }}&md5=1" -O coverity.tar.gz.md5
|
||||
echo ' coverity.tar.gz' >> coverity.tar.gz.md5
|
||||
md5sum -c coverity.tar.gz.md5
|
||||
|
||||
mkdir cov-analysis-linux64
|
||||
tar xzf coverity.tar.gz --strip 1 -C cov-analysis-linux64
|
||||
export PATH=$(pwd)/cov-analysis-linux64/bin:$PATH
|
||||
|
||||
for template in ${{ inputs.coverity_compiler_template_list }}; do
|
||||
cov-configure --template --comptype gcc --compiler "$template"
|
||||
done
|
||||
|
||||
- name: Clean and recompile packages with Coverity toolchain
|
||||
if: inputs.coverity_check_packages != ''
|
||||
shell: su buildbot -c "bash {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
set -o pipefail -o errexit
|
||||
|
||||
coverity_check_packages=(${{ inputs.coverity_check_packages }})
|
||||
printf -v clean_packages "package/%s/clean " "${coverity_check_packages[@]}"
|
||||
make -j$(nproc) BUILD_LOG=1 $clean_packages || ret=$? .github/workflows/scripts/show_build_failures.sh
|
||||
|
||||
coverity_force_compile_packages=(${{ inputs.coverity_force_compile_packages }})
|
||||
printf -v force_compile_packages "package/%s/compile " "${coverity_force_compile_packages[@]}"
|
||||
make -j$(nproc) BUILD_LOG=1 $force_compile_packages || ret=$? .github/workflows/scripts/show_build_failures.sh
|
||||
|
||||
printf -v compile_packages "package/%s/compile " "${coverity_check_packages[@]}"
|
||||
export PATH=$(pwd)/cov-analysis-linux64/bin:$PATH
|
||||
cov-build --dir cov-int make -j $(nproc) BUILD_LOG=1 $compile_packages || ret=$? .github/workflows/scripts/show_build_failures.sh
|
||||
|
||||
- name: Upload build to Coverity for analysis
|
||||
if: inputs.coverity_check_packages != ''
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
tar czf cov-int.tar.gz ./cov-int
|
||||
curl \
|
||||
--form token="${{ secrets.coverity_api_token }}" \
|
||||
--form email="contact@openwrt.org" \
|
||||
--form file=@cov-int.tar.gz \
|
||||
--form version="${{ github.ref_name }}-${{ github.sha }}" \
|
||||
--form description="OpenWrt ${{ github.ref_name }}-${{ github.sha }}" \
|
||||
"https://scan.coverity.com/builds?project=${{ inputs.coverity_project_name }}"
|
||||
|
||||
- name: Upload logs
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.target }}-${{ inputs.subtarget }}-logs
|
||||
path: "openwrt/logs"
|
||||
155
.github/workflows/check-kernel-patches.yml
vendored
155
.github/workflows/check-kernel-patches.yml
vendored
@@ -1,155 +0,0 @@
|
||||
name: Refresh kernel for target
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
target:
|
||||
required: true
|
||||
type: string
|
||||
subtarget:
|
||||
required: true
|
||||
type: string
|
||||
testing:
|
||||
type: boolean
|
||||
use_openwrt_container:
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
setup_build:
|
||||
name: Setup build
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
owner_lc: ${{ steps.lower_owner.outputs.owner_lc }}
|
||||
container_tag: ${{ steps.determine_tools_container.outputs.container_tag }}
|
||||
|
||||
steps:
|
||||
- name: Set lower case owner name
|
||||
id: lower_owner
|
||||
run: |
|
||||
OWNER_LC=$(echo "${{ github.repository_owner }}" \
|
||||
| tr '[:upper:]' '[:lower:]')
|
||||
|
||||
if [ ${{ inputs.use_openwrt_container }} == "true" ]; then
|
||||
OWNER_LC=openwrt
|
||||
fi
|
||||
|
||||
echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT
|
||||
|
||||
# Per branch tools container tag
|
||||
# By default stick to latest
|
||||
# For official test targetting openwrt stable branch
|
||||
# Get the branch or parse the tag and push dedicated tools containers
|
||||
# For local test to use the correct container for stable release testing
|
||||
# you need to use for the branch name a prefix of openwrt-[0-9][0-9].[0-9][0-9]-
|
||||
- name: Determine tools container tag
|
||||
id: determine_tools_container
|
||||
run: |
|
||||
CONTAINER_TAG=latest
|
||||
if [ -n "${{ github.base_ref }}" ]; then
|
||||
if echo "${{ github.base_ref }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then
|
||||
CONTAINER_TAG="${{ github.base_ref }}"
|
||||
fi
|
||||
elif [ ${{ github.ref_type }} == "branch" ]; then
|
||||
if echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then
|
||||
CONTAINER_TAG=${{ github.ref_name }}
|
||||
elif echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]-'; then
|
||||
CONTAINER_TAG="$(echo ${{ github.ref_name }} | sed 's/^\(openwrt-[0-9][0-9]\.[0-9][0-9]\)-.*/\1/')"
|
||||
fi
|
||||
elif [ ${{ github.ref_type }} == "tag" ]; then
|
||||
if echo "${{ github.ref_name }}" | grep -q -E '^v[0-9][0-9]\.[0-9][0-9]\..+'; then
|
||||
CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/^v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')"
|
||||
fi
|
||||
fi
|
||||
echo "Tools container to use tools:$CONTAINER_TAG"
|
||||
echo "container_tag=$CONTAINER_TAG" >> $GITHUB_OUTPUT
|
||||
|
||||
check-patch:
|
||||
name: Check Kernel patches
|
||||
needs: setup_build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/tools:${{ needs.setup_build.outputs.container_tag }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
|
||||
steps:
|
||||
- name: Checkout master directory
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: openwrt
|
||||
|
||||
- name: Fix permission
|
||||
run: |
|
||||
chown -R buildbot:buildbot openwrt
|
||||
|
||||
- name: Prepare prebuilt tools
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
mkdir -p staging_dir build_dir
|
||||
ln -sf /prebuilt_tools/staging_dir/host staging_dir/host
|
||||
ln -sf /prebuilt_tools/build_dir/host build_dir/host
|
||||
|
||||
./scripts/ext-tools.sh --refresh
|
||||
|
||||
- name: Configure testing kernel
|
||||
if: inputs.testing == true
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
echo CONFIG_TESTING_KERNEL=y >> .config
|
||||
|
||||
- name: Configure system
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
echo CONFIG_ALL_KMODS=y >> .config
|
||||
echo CONFIG_DEVEL=y >> .config
|
||||
echo CONFIG_AUTOREMOVE=y >> .config
|
||||
echo CONFIG_CCACHE=y >> .config
|
||||
|
||||
echo "CONFIG_TARGET_${{ inputs.target }}=y" >> .config
|
||||
echo "CONFIG_TARGET_${{ inputs.target }}_${{ inputs.subtarget }}=y" >> .config
|
||||
|
||||
make defconfig
|
||||
|
||||
- name: Build tools
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: make tools/quilt/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
|
||||
|
||||
- name: Refresh Kernel patches
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: make target/linux/refresh V=s
|
||||
|
||||
- name: Validate Refreshed Kernel Patches
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
. .github/workflows/scripts/ci_helpers.sh
|
||||
|
||||
if git diff --name-only --exit-code; then
|
||||
success "Kernel patches for ${{ inputs.target }}/${{ inputs.subtarget }} seems ok"
|
||||
else
|
||||
err "Kernel patches for ${{ inputs.target }}/${{ inputs.subtarget }} require refresh. (run 'make target/linux/refresh' and force push this pr)"
|
||||
err "You can also check the provided artifacts with the refreshed patch from this CI run."
|
||||
mkdir ${{ inputs.target }}-${{ inputs.subtarget }}-refreshed
|
||||
for f in $(git diff --name-only); do
|
||||
cp --parents $f ${{ inputs.target }}-${{ inputs.subtarget }}-refreshed/
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Upload Refreshed Patches
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.target }}-${{ inputs.subtarget }}-refreshed
|
||||
path: openwrt/${{ inputs.target }}-${{ inputs.subtarget }}-refreshed
|
||||
50
.github/workflows/coverity.yml
vendored
50
.github/workflows/coverity.yml
vendored
@@ -15,51 +15,5 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
target: x86
|
||||
subtarget: 64
|
||||
build_full: true
|
||||
include_feeds: true
|
||||
coverity_compiler_template_list: >-
|
||||
x86_64-openwrt-linux-gcc
|
||||
x86_64-openwrt-linux-musl-gcc
|
||||
# qosify fails to build with cov-build
|
||||
coverity_check_packages: >-
|
||||
cgi-io
|
||||
dnsmasq
|
||||
dropbear
|
||||
firewall
|
||||
fstools
|
||||
fwtool
|
||||
iwinfo
|
||||
jsonfilter
|
||||
libnl-tiny
|
||||
libubox
|
||||
mtd
|
||||
netifd
|
||||
odhcp6c
|
||||
odhcpd
|
||||
opkg
|
||||
procd
|
||||
relayd
|
||||
rpcd
|
||||
swconfig
|
||||
ubox
|
||||
ubus
|
||||
ucert
|
||||
uci
|
||||
uclient
|
||||
ucode
|
||||
ugps
|
||||
uhttpd
|
||||
umbim
|
||||
umdns
|
||||
unetd
|
||||
uqmi
|
||||
urngd
|
||||
usbmode
|
||||
usign
|
||||
usteer
|
||||
ustp
|
||||
ustream-ssl
|
||||
actions: write
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/coverity.yml@main
|
||||
|
||||
24
.github/workflows/github-release.yml
vendored
Normal file
24
.github/workflows/github-release.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
name: Create GitHub release
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
prerelease: true
|
||||
111
.github/workflows/kernel.yml
vendored
111
.github/workflows/kernel.yml
vendored
@@ -17,6 +17,8 @@ on:
|
||||
- 'include/kernel*'
|
||||
- 'package/kernel/**'
|
||||
- 'target/linux/**'
|
||||
branches-ignore:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -26,106 +28,15 @@ concurrency:
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
determine_targets:
|
||||
name: Set targets
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
targets_subtargets: ${{ steps.find_targets.outputs.targets_subtargets }}
|
||||
targets: ${{ steps.find_targets.outputs.targets }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v35
|
||||
|
||||
- name: Set targets
|
||||
id: find_targets
|
||||
run: |
|
||||
ALL_TARGETS="$(perl ./scripts/dump-target-info.pl targets 2>/dev/null)"
|
||||
CHANGED_FILES="$(echo ${{ steps.changed-files.outputs.all_changed_files }} | tr ' ' '\n')"
|
||||
|
||||
TARGETS_SUBTARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1 | awk '{ print $1 }')"
|
||||
TARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1,1 | awk '{ print $1 }')"
|
||||
|
||||
# On testing non-specific target, skip testing each subtarget
|
||||
if echo "$CHANGED_FILES" | grep -v -q target/linux ||
|
||||
echo "$CHANGED_FILES" | grep -q target/linux/generic; then
|
||||
TARGETS_SUBTARGETS=$TARGETS
|
||||
fi
|
||||
|
||||
JSON_TARGETS_SUBTARGETS='['
|
||||
FIRST=1
|
||||
for TARGET in $TARGETS_SUBTARGETS; do
|
||||
if echo "$CHANGED_FILES" | grep -v -q target/linux ||
|
||||
echo "$CHANGED_FILES" | grep -q target/linux/generic ||
|
||||
echo "$CHANGED_FILES" | grep -q $(echo $TARGET | cut -d "/" -f 1); then
|
||||
TUPLE='{"target":"'"$(echo $TARGET | cut -d "/" -f 1)"'","subtarget":"'"$(echo $TARGET | cut -d "/" -f 2)"'"}'
|
||||
[[ $FIRST -ne 1 ]] && JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS"','
|
||||
JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS""$TUPLE"
|
||||
FIRST=0
|
||||
fi
|
||||
done
|
||||
JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS"']'
|
||||
|
||||
JSON_TARGETS='['
|
||||
FIRST=1
|
||||
for TARGET in $TARGETS; do
|
||||
if echo "$CHANGED_FILES" | grep -v -q target/linux ||
|
||||
echo "$CHANGED_FILES" | grep -q target/linux/generic ||
|
||||
echo "$CHANGED_FILES" | grep -q $(echo $TARGET | cut -d "/" -f 1); then
|
||||
TUPLE='{"target":"'"$(echo $TARGET | cut -d "/" -f 1)"'","subtarget":"'"$(echo $TARGET | cut -d "/" -f 2)"'"}'
|
||||
[[ $FIRST -ne 1 ]] && JSON_TARGETS="$JSON_TARGETS"','
|
||||
JSON_TARGETS="$JSON_TARGETS""$TUPLE"
|
||||
FIRST=0
|
||||
fi
|
||||
done
|
||||
JSON_TARGETS="$JSON_TARGETS"']'
|
||||
|
||||
echo -e "\n---- targets to build ----\n"
|
||||
echo "$JSON_TARGETS_SUBTARGETS"
|
||||
echo -e "\n---- targets to build ----\n"
|
||||
|
||||
echo -e "\n---- targets to check patch ----\n"
|
||||
echo "$JSON_TARGETS"
|
||||
echo -e "\n---- targets to check patch ----\n"
|
||||
|
||||
echo "targets_subtargets=$JSON_TARGETS_SUBTARGETS" >> $GITHUB_OUTPUT
|
||||
echo "targets=$JSON_TARGETS" >> $GITHUB_OUTPUT
|
||||
|
||||
build:
|
||||
name: Build Kernel with external toolchain
|
||||
needs: determine_targets
|
||||
build-kernels:
|
||||
name: Build all affected Kernels
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
include: ${{fromJson(needs.determine_targets.outputs.targets_subtargets)}}
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
subtarget: ${{ matrix.subtarget }}
|
||||
build_kernel: true
|
||||
build_all_kmods: true
|
||||
|
||||
check-kernel-patches:
|
||||
name: Check Kernel patches
|
||||
needs: determine_targets
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
include: ${{fromJson(needs.determine_targets.outputs.targets)}}
|
||||
uses: ./.github/workflows/check-kernel-patches.yml
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
subtarget: ${{ matrix.subtarget }}
|
||||
|
||||
actions: write
|
||||
secrets:
|
||||
ccache_s3_endpoint: ${{ secrets.CCACHE_S3_ENDPOINT }}
|
||||
ccache_s3_bucket: ${{ secrets.CCACHE_S3_BUCKET }}
|
||||
ccache_s3_access_key: ${{ secrets.CCACHE_S3_ACCESS_KEY }}
|
||||
ccache_s3_secret_key: ${{ secrets.CCACHE_S3_SECRET_KEY }}
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/kernel.yml@main
|
||||
|
||||
42
.github/workflows/label-kernel.yml
vendored
42
.github/workflows/label-kernel.yml
vendored
@@ -7,44 +7,10 @@ on:
|
||||
- labeled
|
||||
|
||||
jobs:
|
||||
set_target:
|
||||
if: startsWith(github.event.label.name, 'ci:kernel:')
|
||||
name: Set target
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
target: ${{ steps.set_target.outputs.target }}
|
||||
subtarget: ${{ steps.set_target.outputs.subtarget }}
|
||||
|
||||
steps:
|
||||
- name: Set target
|
||||
id: set_target
|
||||
env:
|
||||
CI_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
||||
run: |
|
||||
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/target=\1/p' | tee --append $GITHUB_OUTPUT
|
||||
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/subtarget=\2/p' | tee --append $GITHUB_OUTPUT
|
||||
|
||||
build_kernel:
|
||||
name: Build Kernel with external toolchain
|
||||
needs: set_target
|
||||
build-kernels-label:
|
||||
name: Build all affected Kernels from defined label
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
container_name: toolchain
|
||||
target: ${{ needs.set_target.outputs.target }}
|
||||
subtarget: ${{ needs.set_target.outputs.subtarget }}
|
||||
build_kernel: true
|
||||
build_all_kmods: true
|
||||
|
||||
check-kernel-patches:
|
||||
name: Check Kernel patches
|
||||
needs: set_target
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
uses: ./.github/workflows/check-kernel-patches.yml
|
||||
with:
|
||||
target: ${{ needs.set_target.outputs.target }}
|
||||
subtarget: ${{ needs.set_target.outputs.subtarget }}
|
||||
actions: write
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/label-kernel.yml@main
|
||||
|
||||
33
.github/workflows/label-target.yml
vendored
33
.github/workflows/label-target.yml
vendored
@@ -7,35 +7,10 @@ on:
|
||||
- labeled
|
||||
|
||||
jobs:
|
||||
set_target:
|
||||
if: startsWith(github.event.label.name, 'ci:target:')
|
||||
name: Set target
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
target: ${{ steps.set_target.outputs.target }}
|
||||
subtarget: ${{ steps.set_target.outputs.subtarget }}
|
||||
|
||||
steps:
|
||||
- name: Set target
|
||||
id: set_target
|
||||
env:
|
||||
CI_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
||||
run: |
|
||||
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/target=\1/p' | tee --append $GITHUB_OUTPUT
|
||||
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/.*:\(.*\):\(.*\)$/subtarget=\2/p' | tee --append $GITHUB_OUTPUT
|
||||
|
||||
build_target:
|
||||
name: Build target
|
||||
needs: set_target
|
||||
build-target-label:
|
||||
name: Build target from defined label
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
container_name: toolchain
|
||||
target: ${{ needs.set_target.outputs.target }}
|
||||
subtarget: ${{ needs.set_target.outputs.subtarget }}
|
||||
build_full: true
|
||||
build_all_kmods: true
|
||||
build_all_boards: true
|
||||
build_all_modules: true
|
||||
actions: write
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/label-target.yml@main
|
||||
|
||||
32
.github/workflows/packages.yml
vendored
32
.github/workflows/packages.yml
vendored
@@ -3,7 +3,6 @@ name: Build all core packages
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/build.yml'
|
||||
- '.github/workflows/packages.yml'
|
||||
- 'config/**'
|
||||
- 'include/**'
|
||||
@@ -12,13 +11,14 @@ on:
|
||||
- 'toolchain/**'
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/build.yml'
|
||||
- '.github/workflows/packages.yml'
|
||||
- 'config/**'
|
||||
- 'include/**'
|
||||
- 'package/**'
|
||||
- 'target/linux/generic/**'
|
||||
- 'toolchain/**'
|
||||
branches-ignore:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -28,25 +28,15 @@ concurrency:
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Packages with external toolchain
|
||||
build-packages:
|
||||
name: Build all core packages for selected target
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
include:
|
||||
- target: malta
|
||||
subtarget: be
|
||||
- target: x86
|
||||
subtarget: 64
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
subtarget: ${{ matrix.subtarget }}
|
||||
build_kernel: true
|
||||
build_all_kmods: true
|
||||
build_all_modules: true
|
||||
build_full: true
|
||||
|
||||
actions: write
|
||||
secrets:
|
||||
ccache_s3_endpoint: ${{ secrets.CCACHE_S3_ENDPOINT }}
|
||||
ccache_s3_bucket: ${{ secrets.CCACHE_S3_BUCKET }}
|
||||
ccache_s3_access_key: ${{ secrets.CCACHE_S3_ACCESS_KEY }}
|
||||
ccache_s3_secret_key: ${{ secrets.CCACHE_S3_SECRET_KEY }}
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/packages.yml@main
|
||||
|
||||
87
.github/workflows/push-containers.yml
vendored
87
.github/workflows/push-containers.yml
vendored
@@ -4,94 +4,25 @@ on:
|
||||
push:
|
||||
paths:
|
||||
- 'include/version.mk'
|
||||
- 'include/cmake.mk'
|
||||
- 'tools/**'
|
||||
- '.github/workflows/build-tools.yml'
|
||||
- '.github/workflows/push-containers.yml'
|
||||
- '.github/workflows/Dockerfile.tools'
|
||||
- 'toolchain/**'
|
||||
branches-ignore:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-linux-buildbot:
|
||||
name: Build tools with buildbot container
|
||||
if: ${{ github.repository_owner == 'openwrt' }}
|
||||
uses: ./.github/workflows/build-tools.yml
|
||||
with:
|
||||
generate_prebuilt_artifacts: true
|
||||
|
||||
push-tools-container:
|
||||
needs: build-linux-buildbot
|
||||
name: Push prebuilt tools container
|
||||
if: ${{ github.repository_owner == 'openwrt' }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
build-push-containers:
|
||||
name: Build and Push all prebuilt containers
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Set lower case owner name
|
||||
env:
|
||||
OWNER: ${{ github.repository_owner }}
|
||||
run: |
|
||||
echo "OWNER_LC=${OWNER,,}" >> "$GITHUB_ENV"
|
||||
|
||||
# Per branch tools container tag
|
||||
# By default stick to latest
|
||||
# For official test targetting openwrt stable branch
|
||||
# Get the branch or parse the tag and push dedicated tools containers
|
||||
# Any branch that will match this pattern openwrt-[0-9][0-9].[0-9][0-9]
|
||||
# will refresh the tools container with the matching tag.
|
||||
# (example branch openwrt-22.03 -> tools:openwrt-22.03)
|
||||
# (example branch openwrt-22.03-test -> tools:openwrt-22.03)
|
||||
- name: Determine tools container tag
|
||||
run: |
|
||||
CONTAINER_TAG=latest
|
||||
|
||||
if [ ${{ github.ref_type }} == "branch" ]; then
|
||||
if echo "${{ github.ref_name }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then
|
||||
CONTAINER_TAG="$(echo ${{ github.ref_name }} | sed 's/^\(openwrt-[0-9][0-9]\.[0-9][0-9]\).*/\1/')"
|
||||
fi
|
||||
elif [ ${{ github.ref_type }} == "tag" ]; then
|
||||
if echo "${{ github.ref_name }}" | grep -q -E 'v[0-9][0-9]\.[0-9][0-9]\..+'; then
|
||||
CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Tools container to push tools:$CONTAINER_TAG"
|
||||
echo "CONTAINER_TAG=$CONTAINER_TAG" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: 'openwrt'
|
||||
|
||||
- name: Download prebuilt tools from build job
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: linux-buildbot-prebuilt-tools
|
||||
path: openwrt
|
||||
|
||||
- name: Extract prebuild tools
|
||||
working-directory: openwrt
|
||||
run: tar -xf tools.tar
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: openwrt
|
||||
push: true
|
||||
tags: ghcr.io/${{ env.OWNER_LC }}/tools:${{ env.CONTAINER_TAG }}
|
||||
file: openwrt/.github/workflows/Dockerfile.tools
|
||||
actions: write
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/push-containers.yml@main
|
||||
|
||||
53
.github/workflows/toolchain.yml
vendored
53
.github/workflows/toolchain.yml
vendored
@@ -3,14 +3,14 @@ name: Build Toolchains
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/build.yml'
|
||||
- '.github/workflows/toolchain.yml'
|
||||
- 'toolchain/**'
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/build.yml'
|
||||
- '.github/workflows/toolchain.yml'
|
||||
- 'toolchain/**'
|
||||
branches-ignore:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -20,51 +20,10 @@ concurrency:
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
determine_targets:
|
||||
name: Set targets
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
target: ${{ steps.find_targets.outputs.target }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set targets
|
||||
id: find_targets
|
||||
run: |
|
||||
export TARGETS="$(perl ./scripts/dump-target-info.pl targets 2>/dev/null \
|
||||
| sort -u -t '/' -k1,1 \
|
||||
| awk '{ print $1 }')"
|
||||
|
||||
JSON='['
|
||||
FIRST=1
|
||||
for TARGET in $TARGETS; do
|
||||
TUPLE='{"target":"'"$(echo $TARGET | cut -d "/" -f 1)"'","subtarget":"'"$(echo $TARGET | cut -d "/" -f 2)"'"}'
|
||||
[[ $FIRST -ne 1 ]] && JSON="$JSON"','
|
||||
JSON="$JSON""$TUPLE"
|
||||
FIRST=0
|
||||
done
|
||||
JSON="$JSON"']'
|
||||
|
||||
echo -e "\n---- targets ----\n"
|
||||
echo "$JSON"
|
||||
echo -e "\n---- targets ----\n"
|
||||
|
||||
echo "target=$JSON" >> $GITHUB_OUTPUT
|
||||
|
||||
build:
|
||||
name: Build Target Toolchain
|
||||
needs: determine_targets
|
||||
build-toolchains:
|
||||
name: Build Toolchains for each target
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
include: ${{fromJson(needs.determine_targets.outputs.target)}}
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
subtarget: ${{ matrix.subtarget }}
|
||||
build_toolchain: true
|
||||
actions: write
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/toolchain.yml@main
|
||||
|
||||
76
.github/workflows/tools.yml
vendored
76
.github/workflows/tools.yml
vendored
@@ -5,14 +5,14 @@ on:
|
||||
paths:
|
||||
- 'include/**'
|
||||
- 'tools/**'
|
||||
- '.github/workflows/build-tools.yml'
|
||||
- '.github/workflows/tools.yml'
|
||||
push:
|
||||
paths:
|
||||
- 'include/**'
|
||||
- 'tools/**'
|
||||
- '.github/workflows/build-tools.yml'
|
||||
- '.github/workflows/tools.yml'
|
||||
branches-ignore:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -22,72 +22,6 @@ concurrency:
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
build-macos-latest:
|
||||
name: Build tools with macos latest
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: openwrt
|
||||
|
||||
- name: Setup MacOS
|
||||
run: |
|
||||
echo "WORKPATH=/Volumes/OpenWrt" >> "$GITHUB_ENV"
|
||||
hdiutil create -size 20g -type SPARSE -fs "Case-sensitive HFS+" -volname OpenWrt OpenWrt.sparseimage
|
||||
hdiutil attach OpenWrt.sparseimage
|
||||
mv "$GITHUB_WORKSPACE/openwrt" /Volumes/OpenWrt/
|
||||
|
||||
- name: Install required prereq on MacOS
|
||||
working-directory: ${{ env.WORKPATH }}/openwrt
|
||||
run: |
|
||||
brew install \
|
||||
automake \
|
||||
coreutils \
|
||||
diffutils \
|
||||
findutils \
|
||||
gawk \
|
||||
git-extras \
|
||||
gnu-getopt \
|
||||
gnu-sed \
|
||||
grep \
|
||||
make
|
||||
|
||||
echo "/bin" >> "$GITHUB_PATH"
|
||||
echo "/sbin/Library/Apple/usr/bin" >> "$GITHUB_PATH"
|
||||
echo "/usr/bin" >> "$GITHUB_PATH"
|
||||
echo "/usr/local/bin" >> "$GITHUB_PATH"
|
||||
echo "/usr/local/opt/coreutils/bin" >> "$GITHUB_PATH"
|
||||
echo "/usr/local/opt/findutils/libexec/gnubin" >> "$GITHUB_PATH"
|
||||
echo "/usr/local/opt/gettext/bin" >> "$GITHUB_PATH"
|
||||
echo "/usr/local/opt/gnu-getopt/bin" >> "$GITHUB_PATH"
|
||||
echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH"
|
||||
echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH"
|
||||
echo "/usr/sbin" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Make prereq
|
||||
working-directory: ${{ env.WORKPATH }}/openwrt
|
||||
run: make defconfig
|
||||
|
||||
- name: Build tools MacOS
|
||||
working-directory: ${{ env.WORKPATH }}/openwrt
|
||||
run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh
|
||||
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: macos-latest-logs
|
||||
path: ${{ env.WORKPATH }}/openwrt/logs
|
||||
|
||||
- name: Upload config
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: macos-latest-config
|
||||
path: ${{ env.WORKPATH }}/openwrt/.config
|
||||
|
||||
build-linux-buildbot:
|
||||
name: Build tools with buildbot container
|
||||
uses: ./.github/workflows/build-tools.yml
|
||||
build-tools:
|
||||
name: Build host tools for linux and macos based systems
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/tools.yml@main
|
||||
|
||||
2
Makefile
2
Makefile
@@ -14,7 +14,7 @@ $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt dir
|
||||
|
||||
world:
|
||||
|
||||
DISTRO_PKG_CONFIG:=$(shell $(TOPDIR)/scripts/command_all.sh pkg-config | grep '/usr' -m 1)
|
||||
DISTRO_PKG_CONFIG:=$(shell $(TOPDIR)/scripts/command_all.sh pkg-config | grep -e '/usr' -e '/nix/store' -m 1)
|
||||
|
||||
export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH))
|
||||
export PATH:=$(if $(STAGING_DIR),$(abspath $(STAGING_DIR)/../host/bin),$(TOPDIR)/staging_dir/host/bin):$(PATH)
|
||||
|
||||
@@ -26,6 +26,14 @@ menu "Global build settings"
|
||||
directory containing machine readable list of built profiles
|
||||
and resulting images.
|
||||
|
||||
config JSON_CYCLONEDX_SBOM
|
||||
bool "Create CycloneDX SBOM JSON"
|
||||
default BUILDBOT
|
||||
help
|
||||
Create a JSON files *.bom.cdx.json in the build
|
||||
directory containing Software Bill Of Materials in CycloneDX
|
||||
format.
|
||||
|
||||
config ALL_NONSHARED
|
||||
bool "Select all target specific packages by default"
|
||||
select ALL_KMODS
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
src-git packages https://git.openwrt.org/feed/packages.git^f84124d247f043d3801ae3cd94095e52284e8736
|
||||
src-git luci https://git.openwrt.org/project/luci.git^ef54edad4bc24c207450094b33d6b2ddd83c277c
|
||||
src-git routing https://git.openwrt.org/feed/routing.git^b844d67864d6486dc8f68054970c5195ec7c45a8
|
||||
src-git telephony https://git.openwrt.org/feed/telephony.git^f7fbaea4c7bfe9203b037ad616553c9e5ed12405
|
||||
src-git packages https://git.openwrt.org/feed/packages.git^8e3a1824645f5e73ec44c897ac0755c53fb4a1f8
|
||||
src-git luci https://git.openwrt.org/project/luci.git^7739e9f5b03b830f51d53c384be4baef95054cb3
|
||||
src-git routing https://git.openwrt.org/feed/routing.git^83ef3784a9092cfd0a900cc28e2ed4e13671d667
|
||||
src-git telephony https://git.openwrt.org/feed/telephony.git^9746ae8f964e18f04b64fbe1956366954ff223f8
|
||||
|
||||
@@ -40,8 +40,10 @@ IMG_PREFIX_VERCODE:=$(if $(CONFIG_VERSION_CODE_FILENAMES),$(call sanitize,$(VERS
|
||||
IMG_PREFIX:=$(VERSION_DIST_SANITIZED)-$(IMG_PREFIX_VERNUM)$(IMG_PREFIX_VERCODE)$(IMG_PREFIX_EXTRA)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
|
||||
IMG_ROOTFS:=$(IMG_PREFIX)-rootfs
|
||||
IMG_COMBINED:=$(IMG_PREFIX)-combined
|
||||
ifeq ($(DUMP),)
|
||||
IMG_PART_SIGNATURE:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | $(MKHASH) md5 | cut -b1-8)
|
||||
IMG_PART_DISKGUID:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | $(MKHASH) md5 | sed -E 's/(.{8})(.{4})(.{4})(.{4})(.{10})../\1-\2-\3-\4-\500/')
|
||||
endif
|
||||
|
||||
MKFS_DEVTABLE_OPT := -D $(INCLUDE_DIR)/device_table.txt
|
||||
|
||||
@@ -167,7 +169,9 @@ define Image/pad-to
|
||||
mv $(1).new $(1)
|
||||
endef
|
||||
|
||||
ifeq ($(DUMP),)
|
||||
ROOTFS_PARTSIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024*1024)))
|
||||
endif
|
||||
|
||||
define Image/pad-root-squashfs
|
||||
$(call Image/pad-to,$(KDIR)/root.squashfs,$(if $(1),$(1),$(ROOTFS_PARTSIZE)))
|
||||
@@ -277,6 +281,13 @@ endef
|
||||
define Image/Manifest
|
||||
$(call opkg,$(TARGET_DIR_ORIG)) list-installed > \
|
||||
$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest
|
||||
ifndef IB
|
||||
$(if $(CONFIG_JSON_CYCLONEDX_SBOM), \
|
||||
$(SCRIPT_DIR)/package-metadata.pl imgcyclonedxsbom \
|
||||
$(TMP_DIR)/.packageinfo \
|
||||
$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).manifest > \
|
||||
$(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED)).bom.cdx.json)
|
||||
endif
|
||||
endef
|
||||
|
||||
define Image/gzip-ext4-padded-squashfs
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-5.15 = .127
|
||||
LINUX_KERNEL_HASH-5.15.127 = add0a575341b263a06e93599fc220a5dd34cb4ca5b9d05097a5db2a061928f26
|
||||
LINUX_VERSION-5.15 = .137
|
||||
LINUX_KERNEL_HASH-5.15.137 = 9749b21609f9e7ad9c46160c2c107db823b99cef77fa6cb080b6c2dc685fb2f7
|
||||
|
||||
@@ -166,7 +166,7 @@ define Kernel/CompileImage/Initramfs
|
||||
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR) $(TARGET_DIR)/init)
|
||||
rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
|
||||
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE),y)
|
||||
ifneq ($(qstrip $(CONFIG_EXTERNAL_CPIO)),)
|
||||
ifneq ($(call qstrip,$(CONFIG_EXTERNAL_CPIO)),)
|
||||
$(CP) $(CONFIG_EXTERNAL_CPIO) $(KERNEL_BUILD_DIR)/initrd.cpio
|
||||
else
|
||||
( cd $(TARGET_DIR); find . | LC_ALL=C sort | $(STAGING_DIR_HOST)/bin/cpio --reproducible -o -H newc -R 0:0 > $(KERNEL_BUILD_DIR)/initrd.cpio )
|
||||
|
||||
@@ -36,6 +36,8 @@ $(if $(USERID),Require-User: $(USERID)
|
||||
)Source: $(PKG_SOURCE)
|
||||
$(if $(LICENSE),License: $(LICENSE)
|
||||
)$(if $(LICENSE_FILES),LicenseFiles: $(LICENSE_FILES)
|
||||
)$(if $(PKG_CPE_ID),CPE-ID: $(PKG_CPE_ID)
|
||||
)$(if $(ABI_VERSION),ABI-Version: $(ABI_VERSION)
|
||||
)Type: $(if $(Package/$(1)/targets),$(Package/$(1)/targets),$(if $(PKG_TARGETS),$(PKG_TARGETS),ipkg))
|
||||
$(if $(KCONFIG),Kernel-Config: $(KCONFIG)
|
||||
)$(if $(BUILDONLY),Build-Only: $(BUILDONLY)
|
||||
|
||||
@@ -107,16 +107,9 @@ define SetupHostCommand
|
||||
bin="$$$$$$$$(command -v "$$$$$$$${cmd%% *}")"; \
|
||||
if [ -x "$$$$$$$$bin" ] && eval "$$$$$$$$cmd" >/dev/null 2>/dev/null; then \
|
||||
case "$$$$$$$$(ls -dl -- $(STAGING_DIR_HOST)/bin/$(strip $(1)))" in \
|
||||
*" -> $$$$$$$$bin"*) \
|
||||
[ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \
|
||||
;; \
|
||||
"-"*) \
|
||||
find "$(STAGING_DIR_HOST)/stamp" | grep $(strip $(1)) && \
|
||||
[ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \
|
||||
;; \
|
||||
*" -> /"*) \
|
||||
;; \
|
||||
*" -> "*) \
|
||||
"-"* | \
|
||||
*" -> $$$$$$$$bin"* | \
|
||||
*" -> "[!/]*) \
|
||||
[ -x "$(STAGING_DIR_HOST)/bin/$(strip $(1))" ] && exit 0 \
|
||||
;; \
|
||||
esac; \
|
||||
|
||||
@@ -50,7 +50,8 @@ define PackageDir
|
||||
$$(call progress,Collecting $(SCAN_NAME) info: $(SCAN_DIR)/$(2)) \
|
||||
echo Source-Makefile: $(SCAN_DIR)/$(2)/Makefile; \
|
||||
$(if $(3),echo Override: $(3),true); \
|
||||
$(NO_TRACE_MAKE) --no-print-dir -r DUMP=1 FEED="$(call feedname,$(2))" -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) 2>/dev/null || { \
|
||||
$(if $(findstring c,$(OPENWRT_VERBOSE)),$(MAKE),$(NO_TRACE_MAKE) --no-print-dir) -r DUMP=1 FEED="$(call feedname,$(2))" -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) \
|
||||
$(if $(findstring c,$(OPENWRT_VERBOSE)),,2>/dev/null) || { \
|
||||
mkdir -p "$(TOPDIR)/logs/$(SCAN_DIR)/$(2)"; \
|
||||
$(NO_TRACE_MAKE) --no-print-dir -r DUMP=1 FEED="$(call feedname,$(2))" -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) > $(TOPDIR)/logs/$(SCAN_DIR)/$(2)/dump.txt 2>&1; \
|
||||
$$(call progress,ERROR: please fix $(SCAN_DIR)/$(2)/Makefile - see logs/$(SCAN_DIR)/$(2)/dump.txt for details\n) \
|
||||
|
||||
@@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \
|
||||
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
|
||||
|
||||
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),23.05.0-rc3)
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),23.05.2)
|
||||
|
||||
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r23389-5deed175a5)
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r23630-842932a63d)
|
||||
|
||||
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/23.05.0-rc3)
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/23.05.2)
|
||||
|
||||
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
|
||||
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
|
||||
|
||||
@@ -106,6 +106,14 @@ ifdef CONFIG_SIGNED_PACKAGES
|
||||
$(STAGING_DIR_HOST)/bin/usign -S -m Packages -s $(BUILD_KEY); \
|
||||
); done
|
||||
endif
|
||||
ifdef CONFIG_JSON_CYCLONEDX_SBOM
|
||||
@echo Creating CycloneDX package SBOMs...
|
||||
@for d in $(PACKAGE_SUBDIRS); do ( \
|
||||
[ -d $$d ] && \
|
||||
cd $$d || continue; \
|
||||
$(SCRIPT_DIR)/package-metadata.pl pkgcyclonedxsbom Packages.manifest > Packages.bom.cdx.json || true; \
|
||||
); done
|
||||
endif
|
||||
|
||||
$(curdir)/flags-install:= -j1
|
||||
|
||||
|
||||
@@ -80,8 +80,7 @@ BEGIN {
|
||||
}
|
||||
|
||||
if (ipaddr > start && ipaddr < end) {
|
||||
print "ipaddr inside range" > "/dev/stderr"
|
||||
exit(1)
|
||||
print "warning: ipaddr inside range - this might not be supported in future releases of Openwrt" > "/dev/stderr"
|
||||
}
|
||||
|
||||
print "START="int2ip(start)
|
||||
|
||||
@@ -107,7 +107,7 @@ ucidef_set_bridge_mac() {
|
||||
}
|
||||
|
||||
ucidef_set_network_device_mac() {
|
||||
json_select_object "network-device"
|
||||
json_select_object "network_device"
|
||||
json_select_object "${1}"
|
||||
json_add_string macaddr "${2}"
|
||||
json_select ..
|
||||
|
||||
@@ -121,7 +121,7 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
|
||||
v "Sending signal $sig to $name ($pid)"
|
||||
kill -$sig $pid 2>/dev/null
|
||||
|
||||
[ $loop -eq 1 ] && run=true
|
||||
[ $loop -eq 1 ] && sleep 2 && run=true
|
||||
done
|
||||
|
||||
let loop_limit--
|
||||
|
||||
@@ -190,7 +190,7 @@ if VERSIONOPT
|
||||
config VERSION_REPO
|
||||
string
|
||||
prompt "Release repository"
|
||||
default "https://downloads.openwrt.org/releases/23.05.0-rc3"
|
||||
default "https://downloads.openwrt.org/releases/23.05.2"
|
||||
help
|
||||
This is the repository address embedded in the image, it defaults
|
||||
to the trunk snapshot repo; the url may contain the following placeholders:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=arm-trusted-firmware-mediatek
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=https://github.com/mtk-openwrt/arm-trusted-firmware.git
|
||||
@@ -94,6 +94,22 @@ define Trusted-Firmware-A/mt7622-sdmmc-2ddr
|
||||
DDR3_FLYBY:=1
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7981-emmc-ddr4
|
||||
NAME:=MediaTek MT7981 (eMMC, DDR4)
|
||||
BOOT_DEVICE:=emmc
|
||||
BUILD_SUBTARGET:=filogic
|
||||
PLAT:=mt7981
|
||||
DDR_TYPE:=ddr4
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7981-spim-nand-ddr4
|
||||
NAME:=MediaTek MT7981 (SPI-NAND via SPIM, DDR4)
|
||||
BOOT_DEVICE:=spim-nand
|
||||
BUILD_SUBTARGET:=filogic
|
||||
PLAT:=mt7981
|
||||
DDR_TYPE:=ddr4
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7981-nor-ddr3
|
||||
NAME:=MediaTek MT7981 (SPI-NOR, DDR3)
|
||||
BOOT_DEVICE:=nor
|
||||
@@ -118,7 +134,7 @@ define Trusted-Firmware-A/mt7981-sdmmc-ddr3
|
||||
DDR_TYPE:=ddr3
|
||||
endef
|
||||
|
||||
define Trusted-Firmware-A/mt7986-snand-ddr3
|
||||
define Trusted-Firmware-A/mt7981-snand-ddr3
|
||||
NAME:=MediaTek MT7981 (SPI-NAND via SNFI, DDR3)
|
||||
BOOT_DEVICE:=snand
|
||||
BUILD_SUBTARGET:=filogic
|
||||
@@ -347,8 +363,10 @@ TFA_TARGETS:= \
|
||||
mt7981-emmc-ddr3 \
|
||||
mt7981-nor-ddr3 \
|
||||
mt7981-sdmmc-ddr3 \
|
||||
mt7986-snand-ddr3 \
|
||||
mt7981-snand-ddr3 \
|
||||
mt7981-spim-nand-ddr3 \
|
||||
mt7981-emmc-ddr4 \
|
||||
mt7981-spim-nand-ddr4 \
|
||||
mt7986-emmc-ddr3 \
|
||||
mt7986-nor-ddr3 \
|
||||
mt7986-sdmmc-ddr3 \
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/plat/mediatek/mt7988/bl2/bl2_plat_init.c
|
||||
+++ b/plat/mediatek/mt7988/bl2/bl2_plat_init.c
|
||||
@@ -90,6 +90,8 @@ static void mtk_i2p5g_phy_init(void)
|
||||
* clear bit 22 to use external MDIO.
|
||||
*/
|
||||
mmio_setbits_32(GBE_TOP_REG, I2P5G_MDIO);
|
||||
+ /* Internal 2.5Gphy power on sequence */
|
||||
+ eth_2p5g_phy_mtcmos_ctrl(true);
|
||||
}
|
||||
|
||||
static void mt7988_i2c_init(void)
|
||||
@@ -0,0 +1,28 @@
|
||||
From 9e8cb08bc64530e7511b86a131cfad1ae0199586 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Sun, 10 Sep 2023 23:35:47 +0100
|
||||
Subject: [PATCH] mt7622: move wdt init after dram init
|
||||
|
||||
resolves hang on reboot
|
||||
---
|
||||
plat/mediatek/mt7622/bl2/bl2_plat_init.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/plat/mediatek/mt7622/bl2/bl2_plat_init.c
|
||||
+++ b/plat/mediatek/mt7622/bl2/bl2_plat_init.c
|
||||
@@ -40,7 +40,6 @@ bool plat_is_my_cpu_primary(void)
|
||||
const struct initcall bl2_initcalls[] = {
|
||||
INITCALL(plat_mt_cpuxgpt_init),
|
||||
INITCALL(generic_delay_timer_init),
|
||||
- INITCALL(mtk_wdt_init),
|
||||
INITCALL(mtk_print_cpu),
|
||||
INITCALL(mtk_pin_init),
|
||||
#ifndef IMAGE_BL2PL
|
||||
@@ -49,6 +48,7 @@ const struct initcall bl2_initcalls[] =
|
||||
INITCALL(mtk_pwrap_init),
|
||||
INITCALL(mtk_pmic_init),
|
||||
INITCALL(mtk_mem_init),
|
||||
+ INITCALL(mtk_wdt_init),
|
||||
|
||||
INITCALL(NULL)
|
||||
};
|
||||
@@ -13,6 +13,7 @@ PKG_VERSION:=v4.0.3
|
||||
PKG_MIRROR_HASH:=1ecdc31a13350fcdcaa3f77ed8ad73906f79fc668dbb2f337e1d5dd877bf9882
|
||||
PKG_SOURCE_VERSION:=1d9e673698d9db4a4f2301559f481274de2e75ae
|
||||
BINARIES_DIR:=build/binaries
|
||||
PKG_CPE_ID:=cpe:/a:linux4sam:at91bootstrap
|
||||
|
||||
AT91BOOTSTRAP_V4=y
|
||||
ifdef CONFIG_PACKAGE_at91bootstrap-sama5d4_xplaineddf_uboot_secure
|
||||
|
||||
@@ -37,6 +37,23 @@ bananapi,bpi-r3)
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
cmcc,rax3000m)
|
||||
case "$(cmdline_get_var root)" in
|
||||
/dev/mmc*)
|
||||
local envdev=$(find_mmc_part "ubootenv" "mmcblk0")
|
||||
ubootenv_add_uci_config "$envdev" "0x0" "0x40000" "0x40000" "1"
|
||||
ubootenv_add_uci_config "$envdev" "0x40000" "0x40000" "0x40000" "1"
|
||||
;;
|
||||
*)
|
||||
. /lib/upgrade/nand.sh
|
||||
local envubi=$(nand_find_ubi ubi)
|
||||
local envdev=/dev/$(nand_find_volume $envubi ubootenv)
|
||||
local envdev2=/dev/$(nand_find_volume $envubi ubootenv2)
|
||||
ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x1f000" "1"
|
||||
ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x1f000" "1"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
glinet,gl-mt3000)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000"
|
||||
;;
|
||||
@@ -45,7 +62,7 @@ mercusys,mr90x-v1)
|
||||
ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1"
|
||||
;;
|
||||
netgear,wax220)
|
||||
ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x20000" "0x20000"
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
xiaomi,mi-router-wr30u-112m-nmbm|\
|
||||
xiaomi,mi-router-wr30u-stock|\
|
||||
|
||||
@@ -20,19 +20,21 @@ alfa-network,tube-e4g|\
|
||||
engenius,epg600|\
|
||||
engenius,esr600h|\
|
||||
linksys,re7000|\
|
||||
meig,slt866|\
|
||||
sitecom,wlr-4100-v1-002|\
|
||||
zyxel,keenetic-lite-iii-a)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
|
||||
;;
|
||||
arcadyan,we420223-99)
|
||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x1000" "0x1000"
|
||||
;;
|
||||
alfa-network,ax1800rm|\
|
||||
allnet,all0256n-4m|\
|
||||
allnet,all0256n-8m|\
|
||||
allnet,all5002|\
|
||||
yuncore,ax820)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
arcadyan,we420223-99)
|
||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x1000" "0x1000"
|
||||
;;
|
||||
ampedwireless,ally-00x19k|\
|
||||
ampedwireless,ally-r1900k)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
|
||||
|
||||
@@ -124,10 +124,34 @@ define U-Boot/mt7622_bananapi_bpi-r64-snand
|
||||
DEPENDS:=+trusted-firmware-a-mt7622-snand-2ddr
|
||||
endef
|
||||
|
||||
define U-Boot/mt7622_ubnt_unifi-6-lr
|
||||
define U-Boot/mt7622_ubnt_unifi-6-lr-v1
|
||||
NAME:=Ubiquiti UniFi 6 LR
|
||||
UBOOT_CONFIG:=mt7622_ubnt_unifi-6-lr
|
||||
BUILD_DEVICES:=ubnt_unifi-6-lr-v1-ubootmod ubnt_unifi-6-lr-v2-ubootmod
|
||||
UBOOT_CONFIG:=mt7622_ubnt_unifi-6-lr-v1
|
||||
BUILD_DEVICES:=ubnt_unifi-6-lr-v1-ubootmod
|
||||
BUILD_SUBTARGET:=mt7622
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=nor
|
||||
BL2_DDRBLOB:=2
|
||||
DEPENDS:=+trusted-firmware-a-mt7622-nor-2ddr
|
||||
FIP_COMPRESS:=1
|
||||
endef
|
||||
|
||||
define U-Boot/mt7622_ubnt_unifi-6-lr-v2
|
||||
NAME:=Ubiquiti UniFi 6 LR v2
|
||||
UBOOT_CONFIG:=mt7622_ubnt_unifi-6-lr-v2
|
||||
BUILD_DEVICES:=ubnt_unifi-6-lr-v2-ubootmod
|
||||
BUILD_SUBTARGET:=mt7622
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=nor
|
||||
BL2_DDRBLOB:=2
|
||||
DEPENDS:=+trusted-firmware-a-mt7622-nor-2ddr
|
||||
FIP_COMPRESS:=1
|
||||
endef
|
||||
|
||||
define U-Boot/mt7622_ubnt_unifi-6-lr-v3
|
||||
NAME:=Ubiquiti UniFi 6 LR v3
|
||||
UBOOT_CONFIG:=mt7622_ubnt_unifi-6-lr-v3
|
||||
BUILD_DEVICES:=ubnt_unifi-6-lr-v3-ubootmod
|
||||
BUILD_SUBTARGET:=mt7622
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=nor
|
||||
@@ -176,6 +200,30 @@ define U-Boot/mt7629_rfb
|
||||
UBOOT_CONFIG:=mt7629_rfb
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_cmcc_rax3000m-emmc
|
||||
NAME:=CMCC RAX3000M
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=cmcc_rax3000m
|
||||
UBOOT_CONFIG:=mt7981_cmcc_rax3000m-emmc
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=emmc
|
||||
BL2_SOC:=mt7981
|
||||
BL2_DDRTYPE:=ddr4
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-emmc-ddr4
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_cmcc_rax3000m-nand
|
||||
NAME:=CMCC RAX3000M
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=cmcc_rax3000m
|
||||
UBOOT_CONFIG:=mt7981_cmcc_rax3000m-nand
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=spim-nand
|
||||
BL2_SOC:=mt7981
|
||||
BL2_DDRTYPE:=ddr4
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr4
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_h3c_magic-nx30-pro
|
||||
NAME:=H3C Magic NX30 Pro
|
||||
BUILD_SUBTARGET:=filogic
|
||||
@@ -188,6 +236,66 @@ define U-Boot/mt7981_h3c_magic-nx30-pro
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_rfb-spim-nand
|
||||
NAME:=MT7981 Reference Board
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=mediatek_mt7981-rfb
|
||||
UBOOT_CONFIG:=mt7981_rfb
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=spim-nand
|
||||
BL2_SOC:=mt7981
|
||||
BL2_DDRTYPE:=ddr3
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_rfb-emmc
|
||||
NAME:=MT7981 Reference Board
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=mediatek_mt7981-rfb
|
||||
UBOOT_CONFIG:=mt7981_emmc_rfb
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=emmc
|
||||
BL2_SOC:=mt7981
|
||||
BL2_DDRTYPE:=ddr3
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-emmc-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_rfb-nor
|
||||
NAME:=MT7981 Reference Board
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=mediatek_mt7981-rfb
|
||||
UBOOT_CONFIG:=mt7981_nor_rfb
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=spim-nand
|
||||
BL2_SOC:=mt7981
|
||||
BL2_DDRTYPE:=ddr3
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-nor-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_rfb-sd
|
||||
NAME:=MT7981 Reference Board
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=mediatek_mt7981-rfb
|
||||
UBOOT_CONFIG:=mt7981_sd_rfb
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=sdmmc
|
||||
BL2_SOC:=mt7981
|
||||
BL2_DDRTYPE:=ddr3
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-sdmmc-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_rfb-snfi
|
||||
NAME:=MT7981 Reference Board
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=mediatek_mt7981-rfb
|
||||
UBOOT_CONFIG:=mt7981_snfi_nand_rfb
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=snand
|
||||
BL2_SOC:=mt7981
|
||||
BL2_DDRTYPE:=ddr3
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-snand-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_qihoo_360t7
|
||||
NAME:=Qihoo 360T7
|
||||
BUILD_SUBTARGET:=filogic
|
||||
@@ -324,61 +432,62 @@ endef
|
||||
define U-Boot/mt7988_rfb-spim-nand
|
||||
NAME:=MT7988 Reference Board
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=mediatek_mt7988a-rfb-nand
|
||||
BUILD_DEVICES:=mediatek_mt7988a-rfb
|
||||
UBOOT_CONFIG:=mt7988_rfb
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=spim-nand
|
||||
BL2_SOC:=mt7988
|
||||
BL2_DDRTYPE:=ddr4
|
||||
DEPENDS:=+trusted-firmware-a-mt7988-spim-nand-ddr4
|
||||
BL2_DDRTYPE:=comb
|
||||
DEPENDS:=+trusted-firmware-a-mt7988-spim-nand-comb
|
||||
endef
|
||||
|
||||
define U-Boot/mt7988_rfb-snand
|
||||
NAME:=MT7988 Reference Board
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=mediatek_mt7988a-rfb-nand
|
||||
BUILD_DEVICES:=mediatek_mt7988a-rfb
|
||||
UBOOT_CONFIG:=mt7988_rfb
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=snand
|
||||
BL2_SOC:=mt7988
|
||||
BL2_DDRTYPE:=ddr4
|
||||
DEPENDS:=+trusted-firmware-a-mt7988-snand-ddr4
|
||||
BL2_DDRTYPE:=comb
|
||||
DEPENDS:=+trusted-firmware-a-mt7988-snand-comb
|
||||
endef
|
||||
|
||||
define U-Boot/mt7988_rfb-nor
|
||||
NAME:=MT7988 Reference Board
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=mediatek_mt7988a-rfb-nand
|
||||
BUILD_DEVICES:=mediatek_mt7988a-rfb
|
||||
UBOOT_CONFIG:=mt7988_rfb
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=nor
|
||||
BL2_SOC:=mt7988
|
||||
BL2_DDRTYPE:=ddr4
|
||||
DEPENDS:=+trusted-firmware-a-mt7988-nor-ddr4
|
||||
BL2_DDRTYPE:=comb
|
||||
DEPENDS:=+trusted-firmware-a-mt7988-nor-comb
|
||||
FIP_COMPRESS:=1
|
||||
endef
|
||||
|
||||
define U-Boot/mt7988_rfb-emmc
|
||||
NAME:=MT7988 Reference Board
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=mediatek_mt7988a-rfb-nand
|
||||
BUILD_DEVICES:=mediatek_mt7988a-rfb
|
||||
UBOOT_CONFIG:=mt7988_rfb
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=emmc
|
||||
BL2_SOC:=mt7988
|
||||
BL2_DDRTYPE:=ddr4
|
||||
DEPENDS:=+trusted-firmware-a-mt7988-emmc-ddr4
|
||||
BL2_DDRTYPE:=comb
|
||||
DEPENDS:=+trusted-firmware-a-mt7988-emmc-comb
|
||||
endef
|
||||
|
||||
define U-Boot/mt7988_rfb-sd
|
||||
NAME:=MT7988 Reference Board
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=mediatek_mt7988a-rfb-nand
|
||||
BUILD_DEVICES:=mediatek_mt7988a-rfb
|
||||
UBOOT_CONFIG:=mt7988_sd_rfb
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=sdmmc
|
||||
BL2_SOC:=mt7988
|
||||
BL2_DDRTYPE:=ddr4
|
||||
DEPENDS:=+trusted-firmware-a-mt7988-sdmmc-ddr4
|
||||
BL2_DDRTYPE:=comb
|
||||
DEPENDS:=+trusted-firmware-a-mt7988-sdmmc-comb
|
||||
endef
|
||||
|
||||
UBOOT_TARGETS := \
|
||||
@@ -391,13 +500,22 @@ UBOOT_TARGETS := \
|
||||
mt7622_bananapi_bpi-r64-snand \
|
||||
mt7622_linksys_e8450 \
|
||||
mt7622_rfb1 \
|
||||
mt7622_ubnt_unifi-6-lr \
|
||||
mt7622_ubnt_unifi-6-lr-v1 \
|
||||
mt7622_ubnt_unifi-6-lr-v2 \
|
||||
mt7622_ubnt_unifi-6-lr-v3 \
|
||||
mt7623n_bpir2 \
|
||||
mt7623a_unielec_u7623 \
|
||||
mt7628_rfb \
|
||||
ravpower_rp-wd009 \
|
||||
mt7629_rfb \
|
||||
mt7981_cmcc_rax3000m-emmc \
|
||||
mt7981_cmcc_rax3000m-nand \
|
||||
mt7981_h3c_magic-nx30-pro \
|
||||
mt7981_rfb-spim-nand \
|
||||
mt7981_rfb-emmc \
|
||||
mt7981_rfb-nor \
|
||||
mt7981_rfb-sd \
|
||||
mt7981_rfb-snfi \
|
||||
mt7981_qihoo_360t7 \
|
||||
mt7981_xiaomi_mi-router-wr30u \
|
||||
mt7986_bananapi_bpi-r3-emmc \
|
||||
|
||||
@@ -17,14 +17,14 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
drivers/mtd/mtk-snand/Kconfig | 21 +
|
||||
drivers/mtd/mtk-snand/Makefile | 11 +
|
||||
drivers/mtd/mtk-snand/mtk-snand-def.h | 271 ++++
|
||||
drivers/mtd/mtk-snand/mtk-snand-ecc.c | 395 +++++
|
||||
drivers/mtd/mtk-snand/mtk-snand-ids.c | 511 +++++++
|
||||
drivers/mtd/mtk-snand/mtk-snand-ecc.c | 411 ++++++
|
||||
drivers/mtd/mtk-snand/mtk-snand-ids.c | 515 +++++++
|
||||
drivers/mtd/mtk-snand/mtk-snand-mtd.c | 535 +++++++
|
||||
drivers/mtd/mtk-snand/mtk-snand-os.c | 39 +
|
||||
drivers/mtd/mtk-snand/mtk-snand-os.h | 120 ++
|
||||
drivers/mtd/mtk-snand/mtk-snand.c | 1933 +++++++++++++++++++++++++
|
||||
drivers/mtd/mtk-snand/mtk-snand.h | 77 +
|
||||
12 files changed, 3917 insertions(+)
|
||||
12 files changed, 3937 insertions(+)
|
||||
create mode 100644 drivers/mtd/mtk-snand/Kconfig
|
||||
create mode 100644 drivers/mtd/mtk-snand/Makefile
|
||||
create mode 100644 drivers/mtd/mtk-snand/mtk-snand-def.h
|
||||
@@ -369,7 +369,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
+#endif /* _MTK_SNAND_DEF_H_ */
|
||||
--- /dev/null
|
||||
+++ b/drivers/mtd/mtk-snand/mtk-snand-ecc.c
|
||||
@@ -0,0 +1,395 @@
|
||||
@@ -0,0 +1,411 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
|
||||
+/*
|
||||
+ * Copyright (C) 2020 MediaTek Inc. All Rights Reserved.
|
||||
@@ -418,6 +418,10 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
+
|
||||
+static const uint8_t mt7622_ecc_caps[] = { 4, 6, 8, 10, 12 };
|
||||
+
|
||||
+static const uint8_t mt7981_ecc_caps[] = {
|
||||
+ 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24
|
||||
+};
|
||||
+
|
||||
+static const uint8_t mt7986_ecc_caps[] = {
|
||||
+ 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24
|
||||
+};
|
||||
@@ -426,6 +430,10 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
+ [ECC_DECDONE] = 0x11c,
|
||||
+};
|
||||
+
|
||||
+static const uint32_t mt7981_ecc_regs[] = {
|
||||
+ [ECC_DECDONE] = 0x124,
|
||||
+};
|
||||
+
|
||||
+static const uint32_t mt7986_ecc_regs[] = {
|
||||
+ [ECC_DECDONE] = 0x124,
|
||||
+};
|
||||
@@ -447,6 +455,14 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
+ .errnum_bits = 5,
|
||||
+ .errnum_shift = 5,
|
||||
+ },
|
||||
+ [SNAND_SOC_MT7981] = {
|
||||
+ .ecc_caps = mt7981_ecc_caps,
|
||||
+ .num_ecc_cap = ARRAY_SIZE(mt7981_ecc_caps),
|
||||
+ .regs = mt7981_ecc_regs,
|
||||
+ .mode_shift = 5,
|
||||
+ .errnum_bits = 5,
|
||||
+ .errnum_shift = 8,
|
||||
+ },
|
||||
+ [SNAND_SOC_MT7986] = {
|
||||
+ .ecc_caps = mt7986_ecc_caps,
|
||||
+ .num_ecc_cap = ARRAY_SIZE(mt7986_ecc_caps),
|
||||
@@ -767,7 +783,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/drivers/mtd/mtk-snand/mtk-snand-ids.c
|
||||
@@ -0,0 +1,511 @@
|
||||
@@ -0,0 +1,515 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
|
||||
+/*
|
||||
+ * Copyright (C) 2020 MediaTek Inc. All Rights Reserved.
|
||||
@@ -860,6 +876,10 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
+ &snand_cap_read_from_cache_quad,
|
||||
+ &snand_cap_program_load_x4,
|
||||
+ mtk_snand_winbond_select_die),
|
||||
+ SNAND_INFO("W25N01KV", SNAND_ID(SNAND_ID_DYMMY, 0xef, 0xae, 0x21),
|
||||
+ SNAND_MEMORG_1G_2K_64,
|
||||
+ &snand_cap_read_from_cache_quad,
|
||||
+ &snand_cap_program_load_x4),
|
||||
+ SNAND_INFO("W25N02KV", SNAND_ID(SNAND_ID_DYMMY, 0xef, 0xaa, 0x22),
|
||||
+ SNAND_MEMORG_2G_2K_128,
|
||||
+ &snand_cap_read_from_cache_quad,
|
||||
@@ -903,7 +923,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
+ &snand_cap_program_load_x4),
|
||||
+ SNAND_INFO("GD5F2GQ5UExxG", SNAND_ID(SNAND_ID_DYMMY, 0xc8, 0x52),
|
||||
+ SNAND_MEMORG_2G_2K_128,
|
||||
+ &snand_cap_read_from_cache_quad_q2d,
|
||||
+ &snand_cap_read_from_cache_quad_a8d,
|
||||
+ &snand_cap_program_load_x4),
|
||||
+ SNAND_INFO("GD5F4GQ4UCxIG", SNAND_ID(SNAND_ID_DYMMY, 0xc8, 0xb4),
|
||||
+ SNAND_MEMORG_4G_4K_256,
|
||||
|
||||
@@ -310,3 +310,14 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
|
||||
switch (key) {
|
||||
case BKEY_PLUS:
|
||||
--- a/boot/bootflow_menu.c
|
||||
+++ b/boot/bootflow_menu.c
|
||||
@@ -231,7 +231,7 @@ int bootflow_menu_run(struct bootstd_pri
|
||||
|
||||
key = 0;
|
||||
if (ichar) {
|
||||
- key = bootmenu_conv_key(ichar);
|
||||
+ key = bootmenu_conv_key(NULL, ichar, NULL);
|
||||
if (key == BKEY_NONE)
|
||||
key = ichar;
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
+CONFIG_TARGET_MT7988=y
|
||||
+CONFIG_DEBUG_UART_BASE=0x11000000
|
||||
+CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
+CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
+CONFIG_SYS_LOAD_ADDR=0x50000000
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+# CONFIG_AUTOBOOT is not set
|
||||
+CONFIG_DEFAULT_FDT_FILE="mt7988-rfb"
|
||||
@@ -497,7 +497,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
||||
+CONFIG_TARGET_MT7988=y
|
||||
+CONFIG_DEBUG_UART_BASE=0x11000000
|
||||
+CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
+CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
+CONFIG_SYS_LOAD_ADDR=0x50000000
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+# CONFIG_AUTOBOOT is not set
|
||||
+CONFIG_DEFAULT_FDT_FILE="mt7988-sd-rfb"
|
||||
|
||||
@@ -0,0 +1,314 @@
|
||||
--- a/configs/mt7988_sd_rfb_defconfig
|
||||
+++ b/configs/mt7988_sd_rfb_defconfig
|
||||
@@ -12,6 +12,24 @@ CONFIG_DEBUG_UART_BASE=0x11000000
|
||||
CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
CONFIG_SYS_LOAD_ADDR=0x50000000
|
||||
CONFIG_DEBUG_UART=y
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_SMBIOS_PRODUCT_NAME=""
|
||||
+CONFIG_CFB_CONSOLE_ANSI=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+CONFIG_SPI_BOOT=y
|
||||
+CONFIG_SD_BOOT=y
|
||||
+CONFIG_NAND_BOOT=y
|
||||
+CONFIG_BOOTSTD_DEFAULTS=y
|
||||
+CONFIG_BOOTSTD_FULL=y
|
||||
# CONFIG_AUTOBOOT is not set
|
||||
CONFIG_DEFAULT_FDT_FILE="mt7988-sd-rfb"
|
||||
CONFIG_LOGLEVEL=7
|
||||
@@ -22,15 +40,118 @@ CONFIG_SYS_PBSIZE=1049
|
||||
# CONFIG_BOOTM_PLAN9 is not set
|
||||
# CONFIG_BOOTM_RTEMS is not set
|
||||
# CONFIG_BOOTM_VXWORKS is not set
|
||||
-# CONFIG_CMD_ELF is not set
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_BOOTP=y
|
||||
+CONFIG_CMD_BUTTON=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_ELF=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_ECHO=y
|
||||
+CONFIG_CMD_ENV_READMEM=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_EXT4=y
|
||||
+CONFIG_CMD_FAT=y
|
||||
+CONFIG_CMD_FDT=y
|
||||
+CONFIG_CMD_FS_GENERIC=y
|
||||
+CONFIG_CMD_FS_UUID=y
|
||||
CONFIG_CMD_CLK=y
|
||||
CONFIG_CMD_DM=y
|
||||
CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_GPT=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_ITEST=y
|
||||
+CONFIG_CMD_LED=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+CONFIG_CMD_MMC=y
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_NAND=y
|
||||
+CONFIG_CMD_NAND_TRIMFFS=y
|
||||
+CONFIG_CMD_PCI=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_SF_TEST=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
CONFIG_CMD_PWM=y
|
||||
CONFIG_CMD_MMC=y
|
||||
CONFIG_CMD_MTD=y
|
||||
CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_SF=y
|
||||
CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_TFTPBOOT=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_UBI=y
|
||||
+CONFIG_CMD_UBI_RENAME=y
|
||||
+CONFIG_CMD_UBIFS=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_PART=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_SETEXPR=y
|
||||
+CONFIG_CMD_SLEEP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_SOURCE=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+CONFIG_CMD_USB=y
|
||||
+CONFIG_CMD_UUID=y
|
||||
+CONFIG_DISPLAY_CPUINFO=y
|
||||
+CONFIG_DM_MMC=y
|
||||
+CONFIG_DM_MTD=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
+CONFIG_DM_REGULATOR_GPIO=y
|
||||
+CONFIG_DM_USB=y
|
||||
+CONFIG_DM_PWM=y
|
||||
+CONFIG_PWM_MTK=y
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
+CONFIG_VERSION_VARIABLE=y
|
||||
+CONFIG_PARTITION_UUIDS=y
|
||||
+CONFIG_NETCONSOLE=y
|
||||
+CONFIG_DM_GPIO=y
|
||||
+CONFIG_DM_SCSI=y
|
||||
+CONFIG_PHY=y
|
||||
+CONFIG_PHY_MTK_TPHY=y
|
||||
+CONFIG_PCI=y
|
||||
+CONFIG_MTD=y
|
||||
+CONFIG_MTD_UBI_FASTMAP=y
|
||||
+# CONFIG_MTD_RAW_NAND is not set
|
||||
+CONFIG_DM_PCI=y
|
||||
+CONFIG_PCIE_MEDIATEK=y
|
||||
+CONFIG_PINCTRL_MT7988=y
|
||||
+CONFIG_PRE_CONSOLE_BUFFER=y
|
||||
+CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
|
||||
+CONFIG_RAM=y
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_SPI=y
|
||||
+CONFIG_DM_SPI=y
|
||||
+CONFIG_MTK_SPI_NAND=y
|
||||
+CONFIG_MTK_SPI_NAND_MTD=y
|
||||
+CONFIG_SYSRESET_WATCHDOG=y
|
||||
+CONFIG_WDT_MTK=y
|
||||
+CONFIG_LZO=y
|
||||
+CONFIG_ZSTD=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
+CONFIG_RANDOM_UUID=y
|
||||
+CONFIG_REGEX=y
|
||||
+CONFIG_USB=y
|
||||
+CONFIG_USB_HOST=y
|
||||
+CONFIG_USB_XHCI_HCD=y
|
||||
+CONFIG_USB_XHCI_MTK=y
|
||||
+CONFIG_USB_STORAGE=y
|
||||
+CONFIG_OF_EMBED=y
|
||||
+CONFIG_ENV_OVERWRITE=y
|
||||
+CONFIG_ENV_IS_IN_MMC=y
|
||||
+CONFIG_ENV_OFFSET=0x400000
|
||||
+CONFIG_ENV_OFFSET_REDUND=0x440000
|
||||
+CONFIG_ENV_SIZE=0x40000
|
||||
+CONFIG_ENV_SIZE_REDUND=0x40000
|
||||
CONFIG_DOS_PARTITION=y
|
||||
CONFIG_EFI_PARTITION=y
|
||||
CONFIG_PARTITION_TYPE_GUID=y
|
||||
@@ -46,6 +167,9 @@ CONFIG_PROT_TCP=y
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_SYSCON=y
|
||||
CONFIG_CLK=y
|
||||
+CONFIG_MMC=y
|
||||
+CONFIG_MMC_DEFAULT_DEV=1
|
||||
+CONFIG_MMC_SUPPORTS_TUNING=y
|
||||
CONFIG_MMC_HS200_SUPPORT=y
|
||||
CONFIG_MMC_MTK=y
|
||||
CONFIG_MTD=y
|
||||
--- a/configs/mt7988_rfb_defconfig
|
||||
+++ b/configs/mt7988_rfb_defconfig
|
||||
@@ -12,6 +12,24 @@ CONFIG_DEBUG_UART_BASE=0x11000000
|
||||
CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
CONFIG_SYS_LOAD_ADDR=0x50000000
|
||||
CONFIG_DEBUG_UART=y
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_SMBIOS_PRODUCT_NAME=""
|
||||
+CONFIG_CFB_CONSOLE_ANSI=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+CONFIG_SPI_BOOT=y
|
||||
+CONFIG_SD_BOOT=y
|
||||
+CONFIG_NAND_BOOT=y
|
||||
+CONFIG_BOOTSTD_DEFAULTS=y
|
||||
+CONFIG_BOOTSTD_FULL=y
|
||||
# CONFIG_AUTOBOOT is not set
|
||||
CONFIG_DEFAULT_FDT_FILE="mt7988-rfb"
|
||||
CONFIG_LOGLEVEL=7
|
||||
@@ -22,15 +40,118 @@ CONFIG_SYS_PBSIZE=1049
|
||||
# CONFIG_BOOTM_PLAN9 is not set
|
||||
# CONFIG_BOOTM_RTEMS is not set
|
||||
# CONFIG_BOOTM_VXWORKS is not set
|
||||
-# CONFIG_CMD_ELF is not set
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_BOOTP=y
|
||||
+CONFIG_CMD_BUTTON=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_ELF=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_ECHO=y
|
||||
+CONFIG_CMD_ENV_READMEM=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_EXT4=y
|
||||
+CONFIG_CMD_FAT=y
|
||||
+CONFIG_CMD_FDT=y
|
||||
+CONFIG_CMD_FS_GENERIC=y
|
||||
+CONFIG_CMD_FS_UUID=y
|
||||
CONFIG_CMD_CLK=y
|
||||
CONFIG_CMD_DM=y
|
||||
CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_GPT=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_ITEST=y
|
||||
+CONFIG_CMD_LED=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+CONFIG_CMD_MMC=y
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_NAND=y
|
||||
+CONFIG_CMD_NAND_TRIMFFS=y
|
||||
+CONFIG_CMD_PCI=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_SF_TEST=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
CONFIG_CMD_PWM=y
|
||||
CONFIG_CMD_MMC=y
|
||||
CONFIG_CMD_MTD=y
|
||||
CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_SF=y
|
||||
CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_TFTPBOOT=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_UBI=y
|
||||
+CONFIG_CMD_UBI_RENAME=y
|
||||
+CONFIG_CMD_UBIFS=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_PART=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_SETEXPR=y
|
||||
+CONFIG_CMD_SLEEP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_SOURCE=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+CONFIG_CMD_USB=y
|
||||
+CONFIG_CMD_UUID=y
|
||||
+CONFIG_DISPLAY_CPUINFO=y
|
||||
+CONFIG_DM_MMC=y
|
||||
+CONFIG_DM_MTD=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
+CONFIG_DM_REGULATOR_GPIO=y
|
||||
+CONFIG_DM_USB=y
|
||||
+CONFIG_DM_PWM=y
|
||||
+CONFIG_PWM_MTK=y
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
+CONFIG_VERSION_VARIABLE=y
|
||||
+CONFIG_PARTITION_UUIDS=y
|
||||
+CONFIG_NETCONSOLE=y
|
||||
+CONFIG_DM_GPIO=y
|
||||
+CONFIG_DM_SCSI=y
|
||||
+CONFIG_PHY=y
|
||||
+CONFIG_PHY_MTK_TPHY=y
|
||||
+CONFIG_PCI=y
|
||||
+CONFIG_MTD=y
|
||||
+CONFIG_MTD_UBI_FASTMAP=y
|
||||
+# CONFIG_MTD_RAW_NAND is not set
|
||||
+CONFIG_DM_PCI=y
|
||||
+CONFIG_PCIE_MEDIATEK=y
|
||||
+CONFIG_PINCTRL_MT7988=y
|
||||
+CONFIG_PRE_CONSOLE_BUFFER=y
|
||||
+CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
|
||||
+CONFIG_RAM=y
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_SPI=y
|
||||
+CONFIG_DM_SPI=y
|
||||
+CONFIG_MTK_SPI_NAND=y
|
||||
+CONFIG_MTK_SPI_NAND_MTD=y
|
||||
+CONFIG_SYSRESET_WATCHDOG=y
|
||||
+CONFIG_WDT_MTK=y
|
||||
+CONFIG_LZO=y
|
||||
+CONFIG_ZSTD=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
+CONFIG_RANDOM_UUID=y
|
||||
+CONFIG_REGEX=y
|
||||
+CONFIG_USB=y
|
||||
+CONFIG_USB_HOST=y
|
||||
+CONFIG_USB_XHCI_HCD=y
|
||||
+CONFIG_USB_XHCI_MTK=y
|
||||
+CONFIG_USB_STORAGE=y
|
||||
+CONFIG_OF_EMBED=y
|
||||
+CONFIG_ENV_OVERWRITE=y
|
||||
+CONFIG_ENV_IS_IN_MMC=y
|
||||
+CONFIG_ENV_OFFSET=0x400000
|
||||
+CONFIG_ENV_OFFSET_REDUND=0x440000
|
||||
+CONFIG_ENV_SIZE=0x40000
|
||||
+CONFIG_ENV_SIZE_REDUND=0x40000
|
||||
CONFIG_DOS_PARTITION=y
|
||||
CONFIG_EFI_PARTITION=y
|
||||
CONFIG_PARTITION_TYPE_GUID=y
|
||||
@@ -46,6 +167,9 @@ CONFIG_PROT_TCP=y
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_SYSCON=y
|
||||
CONFIG_CLK=y
|
||||
+CONFIG_MMC=y
|
||||
+CONFIG_MMC_DEFAULT_DEV=1
|
||||
+CONFIG_MMC_SUPPORTS_TUNING=y
|
||||
CONFIG_MMC_HS200_SUPPORT=y
|
||||
CONFIG_MMC_MTK=y
|
||||
CONFIG_MTD=y
|
||||
@@ -0,0 +1,129 @@
|
||||
--- a/configs/mt7981_rfb_defconfig
|
||||
+++ b/configs/mt7981_rfb_defconfig
|
||||
@@ -30,6 +30,9 @@ CONFIG_CMD_MTD=y
|
||||
CONFIG_CMD_SF_TEST=y
|
||||
CONFIG_CMD_PING=y
|
||||
CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_UBI=y
|
||||
+CONFIG_CMD_UBI_RENAME=y
|
||||
+CONFIG_ENV_OVERWRITE=y
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_NET_RANDOM_ETHADDR=y
|
||||
CONFIG_REGMAP=y
|
||||
--- a/configs/mt7981_snfi_nand_rfb_defconfig
|
||||
+++ b/configs/mt7981_snfi_nand_rfb_defconfig
|
||||
@@ -1,11 +1,12 @@
|
||||
CONFIG_ARM=y
|
||||
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
|
||||
CONFIG_POSITION_INDEPENDENT=y
|
||||
CONFIG_ARCH_MEDIATEK=y
|
||||
CONFIG_TEXT_BASE=0x41e00000
|
||||
CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
CONFIG_NR_DRAM_BANKS=1
|
||||
-CONFIG_ENV_SIZE=0x20000
|
||||
CONFIG_DEFAULT_DEVICE_TREE="mt7981-snfi-nand-rfb"
|
||||
+CONFIG_SYS_PROMPT="MT7981> "
|
||||
CONFIG_TARGET_MT7981=y
|
||||
CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
@@ -15,7 +16,6 @@ CONFIG_DEBUG_UART=y
|
||||
CONFIG_DEFAULT_FDT_FILE="mt7981-snfi-nand-rfb"
|
||||
CONFIG_LOGLEVEL=7
|
||||
CONFIG_LOG=y
|
||||
-CONFIG_SYS_PROMPT="MT7981> "
|
||||
CONFIG_SYS_CBSIZE=512
|
||||
CONFIG_SYS_PBSIZE=1049
|
||||
# CONFIG_BOOTM_NETBSD is not set
|
||||
@@ -29,8 +29,6 @@ CONFIG_CMD_GPIO=y
|
||||
CONFIG_CMD_MTD=y
|
||||
CONFIG_CMD_PING=y
|
||||
CONFIG_CMD_SMC=y
|
||||
-CONFIG_MTDIDS_DEFAULT="spi-nand0=spi-nand0"
|
||||
-CONFIG_MTDPARTS_DEFAULT="spi-nand0:1024k(bl2),512k(u-boot-env),2048k(factory),2048k(fip),65536k(ubi)"
|
||||
CONFIG_CMD_UBI=y
|
||||
CONFIG_CMD_UBI_RENAME=y
|
||||
CONFIG_ENV_OVERWRITE=y
|
||||
@@ -45,7 +43,6 @@ CONFIG_DM_MTD=y
|
||||
CONFIG_MTK_SPI_NAND=y
|
||||
CONFIG_MTK_SPI_NAND_MTD=y
|
||||
CONFIG_PHY_FIXED=y
|
||||
-CONFIG_DM_ETH=y
|
||||
CONFIG_MEDIATEK_ETH=y
|
||||
CONFIG_PINCTRL=y
|
||||
CONFIG_PINCONF=y
|
||||
@@ -55,3 +52,4 @@ CONFIG_MTK_POWER_DOMAIN=y
|
||||
CONFIG_DM_SERIAL=y
|
||||
CONFIG_MTK_SERIAL=y
|
||||
CONFIG_HEXDUMP=y
|
||||
+CONFIG_LMB_MAX_REGIONS=64
|
||||
--- /dev/null
|
||||
+++ b/configs/mt7981_nor_rfb_defconfig
|
||||
@@ -0,0 +1,68 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
|
||||
+CONFIG_POSITION_INDEPENDENT=y
|
||||
+CONFIG_ARCH_MEDIATEK=y
|
||||
+CONFIG_TEXT_BASE=0x41e00000
|
||||
+CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
+CONFIG_NR_DRAM_BANKS=1
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="mt7981-rfb"
|
||||
+CONFIG_SYS_PROMPT="MT7981> "
|
||||
+CONFIG_TARGET_MT7981=y
|
||||
+CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
+CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
+CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+# CONFIG_AUTOBOOT is not set
|
||||
+CONFIG_DEFAULT_FDT_FILE="mt7981-rfb"
|
||||
+CONFIG_LOGLEVEL=7
|
||||
+CONFIG_LOG=y
|
||||
+CONFIG_SYS_CBSIZE=512
|
||||
+CONFIG_SYS_PBSIZE=1049
|
||||
+# CONFIG_BOOTM_NETBSD is not set
|
||||
+# CONFIG_BOOTM_PLAN9 is not set
|
||||
+# CONFIG_BOOTM_RTEMS is not set
|
||||
+# CONFIG_BOOTM_VXWORKS is not set
|
||||
+# CONFIG_CMD_ELF is not set
|
||||
+# CONFIG_CMD_UNLZ4 is not set
|
||||
+# CONFIG_CMD_UNZIP is not set
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_SF_TEST=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_SMC=y
|
||||
+CONFIG_ENV_OVERWRITE=y
|
||||
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
+CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_REGMAP=y
|
||||
+CONFIG_SYSCON=y
|
||||
+CONFIG_CLK=y
|
||||
+# CONFIG_MMC is not set
|
||||
+CONFIG_MTD=y
|
||||
+CONFIG_DM_MTD=y
|
||||
+CONFIG_MTD_SPI_NAND=y
|
||||
+CONFIG_DM_SPI_FLASH=y
|
||||
+CONFIG_SPI_FLASH_SFDP_SUPPORT=y
|
||||
+CONFIG_SPI_FLASH_EON=y
|
||||
+CONFIG_SPI_FLASH_GIGADEVICE=y
|
||||
+CONFIG_SPI_FLASH_ISSI=y
|
||||
+CONFIG_SPI_FLASH_MACRONIX=y
|
||||
+CONFIG_SPI_FLASH_SPANSION=y
|
||||
+CONFIG_SPI_FLASH_STMICRO=y
|
||||
+CONFIG_SPI_FLASH_WINBOND=y
|
||||
+CONFIG_SPI_FLASH_XMC=y
|
||||
+CONFIG_SPI_FLASH_XTX=y
|
||||
+CONFIG_SPI_FLASH_MTD=y
|
||||
+CONFIG_PHY_FIXED=y
|
||||
+CONFIG_MEDIATEK_ETH=y
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_MT7981=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_MTK_POWER_DOMAIN=y
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_SPI=y
|
||||
+CONFIG_DM_SPI=y
|
||||
+CONFIG_MTK_SPIM=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
+CONFIG_LMB_MAX_REGIONS=64
|
||||
@@ -0,0 +1,474 @@
|
||||
--- a/configs/mt7981_emmc_rfb_defconfig
|
||||
+++ b/configs/mt7981_emmc_rfb_defconfig
|
||||
@@ -14,7 +14,22 @@ CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
CONFIG_DEBUG_UART=y
|
||||
-# CONFIG_AUTOBOOT is not set
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_SMBIOS_PRODUCT_NAME=""
|
||||
+CONFIG_CFB_CONSOLE_ANSI=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+CONFIG_MMC_BOOT=y
|
||||
+CONFIG_BOOTSTD_DEFAULTS=y
|
||||
+CONFIG_BOOTSTD_FULL=y
|
||||
CONFIG_DEFAULT_FDT_FILE="mt7981-emmc-rfb"
|
||||
CONFIG_LOGLEVEL=7
|
||||
CONFIG_LOG=y
|
||||
@@ -24,9 +39,23 @@ CONFIG_SYS_PBSIZE=1049
|
||||
# CONFIG_BOOTM_PLAN9 is not set
|
||||
# CONFIG_BOOTM_RTEMS is not set
|
||||
# CONFIG_BOOTM_VXWORKS is not set
|
||||
-# CONFIG_CMD_ELF is not set
|
||||
# CONFIG_CMD_UNLZ4 is not set
|
||||
# CONFIG_CMD_UNZIP is not set
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_BOOTP=y
|
||||
+CONFIG_CMD_BUTTON=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_ELF=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_ECHO=y
|
||||
+CONFIG_CMD_ENV_READMEM=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_FDT=y
|
||||
+CONFIG_CMD_FS_UUID=y
|
||||
CONFIG_CMD_GPIO=y
|
||||
CONFIG_CMD_GPT=y
|
||||
CONFIG_CMD_GPT_RENAME=y
|
||||
@@ -36,13 +65,35 @@ CONFIG_CMD_PART=y
|
||||
CONFIG_CMD_READ=y
|
||||
CONFIG_CMD_PING=y
|
||||
CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_TFTPBOOT=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_SETEXPR=y
|
||||
+CONFIG_CMD_SLEEP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_SOURCE=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+CONFIG_CMD_UUID=y
|
||||
CONFIG_CMD_FAT=y
|
||||
CONFIG_CMD_FS_GENERIC=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_ITEST=y
|
||||
+CONFIG_CMD_LED=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_SF=y
|
||||
+CONFIG_CMD_SF_TEST=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
CONFIG_PARTITION_TYPE_GUID=y
|
||||
CONFIG_ENV_OVERWRITE=y
|
||||
CONFIG_ENV_IS_IN_MMC=y
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_REGEX=y
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_SYSCON=y
|
||||
CONFIG_CLK=y
|
||||
--- a/configs/mt7981_rfb_defconfig
|
||||
+++ b/configs/mt7981_rfb_defconfig
|
||||
@@ -12,7 +12,23 @@ CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
CONFIG_DEBUG_UART=y
|
||||
-# CONFIG_AUTOBOOT is not set
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_SMBIOS_PRODUCT_NAME=""
|
||||
+CONFIG_CFB_CONSOLE_ANSI=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+CONFIG_SPI_BOOT=y
|
||||
+CONFIG_NAND_BOOT=y
|
||||
+CONFIG_BOOTSTD_DEFAULTS=y
|
||||
+CONFIG_BOOTSTD_FULL=y
|
||||
CONFIG_DEFAULT_FDT_FILE="mt7981-rfb"
|
||||
CONFIG_LOGLEVEL=7
|
||||
CONFIG_LOG=y
|
||||
@@ -22,23 +38,74 @@ CONFIG_SYS_PBSIZE=1049
|
||||
# CONFIG_BOOTM_PLAN9 is not set
|
||||
# CONFIG_BOOTM_RTEMS is not set
|
||||
# CONFIG_BOOTM_VXWORKS is not set
|
||||
-# CONFIG_CMD_ELF is not set
|
||||
# CONFIG_CMD_UNLZ4 is not set
|
||||
# CONFIG_CMD_UNZIP is not set
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_BOOTP=y
|
||||
+CONFIG_CMD_BUTTON=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_ELF=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_ECHO=y
|
||||
+CONFIG_CMD_ENV_READMEM=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_FDT=y
|
||||
+CONFIG_CMD_FS_GENERIC=y
|
||||
+CONFIG_CMD_FS_UUID=y
|
||||
CONFIG_CMD_GPIO=y
|
||||
CONFIG_CMD_MTD=y
|
||||
-CONFIG_CMD_SF_TEST=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_ITEST=y
|
||||
+CONFIG_CMD_LED=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_NAND=y
|
||||
+# CONFIG_MTD_RAW_NAND is not set
|
||||
+CONFIG_CMD_NAND_TRIMFFS=y
|
||||
+CONFIG_CMD_PCI=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
+CONFIG_CMD_SF=y
|
||||
+CONFIG_CMD_SF_TEST=y
|
||||
CONFIG_CMD_SMC=y
|
||||
CONFIG_CMD_UBI=y
|
||||
CONFIG_CMD_UBI_RENAME=y
|
||||
+CONFIG_CMD_UBIFS=y
|
||||
+CONFIG_CMD_TFTPBOOT=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_SETEXPR=y
|
||||
+CONFIG_CMD_SLEEP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_SOURCE=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+CONFIG_CMD_UUID=y
|
||||
+CONFIG_ENV_IS_IN_UBI=y
|
||||
+CONFIG_ENV_UBI_PART="ubi"
|
||||
+CONFIG_ENV_SIZE=0x1f000
|
||||
+CONFIG_ENV_SIZE_REDUND=0x1f000
|
||||
+CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
|
||||
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_ENV_OVERWRITE=y
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_REGEX=y
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_SYSCON=y
|
||||
CONFIG_CLK=y
|
||||
# CONFIG_MMC is not set
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
CONFIG_MTD=y
|
||||
CONFIG_DM_MTD=y
|
||||
CONFIG_MTD_SPI_NAND=y
|
||||
--- a/configs/mt7981_sd_rfb_defconfig
|
||||
+++ b/configs/mt7981_sd_rfb_defconfig
|
||||
@@ -14,7 +14,22 @@ CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
CONFIG_DEBUG_UART=y
|
||||
-# CONFIG_AUTOBOOT is not set
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_SMBIOS_PRODUCT_NAME=""
|
||||
+CONFIG_CFB_CONSOLE_ANSI=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+CONFIG_MMC_BOOT=y
|
||||
+CONFIG_BOOTSTD_DEFAULTS=y
|
||||
+CONFIG_BOOTSTD_FULL=y
|
||||
CONFIG_DEFAULT_FDT_FILE="mt7981-sd-rfb"
|
||||
CONFIG_LOGLEVEL=7
|
||||
CONFIG_LOG=y
|
||||
@@ -24,9 +39,23 @@ CONFIG_SYS_PBSIZE=1049
|
||||
# CONFIG_BOOTM_PLAN9 is not set
|
||||
# CONFIG_BOOTM_RTEMS is not set
|
||||
# CONFIG_BOOTM_VXWORKS is not set
|
||||
-# CONFIG_CMD_ELF is not set
|
||||
# CONFIG_CMD_UNLZ4 is not set
|
||||
# CONFIG_CMD_UNZIP is not set
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_BOOTP=y
|
||||
+CONFIG_CMD_BUTTON=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_ELF=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_ECHO=y
|
||||
+CONFIG_CMD_ENV_READMEM=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_FDT=y
|
||||
+CONFIG_CMD_FS_UUID=y
|
||||
CONFIG_CMD_GPIO=y
|
||||
CONFIG_CMD_GPT=y
|
||||
CONFIG_CMD_GPT_RENAME=y
|
||||
@@ -36,13 +65,35 @@ CONFIG_CMD_PART=y
|
||||
CONFIG_CMD_READ=y
|
||||
CONFIG_CMD_PING=y
|
||||
CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_TFTPBOOT=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_SETEXPR=y
|
||||
+CONFIG_CMD_SLEEP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_SOURCE=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+CONFIG_CMD_UUID=y
|
||||
CONFIG_CMD_FAT=y
|
||||
CONFIG_CMD_FS_GENERIC=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_ITEST=y
|
||||
+CONFIG_CMD_LED=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_SF=y
|
||||
+CONFIG_CMD_SF_TEST=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
CONFIG_PARTITION_TYPE_GUID=y
|
||||
CONFIG_ENV_OVERWRITE=y
|
||||
CONFIG_ENV_IS_IN_MMC=y
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_REGEX=y
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_SYSCON=y
|
||||
CONFIG_CLK=y
|
||||
--- a/configs/mt7981_snfi_nand_rfb_defconfig
|
||||
+++ b/configs/mt7981_snfi_nand_rfb_defconfig
|
||||
@@ -12,7 +12,23 @@ CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
CONFIG_DEBUG_UART=y
|
||||
-# CONFIG_AUTOBOOT is not set
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_SMBIOS_PRODUCT_NAME=""
|
||||
+CONFIG_CFB_CONSOLE_ANSI=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+CONFIG_SPI_BOOT=y
|
||||
+CONFIG_NAND_BOOT=y
|
||||
+CONFIG_BOOTSTD_DEFAULTS=y
|
||||
+CONFIG_BOOTSTD_FULL=y
|
||||
CONFIG_DEFAULT_FDT_FILE="mt7981-snfi-nand-rfb"
|
||||
CONFIG_LOGLEVEL=7
|
||||
CONFIG_LOG=y
|
||||
@@ -22,22 +38,73 @@ CONFIG_SYS_PBSIZE=1049
|
||||
# CONFIG_BOOTM_PLAN9 is not set
|
||||
# CONFIG_BOOTM_RTEMS is not set
|
||||
# CONFIG_BOOTM_VXWORKS is not set
|
||||
-# CONFIG_CMD_ELF is not set
|
||||
# CONFIG_CMD_UNLZ4 is not set
|
||||
# CONFIG_CMD_UNZIP is not set
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_BOOTP=y
|
||||
+CONFIG_CMD_BUTTON=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_ELF=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_ECHO=y
|
||||
+CONFIG_CMD_ENV_READMEM=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_FDT=y
|
||||
+CONFIG_CMD_FS_GENERIC=y
|
||||
+CONFIG_CMD_FS_UUID=y
|
||||
CONFIG_CMD_GPIO=y
|
||||
CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_ITEST=y
|
||||
+CONFIG_CMD_LED=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_NAND=y
|
||||
+# CONFIG_MTD_RAW_NAND is not set
|
||||
+CONFIG_CMD_NAND_TRIMFFS=y
|
||||
+CONFIG_CMD_PCI=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_SF=y
|
||||
+CONFIG_CMD_SF_TEST=y
|
||||
CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
CONFIG_CMD_SMC=y
|
||||
CONFIG_CMD_UBI=y
|
||||
CONFIG_CMD_UBI_RENAME=y
|
||||
+CONFIG_CMD_UBIFS=y
|
||||
+CONFIG_CMD_TFTPBOOT=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_SETEXPR=y
|
||||
+CONFIG_CMD_SLEEP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_SOURCE=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+CONFIG_CMD_UUID=y
|
||||
CONFIG_ENV_OVERWRITE=y
|
||||
+CONFIG_ENV_IS_IN_UBI=y
|
||||
+CONFIG_ENV_UBI_PART="ubi"
|
||||
+CONFIG_ENV_SIZE=0x1f000
|
||||
+CONFIG_ENV_SIZE_REDUND=0x1f000
|
||||
+CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_REGEX=y
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_SYSCON=y
|
||||
CONFIG_CLK=y
|
||||
# CONFIG_MMC is not set
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
CONFIG_MTD=y
|
||||
CONFIG_DM_MTD=y
|
||||
CONFIG_MTK_SPI_NAND=y
|
||||
--- a/configs/mt7981_nor_rfb_defconfig
|
||||
+++ b/configs/mt7981_nor_rfb_defconfig
|
||||
@@ -12,7 +12,22 @@ CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
CONFIG_DEBUG_UART=y
|
||||
-# CONFIG_AUTOBOOT is not set
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_SMBIOS_PRODUCT_NAME=""
|
||||
+CONFIG_CFB_CONSOLE_ANSI=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+CONFIG_SPI_BOOT=y
|
||||
+CONFIG_BOOTSTD_DEFAULTS=y
|
||||
+CONFIG_BOOTSTD_FULL=y
|
||||
CONFIG_DEFAULT_FDT_FILE="mt7981-rfb"
|
||||
CONFIG_LOGLEVEL=7
|
||||
CONFIG_LOG=y
|
||||
@@ -22,21 +37,66 @@ CONFIG_SYS_PBSIZE=1049
|
||||
# CONFIG_BOOTM_PLAN9 is not set
|
||||
# CONFIG_BOOTM_RTEMS is not set
|
||||
# CONFIG_BOOTM_VXWORKS is not set
|
||||
-# CONFIG_CMD_ELF is not set
|
||||
# CONFIG_CMD_UNLZ4 is not set
|
||||
# CONFIG_CMD_UNZIP is not set
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_BOOTP=y
|
||||
+CONFIG_CMD_BUTTON=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_ELF=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_ECHO=y
|
||||
+CONFIG_CMD_ENV_READMEM=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_FDT=y
|
||||
+CONFIG_CMD_FS_GENERIC=y
|
||||
+CONFIG_CMD_FS_UUID=y
|
||||
CONFIG_CMD_GPIO=y
|
||||
CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_ITEST=y
|
||||
+CONFIG_CMD_LED=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_PCI=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_SF=y
|
||||
CONFIG_CMD_SF_TEST=y
|
||||
CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_TFTPBOOT=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_SETEXPR=y
|
||||
+CONFIG_CMD_SLEEP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_SOURCE=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+CONFIG_CMD_UUID=y
|
||||
+CONFIG_ENV_IS_IN_MTD=y
|
||||
+CONFIG_ENV_MTD_NAME="u-boot-env"
|
||||
+CONFIG_ENV_SIZE_REDUND=0x4000
|
||||
+CONFIG_ENV_SIZE=0x4000
|
||||
+CONFIG_ENV_OFFSET=0x0
|
||||
CONFIG_ENV_OVERWRITE=y
|
||||
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_REGEX=y
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_SYSCON=y
|
||||
CONFIG_CLK=y
|
||||
# CONFIG_MMC is not set
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
CONFIG_MTD=y
|
||||
CONFIG_DM_MTD=y
|
||||
CONFIG_MTD_SPI_NAND=y
|
||||
@@ -0,0 +1,140 @@
|
||||
--- a/arch/arm/dts/mt7981-rfb.dts
|
||||
+++ b/arch/arm/dts/mt7981-rfb.dts
|
||||
@@ -143,6 +143,37 @@
|
||||
compatible = "spi-nand";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <52000000>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ label = "BL2";
|
||||
+ reg = <0x00000 0x0100000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@100000 {
|
||||
+ label = "u-boot-env";
|
||||
+ reg = <0x0100000 0x0080000>;
|
||||
+ };
|
||||
+
|
||||
+ factory: partition@180000 {
|
||||
+ label = "Factory";
|
||||
+ reg = <0x180000 0x0200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@380000 {
|
||||
+ label = "FIP";
|
||||
+ reg = <0x380000 0x0200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@580000 {
|
||||
+ label = "ubi";
|
||||
+ reg = <0x580000 0x4000000>;
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
};
|
||||
|
||||
@@ -164,6 +195,37 @@
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <52000000>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ partition@00000 {
|
||||
+ label = "BL2";
|
||||
+ reg = <0x00000 0x0040000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@40000 {
|
||||
+ label = "u-boot-env";
|
||||
+ reg = <0x40000 0x0010000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@50000 {
|
||||
+ label = "Factory";
|
||||
+ reg = <0x50000 0x00B0000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@100000 {
|
||||
+ label = "FIP";
|
||||
+ reg = <0x100000 0x0080000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@180000 {
|
||||
+ label = "firmware";
|
||||
+ reg = <0x180000 0xE00000>;
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
};
|
||||
|
||||
--- a/arch/arm/dts/mt7981-snfi-nand-rfb.dts
|
||||
+++ b/arch/arm/dts/mt7981-snfi-nand-rfb.dts
|
||||
@@ -107,11 +107,11 @@
|
||||
};
|
||||
|
||||
mmc0_pins_default: mmc0default {
|
||||
- mux {
|
||||
- function = "flash";
|
||||
- groups = "emmc_45";
|
||||
- };
|
||||
- };
|
||||
+ mux {
|
||||
+ function = "flash";
|
||||
+ groups = "emmc_45";
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
|
||||
&snand {
|
||||
@@ -119,6 +119,42 @@
|
||||
pinctrl-0 = <&snfi_pins>;
|
||||
status = "okay";
|
||||
quad-spi;
|
||||
+
|
||||
+ spi_nand@0 {
|
||||
+ compatible = "spi-nand";
|
||||
+ reg = <0>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ label = "BL2";
|
||||
+ reg = <0x00000 0x0100000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@100000 {
|
||||
+ label = "u-boot-env";
|
||||
+ reg = <0x0100000 0x0080000>;
|
||||
+ };
|
||||
+
|
||||
+ factory: partition@180000 {
|
||||
+ label = "Factory";
|
||||
+ reg = <0x180000 0x0200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@380000 {
|
||||
+ label = "FIP";
|
||||
+ reg = <0x380000 0x0200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@580000 {
|
||||
+ label = "ubi";
|
||||
+ reg = <0x580000 0x4000000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
|
||||
&pwm {
|
||||
@@ -0,0 +1,47 @@
|
||||
From 41f225dae30ea6ddcff10f120a9e732f994d3a07 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Nicol=C3=B2=20Veronese?= <nicveronese@gmail.com>
|
||||
Date: Tue, 3 Oct 2023 23:46:52 +0200
|
||||
Subject: [PATCH] spi: mtk_spim: prevent global pll clock override
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
With commit 793e6230118032a099ec42a1ea67f434721edcc0
|
||||
a new system to calculate the SPI clocks has been added.
|
||||
|
||||
Unfortunately, the do_div macro overrides the global
|
||||
priv->pll_clk_rate field. This will cause to have a reduced
|
||||
clock rate on each subsequent SPI call.
|
||||
|
||||
Signed-off-by: Valerio 'ftp21' Mancini <ftp21@ftp21.eu>
|
||||
Signed-off-by: Nicolò Veronese <nicveronese@gmail.com>
|
||||
---
|
||||
drivers/spi/mtk_spim.c | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/spi/mtk_spim.c
|
||||
+++ b/drivers/spi/mtk_spim.c
|
||||
@@ -409,7 +409,7 @@ static int mtk_spim_transfer_wait(struct
|
||||
{
|
||||
struct udevice *bus = dev_get_parent(slave->dev);
|
||||
struct mtk_spim_priv *priv = dev_get_priv(bus);
|
||||
- u32 sck_l, sck_h, clk_count, reg;
|
||||
+ u32 pll_clk, sck_l, sck_h, clk_count, reg;
|
||||
ulong us = 1;
|
||||
int ret = 0;
|
||||
|
||||
@@ -418,11 +418,12 @@ static int mtk_spim_transfer_wait(struct
|
||||
else
|
||||
clk_count = op->data.nbytes;
|
||||
|
||||
+ pll_clk = priv->pll_clk_rate;
|
||||
sck_l = readl(priv->base + SPI_CFG2_REG) >> SPI_CFG2_SCK_LOW_OFFSET;
|
||||
sck_h = readl(priv->base + SPI_CFG2_REG) & SPI_CFG2_SCK_HIGH_MASK;
|
||||
- do_div(priv->pll_clk_rate, sck_l + sck_h + 2);
|
||||
+ do_div(pll_clk, sck_l + sck_h + 2);
|
||||
|
||||
- us = CLK_TO_US(priv->pll_clk_rate, clk_count * 8);
|
||||
+ us = CLK_TO_US(pll_clk, clk_count * 8);
|
||||
us += 1000 * 1000; /* 1s tolerance */
|
||||
|
||||
if (us > UINT_MAX)
|
||||
@@ -70,7 +70,7 @@
|
||||
{
|
||||
--- a/boot/image-fit.c
|
||||
+++ b/boot/image-fit.c
|
||||
@@ -2051,6 +2051,49 @@ static const char *fit_get_image_type_pr
|
||||
@@ -2051,6 +2051,47 @@ static const char *fit_get_image_type_pr
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
@@ -93,11 +93,8 @@
|
||||
+ max_size = hdrsize;
|
||||
+
|
||||
+ images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH);
|
||||
+ if (images_noffset < 0) {
|
||||
+ printf("Can't find images parent node '%s' (%s)\n",
|
||||
+ FIT_IMAGES_PATH, fdt_strerror(images_noffset));
|
||||
+ return 0;
|
||||
+ }
|
||||
+ if (images_noffset < 0)
|
||||
+ goto out;
|
||||
+
|
||||
+ for (ndepth = 0,
|
||||
+ noffset = fdt_next_node(fit, images_noffset, &ndepth);
|
||||
@@ -106,7 +103,7 @@
|
||||
+ if (ndepth == 1) {
|
||||
+ ret = fit_image_get_data_and_size(fit, noffset, &data, &data_size);
|
||||
+ if (ret)
|
||||
+ return 0;
|
||||
+ goto out;
|
||||
+
|
||||
+ img_total = data_size + (data - fit);
|
||||
+
|
||||
@@ -114,6 +111,7 @@
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+out:
|
||||
+ return max_size;
|
||||
+}
|
||||
+
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--- /dev/null
|
||||
+++ b/configs/mt7622_ubnt_unifi-6-lr_defconfig
|
||||
+++ b/configs/mt7622_ubnt_unifi-6-lr-v1_defconfig
|
||||
@@ -0,0 +1,147 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_POSITION_INDEPENDENT=y
|
||||
@@ -149,6 +149,305 @@
|
||||
+CONFIG_USE_SERVERIP=y
|
||||
+CONFIG_SERVERIP="192.168.1.254"
|
||||
--- /dev/null
|
||||
+++ b/configs/mt7622_ubnt_unifi-6-lr-v2_defconfig
|
||||
@@ -0,0 +1,147 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_POSITION_INDEPENDENT=y
|
||||
+CONFIG_ARCH_MEDIATEK=y
|
||||
+CONFIG_TARGET_MT7622=y
|
||||
+CONFIG_TEXT_BASE=0x41e00000
|
||||
+CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
+CONFIG_SYS_LOAD_ADDR=0x40080000
|
||||
+CONFIG_USE_DEFAULT_ENV_FILE=y
|
||||
+CONFIG_MTDPARTS_DEFAULT="mtdparts=nor0:128k(bl2),640k(fip),64k(u-boot-env),256k(factory),64k(eeprom),15232k(recovery),-(firmware)"
|
||||
+CONFIG_ENV_IS_IN_MTD=y
|
||||
+CONFIG_ENV_MTD_NAME="nor0"
|
||||
+CONFIG_ENV_SIZE_REDUND=0x4000
|
||||
+CONFIG_ENV_SIZE=0x4000
|
||||
+CONFIG_ENV_OFFSET=0xc0000
|
||||
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_RESET_BUTTON_SETTLE_DELAY=400
|
||||
+CONFIG_BOOTP_SEND_HOSTNAME=y
|
||||
+CONFIG_DEFAULT_ENV_FILE="ubnt_unifi-6-lr-v2_env"
|
||||
+CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
+CONFIG_DEBUG_UART_CLOCK=25000000
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="mt7622-ubnt-unifi-6-lr"
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+CONFIG_SMBIOS_PRODUCT_NAME=""
|
||||
+CONFIG_AUTOBOOT_KEYED=y
|
||||
+CONFIG_BOOTDELAY=30
|
||||
+CONFIG_AUTOBOOT_MENU_SHOW=y
|
||||
+CONFIG_CFB_CONSOLE_ANSI=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
|
||||
+CONFIG_LOGLEVEL=7
|
||||
+CONFIG_LOG=y
|
||||
+CONFIG_DEFAULT_FDT_FILE="mt7622-ubnt-unifi-6-lr"
|
||||
+CONFIG_SYS_PROMPT="MT7622> "
|
||||
+# CONFIG_LEGACY_IMAGE_FORMAT is not set
|
||||
+# CONFIG_BOOTM_PLAN9 is not set
|
||||
+# CONFIG_BOOTM_RTEMS is not set
|
||||
+# CONFIG_BOOTM_VXWORKS is not set
|
||||
+# CONFIG_EFI is not set
|
||||
+# CONFIG_EFI_LOADER is not set
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+# CONFIG_CMD_BOOTEFI is not set
|
||||
+CONFIG_CMD_BOOTP=y
|
||||
+CONFIG_CMD_BUTTON=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_ECHO=y
|
||||
+# CONFIG_CMD_ELF is not set
|
||||
+# CONFIG_CMD_BOOTEFI_BOOTMGR is not set
|
||||
+CONFIG_CMD_ENV_READMEM=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_ITEST=y
|
||||
+CONFIG_CMD_LED=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+# CONFIG_CMD_MBR is not set
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_MTDPARTS=y
|
||||
+# CONFIG_CMD_PCI is not set
|
||||
+CONFIG_CMD_SF_TEST=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
+CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_TFTPBOOT=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+# CONFIG_CMD_UNLZ4 is not set
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_SETEXPR=y
|
||||
+CONFIG_CMD_SLEEP=y
|
||||
+CONFIG_CMD_SOURCE=y
|
||||
+CONFIG_CMD_UUID=y
|
||||
+CONFIG_DISPLAY_CPUINFO=y
|
||||
+CONFIG_DM_ETH=y
|
||||
+CONFIG_DM_ETH_PHY=y
|
||||
+CONFIG_DM_GPIO=y
|
||||
+CONFIG_DM_MDIO=y
|
||||
+CONFIG_DM_MTD=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
+CONFIG_DM_REGULATOR_GPIO=y
|
||||
+# CONFIG_DM_MMC is not set
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_DM_SPI=y
|
||||
+CONFIG_DM_SPI_FLASH=y
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+# CONFIG_PARTITION_UUIDS is not set
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
+# CONFIG_LED is not set
|
||||
+# CONFIG_LZ4 is not set
|
||||
+CONFIG_VERSION_VARIABLE=y
|
||||
+CONFIG_NETCONSOLE=y
|
||||
+CONFIG_REGMAP=y
|
||||
+CONFIG_SYSCON=y
|
||||
+CONFIG_CLK=y
|
||||
+CONFIG_PHY=y
|
||||
+CONFIG_PHY_FIXED=y
|
||||
+CONFIG_PHYLIB_10G=y
|
||||
+CONFIG_PHY_AQUANTIA=y
|
||||
+CONFIG_PHY_ADDR_ENABLE=y
|
||||
+CONFIG_PHY_ADDR=8
|
||||
+CONFIG_MEDIATEK_ETH=y
|
||||
+CONFIG_MTD=y
|
||||
+# CONFIG_MMC is not set
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_MT7622=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_PRE_CONSOLE_BUFFER=y
|
||||
+CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
|
||||
+CONFIG_MTK_POWER_DOMAIN=y
|
||||
+CONFIG_RAM=y
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_SPI=y
|
||||
+CONFIG_MTK_SNFI_SPI=y
|
||||
+CONFIG_MTK_SNOR=y
|
||||
+CONFIG_SYSRESET_WATCHDOG=y
|
||||
+CONFIG_WDT_MTK=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
+CONFIG_RANDOM_UUID=y
|
||||
+CONFIG_REGEX=y
|
||||
+CONFIG_SPI_FLASH=y
|
||||
+CONFIG_SPI_FLASH_BAR=y
|
||||
+CONFIG_SPI_FLASH_MTD=y
|
||||
+CONFIG_SPI_FLASH_UNLOCK_ALL=y
|
||||
+CONFIG_SPI_FLASH_EON=y
|
||||
+CONFIG_SPI_FLASH_GIGADEVICE=y
|
||||
+CONFIG_SPI_FLASH_MACRONIX=y
|
||||
+CONFIG_SPI_FLASH_SPANSION=y
|
||||
+CONFIG_SPI_FLASH_STMICRO=y
|
||||
+CONFIG_SPI_FLASH_SST=y
|
||||
+CONFIG_SPI_FLASH_WINBOND=y
|
||||
+CONFIG_SPI_FLASH_XMC=y
|
||||
+CONFIG_SPI_FLASH_USE_4K_SECTORS=y
|
||||
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
|
||||
+CONFIG_USE_IPADDR=y
|
||||
+CONFIG_IPADDR="192.168.1.1"
|
||||
+CONFIG_USE_SERVERIP=y
|
||||
+CONFIG_SERVERIP="192.168.1.254"
|
||||
--- /dev/null
|
||||
+++ b/configs/mt7622_ubnt_unifi-6-lr-v3_defconfig
|
||||
@@ -0,0 +1,146 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_POSITION_INDEPENDENT=y
|
||||
+CONFIG_ARCH_MEDIATEK=y
|
||||
+CONFIG_TARGET_MT7622=y
|
||||
+CONFIG_TEXT_BASE=0x41e00000
|
||||
+CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
+CONFIG_SYS_LOAD_ADDR=0x40080000
|
||||
+CONFIG_USE_DEFAULT_ENV_FILE=y
|
||||
+CONFIG_MTDPARTS_DEFAULT="mtdparts=nor0:128k(bl2),640k(fip),64k(u-boot-env),256k(factory),64k(eeprom),15232k(recovery),-(firmware)"
|
||||
+CONFIG_ENV_IS_IN_MTD=y
|
||||
+CONFIG_ENV_MTD_NAME="nor0"
|
||||
+CONFIG_ENV_SIZE_REDUND=0x4000
|
||||
+CONFIG_ENV_SIZE=0x4000
|
||||
+CONFIG_ENV_OFFSET=0xc0000
|
||||
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_RESET_BUTTON_SETTLE_DELAY=400
|
||||
+CONFIG_BOOTP_SEND_HOSTNAME=y
|
||||
+CONFIG_DEFAULT_ENV_FILE="ubnt_unifi-6-lr_env"
|
||||
+CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
+CONFIG_DEBUG_UART_CLOCK=25000000
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="mt7622-ubnt-unifi-6-lr-v3"
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+CONFIG_SMBIOS_PRODUCT_NAME=""
|
||||
+CONFIG_AUTOBOOT_KEYED=y
|
||||
+CONFIG_BOOTDELAY=30
|
||||
+CONFIG_AUTOBOOT_MENU_SHOW=y
|
||||
+CONFIG_CFB_CONSOLE_ANSI=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
|
||||
+CONFIG_LOGLEVEL=7
|
||||
+CONFIG_LOG=y
|
||||
+CONFIG_DEFAULT_FDT_FILE="mt7622-ubnt-unifi-6-lr-v3"
|
||||
+CONFIG_SYS_PROMPT="MT7622> "
|
||||
+# CONFIG_LEGACY_IMAGE_FORMAT is not set
|
||||
+# CONFIG_BOOTM_PLAN9 is not set
|
||||
+# CONFIG_BOOTM_RTEMS is not set
|
||||
+# CONFIG_BOOTM_VXWORKS is not set
|
||||
+# CONFIG_EFI is not set
|
||||
+# CONFIG_EFI_LOADER is not set
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+# CONFIG_CMD_BOOTEFI is not set
|
||||
+CONFIG_CMD_BOOTP=y
|
||||
+CONFIG_CMD_BUTTON=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_ECHO=y
|
||||
+# CONFIG_CMD_ELF is not set
|
||||
+# CONFIG_CMD_BOOTEFI_BOOTMGR is not set
|
||||
+CONFIG_CMD_ENV_READMEM=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_ITEST=y
|
||||
+CONFIG_CMD_LED=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+# CONFIG_CMD_MBR is not set
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_MTDPARTS=y
|
||||
+# CONFIG_CMD_PCI is not set
|
||||
+CONFIG_CMD_SF_TEST=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
+CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_TFTPBOOT=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+# CONFIG_CMD_UNLZ4 is not set
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_SETEXPR=y
|
||||
+CONFIG_CMD_SLEEP=y
|
||||
+CONFIG_CMD_SOURCE=y
|
||||
+CONFIG_CMD_UUID=y
|
||||
+CONFIG_DISPLAY_CPUINFO=y
|
||||
+CONFIG_DM_ETH=y
|
||||
+CONFIG_DM_ETH_PHY=y
|
||||
+CONFIG_DM_GPIO=y
|
||||
+CONFIG_DM_MDIO=y
|
||||
+CONFIG_DM_MTD=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
+CONFIG_DM_REGULATOR_GPIO=y
|
||||
+# CONFIG_DM_MMC is not set
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_DM_SPI=y
|
||||
+CONFIG_DM_SPI_FLASH=y
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+# CONFIG_PARTITION_UUIDS is not set
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
+# CONFIG_LED is not set
|
||||
+# CONFIG_LZ4 is not set
|
||||
+CONFIG_VERSION_VARIABLE=y
|
||||
+CONFIG_NETCONSOLE=y
|
||||
+CONFIG_REGMAP=y
|
||||
+CONFIG_SYSCON=y
|
||||
+CONFIG_CLK=y
|
||||
+CONFIG_PHY=y
|
||||
+CONFIG_PHY_FIXED=y
|
||||
+CONFIG_PHY_REALTEK=y
|
||||
+CONFIG_PHY_ADDR_ENABLE=y
|
||||
+CONFIG_PHY_ADDR=0
|
||||
+CONFIG_MEDIATEK_ETH=y
|
||||
+CONFIG_MTD=y
|
||||
+# CONFIG_MMC is not set
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_MT7622=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_PRE_CONSOLE_BUFFER=y
|
||||
+CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
|
||||
+CONFIG_MTK_POWER_DOMAIN=y
|
||||
+CONFIG_RAM=y
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_SPI=y
|
||||
+CONFIG_MTK_SNFI_SPI=y
|
||||
+CONFIG_MTK_SNOR=y
|
||||
+CONFIG_SYSRESET_WATCHDOG=y
|
||||
+CONFIG_WDT_MTK=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
+CONFIG_RANDOM_UUID=y
|
||||
+CONFIG_REGEX=y
|
||||
+CONFIG_SPI_FLASH=y
|
||||
+CONFIG_SPI_FLASH_BAR=y
|
||||
+CONFIG_SPI_FLASH_MTD=y
|
||||
+CONFIG_SPI_FLASH_UNLOCK_ALL=y
|
||||
+CONFIG_SPI_FLASH_EON=y
|
||||
+CONFIG_SPI_FLASH_GIGADEVICE=y
|
||||
+CONFIG_SPI_FLASH_MACRONIX=y
|
||||
+CONFIG_SPI_FLASH_SPANSION=y
|
||||
+CONFIG_SPI_FLASH_STMICRO=y
|
||||
+CONFIG_SPI_FLASH_SST=y
|
||||
+CONFIG_SPI_FLASH_WINBOND=y
|
||||
+CONFIG_SPI_FLASH_XMC=y
|
||||
+CONFIG_SPI_FLASH_USE_4K_SECTORS=y
|
||||
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
|
||||
+CONFIG_USE_IPADDR=y
|
||||
+CONFIG_IPADDR="192.168.1.1"
|
||||
+CONFIG_USE_SERVERIP=y
|
||||
+CONFIG_SERVERIP="192.168.1.254"
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/mt7622-ubnt-unifi-6-lr.dts
|
||||
@@ -0,0 +1,193 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
@@ -344,13 +643,210 @@
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/mt7622-ubnt-unifi-6-lr-v3.dts
|
||||
@@ -0,0 +1,193 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/*
|
||||
+ * Copyright (c) 2019 MediaTek Inc.
|
||||
+ * Author: Sam Shih <sam.shih@mediatek.com>
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include <dt-bindings/input/linux-event-codes.h>
|
||||
+#include "mt7622.dtsi"
|
||||
+#include "mt7622-u-boot.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ model = "mt7622-ubnt-unifi-6-lr-v3";
|
||||
+ compatible = "mediatek,mt7622", "ubnt,unifi-6-lr-v3";
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = &uart0;
|
||||
+ tick-timer = &timer0;
|
||||
+ };
|
||||
+
|
||||
+ memory@40000000 {
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x40000000 0x20000000>;
|
||||
+ };
|
||||
+
|
||||
+ aliases {
|
||||
+ spi0 = &snor;
|
||||
+ };
|
||||
+
|
||||
+ gpio-keys {
|
||||
+ compatible = "gpio-keys";
|
||||
+
|
||||
+ reset {
|
||||
+ label = "reset";
|
||||
+ gpios = <&gpio 62 GPIO_ACTIVE_LOW>;
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ memory@40000000 {
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x40000000 0x20000000>;
|
||||
+ };
|
||||
+
|
||||
+ reg_1p8v: regulator-1p8v {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "fixed-1.8V";
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-always-on;
|
||||
+ };
|
||||
+
|
||||
+ reg_3p3v: regulator-3p3v {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "fixed-3.3V";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-always-on;
|
||||
+ };
|
||||
+
|
||||
+ reg_5v: regulator-5v {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "fixed-5V";
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-always-on;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pcie {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&pcie0_pins>, <&pcie1_pins>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ pcie@0,0 {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
+ pcie@1,0 {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ eth_pins: eth-pins {
|
||||
+ mux {
|
||||
+ function = "eth";
|
||||
+ groups = "mdc_mdio", "rgmii_via_gmac2";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ pcie0_pins: pcie0-pins {
|
||||
+ mux {
|
||||
+ function = "pcie";
|
||||
+ groups = "pcie0_pad_perst",
|
||||
+ "pcie0_1_waken",
|
||||
+ "pcie0_1_clkreq";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ pcie1_pins: pcie1-pins {
|
||||
+ mux {
|
||||
+ function = "pcie";
|
||||
+ groups = "pcie1_pad_perst",
|
||||
+ "pcie1_0_waken",
|
||||
+ "pcie1_0_clkreq";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ snfi_pins: snfi-pins {
|
||||
+ mux {
|
||||
+ function = "flash";
|
||||
+ groups = "snfi";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ snor_pins: snor-pins {
|
||||
+ mux {
|
||||
+ function = "flash";
|
||||
+ groups = "spi_nor";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ uart0_pins: uart0 {
|
||||
+ mux {
|
||||
+ function = "uart";
|
||||
+ groups = "uart0_0_tx_rx" ;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ watchdog_pins: watchdog-default {
|
||||
+ mux {
|
||||
+ function = "watchdog";
|
||||
+ groups = "watchdog";
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&snor {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&snor_pins>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ spi-flash@0 {
|
||||
+ compatible = "jedec,spi-nor";
|
||||
+ reg = <0>;
|
||||
+ spi-tx-bus-width = <1>;
|
||||
+ spi-rx-bus-width = <4>;
|
||||
+ u-boot,dm-pre-reloc;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ mediatek,force-highspeed;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&watchdog {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&watchdog_pins>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+ð {
|
||||
+ status = "okay";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <ð_pins>;
|
||||
+
|
||||
+ mediatek,gmac-id = <0>;
|
||||
+ phy-mode = "sgmii";
|
||||
+ phy-handle = <&gphy>;
|
||||
+
|
||||
+ fixed-link {
|
||||
+ speed = <2500>;
|
||||
+ full-duplex;
|
||||
+ };
|
||||
+
|
||||
+ mdio-bus {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ gphy: ethernet-phy@0 {
|
||||
+ /* RealTek RTL8211FS */
|
||||
+ compatible = "ethernet-phy-ieee802.3-c22";
|
||||
+ reg = <0x0>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
--- a/arch/arm/dts/Makefile
|
||||
+++ b/arch/arm/dts/Makefile
|
||||
@@ -1306,6 +1306,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
|
||||
@@ -1306,6 +1306,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
|
||||
mt7623a-unielec-u7623-02-emmc.dtb \
|
||||
mt7622-bananapi-bpi-r64.dtb \
|
||||
mt7622-linksys-e8450-ubi.dtb \
|
||||
+ mt7622-ubnt-unifi-6-lr.dtb \
|
||||
+ mt7622-ubnt-unifi-6-lr-v3.dtb \
|
||||
mt7623n-bananapi-bpi-r2.dtb \
|
||||
mt7629-rfb.dtb \
|
||||
mt7981-rfb.dtb \
|
||||
@@ -407,6 +903,112 @@
|
||||
+_firstboot=setenv _firstboot ; run _switch_to_menu ; run ethaddr_factory ; run _init_env ; run boot_first
|
||||
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
|
||||
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title [33m$ver[0m"
|
||||
--- /dev/null
|
||||
+++ b/ubnt_unifi-6-lr-v2_env
|
||||
@@ -0,0 +1,50 @@
|
||||
+ethaddr_factory=mtd read nor0 $loadaddr 0x110000 0x10000 && env readmem -b ethaddr $loadaddr 0x6 ; setenv ethaddr_factory
|
||||
+ipaddr=192.168.1.1
|
||||
+serverip=192.168.1.254
|
||||
+loadaddr=0x48000000
|
||||
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_nor ; fi
|
||||
+bootdelay=0
|
||||
+bootfile=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v2-ubootmod-initramfs-recovery.itb
|
||||
+bootfile_bl2=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v2-ubootmod-preloader.bin
|
||||
+bootfile_fip=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v2-ubootmod-bl31-uboot.fip
|
||||
+bootfile_upg=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v2-ubootmod-squashfs-sysupgrade.itb
|
||||
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
|
||||
+bootmenu_default=0
|
||||
+bootmenu_delay=0
|
||||
+bootmenu_title= [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) )[0m
|
||||
+bootmenu_0=Initialize environment.=run _firstboot
|
||||
+bootmenu_0d=Run default boot command.=run boot_default
|
||||
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
|
||||
+bootmenu_2=Boot production system from flash.=run boot_production ; run bootmenu_confirm_return
|
||||
+bootmenu_3=Boot recovery system from flash.=run boot_recovery ; run bootmenu_confirm_return
|
||||
+bootmenu_4=Load production system via TFTP then write to flash.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_5=Load recovery system via TFTP then write to flash.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to flash.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
|
||||
+bootmenu_7=[31mLoad BL2 preloader via TFTP then write to flash.[0m=run boot_tftp_write_preloader ; run bootmenu_confirm_return
|
||||
+bootmenu_8=Reboot.=reset
|
||||
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
|
||||
+boot_first=if button reset ; then run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
|
||||
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
|
||||
+boot_production=run nor_read_production && bootm $loadaddr
|
||||
+boot_recovery=run nor_read_recovery ; bootm $loadaddr
|
||||
+boot_serial_write_fip=loadx $loadaddr 115200 && run boot_write_fip
|
||||
+boot_serial_write_preloader=loadx $loadaddr 115200 && run boot_write_preloader
|
||||
+boot_tftp_forever=while true ; do run boot_tftp_recovery ; sleep 1 ; done
|
||||
+boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run nor_write_production ; if env exists noboot ; then else bootm $loadaddr ; fi
|
||||
+boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run nor_write_recovery ; if env exists noboot ; then else bootm $loadaddr ; fi
|
||||
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr
|
||||
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run boot_write_fip
|
||||
+boot_tftp_write_preloader=tftpboot $loadaddr $bootfile_bl2 && run boot_write_preloader
|
||||
+boot_nor=run boot_production ; run boot_recovery
|
||||
+boot_write_fip=mtd erase nor0 0x20000 0x80000 && mtd write nor0 $loadaddr 0x20000 0x80000
|
||||
+boot_write_preloader=mtd erase nor0 0x0 0x20000 && mtd write nor0 $loadaddr 0x0 0x20000
|
||||
+reset_factory=mtd erase nor0 0xc0000 0x10000 && reset
|
||||
+nor_read_production=mtd read nor0 $loadaddr 0x1000000 0x1000 && imsz $loadaddr image_size && mtd read nor0 $loadaddr 0x1000000 $image_size
|
||||
+nor_read_recovery=mtd read nor0 $loadaddr 0x120000 0x1000 && imsz $loadaddr image_size && mtd read nor0 $loadaddr 0x120000 $image_size
|
||||
+nor_pad_size=imsz $loadaddr image_size ; setexpr image_eb 0x$image_size / 0x1000 ; setexpr tmp1 0x$image_size % 0x1000 ; test 0x$tmp1 -gt 0 && setexpr image_eb 0x$image_eb + 1 ; setexpr image_eb 0x$image_eb * 0x1000
|
||||
+nor_write_production=run nor_pad_size ; test 0x$image_eb -le 0x3000000 && mtd erase nor0 0x1000000 0x$image_eb && mtd write nor0 $loadaddr 0x1000000 $filesize
|
||||
+nor_write_recovery=run nor_pad_size ; test 0x$image_eb -le 0xee0000 && mtd erase nor0 0x120000 0x$image_eb && mtd write nor0 $loadaddr 0x120000 $filesize
|
||||
+_init_env=setenv _init_env ; saveenv
|
||||
+_firstboot=setenv _firstboot ; run _switch_to_menu ; run ethaddr_factory ; run _init_env ; run boot_first
|
||||
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
|
||||
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title [33m$ver[0m"--- /dev/null
|
||||
--- /dev/null
|
||||
+++ b/ubnt_unifi-6-lr-v3_env
|
||||
@@ -0,0 +1,50 @@
|
||||
+ethaddr_factory=mtd read nor0 $loadaddr 0x110000 0x10000 && env readmem -b ethaddr $loadaddr 0x6 ; setenv ethaddr_factory
|
||||
+ipaddr=192.168.1.1
|
||||
+serverip=192.168.1.254
|
||||
+loadaddr=0x48000000
|
||||
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_nor ; fi
|
||||
+bootdelay=0
|
||||
+bootfile=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v3-ubootmod-initramfs-recovery.itb
|
||||
+bootfile_bl2=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v3-ubootmod-preloader.bin
|
||||
+bootfile_fip=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v3-ubootmod-bl31-uboot.fip
|
||||
+bootfile_upg=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v3-ubootmod-squashfs-sysupgrade.itb
|
||||
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
|
||||
+bootmenu_default=0
|
||||
+bootmenu_delay=0
|
||||
+bootmenu_title= [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) )[0m
|
||||
+bootmenu_0=Initialize environment.=run _firstboot
|
||||
+bootmenu_0d=Run default boot command.=run boot_default
|
||||
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
|
||||
+bootmenu_2=Boot production system from flash.=run boot_production ; run bootmenu_confirm_return
|
||||
+bootmenu_3=Boot recovery system from flash.=run boot_recovery ; run bootmenu_confirm_return
|
||||
+bootmenu_4=Load production system via TFTP then write to flash.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_5=Load recovery system via TFTP then write to flash.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to flash.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
|
||||
+bootmenu_7=[31mLoad BL2 preloader via TFTP then write to flash.[0m=run boot_tftp_write_preloader ; run bootmenu_confirm_return
|
||||
+bootmenu_8=Reboot.=reset
|
||||
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
|
||||
+boot_first=if button reset ; then run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
|
||||
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
|
||||
+boot_production=run nor_read_production && bootm $loadaddr
|
||||
+boot_recovery=run nor_read_recovery ; bootm $loadaddr
|
||||
+boot_serial_write_fip=loadx $loadaddr 115200 && run boot_write_fip
|
||||
+boot_serial_write_preloader=loadx $loadaddr 115200 && run boot_write_preloader
|
||||
+boot_tftp_forever=while true ; do run boot_tftp_recovery ; sleep 1 ; done
|
||||
+boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run nor_write_production ; if env exists noboot ; then else bootm $loadaddr ; fi
|
||||
+boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run nor_write_recovery ; if env exists noboot ; then else bootm $loadaddr ; fi
|
||||
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr
|
||||
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run boot_write_fip
|
||||
+boot_tftp_write_preloader=tftpboot $loadaddr $bootfile_bl2 && run boot_write_preloader
|
||||
+boot_nor=run boot_production ; run boot_recovery
|
||||
+boot_write_fip=mtd erase nor0 0x20000 0x80000 && mtd write nor0 $loadaddr 0x20000 0x80000
|
||||
+boot_write_preloader=mtd erase nor0 0x0 0x20000 && mtd write nor0 $loadaddr 0x0 0x20000
|
||||
+reset_factory=mtd erase nor0 0xc0000 0x10000 && reset
|
||||
+nor_read_production=mtd read nor0 $loadaddr 0x1000000 0x1000 && imsz $loadaddr image_size && mtd read nor0 $loadaddr 0x1000000 $image_size
|
||||
+nor_read_recovery=mtd read nor0 $loadaddr 0x120000 0x1000 && imsz $loadaddr image_size && mtd read nor0 $loadaddr 0x120000 $image_size
|
||||
+nor_pad_size=imsz $loadaddr image_size ; setexpr image_eb 0x$image_size / 0x1000 ; setexpr tmp1 0x$image_size % 0x1000 ; test 0x$tmp1 -gt 0 && setexpr image_eb 0x$image_eb + 1 ; setexpr image_eb 0x$image_eb * 0x1000
|
||||
+nor_write_production=run nor_pad_size ; test 0x$image_eb -le 0x3000000 && mtd erase nor0 0x1000000 0x$image_eb && mtd write nor0 $loadaddr 0x1000000 $filesize
|
||||
+nor_write_recovery=run nor_pad_size ; test 0x$image_eb -le 0xee0000 && mtd erase nor0 0x120000 0x$image_eb && mtd write nor0 $loadaddr 0x120000 $filesize
|
||||
+_init_env=setenv _init_env ; saveenv
|
||||
+_firstboot=setenv _firstboot ; run _switch_to_menu ; run ethaddr_factory ; run _init_env ; run boot_first
|
||||
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
|
||||
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title [33m$ver[0m"
|
||||
--- a/common/board_r.c
|
||||
+++ b/common/board_r.c
|
||||
@@ -66,6 +66,7 @@
|
||||
|
||||
@@ -239,12 +239,12 @@
|
||||
+ð {
|
||||
+ status = "okay";
|
||||
+ mediatek,gmac-id = <0>;
|
||||
+ phy-mode = "sgmii";
|
||||
+ phy-mode = "2500base-x";
|
||||
+ mediatek,switch = "mt7531";
|
||||
+ reset-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
|
||||
+
|
||||
+ fixed-link {
|
||||
+ speed = <1000>;
|
||||
+ speed = <2500>;
|
||||
+ full-duplex;
|
||||
+ };
|
||||
+};
|
||||
|
||||
697
package/boot/uboot-mediatek/patches/437-add-cmcc_rax3000m.patch
Normal file
697
package/boot/uboot-mediatek/patches/437-add-cmcc_rax3000m.patch
Normal file
@@ -0,0 +1,697 @@
|
||||
--- /dev/null
|
||||
+++ b/configs/mt7981_cmcc_rax3000m-emmc_defconfig
|
||||
@@ -0,0 +1,175 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_POSITION_INDEPENDENT=y
|
||||
+CONFIG_ARCH_MEDIATEK=y
|
||||
+CONFIG_TARGET_MT7981=y
|
||||
+CONFIG_TEXT_BASE=0x41e00000
|
||||
+CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
|
||||
+CONFIG_NR_DRAM_BANKS=1
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="mt7981-cmcc-rax3000m-emmc"
|
||||
+CONFIG_DEFAULT_ENV_FILE="cmcc_rax3000m-emmc_env"
|
||||
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-cmcc-rax3000m-emmc.dtb"
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
+CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
+CONFIG_SMBIOS_PRODUCT_NAME=""
|
||||
+CONFIG_AUTOBOOT_KEYED=y
|
||||
+CONFIG_BOOTDELAY=30
|
||||
+CONFIG_AUTOBOOT_MENU_SHOW=y
|
||||
+CONFIG_CFB_CONSOLE_ANSI=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+CONFIG_LOGLEVEL=7
|
||||
+CONFIG_LOG=y
|
||||
+CONFIG_SYS_PROMPT="MT7981> "
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_BOOTP=y
|
||||
+CONFIG_CMD_BUTTON=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_ECHO=y
|
||||
+CONFIG_CMD_ENV_READMEM=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_EXT4=y
|
||||
+CONFIG_CMD_FAT=y
|
||||
+CONFIG_CMD_FDT=y
|
||||
+CONFIG_CMD_FS_GENERIC=y
|
||||
+CONFIG_CMD_FS_UUID=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_GPT=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_ITEST=y
|
||||
+CONFIG_CMD_LED=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+# CONFIG_CMD_MBR is not set
|
||||
+CONFIG_CMD_MMC=y
|
||||
+CONFIG_CMD_PCI=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_SF_TEST=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
+CONFIG_CMD_PWM=y
|
||||
+CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_TFTPBOOT=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_PART=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_SETEXPR=y
|
||||
+CONFIG_CMD_SLEEP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_SOURCE=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+CONFIG_CMD_USB=y
|
||||
+CONFIG_CMD_UUID=y
|
||||
+CONFIG_DISPLAY_CPUINFO=y
|
||||
+CONFIG_DM_MMC=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
+CONFIG_DM_REGULATOR_GPIO=y
|
||||
+CONFIG_DM_USB=y
|
||||
+CONFIG_DM_PWM=y
|
||||
+CONFIG_PWM_MTK=y
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
+CONFIG_VERSION_VARIABLE=y
|
||||
+CONFIG_PARTITION_UUIDS=y
|
||||
+CONFIG_NETCONSOLE=y
|
||||
+CONFIG_REGMAP=y
|
||||
+CONFIG_SYSCON=y
|
||||
+CONFIG_CLK=y
|
||||
+CONFIG_DM_GPIO=y
|
||||
+CONFIG_DM_SCSI=y
|
||||
+CONFIG_AHCI=y
|
||||
+CONFIG_AHCI_PCI=y
|
||||
+CONFIG_SCSI_AHCI=y
|
||||
+CONFIG_SCSI=y
|
||||
+CONFIG_CMD_SCSI=y
|
||||
+CONFIG_PHY=y
|
||||
+CONFIG_PHY_MTK_TPHY=y
|
||||
+CONFIG_PHY_FIXED=y
|
||||
+CONFIG_MTK_AHCI=y
|
||||
+CONFIG_DM_ETH=y
|
||||
+CONFIG_MEDIATEK_ETH=y
|
||||
+CONFIG_PCI=y
|
||||
+CONFIG_DM_PCI=y
|
||||
+CONFIG_PCIE_MEDIATEK=y
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_MT7622=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_PRE_CONSOLE_BUFFER=y
|
||||
+CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
|
||||
+CONFIG_MTK_POWER_DOMAIN=y
|
||||
+CONFIG_RAM=y
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_MMC=y
|
||||
+CONFIG_MMC_DEFAULT_DEV=1
|
||||
+CONFIG_MMC_HS200_SUPPORT=y
|
||||
+CONFIG_MMC_MTK=y
|
||||
+CONFIG_MMC_SUPPORTS_TUNING=y
|
||||
+CONFIG_SUPPORT_EMMC_BOOT=y
|
||||
+CONFIG_SPI=y
|
||||
+CONFIG_SYSRESET_WATCHDOG=y
|
||||
+CONFIG_WDT_MTK=y
|
||||
+CONFIG_LZO=y
|
||||
+CONFIG_ZSTD=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
+CONFIG_RANDOM_UUID=y
|
||||
+CONFIG_REGEX=y
|
||||
+CONFIG_USB=y
|
||||
+CONFIG_USB_HOST=y
|
||||
+CONFIG_USB_XHCI_HCD=y
|
||||
+CONFIG_USB_XHCI_MTK=y
|
||||
+CONFIG_USB_STORAGE=y
|
||||
+CONFIG_OF_EMBED=y
|
||||
+CONFIG_ENV_OVERWRITE=y
|
||||
+CONFIG_ENV_IS_IN_MMC=y
|
||||
+CONFIG_ENV_OFFSET=0x400000
|
||||
+CONFIG_ENV_OFFSET_REDUND=0x440000
|
||||
+CONFIG_ENV_SIZE=0x40000
|
||||
+CONFIG_ENV_SIZE_REDUND=0x40000
|
||||
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
+CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_REGMAP=y
|
||||
+CONFIG_SYSCON=y
|
||||
+CONFIG_CLK=y
|
||||
+CONFIG_SUPPORT_EMMC_BOOT=y
|
||||
+CONFIG_PHY_FIXED=y
|
||||
+CONFIG_DM_ETH=y
|
||||
+CONFIG_MEDIATEK_ETH=y
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_MT7981=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_MTK_POWER_DOMAIN=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
+CONFIG_USE_DEFAULT_ENV_FILE=y
|
||||
+CONFIG_CMD_SF=y
|
||||
+CONFIG_LMB_MAX_REGIONS=64
|
||||
+CONFIG_USE_IPADDR=y
|
||||
+CONFIG_IPADDR="192.168.1.1"
|
||||
+CONFIG_USE_SERVERIP=y
|
||||
+CONFIG_SERVERIP="192.168.1.254"
|
||||
--- /dev/null
|
||||
+++ b/configs/mt7981_cmcc_rax3000m-nand_defconfig
|
||||
@@ -0,0 +1,175 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_POSITION_INDEPENDENT=y
|
||||
+CONFIG_ARCH_MEDIATEK=y
|
||||
+CONFIG_TARGET_MT7981=y
|
||||
+CONFIG_TEXT_BASE=0x41e00000
|
||||
+CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
|
||||
+CONFIG_NR_DRAM_BANKS=1
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="mt7981-cmcc-rax3000m-nand"
|
||||
+CONFIG_DEFAULT_ENV_FILE="cmcc_rax3000m-nand_env"
|
||||
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-cmcc-rax3000m-nand.dtb"
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
+CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
+CONFIG_SMBIOS_PRODUCT_NAME=""
|
||||
+CONFIG_AUTOBOOT_KEYED=y
|
||||
+CONFIG_BOOTDELAY=30
|
||||
+CONFIG_AUTOBOOT_MENU_SHOW=y
|
||||
+CONFIG_CFB_CONSOLE_ANSI=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+CONFIG_LOGLEVEL=7
|
||||
+CONFIG_LOG=y
|
||||
+CONFIG_SYS_PROMPT="MT7981> "
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_BOOTP=y
|
||||
+CONFIG_CMD_BUTTON=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_ECHO=y
|
||||
+CONFIG_CMD_ENV_READMEM=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_EXT4=y
|
||||
+CONFIG_CMD_FAT=y
|
||||
+CONFIG_CMD_FDT=y
|
||||
+CONFIG_CMD_FS_GENERIC=y
|
||||
+CONFIG_CMD_FS_UUID=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_GPT=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_ITEST=y
|
||||
+CONFIG_CMD_LED=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+# CONFIG_CMD_MBR is not set
|
||||
+CONFIG_CMD_PCI=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_SF_TEST=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
+CONFIG_CMD_PWM=y
|
||||
+CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_TFTPBOOT=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_UBI=y
|
||||
+CONFIG_CMD_UBI_RENAME=y
|
||||
+CONFIG_CMD_UBIFS=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_PART=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_SETEXPR=y
|
||||
+CONFIG_CMD_SLEEP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_SOURCE=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+CONFIG_CMD_UUID=y
|
||||
+CONFIG_DISPLAY_CPUINFO=y
|
||||
+CONFIG_DM_MTD=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
+CONFIG_DM_REGULATOR_GPIO=y
|
||||
+CONFIG_DM_PWM=y
|
||||
+CONFIG_PWM_MTK=y
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
+CONFIG_VERSION_VARIABLE=y
|
||||
+CONFIG_PARTITION_UUIDS=y
|
||||
+CONFIG_NETCONSOLE=y
|
||||
+CONFIG_REGMAP=y
|
||||
+CONFIG_SYSCON=y
|
||||
+CONFIG_CLK=y
|
||||
+CONFIG_DM_GPIO=y
|
||||
+CONFIG_DM_SCSI=y
|
||||
+CONFIG_AHCI=y
|
||||
+CONFIG_AHCI_PCI=y
|
||||
+CONFIG_SCSI_AHCI=y
|
||||
+CONFIG_SCSI=y
|
||||
+CONFIG_CMD_SCSI=y
|
||||
+CONFIG_PHY=y
|
||||
+CONFIG_PHY_MTK_TPHY=y
|
||||
+CONFIG_PHY_FIXED=y
|
||||
+CONFIG_MTK_AHCI=y
|
||||
+CONFIG_DM_ETH=y
|
||||
+CONFIG_MEDIATEK_ETH=y
|
||||
+CONFIG_PCI=y
|
||||
+# CONFIG_MMC is not set
|
||||
+# CONFIG_DM_MMC is not set
|
||||
+CONFIG_MTD=y
|
||||
+CONFIG_MTD_UBI_FASTMAP=y
|
||||
+CONFIG_DM_PCI=y
|
||||
+CONFIG_PCIE_MEDIATEK=y
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_MT7622=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_PRE_CONSOLE_BUFFER=y
|
||||
+CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
|
||||
+CONFIG_MTK_POWER_DOMAIN=y
|
||||
+CONFIG_RAM=y
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_SPI=y
|
||||
+CONFIG_DM_SPI=y
|
||||
+CONFIG_MTK_SPI_NAND=y
|
||||
+CONFIG_MTK_SPI_NAND_MTD=y
|
||||
+CONFIG_SYSRESET_WATCHDOG=y
|
||||
+CONFIG_WDT_MTK=y
|
||||
+CONFIG_LZO=y
|
||||
+CONFIG_ZSTD=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
+CONFIG_RANDOM_UUID=y
|
||||
+CONFIG_REGEX=y
|
||||
+CONFIG_OF_EMBED=y
|
||||
+CONFIG_ENV_OVERWRITE=y
|
||||
+CONFIG_ENV_IS_IN_UBI=y
|
||||
+CONFIG_ENV_UBI_PART="ubi"
|
||||
+CONFIG_ENV_SIZE=0x1f000
|
||||
+CONFIG_ENV_SIZE_REDUND=0x1f000
|
||||
+CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
|
||||
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
+CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_REGMAP=y
|
||||
+CONFIG_SYSCON=y
|
||||
+CONFIG_CLK=y
|
||||
+CONFIG_PHY_FIXED=y
|
||||
+CONFIG_DM_ETH=y
|
||||
+CONFIG_MEDIATEK_ETH=y
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_MT7981=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_MTK_POWER_DOMAIN=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
+CONFIG_USE_DEFAULT_ENV_FILE=y
|
||||
+CONFIG_MTD_SPI_NAND=y
|
||||
+CONFIG_MTK_SPIM=y
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_NAND=y
|
||||
+CONFIG_CMD_NAND_TRIMFFS=y
|
||||
+CONFIG_LMB_MAX_REGIONS=64
|
||||
+CONFIG_USE_IPADDR=y
|
||||
+CONFIG_IPADDR="192.168.1.1"
|
||||
+CONFIG_USE_SERVERIP=y
|
||||
+CONFIG_SERVERIP="192.168.1.254"
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/mt7981-cmcc-rax3000m.dtsi
|
||||
@@ -0,0 +1,85 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-only
|
||||
+/*
|
||||
+ * Copyright (c) 2022 MediaTek Inc.
|
||||
+ * Author: Sam Shih <sam.shih@mediatek.com>
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "mt7981.dtsi"
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/linux-event-codes.h>
|
||||
+
|
||||
+/ {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ model = "CMCC RAX3000M";
|
||||
+ compatible = "mediatek,mt7981", "mediatek,mt7981-rfb";
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = &uart0;
|
||||
+ tick-timer = &timer0;
|
||||
+ };
|
||||
+
|
||||
+ memory@40000000 {
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x40000000 0x20000000>;
|
||||
+ };
|
||||
+
|
||||
+ keys {
|
||||
+ compatible = "gpio-keys";
|
||||
+
|
||||
+ button-reset {
|
||||
+ label = "reset";
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
+ gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ button-mesh {
|
||||
+ label = "mesh";
|
||||
+ linux,code = <BTN_9>;
|
||||
+ linux,input-type = <EV_SW>;
|
||||
+ gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ led-0 {
|
||||
+ label = "green:status";
|
||||
+ gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-1 {
|
||||
+ label = "blue:status";
|
||||
+ gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-2 {
|
||||
+ label = "red:status";
|
||||
+ gpios = <&gpio 35 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+ð {
|
||||
+ status = "okay";
|
||||
+ mediatek,gmac-id = <0>;
|
||||
+ phy-mode = "2500base-x";
|
||||
+ mediatek,switch = "mt7531";
|
||||
+ reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
|
||||
+
|
||||
+ fixed-link {
|
||||
+ speed = <2500>;
|
||||
+ full-duplex;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ mediatek,force-highspeed;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&watchdog {
|
||||
+ status = "disabled";
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/mt7981-cmcc-rax3000m-emmc.dts
|
||||
@@ -0,0 +1,53 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-only
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "mt7981-cmcc-rax3000m.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ reg_3p3v: regulator-3p3v {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "fixed-3.3V";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-always-on;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mmc0 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc0_pins_default>;
|
||||
+ max-frequency = <26000000>;
|
||||
+ bus-width = <8>;
|
||||
+ cap-mmc-hw-reset;
|
||||
+ vmmc-supply = <®_3p3v>;
|
||||
+ non-removable;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ mmc0_pins_default: mmc0default {
|
||||
+ mux {
|
||||
+ function = "flash";
|
||||
+ groups = "emmc_45";
|
||||
+ };
|
||||
+ conf-cmd-dat {
|
||||
+ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO",
|
||||
+ "SPI0_CS", "SPI0_HOLD", "SPI0_WP",
|
||||
+ "SPI1_CLK", "SPI1_MOSI", "SPI1_MISO";
|
||||
+ input-enable;
|
||||
+ drive-strength = <MTK_DRIVE_4mA>;
|
||||
+ bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
|
||||
+ };
|
||||
+ conf-clk {
|
||||
+ pins = "SPI1_CS";
|
||||
+ drive-strength = <MTK_DRIVE_6mA>;
|
||||
+ bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
|
||||
+ };
|
||||
+ conf-rst {
|
||||
+ pins = "PWM0";
|
||||
+ drive-strength = <MTK_DRIVE_4mA>;
|
||||
+ bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/mt7981-cmcc-rax3000m-nand.dts
|
||||
@@ -0,0 +1,77 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-only
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "mt7981-cmcc-rax3000m.dtsi"
|
||||
+
|
||||
+&pinctrl {
|
||||
+ spi_flash_pins: spi0-pins-func-1 {
|
||||
+ mux {
|
||||
+ function = "flash";
|
||||
+ groups = "spi0", "spi0_wp_hold";
|
||||
+ };
|
||||
+
|
||||
+ conf-pu {
|
||||
+ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
|
||||
+ };
|
||||
+
|
||||
+ conf-pd {
|
||||
+ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&spi0 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&spi_flash_pins>;
|
||||
+ status = "okay";
|
||||
+ must_tx;
|
||||
+ enhance_timing;
|
||||
+ dma_ext;
|
||||
+ ipm_design;
|
||||
+ support_quad;
|
||||
+ tick_dly = <2>;
|
||||
+ sample_sel = <0>;
|
||||
+
|
||||
+ spi_nand@0 {
|
||||
+ compatible = "spi-nand";
|
||||
+ reg = <0>;
|
||||
+ spi-max-frequency = <52000000>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ label = "bl2";
|
||||
+ reg = <0x0 0x100000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@100000 {
|
||||
+ label = "orig-env";
|
||||
+ reg = <0x100000 0x80000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@160000 {
|
||||
+ label = "factory";
|
||||
+ reg = <0x180000 0x200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@380000 {
|
||||
+ label = "fip";
|
||||
+ reg = <0x380000 0x200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@580000 {
|
||||
+ label = "ubi";
|
||||
+ reg = <0x580000 0x7200000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/cmcc_rax3000m-emmc_env
|
||||
@@ -0,0 +1,55 @@
|
||||
+ipaddr=192.168.1.1
|
||||
+serverip=192.168.1.254
|
||||
+loadaddr=0x46000000
|
||||
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
|
||||
+bootargs=root=/dev/mmcblk0p65
|
||||
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_emmc ; fi
|
||||
+bootconf=config-1#mt7981b-cmcc-rax3000m-emmc
|
||||
+bootdelay=0
|
||||
+bootfile=openwrt-mediatek-filogic-cmcc_rax3000m-initramfs-recovery.itb
|
||||
+bootfile_bl2=openwrt-mediatek-filogic-cmcc_rax3000m-emmc-preloader.bin
|
||||
+bootfile_fip=openwrt-mediatek-filogic-cmcc_rax3000m-emmc-bl31-uboot.fip
|
||||
+bootfile_upg=openwrt-mediatek-filogic-cmcc_rax3000m-squashfs-sysupgrade.itb
|
||||
+bootled_pwr=red:status
|
||||
+bootled_rec=blue:status
|
||||
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
|
||||
+bootmenu_default=0
|
||||
+bootmenu_delay=0
|
||||
+bootmenu_title= [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) ) [0;36m[eMMC][0m
|
||||
+bootmenu_0=Initialize environment.=run _firstboot
|
||||
+bootmenu_0d=Run default boot command.=run boot_default
|
||||
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
|
||||
+bootmenu_2=Boot production system from eMMC.=run boot_production ; run bootmenu_confirm_return
|
||||
+bootmenu_3=Boot recovery system from eMMC.=run boot_recovery ; run bootmenu_confirm_return
|
||||
+bootmenu_4=Load production system via TFTP then write to eMMC.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_5=Load recovery system via TFTP then write to eMMC.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to eMMC.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
|
||||
+bootmenu_7=[31mLoad BL2 preloader via TFTP then write to eMMC.[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
|
||||
+bootmenu_8=Reboot.=reset
|
||||
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
|
||||
+boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
|
||||
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
|
||||
+boot_production=led $bootled_pwr on ; run emmc_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
|
||||
+boot_recovery=led $bootled_rec on ; run emmc_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off
|
||||
+boot_emmc=run boot_production ; run boot_recovery
|
||||
+boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
|
||||
+boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run emmc_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run emmc_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run emmc_write_fip
|
||||
+boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run emmc_write_bl2
|
||||
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
|
||||
+mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $loadaddr 0x$part_addr 0x$image_size
|
||||
+mmc_read_vol=mmc read $loadaddr $part_addr 0x100 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200
|
||||
+part_default=production
|
||||
+part_recovery=recovery
|
||||
+reset_factory=eraseenv && reset
|
||||
+emmc_read_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_read_vol
|
||||
+emmc_read_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_read_vol
|
||||
+emmc_write_bl2=mmc partconf 0 1 1 1 && mmc erase 0x0 0x400 && mmc write $fileaddr 0x0 0x400 ; mmc partconf 0 1 1 0
|
||||
+emmc_write_fip=mmc erase 0x3400 0x2000 && mmc write $fileaddr 0x3400 0x2000 && mmc erase 0x2000 0x800
|
||||
+emmc_write_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_write_vol
|
||||
+emmc_write_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_write_vol
|
||||
+_init_env=setenv _init_env ; setenv _create_env ; saveenv ; saveenv
|
||||
+_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
|
||||
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
|
||||
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title [33m$ver[0m"
|
||||
--- /dev/null
|
||||
+++ b/cmcc_rax3000m-nand_env
|
||||
@@ -0,0 +1,56 @@
|
||||
+ipaddr=192.168.1.1
|
||||
+serverip=192.168.1.254
|
||||
+loadaddr=0x46000000
|
||||
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
|
||||
+bootconf=config-1#mt7981b-cmcc-rax3000m-nand
|
||||
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
|
||||
+bootdelay=0
|
||||
+bootfile=openwrt-mediatek-filogic-cmcc_rax3000m-initramfs-recovery.itb
|
||||
+bootfile_bl2=openwrt-mediatek-filogic-cmcc_rax3000m-nand-preloader.bin
|
||||
+bootfile_fip=openwrt-mediatek-filogic-cmcc_rax3000m-nand-bl31-uboot.fip
|
||||
+bootfile_upg=openwrt-mediatek-filogic-cmcc_rax3000m-squashfs-sysupgrade.itb
|
||||
+bootled_pwr=red:status
|
||||
+bootled_rec=blue:status
|
||||
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
|
||||
+bootmenu_default=0
|
||||
+bootmenu_delay=0
|
||||
+bootmenu_title= [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) ) [0;36m[SPI-NAND][0m
|
||||
+bootmenu_0=Initialize environment.=run _firstboot
|
||||
+bootmenu_0d=Run default boot command.=run boot_default
|
||||
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
|
||||
+bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
|
||||
+bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
|
||||
+bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to NAND.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
|
||||
+bootmenu_7=[31mLoad BL2 preloader via TFTP then write to NAND.[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
|
||||
+bootmenu_8=Reboot.=reset
|
||||
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
|
||||
+boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
|
||||
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
|
||||
+boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
|
||||
+boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off
|
||||
+boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever
|
||||
+boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
|
||||
+boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
|
||||
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory
|
||||
+boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2
|
||||
+part_default=production
|
||||
+part_recovery=recovery
|
||||
+reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800
|
||||
+mtd_write_fip=mtd erase fip && mtd write fip $loadaddr
|
||||
+mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr
|
||||
+ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic 0 || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic 1 || run ubi_format
|
||||
+ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset
|
||||
+ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi
|
||||
+ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs
|
||||
+ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery
|
||||
+ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data
|
||||
+ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic 2 && ubi write $loadaddr fit $filesize
|
||||
+ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic 3 && ubi write $loadaddr recovery $filesize
|
||||
+_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
|
||||
+_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
|
||||
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
|
||||
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title [33m$ver[0m"
|
||||
@@ -8,9 +8,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ath11k-firmware
|
||||
PKG_SOURCE_DATE:=2023-07-06
|
||||
PKG_SOURCE_VERSION:=69f6b7346b64784188dba791a9cfb614eefa441f
|
||||
PKG_MIRROR_HASH:=0f0203f755cb6713f6a1f41397dcd0f1a24e5cdbe75258af961343b927ebb3e9
|
||||
PKG_SOURCE_DATE:=2023-03-31
|
||||
PKG_SOURCE_VERSION:=a039049a9349722fa5c74185452ab04644a0d351
|
||||
PKG_MIRROR_HASH:=ed401e3f6e91d70565b3396139193f7e815f410db93700697205ac8ed1b828c5
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
@@ -60,14 +60,14 @@ $(eval $(call Download,qcn9074-board))
|
||||
define Package/ath11k-firmware-ipq8074/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/IPQ8074
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath11k-firmware/IPQ8074/hw2.0/2.9.0.1/WLAN.HK.2.9.0.1-01837-QCAHKSWPL_SILICONZ-1/* \
|
||||
$(PKG_BUILD_DIR)/ath11k-firmware/IPQ8074/hw2.0/testing/2.9.0.1/WLAN.HK.2.9.0.1-01385-QCAHKSWPL_SILICONZ-1/* \
|
||||
$(1)/lib/firmware/IPQ8074/
|
||||
endef
|
||||
|
||||
define Package/ath11k-firmware-qcn9074/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath11k/QCN9074/hw1.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath11k-firmware/QCN9074/hw1.0/2.9.0.1/WLAN.HK.2.9.0.1-01837-QCAHKSWPL_SILICONZ-1/* \
|
||||
$(PKG_BUILD_DIR)/ath11k-firmware/QCN9074/hw1.0/testing/2.9.0.1/WLAN.HK.2.9.0.1-01385-QCAHKSWPL_SILICONZ-1/* \
|
||||
$(1)/lib/firmware/ath11k/QCN9074/hw1.0/
|
||||
$(INSTALL_BIN) \
|
||||
$(DL_DIR)/$(QCN9074_BOARD_FILE) $(1)/lib/firmware/ath11k/QCN9074/hw1.0/board-2.bin
|
||||
|
||||
@@ -15,6 +15,7 @@ PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).1.tar.xz
|
||||
PKG_SOURCE_URL:=@DEBIAN/pool/non-free-firmware/i/intel-microcode/
|
||||
PKG_HASH:=29e77c275b3f60a691832c0844f70effbd94a4594d04af21e0c2e6e0c1ac1894
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/intel-microcode-3.$(PKG_VERSION).1
|
||||
PKG_CPE_ID:=cpe:/a:intel:microcode
|
||||
|
||||
PKG_BUILD_DEPENDS:=iucode-tool/host
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/version.mk
|
||||
|
||||
PKG_NAME:=ipq-wifi
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
|
||||
PKG_SOURCE_DATE:=2023-06-03
|
||||
PKG_SOURCE_VERSION:=cd9c30ca47b8e5388b770c523a7f6b8b969e2f92
|
||||
PKG_MIRROR_HASH:=45e623fcc512b514ade0f22e217275536aa8de4afba7dfdb11696482b8fa71a2
|
||||
PKG_SOURCE_DATE:=2023-11-10
|
||||
PKG_SOURCE_VERSION:=0c2e810e71ed0a59fb00246c7fa2c236ff67a0ee
|
||||
PKG_MIRROR_HASH:=fc6016540bd2c67484952d0e4432d740f0e022d9b688e851bb6321def8d36844
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
@@ -41,6 +41,7 @@ ALLWIFIBOARDS:= \
|
||||
xiaomi_ax3600 \
|
||||
xiaomi_ax9000 \
|
||||
zte_mf289f \
|
||||
zte_mf287 \
|
||||
zte_mf287plus \
|
||||
zyxel_nbg7815
|
||||
|
||||
@@ -129,6 +130,7 @@ $(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9))
|
||||
$(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600))
|
||||
$(eval $(call generate-ipq-wifi-package,xiaomi_ax9000,Xiaomi AX9000))
|
||||
$(eval $(call generate-ipq-wifi-package,zte_mf289f,ZTE MF289F))
|
||||
$(eval $(call generate-ipq-wifi-package,zte_mf287,ZTE MF287))
|
||||
$(eval $(call generate-ipq-wifi-package,zte_mf287plus,ZTE MF287Plus))
|
||||
$(eval $(call generate-ipq-wifi-package,zyxel_nbg7815,Zyxel NBG7815))
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wireless-regdb
|
||||
PKG_VERSION:=2023.05.03
|
||||
PKG_VERSION:=2023.09.01
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/software/network/wireless-regdb/
|
||||
PKG_HASH:=f254d08ab3765aeae2b856222e11a95d44aef519a6663877c71ef68fae4c8c12
|
||||
PKG_HASH:=26d4c2a727cc59239b84735aad856b7c7d0b04e30aa5c235c4f7f47f5f053491
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
|
||||
@@ -1013,31 +1013,33 @@ define KernelPackage/zram/description
|
||||
endef
|
||||
|
||||
define KernelPackage/zram/config
|
||||
choice
|
||||
prompt "ZRAM Default compressor"
|
||||
default ZRAM_DEF_COMP_LZORLE
|
||||
if PACKAGE_kmod-zram
|
||||
choice
|
||||
prompt "ZRAM Default compressor"
|
||||
default ZRAM_DEF_COMP_LZORLE
|
||||
|
||||
config ZRAM_DEF_COMP_LZORLE
|
||||
config ZRAM_DEF_COMP_LZORLE
|
||||
bool "lzo-rle"
|
||||
select PACKAGE_kmod-lib-lzo
|
||||
|
||||
config ZRAM_DEF_COMP_LZO
|
||||
config ZRAM_DEF_COMP_LZO
|
||||
bool "lzo"
|
||||
select PACKAGE_kmod-lib-lzo
|
||||
|
||||
config ZRAM_DEF_COMP_LZ4
|
||||
config ZRAM_DEF_COMP_LZ4
|
||||
bool "lz4"
|
||||
select PACKAGE_kmod-lib-lz4
|
||||
|
||||
config ZRAM_DEF_COMP_LZ4HC
|
||||
config ZRAM_DEF_COMP_LZ4HC
|
||||
bool "lz4-hc"
|
||||
select PACKAGE_kmod-lib-lz4hc
|
||||
|
||||
config ZRAM_DEF_COMP_ZSTD
|
||||
config ZRAM_DEF_COMP_ZSTD
|
||||
bool "zstd"
|
||||
select PACKAGE_kmod-lib-zstd
|
||||
|
||||
endchoice
|
||||
endchoice
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,zram))
|
||||
|
||||
@@ -77,13 +77,11 @@ $(eval $(call KernelPackage,kvm-amd))
|
||||
define KernelPackage/vfio
|
||||
SUBMENU:=Virtualization
|
||||
TITLE:=VFIO Non-Privileged userspace driver framework
|
||||
DEPENDS:=@TARGET_x86_64
|
||||
DEPENDS:=@TARGET_x86_64||TARGET_armsr_armv8
|
||||
KCONFIG:= \
|
||||
CONFIG_VFIO \
|
||||
CONFIG_VFIO_NOIOMMU=n \
|
||||
CONFIG_VFIO_MDEV=n
|
||||
MODPARAMS.vfio:=\
|
||||
enable_unsafe_noiommu_mode=n
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/drivers/vfio/vfio.ko \
|
||||
$(LINUX_DIR)/drivers/vfio/vfio_virqfd.ko \
|
||||
@@ -101,7 +99,7 @@ $(eval $(call KernelPackage,vfio))
|
||||
define KernelPackage/vfio-pci
|
||||
SUBMENU:=Virtualization
|
||||
TITLE:=Generic VFIO support for any PCI device
|
||||
DEPENDS:=@TARGET_x86_64 @PCI_SUPPORT +kmod-vfio +kmod-irqbypass
|
||||
DEPENDS:=@TARGET_x86_64||TARGET_armsr_armv8 @PCI_SUPPORT +kmod-vfio +kmod-irqbypass
|
||||
KCONFIG:= \
|
||||
CONFIG_VFIO_PCI \
|
||||
CONFIG_VFIO_PCI_IGD=n
|
||||
@@ -117,3 +115,27 @@ define KernelPackage/vfio-pci/description
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,vfio-pci))
|
||||
|
||||
|
||||
define KernelPackage/vhost
|
||||
SUBMENU:=Virtualization
|
||||
TITLE:=Host kernel accelerator for virtio (base)
|
||||
KCONFIG:=CONFIG_VHOST
|
||||
FILES:=$(LINUX_DIR)/drivers/vhost/vhost.ko \
|
||||
$(LINUX_DIR)/drivers/vhost/vhost_iotlb.ko
|
||||
AUTOLOAD:=$(call AutoProbe,vhost vhost_iotlb)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,vhost))
|
||||
|
||||
|
||||
define KernelPackage/vhost-net
|
||||
SUBMENU:=Virtualization
|
||||
TITLE:=Host kernel accelerator for virtio-net
|
||||
DEPENDS:=+kmod-tun +kmod-vhost
|
||||
KCONFIG:=CONFIG_VHOST_NET
|
||||
FILES:=$(LINUX_DIR)/drivers/vhost/vhost_net.ko
|
||||
AUTOLOAD:=$(call AutoProbe,vhost_net)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,vhost-net))
|
||||
|
||||
@@ -15,12 +15,9 @@ MP_CONFIG_INT="mesh_retry_timeout mesh_confirm_timeout mesh_holding_timeout mesh
|
||||
MP_CONFIG_BOOL="mesh_auto_open_plinks mesh_fwding"
|
||||
MP_CONFIG_STRING="mesh_power_mode"
|
||||
|
||||
NEWAPLIST=
|
||||
OLDAPLIST=
|
||||
NEWSPLIST=
|
||||
OLDSPLIST=
|
||||
NEWUMLIST=
|
||||
OLDUMLIST=
|
||||
wdev_tool() {
|
||||
ucode /usr/share/hostap/wdev.uc "$@"
|
||||
}
|
||||
|
||||
drv_mac80211_init_device_config() {
|
||||
hostapd_common_add_device_config
|
||||
@@ -29,7 +26,8 @@ drv_mac80211_init_device_config() {
|
||||
config_add_string tx_burst
|
||||
config_add_string distance
|
||||
config_add_int beacon_int chanbw frag rts
|
||||
config_add_int rxantenna txantenna antenna_gain txpower min_tx_power
|
||||
config_add_int rxantenna txantenna txpower min_tx_power
|
||||
config_add_int num_global_macaddr multiple_bssid
|
||||
config_add_boolean noscan ht_coex acs_exclude_dfs background_radar
|
||||
config_add_array ht_capab
|
||||
config_add_array channels
|
||||
@@ -490,12 +488,12 @@ ${channel:+channel=$channel}
|
||||
${channel_list:+chanlist=$channel_list}
|
||||
${hostapd_noscan:+noscan=1}
|
||||
${tx_burst:+tx_queue_data2_burst=$tx_burst}
|
||||
${multiple_bssid:+mbssid=$multiple_bssid}
|
||||
#num_global_macaddr=$num_global_macaddr
|
||||
$base_cfg
|
||||
|
||||
EOF
|
||||
json_select ..
|
||||
radio_md5sum=$(md5sum $hostapd_conf_file | cut -d" " -f1)
|
||||
echo "radio_config_id=${radio_md5sum}" >> $hostapd_conf_file
|
||||
}
|
||||
|
||||
mac80211_hostapd_setup_bss() {
|
||||
@@ -522,6 +520,7 @@ mac80211_hostapd_setup_bss() {
|
||||
cat >> /var/run/hostapd-$phy.conf <<EOF
|
||||
$hostapd_cfg
|
||||
bssid=$macaddr
|
||||
${default_macaddr:+#default_macaddr}
|
||||
${dtim_period:+dtim_period=$dtim_period}
|
||||
${max_listen_int:+max_listen_interval=$max_listen_int}
|
||||
EOF
|
||||
@@ -538,47 +537,7 @@ mac80211_generate_mac() {
|
||||
local phy="$1"
|
||||
local id="${macidx:-0}"
|
||||
|
||||
local ref="$(cat /sys/class/ieee80211/${phy}/macaddress)"
|
||||
local mask="$(cat /sys/class/ieee80211/${phy}/address_mask)"
|
||||
|
||||
[ "$mask" = "00:00:00:00:00:00" ] && {
|
||||
mask="ff:ff:ff:ff:ff:ff";
|
||||
|
||||
[ "$(wc -l < /sys/class/ieee80211/${phy}/addresses)" -gt $id ] && {
|
||||
addr="$(mac80211_get_addr "$phy" "$id")"
|
||||
[ -n "$addr" ] && {
|
||||
echo "$addr"
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local oIFS="$IFS"; IFS=":"; set -- $mask; IFS="$oIFS"
|
||||
|
||||
local mask1=$1
|
||||
local mask6=$6
|
||||
|
||||
local oIFS="$IFS"; IFS=":"; set -- $ref; IFS="$oIFS"
|
||||
|
||||
macidx=$(($id + 1))
|
||||
[ "$((0x$mask1))" -gt 0 ] && {
|
||||
b1="0x$1"
|
||||
[ "$id" -gt 0 ] && \
|
||||
b1=$(($b1 ^ ((($id - !($b1 & 2)) << 2)) | 0x2))
|
||||
printf "%02x:%s:%s:%s:%s:%s" $b1 $2 $3 $4 $5 $6
|
||||
return
|
||||
}
|
||||
|
||||
[ "$((0x$mask6))" -lt 255 ] && {
|
||||
printf "%s:%s:%s:%s:%s:%02x" $1 $2 $3 $4 $5 $(( 0x$6 ^ $id ))
|
||||
return
|
||||
}
|
||||
|
||||
off2=$(( (0x$6 + $id) / 0x100 ))
|
||||
printf "%s:%s:%s:%s:%02x:%02x" \
|
||||
$1 $2 $3 $4 \
|
||||
$(( (0x$5 + $off2) % 0x100 )) \
|
||||
$(( (0x$6 + $id) % 0x100 ))
|
||||
wdev_tool "$phy" get_macaddr id=$id num_global=$num_global_macaddr mbssid=${multiple_bssid:-0}
|
||||
}
|
||||
|
||||
get_board_phy_name() (
|
||||
@@ -661,74 +620,6 @@ mac80211_check_ap() {
|
||||
has_ap=1
|
||||
}
|
||||
|
||||
mac80211_iw_interface_add() {
|
||||
local phy="$1"
|
||||
local ifname="$2"
|
||||
local type="$3"
|
||||
local wdsflag="$4"
|
||||
local rc
|
||||
local oldifname
|
||||
|
||||
iw phy "$phy" interface add "$ifname" type "$type" $wdsflag >/dev/null 2>&1
|
||||
rc="$?"
|
||||
|
||||
[ "$rc" = 233 ] && {
|
||||
# Device might have just been deleted, give the kernel some time to finish cleaning it up
|
||||
sleep 1
|
||||
|
||||
iw phy "$phy" interface add "$ifname" type "$type" $wdsflag >/dev/null 2>&1
|
||||
rc="$?"
|
||||
}
|
||||
|
||||
[ "$rc" = 233 ] && {
|
||||
# Keep matching pre-existing interface
|
||||
[ -d "/sys/class/ieee80211/${phy}/device/net/${ifname}" ] && \
|
||||
case "$(iw dev $ifname info | grep "^\ttype" | cut -d' ' -f2- 2>/dev/null)" in
|
||||
"AP")
|
||||
[ "$type" = "__ap" ] && rc=0
|
||||
;;
|
||||
"IBSS")
|
||||
[ "$type" = "adhoc" ] && rc=0
|
||||
;;
|
||||
"managed")
|
||||
[ "$type" = "managed" ] && rc=0
|
||||
;;
|
||||
"mesh point")
|
||||
[ "$type" = "mp" ] && rc=0
|
||||
;;
|
||||
"monitor")
|
||||
[ "$type" = "monitor" ] && rc=0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
[ "$rc" = 233 ] && {
|
||||
iw dev "$ifname" del >/dev/null 2>&1
|
||||
[ "$?" = 0 ] && {
|
||||
sleep 1
|
||||
|
||||
iw phy "$phy" interface add "$ifname" type "$type" $wdsflag >/dev/null 2>&1
|
||||
rc="$?"
|
||||
}
|
||||
}
|
||||
|
||||
[ "$rc" != 0 ] && {
|
||||
# Device might not support virtual interfaces, so the interface never got deleted in the first place.
|
||||
# Check if the interface already exists, and avoid failing in this case.
|
||||
[ -d "/sys/class/ieee80211/${phy}/device/net/${ifname}" ] && rc=0
|
||||
}
|
||||
|
||||
[ "$rc" != 0 ] && {
|
||||
# Device doesn't support virtual interfaces and may have existing interface other than ifname.
|
||||
oldifname="$(basename "/sys/class/ieee80211/${phy}/device/net"/* 2>/dev/null)"
|
||||
[ "$oldifname" ] && ip link set "$oldifname" name "$ifname" 1>/dev/null 2>&1
|
||||
rc="$?"
|
||||
}
|
||||
|
||||
[ "$rc" != 0 ] && echo "Failed to create interface $ifname"
|
||||
return $rc
|
||||
}
|
||||
|
||||
mac80211_set_ifname() {
|
||||
local phy="$1"
|
||||
local prefix="$2"
|
||||
@@ -752,21 +643,23 @@ mac80211_prepare_vif() {
|
||||
mac80211_set_ifname "$phy" "$prefix"
|
||||
}
|
||||
|
||||
append active_ifnames "$ifname"
|
||||
set_default wds 0
|
||||
set_default powersave 0
|
||||
json_add_string _ifname "$ifname"
|
||||
|
||||
json_select ..
|
||||
|
||||
default_macaddr=
|
||||
if [ -z "$macaddr" ]; then
|
||||
macaddr="$(mac80211_generate_mac $phy)"
|
||||
macidx="$(($macidx + 1))"
|
||||
default_macaddr=1
|
||||
elif [ "$macaddr" = 'random' ]; then
|
||||
macaddr="$(macaddr_random)"
|
||||
fi
|
||||
json_add_string _macaddr "$macaddr"
|
||||
json_add_string _default_macaddr "$default_macaddr"
|
||||
json_select ..
|
||||
|
||||
json_add_object data
|
||||
json_add_string ifname "$ifname"
|
||||
json_close_object
|
||||
|
||||
[ "$mode" == "ap" ] && {
|
||||
[ -z "$wpa_psk_file" ] && hostapd_set_psk "$ifname"
|
||||
@@ -777,9 +670,6 @@ mac80211_prepare_vif() {
|
||||
|
||||
# It is far easier to delete and create the desired interface
|
||||
case "$mode" in
|
||||
adhoc)
|
||||
mac80211_iw_interface_add "$phy" "$ifname" adhoc || return
|
||||
;;
|
||||
ap)
|
||||
# Hostapd will handle recreating the interface and
|
||||
# subsequent virtual APs belonging to the same PHY
|
||||
@@ -791,114 +681,16 @@ mac80211_prepare_vif() {
|
||||
|
||||
mac80211_hostapd_setup_bss "$phy" "$ifname" "$macaddr" "$type" || return
|
||||
|
||||
NEWAPLIST="${NEWAPLIST}$ifname "
|
||||
[ -n "$hostapd_ctrl" ] || {
|
||||
ap_ifname="${ifname}"
|
||||
hostapd_ctrl="${hostapd_ctrl:-/var/run/hostapd/$ifname}"
|
||||
}
|
||||
;;
|
||||
mesh)
|
||||
mac80211_iw_interface_add "$phy" "$ifname" mp || return
|
||||
;;
|
||||
monitor)
|
||||
mac80211_iw_interface_add "$phy" "$ifname" monitor || return
|
||||
;;
|
||||
sta)
|
||||
local wdsflag=
|
||||
[ "$enable" = 0 ] || staidx="$(($staidx + 1))"
|
||||
[ "$wds" -gt 0 ] && wdsflag="4addr on"
|
||||
mac80211_iw_interface_add "$phy" "$ifname" managed "$wdsflag" || return
|
||||
if [ "$wds" -gt 0 ]; then
|
||||
iw "$ifname" set 4addr on
|
||||
else
|
||||
iw "$ifname" set 4addr off
|
||||
fi
|
||||
[ "$powersave" -gt 0 ] && powersave="on" || powersave="off"
|
||||
iw "$ifname" set power_save "$powersave"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$mode" in
|
||||
monitor|mesh)
|
||||
[ "$auto_channel" -gt 0 ] || iw dev "$ifname" set channel "$channel" $iw_htmode
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$mode" != "ap" ]; then
|
||||
# ALL ap functionality will be passed to hostapd
|
||||
# All interfaces must have unique mac addresses
|
||||
# which can either be explicitly set in the device
|
||||
# section, or automatically generated
|
||||
ip link set dev "$ifname" address "$macaddr"
|
||||
fi
|
||||
|
||||
json_select ..
|
||||
}
|
||||
|
||||
mac80211_setup_supplicant() {
|
||||
local enable=$1
|
||||
local add_sp=0
|
||||
local spobj="$(ubus -S list | grep wpa_supplicant.${ifname})"
|
||||
|
||||
[ "$enable" = 0 ] && {
|
||||
ubus call wpa_supplicant.${phy} config_remove "{\"iface\":\"$ifname\"}"
|
||||
ip link set dev "$ifname" down
|
||||
iw dev "$ifname" del
|
||||
return 0
|
||||
}
|
||||
|
||||
wpa_supplicant_prepare_interface "$ifname" nl80211 || {
|
||||
iw dev "$ifname" del
|
||||
return 1
|
||||
}
|
||||
if [ "$mode" = "sta" ]; then
|
||||
wpa_supplicant_add_network "$ifname"
|
||||
else
|
||||
wpa_supplicant_add_network "$ifname" "$freq" "$htmode" "$noscan"
|
||||
fi
|
||||
|
||||
NEWSPLIST="${NEWSPLIST}$ifname "
|
||||
|
||||
if [ "${NEWAPLIST%% *}" != "${OLDAPLIST%% *}" ]; then
|
||||
[ "$spobj" ] && ubus call wpa_supplicant config_remove "{\"iface\":\"$ifname\"}"
|
||||
add_sp=1
|
||||
fi
|
||||
[ -z "$spobj" ] && add_sp=1
|
||||
|
||||
NEW_MD5_SP=$(test -e "${_config}" && md5sum ${_config})
|
||||
OLD_MD5_SP=$(uci -q -P /var/state get wireless._${phy}.md5_${ifname})
|
||||
if [ "$add_sp" = "1" ]; then
|
||||
wpa_supplicant_run "$ifname" "$hostapd_ctrl"
|
||||
else
|
||||
[ "${NEW_MD5_SP}" == "${OLD_MD5_SP}" ] || ubus call $spobj reload
|
||||
fi
|
||||
uci -q -P /var/state set wireless._${phy}.md5_${ifname}="${NEW_MD5_SP}"
|
||||
return 0
|
||||
}
|
||||
|
||||
mac80211_setup_supplicant_noctl() {
|
||||
local enable=$1
|
||||
local spobj="$(ubus -S list | grep wpa_supplicant.${ifname})"
|
||||
wpa_supplicant_prepare_interface "$ifname" nl80211 || {
|
||||
iw dev "$ifname" del
|
||||
return 1
|
||||
}
|
||||
|
||||
wpa_supplicant_add_network "$ifname" "$freq" "$htmode" "$noscan"
|
||||
|
||||
NEWSPLIST="${NEWSPLIST}$ifname "
|
||||
[ "$enable" = 0 ] && {
|
||||
ubus call wpa_supplicant config_remove "{\"iface\":\"$ifname\"}"
|
||||
ip link set dev "$ifname" down
|
||||
return 0
|
||||
}
|
||||
if [ -z "$spobj" ]; then
|
||||
wpa_supplicant_run "$ifname"
|
||||
else
|
||||
ubus call $spobj reload
|
||||
fi
|
||||
}
|
||||
|
||||
mac80211_prepare_iw_htmode() {
|
||||
case "$htmode" in
|
||||
VHT20|HT20|HE20) iw_htmode=HT20;;
|
||||
@@ -936,6 +728,13 @@ mac80211_prepare_iw_htmode() {
|
||||
esac
|
||||
}
|
||||
|
||||
mac80211_add_mesh_params() {
|
||||
for var in $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING; do
|
||||
eval "mp_val=\"\$$var\""
|
||||
[ -n "$mp_val" ] && json_add_string "$var" "$mp_val"
|
||||
done
|
||||
}
|
||||
|
||||
mac80211_setup_adhoc() {
|
||||
local enable=$1
|
||||
json_get_vars bssid ssid key mcast_rate
|
||||
@@ -977,82 +776,215 @@ mac80211_setup_adhoc() {
|
||||
mcval=
|
||||
[ -n "$mcast_rate" ] && wpa_supplicant_add_rate mcval "$mcast_rate"
|
||||
|
||||
iw dev "$ifname" set type ibss
|
||||
iw dev "$ifname" ibss join "$ssid" $freq $iw_htmode fixed-freq $bssid \
|
||||
beacon-interval $beacon_int \
|
||||
${brstr:+basic-rates $brstr} \
|
||||
${mcval:+mcast-rate $mcval} \
|
||||
${keyspec:+keys $keyspec}
|
||||
local prev
|
||||
json_set_namespace wdev_uc prev
|
||||
|
||||
json_add_object "$ifname"
|
||||
json_add_string mode adhoc
|
||||
[ -n "$default_macaddr" ] || json_add_string macaddr "$macaddr"
|
||||
json_add_string ssid "$ssid"
|
||||
json_add_string freq "$freq"
|
||||
json_add_string htmode "$iw_htmode"
|
||||
[ -n "$bssid" ] && json_add_string bssid "$bssid"
|
||||
json_add_int beacon-interval "$beacon_int"
|
||||
[ -n "$brstr" ] && json_add_string basic-rates "$brstr"
|
||||
[ -n "$mcval" ] && json_add_string mcast-rate "$mcval"
|
||||
[ -n "$keyspec" ] && json_add_string keys "$keyspec"
|
||||
json_close_object
|
||||
|
||||
json_set_namespace "$prev"
|
||||
}
|
||||
|
||||
mac80211_setup_mesh() {
|
||||
local enable=$1
|
||||
json_get_vars ssid mesh_id mcast_rate
|
||||
|
||||
NEWUMLIST="${NEWUMLIST}$ifname "
|
||||
|
||||
[ "$enable" = 0 ] && {
|
||||
ip link set dev "$ifname" down
|
||||
return 0
|
||||
}
|
||||
|
||||
mcval=
|
||||
[ -n "$mcast_rate" ] && wpa_supplicant_add_rate mcval "$mcast_rate"
|
||||
[ -n "$mesh_id" ] && ssid="$mesh_id"
|
||||
|
||||
iw dev "$ifname" mesh join "$ssid" freq $freq $iw_htmode \
|
||||
${mcval:+mcast-rate $mcval} \
|
||||
beacon-interval $beacon_int
|
||||
local prev
|
||||
json_set_namespace wdev_uc prev
|
||||
|
||||
json_add_object "$ifname"
|
||||
json_add_string mode mesh
|
||||
[ -n "$default_macaddr" ] || json_add_string macaddr "$macaddr"
|
||||
json_add_string ssid "$ssid"
|
||||
json_add_string freq "$freq"
|
||||
json_add_string htmode "$iw_htmode"
|
||||
[ -n "$mcval" ] && json_add_string mcast-rate "$mcval"
|
||||
json_add_int beacon-interval "$beacon_int"
|
||||
mac80211_add_mesh_params
|
||||
|
||||
json_close_object
|
||||
|
||||
json_set_namespace "$prev"
|
||||
}
|
||||
|
||||
mac80211_setup_monitor() {
|
||||
local prev
|
||||
json_set_namespace wdev_uc prev
|
||||
|
||||
json_add_object "$ifname"
|
||||
json_add_string mode monitor
|
||||
[ -n "$freq" ] && json_add_string freq "$freq"
|
||||
json_add_string htmode "$iw_htmode"
|
||||
json_close_object
|
||||
|
||||
json_set_namespace "$prev"
|
||||
}
|
||||
|
||||
mac80211_set_vif_txpower() {
|
||||
local name="$1"
|
||||
|
||||
json_select config
|
||||
json_get_var ifname _ifname
|
||||
json_get_vars vif_txpower
|
||||
json_select ..
|
||||
|
||||
[ -z "$vif_txpower" ] || iw dev "$ifname" set txpower fixed "${vif_txpower%%.*}00"
|
||||
}
|
||||
|
||||
wpa_supplicant_init_config() {
|
||||
json_set_namespace wpa_supp prev
|
||||
|
||||
json_init
|
||||
json_add_array config
|
||||
|
||||
json_set_namespace "$prev"
|
||||
}
|
||||
|
||||
wpa_supplicant_add_interface() {
|
||||
local ifname="$1"
|
||||
local mode="$2"
|
||||
local prev
|
||||
|
||||
_wpa_supplicant_common "$ifname"
|
||||
|
||||
json_set_namespace wpa_supp prev
|
||||
|
||||
json_add_object
|
||||
json_add_string ctrl "$_rpath"
|
||||
json_add_string iface "$ifname"
|
||||
json_add_string mode "$mode"
|
||||
json_add_string config "$_config"
|
||||
[ -n "$default_macaddr" ] || json_add_string macaddr "$macaddr"
|
||||
[ -n "$network_bridge" ] && json_add_string bridge "$network_bridge"
|
||||
[ -n "$wds" ] && json_add_boolean 4addr "$wds"
|
||||
json_add_boolean powersave "$powersave"
|
||||
[ "$mode" = "mesh" ] && mac80211_add_mesh_params
|
||||
json_close_object
|
||||
|
||||
json_set_namespace "$prev"
|
||||
|
||||
wpa_supp_init=1
|
||||
}
|
||||
|
||||
wpa_supplicant_set_config() {
|
||||
local phy="$1"
|
||||
local prev
|
||||
|
||||
json_set_namespace wpa_supp prev
|
||||
json_close_array
|
||||
json_add_string phy "$phy"
|
||||
json_add_boolean defer 1
|
||||
local data="$(json_dump)"
|
||||
|
||||
json_cleanup
|
||||
json_set_namespace "$prev"
|
||||
|
||||
ubus -S -t 0 wait_for wpa_supplicant || {
|
||||
[ -n "$wpa_supp_init" ] || return 0
|
||||
|
||||
ubus wait_for wpa_supplicant
|
||||
}
|
||||
|
||||
local supplicant_res="$(ubus call wpa_supplicant config_set "$data")"
|
||||
ret="$?"
|
||||
[ "$ret" != 0 -o -z "$supplicant_res" ] && wireless_setup_vif_failed WPA_SUPPLICANT_FAILED
|
||||
|
||||
wireless_add_process "$(jsonfilter -s "$supplicant_res" -l 1 -e @.pid)" "/usr/sbin/wpa_supplicant" 1 1
|
||||
|
||||
}
|
||||
|
||||
hostapd_set_config() {
|
||||
[ -n "$hostapd_ctrl" ] || {
|
||||
ubus call hostapd config_set '{ "phy": "'"$phy"'", "config": "", "prev_config": "'"${hostapd_conf_file}.prev"'" }' > /dev/null
|
||||
return 0;
|
||||
}
|
||||
|
||||
ubus wait_for hostapd
|
||||
local hostapd_res="$(ubus call hostapd config_set "{ \"phy\": \"$phy\", \"config\":\"${hostapd_conf_file}\", \"prev_config\": \"${hostapd_conf_file}.prev\"}")"
|
||||
ret="$?"
|
||||
[ "$ret" != 0 -o -z "$hostapd_res" ] && {
|
||||
wireless_setup_failed HOSTAPD_START_FAILED
|
||||
return
|
||||
}
|
||||
wireless_add_process "$(jsonfilter -s "$hostapd_res" -l 1 -e @.pid)" "/usr/sbin/hostapd" 1 1
|
||||
}
|
||||
|
||||
|
||||
wpa_supplicant_start() {
|
||||
local phy="$1"
|
||||
|
||||
[ -n "$wpa_supp_init" ] || return 0
|
||||
|
||||
ubus call wpa_supplicant config_set '{ "phy": "'"$phy"'" }' > /dev/null
|
||||
}
|
||||
|
||||
mac80211_setup_supplicant() {
|
||||
local enable=$1
|
||||
local add_sp=0
|
||||
|
||||
wpa_supplicant_prepare_interface "$ifname" nl80211 || return 1
|
||||
|
||||
if [ "$mode" = "sta" ]; then
|
||||
wpa_supplicant_add_network "$ifname"
|
||||
else
|
||||
wpa_supplicant_add_network "$ifname" "$freq" "$htmode" "$hostapd_noscan"
|
||||
fi
|
||||
|
||||
wpa_supplicant_add_interface "$ifname" "$mode"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
mac80211_setup_vif() {
|
||||
local name="$1"
|
||||
local failed
|
||||
local action=up
|
||||
|
||||
json_select data
|
||||
json_get_vars ifname
|
||||
json_select ..
|
||||
|
||||
json_select config
|
||||
json_get_vars mode
|
||||
json_get_var vif_txpower
|
||||
json_get_var vif_enable enable 1
|
||||
json_get_var ifname _ifname
|
||||
json_get_var macaddr _macaddr
|
||||
json_get_var default_macaddr _default_macaddr
|
||||
json_get_vars mode wds powersave
|
||||
|
||||
[ "$vif_enable" = 1 ] || action=down
|
||||
if [ "$mode" != "ap" ] || [ "$ifname" = "$ap_ifname" ]; then
|
||||
ip link set dev "$ifname" "$action" || {
|
||||
wireless_setup_vif_failed IFUP_ERROR
|
||||
json_select ..
|
||||
return
|
||||
}
|
||||
[ -z "$vif_txpower" ] || iw dev "$ifname" set txpower fixed "${vif_txpower%%.*}00"
|
||||
fi
|
||||
set_default powersave 0
|
||||
set_default wds 0
|
||||
|
||||
case "$mode" in
|
||||
mesh)
|
||||
json_get_vars $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING
|
||||
wireless_vif_parse_encryption
|
||||
[ -z "$htmode" ] && htmode="NOHT";
|
||||
if wpa_supplicant -vmesh || [ "$wpa" -gt 0 -o "$auto_channel" -gt 0 ] || chan_is_dfs "$phy" "$channel"; then
|
||||
mac80211_setup_supplicant $vif_enable || failed=1
|
||||
if wpa_supplicant -vmesh; then
|
||||
mac80211_setup_supplicant || failed=1
|
||||
else
|
||||
mac80211_setup_mesh $vif_enable
|
||||
mac80211_setup_mesh
|
||||
fi
|
||||
for var in $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING; do
|
||||
json_get_var mp_val "$var"
|
||||
[ -n "$mp_val" ] && iw dev "$ifname" set mesh_param "$var" "$mp_val"
|
||||
done
|
||||
;;
|
||||
adhoc)
|
||||
wireless_vif_parse_encryption
|
||||
if [ "$wpa" -gt 0 -o "$auto_channel" -gt 0 ]; then
|
||||
mac80211_setup_supplicant_noctl $vif_enable || failed=1
|
||||
mac80211_setup_supplicant || failed=1
|
||||
else
|
||||
mac80211_setup_adhoc $vif_enable
|
||||
mac80211_setup_adhoc
|
||||
fi
|
||||
;;
|
||||
sta)
|
||||
mac80211_setup_supplicant $vif_enable || failed=1
|
||||
mac80211_setup_supplicant || failed=1
|
||||
;;
|
||||
monitor)
|
||||
mac80211_setup_monitor
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1085,7 +1017,6 @@ band_match && $3 == "MHz" && $4 == channel {
|
||||
'
|
||||
}
|
||||
|
||||
|
||||
chan_is_dfs() {
|
||||
local phy="$1"
|
||||
local chan="$2"
|
||||
@@ -1093,27 +1024,6 @@ chan_is_dfs() {
|
||||
return $!
|
||||
}
|
||||
|
||||
mac80211_vap_cleanup() {
|
||||
local service="$1"
|
||||
local vaps="$2"
|
||||
|
||||
for wdev in $vaps; do
|
||||
[ "$service" != "none" ] && ubus call ${service} config_remove "{\"iface\":\"$wdev\"}"
|
||||
ip link set dev "$wdev" down 2>/dev/null
|
||||
iw dev "$wdev" del
|
||||
done
|
||||
}
|
||||
|
||||
mac80211_interface_cleanup() {
|
||||
local phy="$1"
|
||||
local primary_ap=$(uci -q -P /var/state get wireless._${phy}.aplist)
|
||||
primary_ap=${primary_ap%% *}
|
||||
|
||||
mac80211_vap_cleanup hostapd "${primary_ap}"
|
||||
mac80211_vap_cleanup wpa_supplicant "$(uci -q -P /var/state get wireless._${phy}.splist)"
|
||||
mac80211_vap_cleanup none "$(uci -q -P /var/state get wireless._${phy}.umlist)"
|
||||
}
|
||||
|
||||
mac80211_set_noscan() {
|
||||
hostapd_noscan=1
|
||||
}
|
||||
@@ -1122,49 +1032,44 @@ drv_mac80211_cleanup() {
|
||||
hostapd_common_cleanup
|
||||
}
|
||||
|
||||
mac80211_reset_config() {
|
||||
local phy="$1"
|
||||
|
||||
hostapd_conf_file="/var/run/hostapd-$phy.conf"
|
||||
ubus call hostapd config_set '{ "phy": "'"$phy"'", "config": "", "prev_config": "'"$hostapd_conf_file"'" }' > /dev/null
|
||||
ubus call wpa_supplicant config_set '{ "phy": "'"$phy"'", "config": [] }' > /dev/null
|
||||
wdev_tool "$phy" set_config '{}'
|
||||
}
|
||||
|
||||
drv_mac80211_setup() {
|
||||
json_select config
|
||||
json_get_vars \
|
||||
phy macaddr path \
|
||||
country chanbw distance \
|
||||
txpower antenna_gain \
|
||||
txpower \
|
||||
rxantenna txantenna \
|
||||
frag rts beacon_int:100 htmode
|
||||
frag rts beacon_int:100 htmode \
|
||||
num_global_macaddr:1 multiple_bssid
|
||||
json_get_values basic_rate_list basic_rate
|
||||
json_get_values scan_list scan_list
|
||||
json_select ..
|
||||
|
||||
json_select data && {
|
||||
json_get_var prev_rxantenna rxantenna
|
||||
json_get_var prev_txantenna txantenna
|
||||
json_select ..
|
||||
}
|
||||
|
||||
find_phy || {
|
||||
echo "Could not find PHY for device '$1'"
|
||||
wireless_set_retry 0
|
||||
return 1
|
||||
}
|
||||
|
||||
wireless_set_data phy="$phy"
|
||||
[ -z "$(uci -q -P /var/state show wireless._${phy})" ] && uci -q -P /var/state set wireless._${phy}=phy
|
||||
|
||||
OLDAPLIST=$(uci -q -P /var/state get wireless._${phy}.aplist)
|
||||
OLDSPLIST=$(uci -q -P /var/state get wireless._${phy}.splist)
|
||||
OLDUMLIST=$(uci -q -P /var/state get wireless._${phy}.umlist)
|
||||
|
||||
local wdev
|
||||
local cwdev
|
||||
local found
|
||||
|
||||
for wdev in $(list_phy_interfaces "$phy"); do
|
||||
found=0
|
||||
for cwdev in $OLDAPLIST $OLDSPLIST $OLDUMLIST; do
|
||||
if [ "$wdev" = "$cwdev" ]; then
|
||||
found=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ "$found" = "0" ]; then
|
||||
ip link set dev "$wdev" down
|
||||
iw dev "$wdev" del
|
||||
fi
|
||||
done
|
||||
|
||||
# convert channel to frequency
|
||||
[ "$auto_channel" -gt 0 ] || freq="$(get_freq "$phy" "$channel" "$band")"
|
||||
|
||||
@@ -1177,7 +1082,6 @@ drv_mac80211_setup() {
|
||||
|
||||
hostapd_conf_file="/var/run/hostapd-$phy.conf"
|
||||
|
||||
no_ap=1
|
||||
macidx=0
|
||||
staidx=0
|
||||
|
||||
@@ -1190,13 +1094,14 @@ drv_mac80211_setup() {
|
||||
set_default rxantenna 0xffffffff
|
||||
set_default txantenna 0xffffffff
|
||||
set_default distance 0
|
||||
set_default antenna_gain 0
|
||||
|
||||
[ "$txantenna" = "all" ] && txantenna=0xffffffff
|
||||
[ "$rxantenna" = "all" ] && rxantenna=0xffffffff
|
||||
|
||||
[ "$rxantenna" = "$prev_rxantenna" -a "$txantenna" = "$prev_txantenna" ] || mac80211_reset_config "$phy"
|
||||
wireless_set_data phy="$phy" txantenna="$txantenna" rxantenna="$rxantenna"
|
||||
|
||||
iw phy "$phy" set antenna $txantenna $rxantenna >/dev/null 2>&1
|
||||
iw phy "$phy" set antenna_gain $antenna_gain >/dev/null 2>&1
|
||||
iw phy "$phy" set distance "$distance" >/dev/null 2>&1
|
||||
|
||||
if [ -n "$txpower" ]; then
|
||||
@@ -1212,78 +1117,36 @@ drv_mac80211_setup() {
|
||||
hostapd_ctrl=
|
||||
ap_ifname=
|
||||
hostapd_noscan=
|
||||
wpa_supp_init=
|
||||
for_each_interface "ap" mac80211_check_ap
|
||||
|
||||
rm -f "$hostapd_conf_file"
|
||||
[ -f "$hostapd_conf_file" ] && mv "$hostapd_conf_file" "$hostapd_conf_file.prev"
|
||||
|
||||
for_each_interface "sta adhoc mesh" mac80211_set_noscan
|
||||
[ -n "$has_ap" ] && mac80211_hostapd_setup_base "$phy"
|
||||
|
||||
local prev
|
||||
json_set_namespace wdev_uc prev
|
||||
json_init
|
||||
json_set_namespace "$prev"
|
||||
|
||||
wpa_supplicant_init_config
|
||||
|
||||
mac80211_prepare_iw_htmode
|
||||
for_each_interface "sta adhoc mesh monitor" mac80211_prepare_vif
|
||||
NEWAPLIST=
|
||||
for_each_interface "ap" mac80211_prepare_vif
|
||||
NEW_MD5=$(test -e "${hostapd_conf_file}" && md5sum ${hostapd_conf_file})
|
||||
OLD_MD5=$(uci -q -P /var/state get wireless._${phy}.md5)
|
||||
if [ "${NEWAPLIST}" != "${OLDAPLIST}" ]; then
|
||||
mac80211_vap_cleanup hostapd "${OLDAPLIST}"
|
||||
fi
|
||||
[ -n "${NEWAPLIST}" ] && mac80211_iw_interface_add "$phy" "${NEWAPLIST%% *}" __ap
|
||||
local add_ap=0
|
||||
local primary_ap=${NEWAPLIST%% *}
|
||||
[ -n "$hostapd_ctrl" ] && {
|
||||
local no_reload=1
|
||||
if [ -n "$(ubus list | grep hostapd.$primary_ap)" ]; then
|
||||
no_reload=0
|
||||
[ "${NEW_MD5}" = "${OLD_MD5}" ] || {
|
||||
ubus call hostapd.$primary_ap reload
|
||||
no_reload=$?
|
||||
if [ "$no_reload" != "0" ]; then
|
||||
mac80211_vap_cleanup hostapd "${OLDAPLIST}"
|
||||
mac80211_vap_cleanup wpa_supplicant "$(uci -q -P /var/state get wireless._${phy}.splist)"
|
||||
mac80211_vap_cleanup none "$(uci -q -P /var/state get wireless._${phy}.umlist)"
|
||||
sleep 2
|
||||
mac80211_iw_interface_add "$phy" "${NEWAPLIST%% *}" __ap
|
||||
for_each_interface "sta adhoc mesh monitor" mac80211_prepare_vif
|
||||
fi
|
||||
}
|
||||
fi
|
||||
if [ "$no_reload" != "0" ]; then
|
||||
add_ap=1
|
||||
ubus wait_for hostapd
|
||||
local hostapd_res="$(ubus call hostapd config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}")"
|
||||
ret="$?"
|
||||
[ "$ret" != 0 -o -z "$hostapd_res" ] && {
|
||||
wireless_setup_failed HOSTAPD_START_FAILED
|
||||
return
|
||||
}
|
||||
wireless_add_process "$(jsonfilter -s "$hostapd_res" -l 1 -e @.pid)" "/usr/sbin/hostapd" 1 1
|
||||
fi
|
||||
}
|
||||
uci -q -P /var/state set wireless._${phy}.aplist="${NEWAPLIST}"
|
||||
uci -q -P /var/state set wireless._${phy}.md5="${NEW_MD5}"
|
||||
active_ifnames=
|
||||
for_each_interface "ap sta adhoc mesh monitor" mac80211_prepare_vif
|
||||
for_each_interface "ap sta adhoc mesh monitor" mac80211_setup_vif
|
||||
|
||||
[ "${add_ap}" = 1 ] && sleep 1
|
||||
for_each_interface "ap" mac80211_setup_vif
|
||||
[ -x /usr/sbin/wpa_supplicant ] && wpa_supplicant_set_config "$phy"
|
||||
[ -x /usr/sbin/hostapd ] && hostapd_set_config "$phy"
|
||||
|
||||
NEWSPLIST=
|
||||
NEWUMLIST=
|
||||
[ -x /usr/sbin/wpa_supplicant ] && wpa_supplicant_start "$phy"
|
||||
|
||||
for_each_interface "sta adhoc mesh monitor" mac80211_setup_vif
|
||||
json_set_namespace wdev_uc prev
|
||||
wdev_tool "$phy" set_config "$(json_dump)" $active_ifnames
|
||||
json_set_namespace "$prev"
|
||||
|
||||
uci -q -P /var/state set wireless._${phy}.splist="${NEWSPLIST}"
|
||||
uci -q -P /var/state set wireless._${phy}.umlist="${NEWUMLIST}"
|
||||
|
||||
local foundvap
|
||||
local dropvap=""
|
||||
for oldvap in $OLDSPLIST; do
|
||||
foundvap=0
|
||||
for newvap in $NEWSPLIST; do
|
||||
[ "$oldvap" = "$newvap" ] && foundvap=1
|
||||
done
|
||||
[ "$foundvap" = "0" ] && dropvap="$dropvap $oldvap"
|
||||
done
|
||||
[ -n "$dropvap" ] && mac80211_vap_cleanup wpa_supplicant "$dropvap"
|
||||
for_each_interface "ap sta adhoc mesh monitor" mac80211_set_vif_txpower
|
||||
wireless_set_up
|
||||
}
|
||||
|
||||
@@ -1314,8 +1177,12 @@ drv_mac80211_teardown() {
|
||||
return 1
|
||||
}
|
||||
|
||||
mac80211_interface_cleanup "$phy"
|
||||
uci -q -P /var/state revert wireless._${phy}
|
||||
mac80211_reset_config "$phy"
|
||||
|
||||
for wdev in $(list_phy_interfaces "$phy"); do
|
||||
ip link set dev "$wdev" down
|
||||
iw dev "$wdev" del
|
||||
done
|
||||
}
|
||||
|
||||
add_driver mac80211
|
||||
|
||||
@@ -0,0 +1,413 @@
|
||||
From: Shiji Yang <yangshiji66@outlook.com>
|
||||
Date: Tue, 25 Jul 2023 20:05:06 +0800
|
||||
Subject: [PATCH] wifi: rt2x00: rework MT7620 PA/LNA RF calibration
|
||||
|
||||
1. Move MT7620 PA/LNA calibration code to dedicated functions.
|
||||
2. For external PA/LNA devices, restore RF and BBP registers before
|
||||
R-Calibration.
|
||||
3. Do Rx DCOC calibration again before RXIQ calibration.
|
||||
4. Correct MAC_SYS_CTRL register RX mask to 0x08 in R-Calibration
|
||||
function. For MAC_SYS_CTRL register, Bit[2] controls MAC_TX_EN
|
||||
and Bit[3] controls MAC_RX_EN (Bit index starts from 0).
|
||||
5. Move the channel configuration code from rt2800_vco_calibration()
|
||||
to the rt2800_config_channel().
|
||||
6. Use MT7620 SOC specific AGC initial LNA value instead of the
|
||||
RT5592's value.
|
||||
7. Adjust the register operation sequence according to the vendor
|
||||
driver code. This may not be useful, but it can make things
|
||||
clearer when developers try to review it.
|
||||
|
||||
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2800lib.c | 306 ++++++++++--------
|
||||
drivers/net/wireless/ralink/rt2x00/rt2x00.h | 6 +
|
||||
2 files changed, 182 insertions(+), 130 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -3881,14 +3881,6 @@ static void rt2800_config_channel_rf7620
|
||||
rfcsr |= tx_agc_fc;
|
||||
rt2800_rfcsr_write_bank(rt2x00dev, 7, 59, rfcsr);
|
||||
}
|
||||
-
|
||||
- if (conf_is_ht40(conf)) {
|
||||
- rt2800_bbp_glrt_write(rt2x00dev, 141, 0x10);
|
||||
- rt2800_bbp_glrt_write(rt2x00dev, 157, 0x2f);
|
||||
- } else {
|
||||
- rt2800_bbp_glrt_write(rt2x00dev, 141, 0x1a);
|
||||
- rt2800_bbp_glrt_write(rt2x00dev, 157, 0x40);
|
||||
- }
|
||||
}
|
||||
|
||||
static void rt2800_config_alc_rt6352(struct rt2x00_dev *rt2x00dev,
|
||||
@@ -4457,89 +4449,63 @@ static void rt2800_config_channel(struct
|
||||
usleep_range(1000, 1500);
|
||||
}
|
||||
|
||||
- if (rt2x00_rt(rt2x00dev, RT5592) || rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
+ if (rt2x00_rt(rt2x00dev, RT5592)) {
|
||||
reg = 0x10;
|
||||
- if (!conf_is_ht40(conf)) {
|
||||
- if (rt2x00_rt(rt2x00dev, RT6352) &&
|
||||
- rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
- reg |= 0x5;
|
||||
- } else {
|
||||
- reg |= 0xa;
|
||||
- }
|
||||
- }
|
||||
+ if (!conf_is_ht40(conf))
|
||||
+ reg |= 0xa;
|
||||
rt2800_bbp_write(rt2x00dev, 195, 141);
|
||||
rt2800_bbp_write(rt2x00dev, 196, reg);
|
||||
|
||||
- /* AGC init.
|
||||
- * Despite the vendor driver using different values here for
|
||||
- * RT6352 chip, we use 0x1c for now. This may have to be changed
|
||||
- * once TSSI got implemented.
|
||||
- */
|
||||
reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2*rt2x00dev->lna_gain;
|
||||
rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
|
||||
-
|
||||
- if (rt2x00_rt(rt2x00dev, RT5592))
|
||||
- rt2800_iq_calibrate(rt2x00dev, rf->channel);
|
||||
+
|
||||
+ rt2800_iq_calibrate(rt2x00dev, rf->channel);
|
||||
}
|
||||
|
||||
if (rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
- if (test_bit(CAPABILITY_EXTERNAL_PA_TX0,
|
||||
- &rt2x00dev->cap_flags)) {
|
||||
- reg = rt2800_register_read(rt2x00dev, RF_CONTROL3);
|
||||
- reg |= 0x00000101;
|
||||
- rt2800_register_write(rt2x00dev, RF_CONTROL3, reg);
|
||||
-
|
||||
- reg = rt2800_register_read(rt2x00dev, RF_BYPASS3);
|
||||
- reg |= 0x00000101;
|
||||
- rt2800_register_write(rt2x00dev, RF_BYPASS3, reg);
|
||||
-
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0x73);
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0x73);
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0x73);
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 46, 0x27);
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0xC8);
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xA4);
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x05);
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x27);
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0xC8);
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xA4);
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 57, 0x05);
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x27);
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0xC8);
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xA4);
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x05);
|
||||
- rt2800_rfcsr_write_dccal(rt2x00dev, 05, 0x00);
|
||||
+ /* BBP for GLRT BW */
|
||||
+ if (conf_is_ht40(conf)) {
|
||||
+ rt2800_bbp_glrt_write(rt2x00dev, 141, 0x10);
|
||||
+ rt2800_bbp_glrt_write(rt2x00dev, 157, 0x2f);
|
||||
+ } else {
|
||||
+ rt2800_bbp_glrt_write(rt2x00dev, 141, 0x1a);
|
||||
+ rt2800_bbp_glrt_write(rt2x00dev, 157, 0x40);
|
||||
|
||||
- rt2800_register_write(rt2x00dev, TX0_RF_GAIN_CORRECT,
|
||||
- 0x36303636);
|
||||
- rt2800_register_write(rt2x00dev, TX0_RF_GAIN_ATTEN,
|
||||
- 0x6C6C6B6C);
|
||||
- rt2800_register_write(rt2x00dev, TX1_RF_GAIN_ATTEN,
|
||||
- 0x6C6C6B6C);
|
||||
+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 &&
|
||||
+ rt2x00_has_cap_external_lna_bg(rt2x00dev))
|
||||
+ rt2800_bbp_glrt_write(rt2x00dev, 141, 0x15);
|
||||
}
|
||||
|
||||
- if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
- reg = rt2800_register_read(rt2x00dev, RF_CONTROL3);
|
||||
- reg |= 0x00000101;
|
||||
- rt2800_register_write(rt2x00dev, RF_CONTROL3, reg);
|
||||
-
|
||||
- reg = rt2800_register_read(rt2x00dev, RF_BYPASS3);
|
||||
- reg |= 0x00000101;
|
||||
- rt2800_register_write(rt2x00dev, RF_BYPASS3, reg);
|
||||
-
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66);
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20);
|
||||
- rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x42);
|
||||
- rt2800_bbp_write(rt2x00dev, 75, 0x68);
|
||||
- rt2800_bbp_write(rt2x00dev, 76, 0x4C);
|
||||
- rt2800_bbp_write(rt2x00dev, 79, 0x1C);
|
||||
- rt2800_bbp_write(rt2x00dev, 80, 0x0C);
|
||||
- rt2800_bbp_write(rt2x00dev, 82, 0xB6);
|
||||
- /* bank 0 RF reg 42 and glrt BBP reg 141 will be set in
|
||||
- * config channel function in dependence of channel and
|
||||
- * HT20/HT40 so don't touch it
|
||||
- */
|
||||
+ if (rt2x00dev->default_ant.rx_chain_num == 1) {
|
||||
+ rt2800_bbp_write(rt2x00dev, 91, 0x07);
|
||||
+ rt2800_bbp_write(rt2x00dev, 95, 0x1A);
|
||||
+ rt2800_bbp_write(rt2x00dev, 195, 128);
|
||||
+ rt2800_bbp_write(rt2x00dev, 196, 0xA0);
|
||||
+ rt2800_bbp_write(rt2x00dev, 195, 170);
|
||||
+ rt2800_bbp_write(rt2x00dev, 196, 0x12);
|
||||
+ rt2800_bbp_write(rt2x00dev, 195, 171);
|
||||
+ rt2800_bbp_write(rt2x00dev, 196, 0x10);
|
||||
+ } else {
|
||||
+ rt2800_bbp_write(rt2x00dev, 91, 0x06);
|
||||
+ rt2800_bbp_write(rt2x00dev, 95, 0x9A);
|
||||
+ rt2800_bbp_write(rt2x00dev, 195, 128);
|
||||
+ rt2800_bbp_write(rt2x00dev, 196, 0xE0);
|
||||
+ rt2800_bbp_write(rt2x00dev, 195, 170);
|
||||
+ rt2800_bbp_write(rt2x00dev, 196, 0x30);
|
||||
+ rt2800_bbp_write(rt2x00dev, 195, 171);
|
||||
+ rt2800_bbp_write(rt2x00dev, 196, 0x30);
|
||||
}
|
||||
+
|
||||
+ /* AGC init */
|
||||
+ reg = rf->channel <= 14 ? 0x04 + 2 * rt2x00dev->lna_gain : 0;
|
||||
+ rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
|
||||
+
|
||||
+ /* On 11A, We should delay and wait RF/BBP to be stable
|
||||
+ * and the appropriate time should be 1000 micro seconds
|
||||
+ * 2005/06/05 - On 11G, we also need this delay time.
|
||||
+ * Otherwise it's difficult to pass the WHQL.
|
||||
+ */
|
||||
+ usleep_range(1000, 1500);
|
||||
}
|
||||
|
||||
bbp = rt2800_bbp_read(rt2x00dev, 4);
|
||||
@@ -5649,43 +5615,6 @@ void rt2800_vco_calibration(struct rt2x0
|
||||
}
|
||||
}
|
||||
rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin);
|
||||
-
|
||||
- if (rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
- if (rt2x00dev->default_ant.rx_chain_num == 1) {
|
||||
- rt2800_bbp_write(rt2x00dev, 91, 0x07);
|
||||
- rt2800_bbp_write(rt2x00dev, 95, 0x1A);
|
||||
- rt2800_bbp_write(rt2x00dev, 195, 128);
|
||||
- rt2800_bbp_write(rt2x00dev, 196, 0xA0);
|
||||
- rt2800_bbp_write(rt2x00dev, 195, 170);
|
||||
- rt2800_bbp_write(rt2x00dev, 196, 0x12);
|
||||
- rt2800_bbp_write(rt2x00dev, 195, 171);
|
||||
- rt2800_bbp_write(rt2x00dev, 196, 0x10);
|
||||
- } else {
|
||||
- rt2800_bbp_write(rt2x00dev, 91, 0x06);
|
||||
- rt2800_bbp_write(rt2x00dev, 95, 0x9A);
|
||||
- rt2800_bbp_write(rt2x00dev, 195, 128);
|
||||
- rt2800_bbp_write(rt2x00dev, 196, 0xE0);
|
||||
- rt2800_bbp_write(rt2x00dev, 195, 170);
|
||||
- rt2800_bbp_write(rt2x00dev, 196, 0x30);
|
||||
- rt2800_bbp_write(rt2x00dev, 195, 171);
|
||||
- rt2800_bbp_write(rt2x00dev, 196, 0x30);
|
||||
- }
|
||||
-
|
||||
- if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
- rt2800_bbp_write(rt2x00dev, 75, 0x68);
|
||||
- rt2800_bbp_write(rt2x00dev, 76, 0x4C);
|
||||
- rt2800_bbp_write(rt2x00dev, 79, 0x1C);
|
||||
- rt2800_bbp_write(rt2x00dev, 80, 0x0C);
|
||||
- rt2800_bbp_write(rt2x00dev, 82, 0xB6);
|
||||
- }
|
||||
-
|
||||
- /* On 11A, We should delay and wait RF/BBP to be stable
|
||||
- * and the appropriate time should be 1000 micro seconds
|
||||
- * 2005/06/05 - On 11G, we also need this delay time.
|
||||
- * Otherwise it's difficult to pass the WHQL.
|
||||
- */
|
||||
- usleep_range(1000, 1500);
|
||||
- }
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rt2800_vco_calibration);
|
||||
|
||||
@@ -8650,7 +8579,7 @@ static void rt2800_r_calibration(struct
|
||||
rt2x00_warn(rt2x00dev, "Wait MAC Tx Status to MAX !!!\n");
|
||||
|
||||
maccfg = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
|
||||
- maccfg &= (~0x04);
|
||||
+ maccfg &= (~0x08);
|
||||
rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, maccfg);
|
||||
|
||||
if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_RX)))
|
||||
@@ -10688,30 +10617,143 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00);
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
|
||||
}
|
||||
+}
|
||||
|
||||
- rt6352_enable_pa_pin(rt2x00dev, 0);
|
||||
- rt2800_r_calibration(rt2x00dev);
|
||||
- rt2800_rf_self_txdc_cal(rt2x00dev);
|
||||
- rt2800_rxdcoc_calibration(rt2x00dev);
|
||||
- rt2800_bw_filter_calibration(rt2x00dev, true);
|
||||
- rt2800_bw_filter_calibration(rt2x00dev, false);
|
||||
- rt2800_loft_iq_calibration(rt2x00dev);
|
||||
- rt2800_rxiq_calibration(rt2x00dev);
|
||||
- rt6352_enable_pa_pin(rt2x00dev, 1);
|
||||
+static void rt2800_init_palna_rt6352(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ u32 reg;
|
||||
+
|
||||
+ if (rt2x00_has_cap_external_pa(rt2x00dev)) {
|
||||
+ reg = rt2800_register_read(rt2x00dev, RF_CONTROL3);
|
||||
+ reg |= 0x00000101;
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL3, reg);
|
||||
+
|
||||
+ reg = rt2800_register_read(rt2x00dev, RF_BYPASS3);
|
||||
+ reg |= 0x00000101;
|
||||
+ rt2800_register_write(rt2x00dev, RF_BYPASS3, reg);
|
||||
+ }
|
||||
|
||||
- if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 &&
|
||||
+ rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66);
|
||||
rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20);
|
||||
rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x42);
|
||||
+ }
|
||||
+
|
||||
+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 &&
|
||||
+ rt2x00_has_cap_external_pa(rt2x00dev)) {
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0x73);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0x73);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0x73);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 46, 0x27);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0xC8);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xA4);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x05);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x27);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0xC8);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xA4);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 57, 0x05);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x27);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0xC8);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xA4);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x05);
|
||||
+ }
|
||||
+
|
||||
+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 &&
|
||||
+ rt2x00_has_cap_external_pa(rt2x00dev))
|
||||
+ rt2800_rfcsr_write_dccal(rt2x00dev, 05, 0x00);
|
||||
+
|
||||
+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 &&
|
||||
+ rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
rt2800_bbp_write(rt2x00dev, 75, 0x68);
|
||||
rt2800_bbp_write(rt2x00dev, 76, 0x4C);
|
||||
rt2800_bbp_write(rt2x00dev, 79, 0x1C);
|
||||
rt2800_bbp_write(rt2x00dev, 80, 0x0C);
|
||||
rt2800_bbp_write(rt2x00dev, 82, 0xB6);
|
||||
- /* bank 0 RF reg 42 and glrt BBP reg 141 will be set in config
|
||||
- * channel function in dependence of channel and HT20/HT40,
|
||||
- * so don't touch them here.
|
||||
- */
|
||||
+ }
|
||||
+
|
||||
+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 &&
|
||||
+ rt2x00_has_cap_external_pa(rt2x00dev)) {
|
||||
+ rt2800_register_write(rt2x00dev, TX0_RF_GAIN_CORRECT, 0x36303636);
|
||||
+ rt2800_register_write(rt2x00dev, TX0_RF_GAIN_ATTEN, 0x6C6C6B6C);
|
||||
+ rt2800_register_write(rt2x00dev, TX1_RF_GAIN_ATTEN, 0x6C6C6B6C);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void rt2800_restore_rf_bbp_rt6352(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ if (rt2x00_has_cap_external_pa(rt2x00dev)) {
|
||||
+ rt2800_register_write(rt2x00dev, RF_CONTROL3, 0x0);
|
||||
+ rt2800_register_write(rt2x00dev, RF_BYPASS3, 0x0);
|
||||
+ }
|
||||
+
|
||||
+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 &&
|
||||
+ rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x16);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x23);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 18, 0x02);
|
||||
+ }
|
||||
+
|
||||
+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 &&
|
||||
+ rt2x00_has_cap_external_pa(rt2x00dev)) {
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0xD3);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0xB3);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0xD5);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 46, 0x27);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0x6C);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xFC);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x1F);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x27);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0x66);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xFF);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 57, 0x1C);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x20);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0x6B);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xF7);
|
||||
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x09);
|
||||
+ }
|
||||
+
|
||||
+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 &&
|
||||
+ rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
+ rt2800_bbp_write(rt2x00dev, 75, 0x60);
|
||||
+ rt2800_bbp_write(rt2x00dev, 76, 0x44);
|
||||
+ rt2800_bbp_write(rt2x00dev, 79, 0x1C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 80, 0x0C);
|
||||
+ rt2800_bbp_write(rt2x00dev, 82, 0xB6);
|
||||
+ }
|
||||
+
|
||||
+ if (rt2800_hw_get_chippkg(rt2x00dev) == 1 &&
|
||||
+ rt2x00_has_cap_external_pa(rt2x00dev)) {
|
||||
+ rt2800_register_write(rt2x00dev, TX0_RF_GAIN_CORRECT, 0x3630363A);
|
||||
+ rt2800_register_write(rt2x00dev, TX0_RF_GAIN_ATTEN, 0x6C6C666C);
|
||||
+ rt2800_register_write(rt2x00dev, TX1_RF_GAIN_ATTEN, 0x6C6C666C);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void rt2800_calibration_rt6352(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ if (rt2x00_has_cap_external_pa(rt2x00dev) ||
|
||||
+ rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
+ rt6352_enable_pa_pin(rt2x00dev, 0);
|
||||
+ rt2800_restore_rf_bbp_rt6352(rt2x00dev);
|
||||
+ }
|
||||
+
|
||||
+ rt2800_r_calibration(rt2x00dev);
|
||||
+ rt2800_rf_self_txdc_cal(rt2x00dev);
|
||||
+ rt2800_rxdcoc_calibration(rt2x00dev);
|
||||
+ rt2800_bw_filter_calibration(rt2x00dev, true);
|
||||
+ rt2800_bw_filter_calibration(rt2x00dev, false);
|
||||
+ rt2800_loft_iq_calibration(rt2x00dev);
|
||||
+
|
||||
+ /* missing DPD Calibration for devices using internal PA */
|
||||
+
|
||||
+ rt2800_rxdcoc_calibration(rt2x00dev);
|
||||
+ rt2800_rxiq_calibration(rt2x00dev);
|
||||
+
|
||||
+ if (rt2x00_has_cap_external_pa(rt2x00dev) ||
|
||||
+ rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
+ rt6352_enable_pa_pin(rt2x00dev, 1);
|
||||
+ rt2800_init_palna_rt6352(rt2x00dev);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10804,6 +10846,10 @@ int rt2800_enable_radio(struct rt2x00_de
|
||||
rt2800_init_bbp(rt2x00dev);
|
||||
rt2800_init_rfcsr(rt2x00dev);
|
||||
|
||||
+ /* Do calibration and init PA/LNA for RT6352 */
|
||||
+ if (rt2x00_rt(rt2x00dev, RT6352))
|
||||
+ rt2800_calibration_rt6352(rt2x00dev);
|
||||
+
|
||||
if (rt2x00_is_usb(rt2x00dev) &&
|
||||
(rt2x00_rt(rt2x00dev, RT3070) ||
|
||||
rt2x00_rt(rt2x00dev, RT3071) ||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
@@ -1277,6 +1277,12 @@ rt2x00_has_cap_external_lna_bg(struct rt
|
||||
}
|
||||
|
||||
static inline bool
|
||||
+rt2x00_has_cap_external_pa(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ return rt2x00_has_cap_flag(rt2x00dev, CAPABILITY_EXTERNAL_PA_TX0);
|
||||
+}
|
||||
+
|
||||
+static inline bool
|
||||
rt2x00_has_cap_double_antenna(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
return rt2x00_has_cap_flag(rt2x00dev, CAPABILITY_DOUBLE_ANTENNA);
|
||||
@@ -0,0 +1,149 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Thu, 14 Sep 2023 13:17:16 +0200
|
||||
Subject: [PATCH] cfg80211: allow grace period for DFS available after beacon
|
||||
shutdown
|
||||
|
||||
Fixes reconfiguring an AP on a DFS channel in non-ETSI regdomain
|
||||
|
||||
Fixes: b35a51c7dd25 ("cfg80211: Make pre-CAC results valid only for ETSI domain")
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/include/net/cfg80211.h
|
||||
+++ b/include/net/cfg80211.h
|
||||
@@ -175,6 +175,8 @@ enum ieee80211_channel_flags {
|
||||
* @dfs_state: current state of this channel. Only relevant if radar is required
|
||||
* on this channel.
|
||||
* @dfs_state_entered: timestamp (jiffies) when the dfs state was entered.
|
||||
+ * @dfs_state_last_available: timestamp (jiffies) of the last time when the
|
||||
+ * channel was available.
|
||||
* @dfs_cac_ms: DFS CAC time in milliseconds, this is valid for DFS channels.
|
||||
*/
|
||||
struct ieee80211_channel {
|
||||
@@ -191,6 +193,7 @@ struct ieee80211_channel {
|
||||
int orig_mag, orig_mpwr;
|
||||
enum nl80211_dfs_state dfs_state;
|
||||
unsigned long dfs_state_entered;
|
||||
+ unsigned long dfs_state_last_available;
|
||||
unsigned int dfs_cac_ms;
|
||||
};
|
||||
|
||||
--- a/net/wireless/ap.c
|
||||
+++ b/net/wireless/ap.c
|
||||
@@ -30,6 +30,9 @@ static int ___cfg80211_stop_ap(struct cf
|
||||
if (!wdev->links[link_id].ap.beacon_interval)
|
||||
return -ENOENT;
|
||||
|
||||
+ cfg80211_update_last_available(wdev->wiphy,
|
||||
+ &wdev->links[link_id].ap.chandef);
|
||||
+
|
||||
err = rdev_stop_ap(rdev, dev, link_id);
|
||||
if (!err) {
|
||||
wdev->conn_owner_nlportid = 0;
|
||||
@@ -41,9 +44,6 @@ static int ___cfg80211_stop_ap(struct cf
|
||||
if (notify)
|
||||
nl80211_send_ap_stopped(wdev);
|
||||
|
||||
- /* Should we apply the grace period during beaconing interface
|
||||
- * shutdown also?
|
||||
- */
|
||||
cfg80211_sched_dfs_chan_update(rdev);
|
||||
}
|
||||
|
||||
--- a/net/wireless/chan.c
|
||||
+++ b/net/wireless/chan.c
|
||||
@@ -461,6 +461,8 @@ static void cfg80211_set_chans_dfs_state
|
||||
|
||||
c->dfs_state = dfs_state;
|
||||
c->dfs_state_entered = jiffies;
|
||||
+ if (dfs_state == NL80211_DFS_AVAILABLE)
|
||||
+ c->dfs_state_last_available = jiffies;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -873,6 +875,49 @@ static bool cfg80211_get_chans_dfs_avail
|
||||
return true;
|
||||
}
|
||||
|
||||
+static void
|
||||
+__cfg80211_update_last_available(struct wiphy *wiphy,
|
||||
+ u32 center_freq,
|
||||
+ u32 bandwidth)
|
||||
+{
|
||||
+ struct ieee80211_channel *c;
|
||||
+ u32 freq, start_freq, end_freq;
|
||||
+
|
||||
+ start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
|
||||
+ end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
|
||||
+
|
||||
+ /*
|
||||
+ * Check entire range of channels for the bandwidth.
|
||||
+ * If any channel in between is disabled or has not
|
||||
+ * had gone through CAC return false
|
||||
+ */
|
||||
+ for (freq = start_freq; freq <= end_freq; freq += MHZ_TO_KHZ(20)) {
|
||||
+ c = ieee80211_get_channel_khz(wiphy, freq);
|
||||
+ if (!c)
|
||||
+ return;
|
||||
+
|
||||
+ c->dfs_state_last_available = jiffies;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void cfg80211_update_last_available(struct wiphy *wiphy,
|
||||
+ const struct cfg80211_chan_def *chandef)
|
||||
+{
|
||||
+ int width;
|
||||
+
|
||||
+ width = cfg80211_chandef_get_width(chandef);
|
||||
+ if (width < 0)
|
||||
+ return;
|
||||
+
|
||||
+ __cfg80211_update_last_available(wiphy, MHZ_TO_KHZ(chandef->center_freq1),
|
||||
+ width);
|
||||
+ if (chandef->width != NL80211_CHAN_WIDTH_80P80)
|
||||
+ return;
|
||||
+
|
||||
+ __cfg80211_update_last_available(wiphy, MHZ_TO_KHZ(chandef->center_freq2),
|
||||
+ width);
|
||||
+}
|
||||
+
|
||||
static bool cfg80211_chandef_dfs_available(struct wiphy *wiphy,
|
||||
const struct cfg80211_chan_def *chandef)
|
||||
{
|
||||
--- a/net/wireless/core.h
|
||||
+++ b/net/wireless/core.h
|
||||
@@ -477,6 +477,8 @@ void cfg80211_set_dfs_state(struct wiphy
|
||||
enum nl80211_dfs_state dfs_state);
|
||||
|
||||
void cfg80211_dfs_channels_update_work(struct work_struct *work);
|
||||
+void cfg80211_update_last_available(struct wiphy *wiphy,
|
||||
+ const struct cfg80211_chan_def *chandef);
|
||||
|
||||
unsigned int
|
||||
cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy,
|
||||
--- a/net/wireless/mlme.c
|
||||
+++ b/net/wireless/mlme.c
|
||||
@@ -891,6 +891,8 @@ void cfg80211_dfs_channels_update_work(s
|
||||
if (c->dfs_state == NL80211_DFS_UNAVAILABLE) {
|
||||
time_dfs_update = IEEE80211_DFS_MIN_NOP_TIME_MS;
|
||||
radar_event = NL80211_RADAR_NOP_FINISHED;
|
||||
+ timeout = c->dfs_state_entered +
|
||||
+ msecs_to_jiffies(time_dfs_update);
|
||||
} else {
|
||||
if (regulatory_pre_cac_allowed(wiphy) ||
|
||||
cfg80211_any_wiphy_oper_chan(wiphy, c))
|
||||
@@ -898,11 +900,10 @@ void cfg80211_dfs_channels_update_work(s
|
||||
|
||||
time_dfs_update = REG_PRE_CAC_EXPIRY_GRACE_MS;
|
||||
radar_event = NL80211_RADAR_PRE_CAC_EXPIRED;
|
||||
+ timeout = c->dfs_state_last_available +
|
||||
+ msecs_to_jiffies(time_dfs_update);
|
||||
}
|
||||
|
||||
- timeout = c->dfs_state_entered +
|
||||
- msecs_to_jiffies(time_dfs_update);
|
||||
-
|
||||
if (time_after_eq(jiffies, timeout)) {
|
||||
c->dfs_state = NL80211_DFS_USABLE;
|
||||
c->dfs_state_entered = jiffies;
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/include/net/cfg80211.h
|
||||
+++ b/include/net/cfg80211.h
|
||||
@@ -4081,6 +4081,7 @@ struct mgmt_frame_regs {
|
||||
@@ -4084,6 +4084,7 @@ struct mgmt_frame_regs {
|
||||
* (as advertised by the nl80211 feature flag.)
|
||||
* @get_tx_power: store the current TX power into the dbm variable;
|
||||
* return 0 if successful
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting
|
||||
* functions to adjust rfkill hw state
|
||||
@@ -4431,6 +4432,7 @@ struct cfg80211_ops {
|
||||
@@ -4434,6 +4435,7 @@ struct cfg80211_ops {
|
||||
enum nl80211_tx_power_setting type, int mbm);
|
||||
int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||
int *dbm);
|
||||
|
||||
@@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2023-07-26
|
||||
PKG_SOURCE_VERSION:=cd3dfe39276905307cc028ac8edf2c06963cda23
|
||||
PKG_MIRROR_HASH:=413d2d0faa81d834ba13cb9e503e1e3a61e3e071014da6b525a123e5da053f90
|
||||
PKG_SOURCE_DATE:=2023-08-14
|
||||
PKG_SOURCE_VERSION:=b14c2351ddb8601c322576d84029e463d456caef
|
||||
PKG_MIRROR_HASH:=62b5e157ad525424b6857e77ed373e8d39d03af71b057f8b309d8b293d6eac5f
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_USE_NINJA:=0
|
||||
@@ -262,18 +262,34 @@ define KernelPackage/mt7921-firmware
|
||||
TITLE:=MediaTek MT7921 firmware
|
||||
endef
|
||||
|
||||
define KernelPackage/mt792x-common
|
||||
$(KernelPackage/mt76-default)
|
||||
TITLE:=MediaTek MT792x wireless driver common code
|
||||
HIDDEN:=1
|
||||
DEPENDS+=+kmod-mt76-connac +@DRIVER_11AX_SUPPORT
|
||||
FILES:= $(PKG_BUILD_DIR)/mt792x-lib.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/mt792x-usb
|
||||
$(KernelPackage/mt76-default)
|
||||
TITLE:=MediaTek MT792x wireless driver USB code
|
||||
HIDDEN:=1
|
||||
DEPENDS+=+kmod-mt792x-common +kmod-mt76-usb +@DRIVER_11AX_SUPPORT
|
||||
FILES:= $(PKG_BUILD_DIR)/mt792x-usb.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/mt7921-common
|
||||
$(KernelPackage/mt76-default)
|
||||
TITLE:=MediaTek MT7615 wireless driver common code
|
||||
TITLE:=MediaTek MT7921 wireless driver common code
|
||||
HIDDEN:=1
|
||||
DEPENDS+=+kmod-mt76-connac +kmod-mt7921-firmware +@DRIVER_11AX_SUPPORT +kmod-hwmon-core
|
||||
DEPENDS+=+kmod-mt792x-common +kmod-mt7921-firmware +@DRIVER_11AX_SUPPORT +kmod-hwmon-core
|
||||
FILES:= $(PKG_BUILD_DIR)/mt7921/mt7921-common.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/mt7921u
|
||||
$(KernelPackage/mt76-default)
|
||||
TITLE:=MediaTek MT7921U wireless driver
|
||||
DEPENDS+=+kmod-mt76-usb +kmod-mt7921-common
|
||||
DEPENDS+=+kmod-mt792x-usb +kmod-mt7921-common
|
||||
FILES:= $(PKG_BUILD_DIR)/mt7921/mt7921u.ko
|
||||
AUTOLOAD:=$(call AutoProbe,mt7921u)
|
||||
endef
|
||||
@@ -384,6 +400,12 @@ ifdef CONFIG_PACKAGE_kmod-mt7915e
|
||||
NOSTDINC_FLAGS += -DCONFIG_MT798X_WMAC
|
||||
endif
|
||||
endif
|
||||
ifdef CONFIG_PACKAGE_kmod-mt792x-common
|
||||
PKG_MAKE_FLAGS += CONFIG_MT792x_LIB=m
|
||||
endif
|
||||
ifdef CONFIG_PACKAGE_kmod-mt792x-usb
|
||||
PKG_MAKE_FLAGS += CONFIG_MT792x_USB=m
|
||||
endif
|
||||
ifdef CONFIG_PACKAGE_kmod-mt7921-common
|
||||
PKG_MAKE_FLAGS += CONFIG_MT7921_COMMON=m
|
||||
endif
|
||||
@@ -566,6 +588,8 @@ $(eval $(call KernelPackage,mt7916-firmware))
|
||||
$(eval $(call KernelPackage,mt7981-firmware))
|
||||
$(eval $(call KernelPackage,mt7986-firmware))
|
||||
$(eval $(call KernelPackage,mt7921-firmware))
|
||||
$(eval $(call KernelPackage,mt792x-common))
|
||||
$(eval $(call KernelPackage,mt792x-usb))
|
||||
$(eval $(call KernelPackage,mt7921-common))
|
||||
$(eval $(call KernelPackage,mt7921u))
|
||||
$(eval $(call KernelPackage,mt7921s))
|
||||
|
||||
@@ -19,6 +19,7 @@ PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
PKG_CPE_ID:=cpe:/a:gmplib:gmp
|
||||
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ PKG_SOURCE_VERSION:=1728e3e4bef0e138ea95ffe62163eb9a6ac6fa32
|
||||
PKG_ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION)))
|
||||
|
||||
PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
|
||||
PKG_CPE_ID:=cpe:/a:libbpf_project:libbpf
|
||||
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@@ -10,6 +10,7 @@ PKG_HASH:=9baa186059ebbf25c06308e9f991fda31f7183c0f24931826d83aa6abd8a0261
|
||||
|
||||
PKG_LICENSE:=BSD-4-Clause
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
PKG_CPE_ID:=cpe:/a:freedesktop:libbsd
|
||||
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@@ -18,6 +18,7 @@ PKG_HASH:=67bd9df49fe34e8b82144f6dfb93b320f384a8ea59727e92ff8d18b5f4b579a8
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
PKG_CPE_ID:=cpe:/a:netfilter:libnetfilter_conntrack
|
||||
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@@ -55,10 +55,16 @@ $(call Package/libnl/default)
|
||||
DEPENDS:=+libnl-route
|
||||
endef
|
||||
|
||||
define Package/libnl-cli
|
||||
$(call Package/libnl/default)
|
||||
TITLE:=CLI Netlink Library
|
||||
DEPENDS:=+libnl-genl +libnl-nf
|
||||
endef
|
||||
|
||||
define Package/libnl
|
||||
$(call Package/libnl/default)
|
||||
TITLE:=Full Netlink Library
|
||||
DEPENDS:=+libnl-genl +libnl-route +libnl-nf
|
||||
DEPENDS:=+libnl-genl +libnl-route +libnl-nf +libnl-cli
|
||||
endef
|
||||
|
||||
define Package/libnl-core/description
|
||||
@@ -77,6 +83,10 @@ define Package/libnl-nf/description
|
||||
Netfilter Netlink Library Functions
|
||||
endef
|
||||
|
||||
define Package/libnl-cli/description
|
||||
CLI Netlink Library Functions
|
||||
endef
|
||||
|
||||
define Package/libnl/description
|
||||
Socket handling, connection management, sending and receiving of data,
|
||||
message construction and parsing, object caching system, etc.
|
||||
@@ -98,6 +108,7 @@ define Build/InstallDev
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-genl-3.so $(1)/usr/lib/libnl-genl.so
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-nf-3.so $(1)/usr/lib/libnl-nf.so
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-route-3.so $(1)/usr/lib/libnl-route.so
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-cli-3.so $(1)/usr/lib/libnl-cli.so
|
||||
endef
|
||||
|
||||
define Package/libnl-core/install
|
||||
@@ -120,6 +131,11 @@ define Package/libnl-nf/install
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-nf-3.so.* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libnl-cli/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnl-cli-3.so.* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libnl/install
|
||||
:
|
||||
endef
|
||||
@@ -128,4 +144,5 @@ $(eval $(call BuildPackage,libnl-core))
|
||||
$(eval $(call BuildPackage,libnl-genl))
|
||||
$(eval $(call BuildPackage,libnl-route))
|
||||
$(eval $(call BuildPackage,libnl-nf))
|
||||
$(eval $(call BuildPackage,libnl-cli))
|
||||
$(eval $(call BuildPackage,libnl))
|
||||
|
||||
@@ -18,6 +18,7 @@ PKG_HASH:=ed19a0383fad72e3ad435fd239d7cd80d64916b87269550159d20e47160ebe5f
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_CPE_ID:=cpe:/a:tcpdump:libpcap
|
||||
|
||||
PKG_ASLR_PIE_REGULAR:=1
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
PKG_CPE_ID:=cpe:/a:selinuxproject:libselinux
|
||||
|
||||
PKG_BUILD_FLAGS:=no-lto
|
||||
|
||||
HOST_BUILD_DEPENDS:=libsepol/host musl-fts/host pcre2/host
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -16,6 +16,8 @@ PKG_HASH:=78fdaf69924db780bac78546e43d9c44074bad798c2c415d0b9bb96d065ee8a2
|
||||
PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
PKG_CPE_ID:=cpe:/a:selinuxproject:libsepol
|
||||
|
||||
PKG_BUILD_FLAGS:=no-lto
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ config MBEDTLS_ECP_DP_SECP384R1_ENABLED
|
||||
|
||||
config MBEDTLS_ECP_DP_SECP521R1_ENABLED
|
||||
bool "MBEDTLS_ECP_DP_SECP521R1_ENABLED"
|
||||
default n
|
||||
default y
|
||||
|
||||
config MBEDTLS_ECP_DP_SECP192K1_ENABLED
|
||||
bool "MBEDTLS_ECP_DP_SECP192K1_ENABLED"
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=mbedtls
|
||||
PKG_VERSION:=2.28.4
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=2.28.5
|
||||
PKG_RELEASE:=2
|
||||
PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=578c4dcd15bbff3f5cd56aa07cd4f850fc733634e3d5947be4f7157d5bfd81ac
|
||||
PKG_HASH:=849e86b626e42ded6bf67197b64aa771daa54e2a7e2868dc67e1e4711959e5e3
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
PKG_LICENSE_FILES:=gpl-2.0.txt
|
||||
|
||||
@@ -33,7 +33,7 @@ Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <time.h>
|
||||
@@ -3001,6 +3005,61 @@ find_parent:
|
||||
@@ -3002,6 +3006,61 @@ find_parent:
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
|
||||
/*
|
||||
* Check for CN match
|
||||
*/
|
||||
@@ -3021,24 +3080,51 @@ static int x509_crt_check_cn(const mbedt
|
||||
@@ -3022,24 +3081,51 @@ static int x509_crt_check_cn(const mbedt
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3049,31 +3135,23 @@ static void x509_crt_verify_name(const m
|
||||
@@ -3050,31 +3136,23 @@ static void x509_crt_verify_name(const m
|
||||
uint32_t *flags)
|
||||
{
|
||||
const mbedtls_x509_name *name;
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=nettle
|
||||
PKG_VERSION:=3.9
|
||||
PKG_VERSION:=3.9.1
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=@GNU/nettle
|
||||
PKG_HASH:=0ee7adf5a7201610bb7fe0acbb7c9b3be83be44904dd35ebbcd965cd896bfeaa
|
||||
PKG_HASH:=ccfeff981b0ca71bbd6fbcb054f407c60ffb644389a5be80d6716d5b550c6ce3
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=openssl
|
||||
PKG_VERSION:=3.0.10
|
||||
PKG_VERSION:=3.0.12
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto
|
||||
|
||||
@@ -24,7 +24,7 @@ PKG_SOURCE_URL:= \
|
||||
ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \
|
||||
ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/old/$(PKG_BASE)/
|
||||
|
||||
PKG_HASH:=1761d4f5b13a1028b9b6f3d4b8e17feb0cedc9370f6afe61d7193d2cdce83323
|
||||
PKG_HASH:=f93c9e8edde5e9166119de31755fc87b4aa34863662f67ddfcba14d0b6b69b61
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -10,7 +10,7 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
|
||||
--- a/crypto/build.info
|
||||
+++ b/crypto/build.info
|
||||
@@ -111,7 +111,7 @@ DEFINE[../libcrypto]=$UPLINKDEF
|
||||
@@ -109,7 +109,7 @@ DEFINE[../libcrypto]=$UPLINKDEF
|
||||
|
||||
DEPEND[info.o]=buildinf.h
|
||||
DEPEND[cversion.o]=buildinf.h
|
||||
|
||||
@@ -15,6 +15,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://ftp.rpm.org/popt/releases/popt-1.x/
|
||||
PKG_HASH:=c25a4838fc8e4c1c8aacb8bd620edb3084a3d63bf8987fdad3ca2758c63240f9
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_CPE_ID:=cpe:/a:popt_project:popt
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_REMOVE_FILES:=autogen.sh aclocal.m4
|
||||
|
||||
@@ -15,6 +15,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=@SF/linux-diag
|
||||
PKG_HASH:=e865de2c1f559fff0d3fc936e660c0efaf7afe662064f2fb97ccad1ec28d208a
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
PKG_CPE_ID:=cpe:/a:sysfsutils_project:sysfsutils
|
||||
|
||||
PKG_LICENSE:=LGPL-2.1
|
||||
PKG_LICENSE_FILES:=COPYING cmd/GPL lib/LGPL
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wolfssl
|
||||
PKG_VERSION:=5.6.3-stable
|
||||
PKG_VERSION:=5.6.4-stable
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION)
|
||||
PKG_HASH:=2e74a397fa797c2902d7467d500de904907666afb4ff80f6464f6efd5afb114a
|
||||
PKG_HASH:=031691906794ff45e1e792561cf31759f5d29ac74936bc8dffb8b14f16d820b4
|
||||
|
||||
PKG_FIXUP:=libtool libtool-abiver
|
||||
PKG_INSTALL:=1
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From 41d248461bd9ad44193a4806ecb5361513e8944e Mon Sep 17 00:00:00 2001
|
||||
From: jordan <jordan@wolfssl.com>
|
||||
Date: Tue, 27 Jun 2023 13:18:25 -0500
|
||||
Subject: [PATCH] fix detection of cut tool in configure.ac
|
||||
|
||||
---
|
||||
configure.ac | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -8723,10 +8723,11 @@ echo "extern \"C\" {" >> $OPTION_FILE
|
||||
echo "#endif" >> $OPTION_FILE
|
||||
echo "" >> $OPTION_FILE
|
||||
|
||||
-# check for supported command to trim option with
|
||||
+# Check for supported command to trim option with.
|
||||
+# note: cut requires an argument to exit with success.
|
||||
if colrm >/dev/null 2>&1 </dev/null; then
|
||||
TRIM="colrm 3"
|
||||
-elif cut >/dev/null 2>&1 </dev/null; then
|
||||
+elif cut --version >/dev/null 2>&1 </dev/null; then
|
||||
TRIM="cut -c1-2"
|
||||
else
|
||||
AC_MSG_ERROR([Could not find colrm or cut to make options file])
|
||||
@@ -9,9 +9,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall4.git
|
||||
PKG_SOURCE_DATE:=2023-03-23
|
||||
PKG_SOURCE_VERSION:=04a06bd70b9808b14444cae81a2faba4708ee231
|
||||
PKG_MIRROR_HASH:=37c34facb733c50d0fdbfa238765a23e667e4daaae9728aaccbaba87a2a07bb9
|
||||
PKG_SOURCE_DATE:=2023-09-01
|
||||
PKG_SOURCE_VERSION:=598d9fbb5179667aa0c525040eaa41bc7f2dc015
|
||||
PKG_MIRROR_HASH:=038b5b5611425e3c0fcc3ef4a0aea37296733300766d787909a689d16d4f39b4
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
PKG_LICENSE:=ISC
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=netifd
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=1.1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
|
||||
PKG_SOURCE_DATE:=2023-06-04
|
||||
PKG_SOURCE_VERSION:=ec9dba72124597b7224bbfe75960386dc320f4bd
|
||||
PKG_MIRROR_HASH:=baee39a3882a2b03fc83a3a6a8963c340fa8d884c7a8c9e80e7d2dddc50e24bd
|
||||
PKG_SOURCE_DATE:=2023-11-10
|
||||
PKG_SOURCE_VERSION:=35facc8306f590a7330789ab6d5785c0d43073ef
|
||||
PKG_MIRROR_HASH:=4f73591ae1873e18df235349e478f2196ca0d3123c313a04149dc9d5e2bfb403
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
ifup_all=
|
||||
setup_wifi=
|
||||
|
||||
if_call() {
|
||||
local interface="$1"
|
||||
@@ -14,7 +13,6 @@ case "$0" in
|
||||
*ifdown) modes=down;;
|
||||
*ifup)
|
||||
modes="down up"
|
||||
setup_wifi=1
|
||||
;;
|
||||
*) echo "Invalid command: $0";;
|
||||
esac
|
||||
@@ -25,10 +23,6 @@ while :; do
|
||||
ifup_all=1
|
||||
shift
|
||||
;;
|
||||
-w)
|
||||
setup_wifi=
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
@@ -40,7 +34,6 @@ if [ -n "$ifup_all" ]; then
|
||||
for interface in $(ubus -S list 'network.interface.*'); do
|
||||
if_call "${interface##network.interface.}"
|
||||
done
|
||||
[ -n "$setup_wifi" ] && /sbin/wifi up
|
||||
exit
|
||||
else
|
||||
ubus -S list "network.interface.$1" > /dev/null || {
|
||||
@@ -49,29 +42,3 @@ else
|
||||
}
|
||||
if_call "$1"
|
||||
fi
|
||||
|
||||
if [ -n "$setup_wifi" ] && grep -sq config /etc/config/wireless; then
|
||||
. /lib/functions.sh
|
||||
|
||||
find_related_radios() {
|
||||
local wdev wnet
|
||||
config_get wdev "$1" device
|
||||
config_get wnet "$1" network
|
||||
|
||||
if [ -n "$wdev" ]; then
|
||||
for wnet in $wnet; do
|
||||
if [ "$wnet" = "$network" ]; then
|
||||
append radio_devs "$wdev" "$N"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
network="$1"
|
||||
config_load wireless
|
||||
config_foreach find_related_radios wifi-iface
|
||||
|
||||
for dev in $(echo "$radio_devs" | sort -u); do
|
||||
/sbin/wifi up "$dev"
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From 8587c074f1eb2064c42adb0a6aa5073f695ab89d Mon Sep 17 00:00:00 2001
|
||||
From: Jo-Philipp Wich <jo@mein.io>
|
||||
Date: Tue, 14 Nov 2023 14:01:44 +0100
|
||||
Subject: [PATCH] interface-ip: fix IPv4 route target masking
|
||||
|
||||
A previous commit supposed to mask out excess host bits in route targets
|
||||
failed to correctly calculate the mask value, causing it to produce
|
||||
improper results for certain mask lengths.
|
||||
|
||||
Fixes: #17
|
||||
Fixes: 76eb342 ("interface-ip: mask out host bits in IPv4 route targets")
|
||||
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
---
|
||||
interface-ip.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/interface-ip.c b/interface-ip.c
|
||||
index d2fe385..28e7106 100644
|
||||
--- a/interface-ip.c
|
||||
+++ b/interface-ip.c
|
||||
@@ -448,7 +448,7 @@ interface_ip_add_route(struct interface *iface, struct blob_attr *attr, bool v6)
|
||||
|
||||
/* Mask out IPv4 host bits to avoid "Invalid prefix for given prefix length" */
|
||||
if (af == AF_INET && route->mask < 32)
|
||||
- route->addr.in.s_addr &= ((1u << route->mask) - 1);
|
||||
+ clear_if_addr(&route->addr, route->mask);
|
||||
}
|
||||
|
||||
if ((cur = tb[ROUTE_GATEWAY]) != NULL) {
|
||||
--
|
||||
2.39.1
|
||||
|
||||
@@ -73,11 +73,6 @@ config WPA_WOLFSSL
|
||||
select WOLFSSL_HAS_SESSION_TICKET
|
||||
select WOLFSSL_HAS_WPAS
|
||||
|
||||
config DRIVER_WEXT_SUPPORT
|
||||
bool
|
||||
select KERNEL_WIRELESS_EXT
|
||||
default n
|
||||
|
||||
config DRIVER_11AC_SUPPORT
|
||||
bool
|
||||
default n
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostapd
|
||||
PKG_RELEASE:=1.2
|
||||
PKG_RELEASE:=6
|
||||
|
||||
PKG_SOURCE_URL:=http://w1.fi/hostap.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2023-06-22
|
||||
PKG_SOURCE_VERSION:=599d00be9de2846c6ea18c1487d8329522ade22b
|
||||
PKG_MIRROR_HASH:=828810c558ea181e45ed0c8b940f5c41e55775e2979a15aed8cf0ab17dd7723c
|
||||
PKG_SOURCE_DATE:=2023-09-08
|
||||
PKG_SOURCE_VERSION:=e5ccbfc69ecf297590341ae8b461edba9d8e964c
|
||||
PKG_MIRROR_HASH:=fcc6550f46c7f8bbdbf71e63f8f699b9a0878565ad1b90a17855f5ec21283b8f
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
@@ -21,13 +21,10 @@ PKG_BUILD_PARALLEL:=1
|
||||
PKG_ASLR_PIE_REGULAR:=1
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_PACKAGE_kmod-ath9k \
|
||||
CONFIG_PACKAGE_kmod-cfg80211 \
|
||||
CONFIG_PACKAGE_hostapd \
|
||||
CONFIG_PACKAGE_hostapd-basic \
|
||||
CONFIG_PACKAGE_hostapd-mini \
|
||||
CONFIG_WPA_RFKILL_SUPPORT \
|
||||
CONFIG_DRIVER_WEXT_SUPPORT \
|
||||
CONFIG_DRIVER_11AC_SUPPORT \
|
||||
CONFIG_DRIVER_11AX_SUPPORT \
|
||||
CONFIG_WPA_ENABLE_WEP
|
||||
@@ -82,13 +79,15 @@ ifneq ($(CONFIG_DRIVER_11AX_SUPPORT),)
|
||||
HOSTAPD_IEEE80211AX:=y
|
||||
endif
|
||||
|
||||
CORE_DEPENDS = +ucode +libubus +libucode +ucode-mod-fs +ucode-mod-nl80211 +ucode-mod-rtnl +ucode-mod-ubus +ucode-mod-uloop +libblobmsg-json
|
||||
OPENSSL_DEPENDS = +PACKAGE_$(1):libopenssl +PACKAGE_$(1):libopenssl-legacy
|
||||
|
||||
DRIVER_MAKEOPTS= \
|
||||
CONFIG_ACS=$(CONFIG_PACKAGE_kmod-cfg80211) \
|
||||
CONFIG_DRIVER_NL80211=$(CONFIG_PACKAGE_kmod-cfg80211) \
|
||||
CONFIG_ACS=y CONFIG_DRIVER_NL80211=y \
|
||||
CONFIG_IEEE80211AC=$(HOSTAPD_IEEE80211AC) \
|
||||
CONFIG_IEEE80211AX=$(HOSTAPD_IEEE80211AX) \
|
||||
CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \
|
||||
CONFIG_MBO=$(CONFIG_WPA_MBO_SUPPORT)
|
||||
CONFIG_MBO=$(CONFIG_WPA_MBO_SUPPORT) \
|
||||
CONFIG_UCODE=y
|
||||
|
||||
ifeq ($(SSL_VARIANT),openssl)
|
||||
DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_SAE=y
|
||||
@@ -141,7 +140,7 @@ ifneq ($(LOCAL_TYPE),hostapd)
|
||||
endif
|
||||
endif
|
||||
|
||||
DRV_DEPENDS:=+PACKAGE_kmod-cfg80211:libnl-tiny
|
||||
DRV_DEPENDS:=+libnl-tiny
|
||||
|
||||
|
||||
define Package/hostapd/Default
|
||||
@@ -150,7 +149,7 @@ define Package/hostapd/Default
|
||||
SUBMENU:=WirelessAPD
|
||||
TITLE:=IEEE 802.1x Authenticator
|
||||
URL:=http://hostap.epitest.fi/
|
||||
DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus
|
||||
DEPENDS:=$(DRV_DEPENDS) +hostapd-common $(CORE_DEPENDS)
|
||||
EXTRA_DEPENDS:=hostapd-common (=$(PKG_VERSION)-$(PKG_RELEASE))
|
||||
USERID:=network=101:network=101
|
||||
PROVIDES:=hostapd
|
||||
@@ -173,7 +172,7 @@ define Package/hostapd-openssl
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (OpenSSL full)
|
||||
VARIANT:=full-openssl
|
||||
DEPENDS+=+PACKAGE_hostapd-openssl:libopenssl
|
||||
DEPENDS+=$(OPENSSL_DEPENDS)
|
||||
endef
|
||||
|
||||
Package/hostapd-openssl/description = $(Package/hostapd/description)
|
||||
@@ -255,7 +254,7 @@ define Package/wpad/Default
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
TITLE:=IEEE 802.1x Auth/Supplicant
|
||||
DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus
|
||||
DEPENDS:=$(DRV_DEPENDS) +hostapd-common $(CORE_DEPENDS)
|
||||
EXTRA_DEPENDS:=hostapd-common (=$(PKG_VERSION)-$(PKG_RELEASE))
|
||||
USERID:=network=101:network=101
|
||||
URL:=http://hostap.epitest.fi/
|
||||
@@ -280,7 +279,7 @@ define Package/wpad-openssl
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (OpenSSL full)
|
||||
VARIANT:=wpad-full-openssl
|
||||
DEPENDS+=+PACKAGE_wpad-openssl:libopenssl
|
||||
DEPENDS+=$(OPENSSL_DEPENDS)
|
||||
endef
|
||||
|
||||
Package/wpad-openssl/description = $(Package/wpad/description)
|
||||
@@ -317,7 +316,7 @@ define Package/wpad-basic-openssl
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (OpenSSL, 11r, 11w)
|
||||
VARIANT:=wpad-basic-openssl
|
||||
DEPENDS+=+PACKAGE_wpad-basic-openssl:libopenssl
|
||||
DEPENDS+=$(OPENSSL_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-openssl/description
|
||||
@@ -358,7 +357,7 @@ endef
|
||||
|
||||
define Package/wpad-mesh
|
||||
$(call Package/wpad/Default,$(1))
|
||||
DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN)
|
||||
DEPENDS+=@(!TARGET_uml||BROKEN)
|
||||
PROVIDES+=wpa-supplicant-mesh wpad-mesh
|
||||
endef
|
||||
|
||||
@@ -369,7 +368,7 @@ endef
|
||||
define Package/wpad-mesh-openssl
|
||||
$(call Package/wpad-mesh,$(1))
|
||||
TITLE+= (OpenSSL, 11s, SAE)
|
||||
DEPENDS+=+PACKAGE_wpad-mesh-openssl:libopenssl
|
||||
DEPENDS+=$(OPENSSL_DEPENDS)
|
||||
VARIANT:=wpad-mesh-openssl
|
||||
endef
|
||||
|
||||
@@ -400,7 +399,7 @@ define Package/wpa-supplicant/Default
|
||||
SUBMENU:=WirelessAPD
|
||||
TITLE:=WPA Supplicant
|
||||
URL:=http://hostap.epitest.fi/wpa_supplicant/
|
||||
DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus
|
||||
DEPENDS:=$(DRV_DEPENDS) +hostapd-common $(CORE_DEPENDS)
|
||||
EXTRA_DEPENDS:=hostapd-common (=$(PKG_VERSION)-$(PKG_RELEASE))
|
||||
USERID:=network=101:network=101
|
||||
PROVIDES:=wpa-supplicant
|
||||
@@ -418,7 +417,7 @@ define Package/wpa-supplicant-openssl
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (OpenSSL full)
|
||||
VARIANT:=supplicant-full-openssl
|
||||
DEPENDS+=+PACKAGE_wpa-supplicant-openssl:libopenssl
|
||||
DEPENDS+=$(OPENSSL_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-wolfssl
|
||||
@@ -442,13 +441,12 @@ endef
|
||||
define Package/wpa-supplicant-p2p
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (Wi-Fi P2P support)
|
||||
DEPENDS+=@PACKAGE_kmod-cfg80211
|
||||
VARIANT:=supplicant-p2p-internal
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mesh/Default
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN)
|
||||
DEPENDS+=@(!TARGET_uml||BROKEN)
|
||||
PROVIDES+=wpa-supplicant-mesh
|
||||
endef
|
||||
|
||||
@@ -456,7 +454,7 @@ define Package/wpa-supplicant-mesh-openssl
|
||||
$(call Package/wpa-supplicant-mesh/Default,$(1))
|
||||
TITLE+= (OpenSSL, 11s, SAE)
|
||||
VARIANT:=supplicant-mesh-openssl
|
||||
DEPENDS+=+PACKAGE_wpa-supplicant-mesh-openssl:libopenssl
|
||||
DEPENDS+=$(OPENSSL_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mesh-wolfssl
|
||||
@@ -522,7 +520,7 @@ define Package/eapol-test/Default
|
||||
SECTION:=net
|
||||
SUBMENU:=WirelessAPD
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=$(DRV_DEPENDS) +libubus
|
||||
DEPENDS:=$(DRV_DEPENDS) $(CORE_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/eapol-test
|
||||
@@ -536,7 +534,7 @@ define Package/eapol-test-openssl
|
||||
TITLE+= (OpenSSL full)
|
||||
VARIANT:=supplicant-full-openssl
|
||||
CONFLICTS:=$(filter-out eapol-test-openssl ,$(EAPOL_TEST_PROVIDERS))
|
||||
DEPENDS+=+PACKAGE_eapol-test-openssl:libopenssl
|
||||
DEPENDS+=$(OPENSSL_DEPENDS)
|
||||
PROVIDES:=eapol-test
|
||||
endef
|
||||
|
||||
@@ -587,11 +585,7 @@ TARGET_CPPFLAGS := \
|
||||
-D_GNU_SOURCE \
|
||||
$(if $(CONFIG_WPA_MSG_MIN_PRIORITY),-DCONFIG_MSG_MIN_PRIORITY=$(CONFIG_WPA_MSG_MIN_PRIORITY))
|
||||
|
||||
TARGET_LDFLAGS += -lubox -lubus
|
||||
|
||||
ifdef CONFIG_PACKAGE_kmod-cfg80211
|
||||
TARGET_LDFLAGS += -lm -lnl-tiny
|
||||
endif
|
||||
TARGET_LDFLAGS += -lubox -lubus -lblobmsg_json -lucode -lm -lnl-tiny
|
||||
|
||||
ifdef CONFIG_WPA_ENABLE_WEP
|
||||
DRIVER_MAKEOPTS += CONFIG_WEP=y
|
||||
@@ -676,22 +670,55 @@ define Build/Compile
|
||||
$(Build/Compile/$(BUILD_VARIANT))
|
||||
endef
|
||||
|
||||
define Install/hostapd/full
|
||||
$(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/config $(1)/etc/radius
|
||||
ln -sf hostapd $(1)/usr/sbin/hostapd-radius
|
||||
$(INSTALL_BIN) ./files/radius.init $(1)/etc/init.d/radius
|
||||
$(INSTALL_DATA) ./files/radius.config $(1)/etc/config/radius
|
||||
$(INSTALL_DATA) ./files/radius.clients $(1)/etc/radius/clients
|
||||
$(INSTALL_DATA) ./files/radius.users $(1)/etc/radius/users
|
||||
endef
|
||||
|
||||
define Package/hostapd-full/conffiles
|
||||
/etc/config/radius
|
||||
/etc/radius
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_VARIANT),full)
|
||||
Package/wpad-mesh-openssl/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/wpad-mesh-wolfssl/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/wpad-mesh-mbedtls/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/wpad/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/wpad-openssl/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/wpad-wolfssl/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/wpad-mbedtls/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/hostapd/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/hostapd-openssl/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/hostapd-wolfssl/conffiles = $(Package/hostapd-full/conffiles)
|
||||
Package/hostapd-mbedtls/conffiles = $(Package/hostapd-full/conffiles)
|
||||
endif
|
||||
|
||||
define Install/hostapd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/share/hostap
|
||||
$(INSTALL_DATA) ./files/hostapd.uc $(1)/usr/share/hostap/
|
||||
$(if $(findstring full,$(CONFIG_VARIANT)),$(Install/hostapd/full))
|
||||
endef
|
||||
|
||||
define Install/supplicant
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/share/hostap
|
||||
$(INSTALL_DATA) ./files/wpa_supplicant.uc $(1)/usr/share/hostap/
|
||||
endef
|
||||
|
||||
define Package/hostapd-common/install
|
||||
$(INSTALL_DIR) $(1)/etc/capabilities $(1)/etc/rc.button $(1)/etc/hotplug.d/ieee80211 $(1)/etc/init.d $(1)/lib/netifd $(1)/usr/share/acl.d
|
||||
$(INSTALL_DIR) $(1)/etc/capabilities $(1)/etc/rc.button $(1)/etc/hotplug.d/ieee80211 $(1)/etc/init.d $(1)/lib/netifd $(1)/usr/share/acl.d $(1)/usr/share/hostap
|
||||
$(INSTALL_BIN) ./files/dhcp-get-server.sh $(1)/lib/netifd/dhcp-get-server.sh
|
||||
$(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/netifd/hostapd.sh
|
||||
$(INSTALL_BIN) ./files/wpad.init $(1)/etc/init.d/wpad
|
||||
$(INSTALL_BIN) ./files/wps-hotplug.sh $(1)/etc/rc.button/wps
|
||||
$(INSTALL_DATA) ./files/wpad_acl.json $(1)/usr/share/acl.d
|
||||
$(INSTALL_DATA) ./files/wpad.json $(1)/etc/capabilities
|
||||
$(INSTALL_DATA) ./files/common.uc $(1)/usr/share/hostap/
|
||||
$(INSTALL_DATA) ./files/wdev.uc $(1)/usr/share/hostap/
|
||||
endef
|
||||
|
||||
define Package/hostapd/install
|
||||
|
||||
373
package/network/services/hostapd/files/common.uc
Normal file
373
package/network/services/hostapd/files/common.uc
Normal file
@@ -0,0 +1,373 @@
|
||||
import * as nl80211 from "nl80211";
|
||||
import * as rtnl from "rtnl";
|
||||
import { readfile, glob, basename, readlink } from "fs";
|
||||
|
||||
const iftypes = {
|
||||
ap: nl80211.const.NL80211_IFTYPE_AP,
|
||||
mesh: nl80211.const.NL80211_IFTYPE_MESH_POINT,
|
||||
sta: nl80211.const.NL80211_IFTYPE_STATION,
|
||||
adhoc: nl80211.const.NL80211_IFTYPE_ADHOC,
|
||||
monitor: nl80211.const.NL80211_IFTYPE_MONITOR,
|
||||
};
|
||||
|
||||
const mesh_params = {
|
||||
mesh_retry_timeout: "retry_timeout",
|
||||
mesh_confirm_timeout: "confirm_timeout",
|
||||
mesh_holding_timeout: "holding_timeout",
|
||||
mesh_max_peer_links: "max_peer_links",
|
||||
mesh_max_retries: "max_retries",
|
||||
mesh_ttl: "ttl",
|
||||
mesh_element_ttl: "element_ttl",
|
||||
mesh_auto_open_plinks: "auto_open_plinks",
|
||||
mesh_hwmp_max_preq_retries: "hwmp_max_preq_retries",
|
||||
mesh_path_refresh_time: "path_refresh_time",
|
||||
mesh_min_discovery_timeout: "min_discovery_timeout",
|
||||
mesh_hwmp_active_path_timeout: "hwmp_active_path_timeout",
|
||||
mesh_hwmp_preq_min_interval: "hwmp_preq_min_interval",
|
||||
mesh_hwmp_net_diameter_traversal_time: "hwmp_net_diam_trvs_time",
|
||||
mesh_hwmp_rootmode: "hwmp_rootmode",
|
||||
mesh_hwmp_rann_interval: "hwmp_rann_interval",
|
||||
mesh_gate_announcements: "gate_announcements",
|
||||
mesh_sync_offset_max_neighor: "sync_offset_max_neighbor",
|
||||
mesh_rssi_threshold: "rssi_threshold",
|
||||
mesh_hwmp_active_path_to_root_timeout: "hwmp_path_to_root_timeout",
|
||||
mesh_hwmp_root_interval: "hwmp_root_interval",
|
||||
mesh_hwmp_confirmation_interval: "hwmp_confirmation_interval",
|
||||
mesh_awake_window: "awake_window",
|
||||
mesh_plink_timeout: "plink_timeout",
|
||||
mesh_fwding: "forwarding",
|
||||
mesh_power_mode: "power_mode",
|
||||
mesh_nolearn: "nolearn"
|
||||
};
|
||||
|
||||
function wdev_remove(name)
|
||||
{
|
||||
nl80211.request(nl80211.const.NL80211_CMD_DEL_INTERFACE, 0, { dev: name });
|
||||
}
|
||||
|
||||
function __phy_is_fullmac(phyidx)
|
||||
{
|
||||
let data = nl80211.request(nl80211.const.NL80211_CMD_GET_WIPHY, 0, { wiphy: phyidx });
|
||||
|
||||
return !data.software_iftypes.ap_vlan;
|
||||
}
|
||||
|
||||
function phy_is_fullmac(phy)
|
||||
{
|
||||
let phyidx = int(trim(readfile(`/sys/class/ieee80211/${phy}/index`)));
|
||||
|
||||
return __phy_is_fullmac(phyidx);
|
||||
}
|
||||
|
||||
function find_reusable_wdev(phyidx)
|
||||
{
|
||||
if (!__phy_is_fullmac(phyidx))
|
||||
return null;
|
||||
|
||||
let data = nl80211.request(
|
||||
nl80211.const.NL80211_CMD_GET_INTERFACE,
|
||||
nl80211.const.NLM_F_DUMP,
|
||||
{ wiphy: phyidx });
|
||||
for (let res in data)
|
||||
if (trim(readfile(`/sys/class/net/${res.ifname}/operstate`)) == "down")
|
||||
return res.ifname;
|
||||
return null;
|
||||
}
|
||||
|
||||
function wdev_create(phy, name, data)
|
||||
{
|
||||
let phyidx = int(readfile(`/sys/class/ieee80211/${phy}/index`));
|
||||
|
||||
wdev_remove(name);
|
||||
|
||||
if (!iftypes[data.mode])
|
||||
return `Invalid mode: ${data.mode}`;
|
||||
|
||||
let req = {
|
||||
wiphy: phyidx,
|
||||
ifname: name,
|
||||
iftype: iftypes[data.mode],
|
||||
};
|
||||
|
||||
if (data["4addr"])
|
||||
req["4addr"] = data["4addr"];
|
||||
if (data.macaddr)
|
||||
req.mac = data.macaddr;
|
||||
|
||||
nl80211.error();
|
||||
|
||||
let reuse_ifname = find_reusable_wdev(phyidx);
|
||||
if (reuse_ifname &&
|
||||
(reuse_ifname == name ||
|
||||
rtnl.request(rtnl.const.RTM_SETLINK, 0, { dev: reuse_ifname, ifname: name}) != false))
|
||||
nl80211.request(
|
||||
nl80211.const.NL80211_CMD_SET_INTERFACE, 0, {
|
||||
wiphy: phyidx,
|
||||
dev: name,
|
||||
iftype: iftypes[data.mode],
|
||||
});
|
||||
else
|
||||
nl80211.request(
|
||||
nl80211.const.NL80211_CMD_NEW_INTERFACE,
|
||||
nl80211.const.NLM_F_CREATE,
|
||||
req);
|
||||
|
||||
let error = nl80211.error();
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
if (data.powersave != null) {
|
||||
nl80211.request(nl80211.const.NL80211_CMD_SET_POWER_SAVE, 0,
|
||||
{ dev: name, ps_state: data.powersave ? 1 : 0});
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function wdev_set_mesh_params(name, data)
|
||||
{
|
||||
let mesh_cfg = {};
|
||||
|
||||
for (let key in mesh_params) {
|
||||
let val = data[key];
|
||||
if (val == null)
|
||||
continue;
|
||||
mesh_cfg[mesh_params[key]] = int(val);
|
||||
}
|
||||
|
||||
if (!length(mesh_cfg))
|
||||
return null;
|
||||
|
||||
nl80211.request(nl80211.const.NL80211_CMD_SET_MESH_CONFIG, 0,
|
||||
{ dev: name, mesh_params: mesh_cfg });
|
||||
|
||||
return nl80211.error();
|
||||
}
|
||||
|
||||
function wdev_set_up(name, up)
|
||||
{
|
||||
rtnl.request(rtnl.const.RTM_SETLINK, 0, { dev: name, change: 1, flags: up ? 1 : 0 });
|
||||
}
|
||||
|
||||
function phy_sysfs_file(phy, name)
|
||||
{
|
||||
return trim(readfile(`/sys/class/ieee80211/${phy}/${name}`));
|
||||
}
|
||||
|
||||
function macaddr_split(str)
|
||||
{
|
||||
return map(split(str, ":"), (val) => hex(val));
|
||||
}
|
||||
|
||||
function macaddr_join(addr)
|
||||
{
|
||||
return join(":", map(addr, (val) => sprintf("%02x", val)));
|
||||
}
|
||||
|
||||
function wdev_macaddr(wdev)
|
||||
{
|
||||
return trim(readfile(`/sys/class/net/${wdev}/address`));
|
||||
}
|
||||
|
||||
const phy_proto = {
|
||||
macaddr_init: function(used, options) {
|
||||
this.macaddr_options = options ?? {};
|
||||
this.macaddr_list = {};
|
||||
|
||||
if (type(used) == "object")
|
||||
for (let addr in used)
|
||||
this.macaddr_list[addr] = used[addr];
|
||||
else
|
||||
for (let addr in used)
|
||||
this.macaddr_list[addr] = -1;
|
||||
|
||||
this.for_each_wdev((wdev) => {
|
||||
let macaddr = wdev_macaddr(wdev);
|
||||
this.macaddr_list[macaddr] ??= -1;
|
||||
});
|
||||
|
||||
return this.macaddr_list;
|
||||
},
|
||||
|
||||
macaddr_generate: function(data) {
|
||||
let phy = this.name;
|
||||
let idx = int(data.id ?? 0);
|
||||
let mbssid = int(data.mbssid ?? 0) > 0;
|
||||
let num_global = int(data.num_global ?? 1);
|
||||
let use_global = !mbssid && idx < num_global;
|
||||
|
||||
let base_addr = phy_sysfs_file(phy, "macaddress");
|
||||
if (!base_addr)
|
||||
return null;
|
||||
|
||||
if (!idx && !mbssid)
|
||||
return base_addr;
|
||||
|
||||
let base_mask = phy_sysfs_file(phy, "address_mask");
|
||||
if (!base_mask)
|
||||
return null;
|
||||
|
||||
if (base_mask == "00:00:00:00:00:00" && idx >= num_global) {
|
||||
let addrs = split(phy_sysfs_file(phy, "addresses"), "\n");
|
||||
|
||||
if (idx < length(addrs))
|
||||
return addrs[idx];
|
||||
|
||||
base_mask = "ff:ff:ff:ff:ff:ff";
|
||||
}
|
||||
|
||||
let addr = macaddr_split(base_addr);
|
||||
let mask = macaddr_split(base_mask);
|
||||
let type;
|
||||
|
||||
if (mbssid)
|
||||
type = "b5";
|
||||
else if (use_global)
|
||||
type = "add";
|
||||
else if (mask[0] > 0)
|
||||
type = "b1";
|
||||
else if (mask[5] < 0xff)
|
||||
type = "b5";
|
||||
else
|
||||
type = "add";
|
||||
|
||||
switch (type) {
|
||||
case "b1":
|
||||
if (!(addr[0] & 2))
|
||||
idx--;
|
||||
addr[0] |= 2;
|
||||
addr[0] ^= idx << 2;
|
||||
break;
|
||||
case "b5":
|
||||
if (mbssid)
|
||||
addr[0] |= 2;
|
||||
addr[5] ^= idx;
|
||||
break;
|
||||
default:
|
||||
for (let i = 5; i > 0; i--) {
|
||||
addr[i] += idx;
|
||||
if (addr[i] < 256)
|
||||
break;
|
||||
addr[i] %= 256;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return macaddr_join(addr);
|
||||
},
|
||||
|
||||
macaddr_next: function(val) {
|
||||
let data = this.macaddr_options ?? {};
|
||||
let list = this.macaddr_list;
|
||||
|
||||
for (let i = 0; i < 32; i++) {
|
||||
data.id = i;
|
||||
|
||||
let mac = this.macaddr_generate(data);
|
||||
if (!mac)
|
||||
return null;
|
||||
|
||||
if (list[mac] != null)
|
||||
continue;
|
||||
|
||||
list[mac] = val != null ? val : -1;
|
||||
return mac;
|
||||
}
|
||||
},
|
||||
|
||||
for_each_wdev: function(cb) {
|
||||
let wdevs = glob(`/sys/class/ieee80211/${this.name}/device/net/*`);
|
||||
wdevs = map(wdevs, (arg) => basename(arg));
|
||||
for (let wdev in wdevs) {
|
||||
if (basename(readlink(`/sys/class/net/${wdev}/phy80211`)) != this.name)
|
||||
continue;
|
||||
|
||||
cb(wdev);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function phy_open(phy)
|
||||
{
|
||||
let phyidx = readfile(`/sys/class/ieee80211/${phy}/index`);
|
||||
if (!phyidx)
|
||||
return null;
|
||||
|
||||
return proto({
|
||||
name: phy,
|
||||
idx: int(phyidx)
|
||||
}, phy_proto);
|
||||
}
|
||||
|
||||
const vlist_proto = {
|
||||
update: function(values, arg) {
|
||||
let data = this.data;
|
||||
let cb = this.cb;
|
||||
let seq = { };
|
||||
let new_data = {};
|
||||
let old_data = {};
|
||||
|
||||
this.data = new_data;
|
||||
|
||||
if (type(values) == "object") {
|
||||
for (let key in values) {
|
||||
old_data[key] = data[key];
|
||||
new_data[key] = values[key];
|
||||
delete data[key];
|
||||
}
|
||||
} else {
|
||||
for (let val in values) {
|
||||
let cur_key = val[0];
|
||||
let cur_obj = val[1];
|
||||
|
||||
old_data[cur_key] = data[cur_key];
|
||||
new_data[cur_key] = val[1];
|
||||
delete data[cur_key];
|
||||
}
|
||||
}
|
||||
|
||||
for (let key in data) {
|
||||
cb(null, data[key], arg);
|
||||
delete data[key];
|
||||
}
|
||||
for (let key in new_data)
|
||||
cb(new_data[key], old_data[key], arg);
|
||||
}
|
||||
};
|
||||
|
||||
function is_equal(val1, val2) {
|
||||
let t1 = type(val1);
|
||||
|
||||
if (t1 != type(val2))
|
||||
return false;
|
||||
|
||||
if (t1 == "array") {
|
||||
if (length(val1) != length(val2))
|
||||
return false;
|
||||
|
||||
for (let i = 0; i < length(val1); i++)
|
||||
if (!is_equal(val1[i], val2[i]))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
} else if (t1 == "object") {
|
||||
for (let key in val1)
|
||||
if (!is_equal(val1[key], val2[key]))
|
||||
return false;
|
||||
for (let key in val2)
|
||||
if (val1[key] == null)
|
||||
return false;
|
||||
return true;
|
||||
} else {
|
||||
return val1 == val2;
|
||||
}
|
||||
}
|
||||
|
||||
function vlist_new(cb) {
|
||||
return proto({
|
||||
cb: cb,
|
||||
data: {}
|
||||
}, vlist_proto);
|
||||
}
|
||||
|
||||
export { wdev_remove, wdev_create, wdev_set_mesh_params, wdev_set_up, is_equal, vlist_new, phy_is_fullmac, phy_open };
|
||||
@@ -50,14 +50,14 @@ hostapd_append_wpa_key_mgmt() {
|
||||
append wpa_key_mgmt "WPA-EAP-SUITE-B-192"
|
||||
[ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-EAP-SHA384"
|
||||
;;
|
||||
eap-eap192)
|
||||
append wpa_key_mgmt "WPA-EAP-SUITE-B-192"
|
||||
eap-eap2)
|
||||
append wpa_key_mgmt "WPA-EAP"
|
||||
[ "${ieee80211r:-0}" -gt 0 ] && {
|
||||
append wpa_key_mgmt "FT-EAP-SHA384"
|
||||
append wpa_key_mgmt "FT-EAP"
|
||||
}
|
||||
[ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-EAP-SHA256"
|
||||
append wpa_key_mgmt "WPA-EAP-SHA256"
|
||||
[ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-EAP"
|
||||
;;
|
||||
eap2)
|
||||
[ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-EAP"
|
||||
append wpa_key_mgmt "WPA-EAP-SHA256"
|
||||
;;
|
||||
sae)
|
||||
append wpa_key_mgmt "SAE"
|
||||
@@ -77,6 +77,10 @@ hostapd_append_wpa_key_mgmt() {
|
||||
|
||||
[ "$fils" -gt 0 ] && {
|
||||
case "$auth_type" in
|
||||
eap-192)
|
||||
append wpa_key_mgmt FILS-SHA384
|
||||
[ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt FT-FILS-SHA384
|
||||
;;
|
||||
eap*)
|
||||
append wpa_key_mgmt FILS-SHA256
|
||||
[ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt FT-FILS-SHA256
|
||||
@@ -121,6 +125,7 @@ hostapd_common_add_device_config() {
|
||||
config_add_array hostapd_options
|
||||
|
||||
config_add_int airtime_mode
|
||||
config_add_int mbssid
|
||||
|
||||
hostapd_add_log_config
|
||||
}
|
||||
@@ -133,7 +138,8 @@ hostapd_prepare_device_config() {
|
||||
|
||||
json_get_vars country country3 country_ie beacon_int:100 doth require_mode legacy_rates \
|
||||
acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density \
|
||||
rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc
|
||||
rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc \
|
||||
mbssid:0
|
||||
|
||||
hostapd_set_log_options base_cfg
|
||||
|
||||
@@ -234,6 +240,7 @@ hostapd_prepare_device_config() {
|
||||
[ -n "$rts_threshold" ] && append base_cfg "rts_threshold=$rts_threshold" "$N"
|
||||
[ "$airtime_mode" -gt 0 ] && append base_cfg "airtime_mode=$airtime_mode" "$N"
|
||||
[ -n "$maxassoc" ] && append base_cfg "iface_max_num_sta=$maxassoc" "$N"
|
||||
[ "$mbssid" -gt 0 ] && [ "$mbssid" -le 2 ] && append base_cfg "mbssid=$mbssid" "$N"
|
||||
|
||||
json_get_values opts hostapd_options
|
||||
for val in $opts; do
|
||||
@@ -625,8 +632,7 @@ hostapd_set_bss_options() {
|
||||
[ -n "$wpa_strict_rekey" ] && append bss_conf "wpa_strict_rekey=$wpa_strict_rekey" "$N"
|
||||
}
|
||||
|
||||
set_default nasid "${macaddr//\:}"
|
||||
append bss_conf "nas_identifier=$nasid" "$N"
|
||||
[ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N"
|
||||
|
||||
[ -n "$acct_interval" ] && \
|
||||
append bss_conf "radius_acct_interim_interval=$acct_interval" "$N"
|
||||
@@ -636,12 +642,12 @@ hostapd_set_bss_options() {
|
||||
[ -n "$ocv" ] && append bss_conf "ocv=$ocv" "$N"
|
||||
|
||||
case "$auth_type" in
|
||||
sae|owe|eap192|eap-eap192)
|
||||
sae|owe|eap2|eap192)
|
||||
set_default ieee80211w 2
|
||||
set_default sae_require_mfp 1
|
||||
set_default sae_pwe 2
|
||||
;;
|
||||
psk-sae)
|
||||
psk-sae|eap-eap2)
|
||||
set_default ieee80211w 1
|
||||
set_default sae_require_mfp 1
|
||||
set_default sae_pwe 2
|
||||
@@ -692,7 +698,7 @@ hostapd_set_bss_options() {
|
||||
vlan_possible=1
|
||||
wps_possible=1
|
||||
;;
|
||||
eap|eap192|eap-eap192)
|
||||
eap|eap2|eap-eap2|eap192)
|
||||
json_get_vars \
|
||||
auth_server auth_secret auth_port \
|
||||
dae_client dae_secret dae_port \
|
||||
@@ -864,8 +870,9 @@ hostapd_set_bss_options() {
|
||||
[ "$bss_transition" -eq "1" ] && append bss_conf "bss_transition=1" "$N"
|
||||
[ "$mbo" -eq 1 ] && append bss_conf "mbo=1" "$N"
|
||||
|
||||
json_get_vars ieee80211k rrm_neighbor_report rrm_beacon_report
|
||||
json_get_vars ieee80211k rrm_neighbor_report rrm_beacon_report rnr
|
||||
set_default ieee80211k 0
|
||||
set_default rnr 0
|
||||
if [ "$ieee80211k" -eq "1" ]; then
|
||||
set_default rrm_neighbor_report 1
|
||||
set_default rrm_beacon_report 1
|
||||
@@ -876,6 +883,7 @@ hostapd_set_bss_options() {
|
||||
|
||||
[ "$rrm_neighbor_report" -eq "1" ] && append bss_conf "rrm_neighbor_report=1" "$N"
|
||||
[ "$rrm_beacon_report" -eq "1" ] && append bss_conf "rrm_beacon_report=1" "$N"
|
||||
[ "$rnr" -eq "1" ] && append bss_conf "rnr=1" "$N"
|
||||
|
||||
json_get_vars ftm_responder stationary_ap lci civic
|
||||
set_default ftm_responder 0
|
||||
@@ -1156,9 +1164,6 @@ hostapd_set_bss_options() {
|
||||
append bss_conf "$val" "$N"
|
||||
done
|
||||
|
||||
bss_md5sum="$(echo $bss_conf | md5sum | cut -d" " -f1)"
|
||||
append bss_conf "config_id=$bss_md5sum" "$N"
|
||||
|
||||
append "$var" "$bss_conf" "$N"
|
||||
return 0
|
||||
}
|
||||
@@ -1300,7 +1305,7 @@ wpa_supplicant_add_network() {
|
||||
default_disabled
|
||||
|
||||
case "$auth_type" in
|
||||
sae|owe|eap192|eap-eap192)
|
||||
sae|owe|eap2|eap192)
|
||||
set_default ieee80211w 2
|
||||
;;
|
||||
psk-sae)
|
||||
@@ -1383,7 +1388,7 @@ wpa_supplicant_add_network() {
|
||||
fi
|
||||
append network_data "$passphrase" "$N$T"
|
||||
;;
|
||||
eap|eap192|eap-eap192)
|
||||
eap|eap2|eap192)
|
||||
hostapd_append_wpa_key_mgmt
|
||||
key_mgmt="$wpa_key_mgmt"
|
||||
|
||||
@@ -1588,29 +1593,6 @@ EOF
|
||||
return 0
|
||||
}
|
||||
|
||||
wpa_supplicant_run() {
|
||||
local ifname="$1"
|
||||
local hostapd_ctrl="$2"
|
||||
|
||||
_wpa_supplicant_common "$ifname"
|
||||
|
||||
ubus wait_for wpa_supplicant
|
||||
local supplicant_res="$(ubus call wpa_supplicant config_add "{ \
|
||||
\"driver\": \"${_w_driver:-wext}\", \"ctrl\": \"$_rpath\", \
|
||||
\"iface\": \"$ifname\", \"config\": \"$_config\" \
|
||||
${network_bridge:+, \"bridge\": \"$network_bridge\"} \
|
||||
${hostapd_ctrl:+, \"hostapd_ctrl\": \"$hostapd_ctrl\"} \
|
||||
}")"
|
||||
|
||||
ret="$?"
|
||||
|
||||
[ "$ret" != 0 -o -z "$supplicant_res" ] && wireless_setup_vif_failed WPA_SUPPLICANT_FAILED
|
||||
|
||||
wireless_add_process "$(jsonfilter -s "$supplicant_res" -l 1 -e @.pid)" "/usr/sbin/wpa_supplicant" 1 1
|
||||
|
||||
return $ret
|
||||
}
|
||||
|
||||
hostapd_common_cleanup() {
|
||||
killall meshd-nl80211
|
||||
}
|
||||
|
||||
812
package/network/services/hostapd/files/hostapd.uc
Normal file
812
package/network/services/hostapd/files/hostapd.uc
Normal file
@@ -0,0 +1,812 @@
|
||||
let libubus = require("ubus");
|
||||
import { open, readfile } from "fs";
|
||||
import { wdev_create, wdev_remove, is_equal, vlist_new, phy_is_fullmac, phy_open } from "common";
|
||||
|
||||
let ubus = libubus.connect();
|
||||
|
||||
hostapd.data.config = {};
|
||||
|
||||
hostapd.data.file_fields = {
|
||||
vlan_file: true,
|
||||
wpa_psk_file: true,
|
||||
accept_mac_file: true,
|
||||
deny_mac_file: true,
|
||||
eap_user_file: true,
|
||||
ca_cert: true,
|
||||
server_cert: true,
|
||||
server_cert2: true,
|
||||
private_key: true,
|
||||
private_key2: true,
|
||||
dh_file: true,
|
||||
eap_sim_db: true,
|
||||
};
|
||||
|
||||
function iface_remove(cfg)
|
||||
{
|
||||
if (!cfg || !cfg.bss || !cfg.bss[0] || !cfg.bss[0].ifname)
|
||||
return;
|
||||
|
||||
for (let bss in cfg.bss)
|
||||
wdev_remove(bss.ifname);
|
||||
}
|
||||
|
||||
function iface_gen_config(phy, config, start_disabled)
|
||||
{
|
||||
let str = `data:
|
||||
${join("\n", config.radio.data)}
|
||||
channel=${config.radio.channel}
|
||||
`;
|
||||
|
||||
for (let i = 0; i < length(config.bss); i++) {
|
||||
let bss = config.bss[i];
|
||||
let type = i > 0 ? "bss" : "interface";
|
||||
let nasid = bss.nasid ?? replace(bss.bssid, ":", "");
|
||||
|
||||
str += `
|
||||
${type}=${bss.ifname}
|
||||
bssid=${bss.bssid}
|
||||
${join("\n", bss.data)}
|
||||
nas_identifier=${nasid}
|
||||
`;
|
||||
if (start_disabled)
|
||||
str += `
|
||||
start_disabled=1
|
||||
`;
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
function iface_freq_info(iface, config, params)
|
||||
{
|
||||
let freq = params.frequency;
|
||||
if (!freq)
|
||||
return null;
|
||||
|
||||
let sec_offset = params.sec_chan_offset;
|
||||
if (sec_offset != -1 && sec_offset != 1)
|
||||
sec_offset = 0;
|
||||
|
||||
let width = 0;
|
||||
for (let line in config.radio.data) {
|
||||
if (!sec_offset && match(line, /^ht_capab=.*HT40/)) {
|
||||
sec_offset = null; // auto-detect
|
||||
continue;
|
||||
}
|
||||
|
||||
let val = match(line, /^(vht_oper_chwidth|he_oper_chwidth)=(\d+)/);
|
||||
if (!val)
|
||||
continue;
|
||||
|
||||
val = int(val[2]);
|
||||
if (val > width)
|
||||
width = val;
|
||||
}
|
||||
|
||||
if (freq < 4000)
|
||||
width = 0;
|
||||
|
||||
return hostapd.freq_info(freq, sec_offset, width);
|
||||
}
|
||||
|
||||
function iface_add(phy, config, phy_status)
|
||||
{
|
||||
let config_inline = iface_gen_config(phy, config, !!phy_status);
|
||||
|
||||
let bss = config.bss[0];
|
||||
let ret = hostapd.add_iface(`bss_config=${phy}:${config_inline}`);
|
||||
if (ret < 0)
|
||||
return false;
|
||||
|
||||
if (!phy_status)
|
||||
return true;
|
||||
|
||||
let iface = hostapd.interfaces[phy];
|
||||
if (!iface)
|
||||
return false;
|
||||
|
||||
let freq_info = iface_freq_info(iface, config, phy_status);
|
||||
|
||||
return iface.start(freq_info) >= 0;
|
||||
}
|
||||
|
||||
function iface_config_macaddr_list(config)
|
||||
{
|
||||
let macaddr_list = {};
|
||||
for (let i = 0; i < length(config.bss); i++) {
|
||||
let bss = config.bss[i];
|
||||
if (!bss.default_macaddr)
|
||||
macaddr_list[bss.bssid] = i;
|
||||
}
|
||||
|
||||
return macaddr_list;
|
||||
}
|
||||
|
||||
function iface_update_supplicant_macaddr(phy, config)
|
||||
{
|
||||
let macaddr_list = [];
|
||||
for (let i = 0; i < length(config.bss); i++)
|
||||
push(macaddr_list, config.bss[i].bssid);
|
||||
ubus.call("wpa_supplicant", "phy_set_macaddr_list", { phy: phy, macaddr: macaddr_list });
|
||||
}
|
||||
|
||||
function iface_restart(phydev, config, old_config)
|
||||
{
|
||||
let phy = phydev.name;
|
||||
|
||||
hostapd.remove_iface(phy);
|
||||
iface_remove(old_config);
|
||||
iface_remove(config);
|
||||
|
||||
if (!config.bss || !config.bss[0]) {
|
||||
hostapd.printf(`No bss for phy ${phy}`);
|
||||
return;
|
||||
}
|
||||
|
||||
phydev.macaddr_init(iface_config_macaddr_list(config));
|
||||
for (let i = 0; i < length(config.bss); i++) {
|
||||
let bss = config.bss[i];
|
||||
if (bss.default_macaddr)
|
||||
bss.bssid = phydev.macaddr_next();
|
||||
}
|
||||
|
||||
iface_update_supplicant_macaddr(phy, config);
|
||||
|
||||
let bss = config.bss[0];
|
||||
let err = wdev_create(phy, bss.ifname, { mode: "ap" });
|
||||
if (err)
|
||||
hostapd.printf(`Failed to create ${bss.ifname} on phy ${phy}: ${err}`);
|
||||
|
||||
let ubus = hostapd.data.ubus;
|
||||
let phy_status = ubus.call("wpa_supplicant", "phy_status", { phy: phy });
|
||||
if (phy_status && phy_status.state == "COMPLETED") {
|
||||
if (iface_add(phy, config, phy_status))
|
||||
return;
|
||||
|
||||
hostapd.printf(`Failed to bring up phy ${phy} ifname=${bss.ifname} with supplicant provided frequency`);
|
||||
}
|
||||
|
||||
ubus.call("wpa_supplicant", "phy_set_state", { phy: phy, stop: true });
|
||||
if (!iface_add(phy, config))
|
||||
hostapd.printf(`hostapd.add_iface failed for phy ${phy} ifname=${bss.ifname}`);
|
||||
ubus.call("wpa_supplicant", "phy_set_state", { phy: phy, stop: false });
|
||||
}
|
||||
|
||||
function array_to_obj(arr, key, start)
|
||||
{
|
||||
let obj = {};
|
||||
|
||||
start ??= 0;
|
||||
for (let i = start; i < length(arr); i++) {
|
||||
let cur = arr[i];
|
||||
obj[cur[key]] = cur;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
function find_array_idx(arr, key, val)
|
||||
{
|
||||
for (let i = 0; i < length(arr); i++)
|
||||
if (arr[i][key] == val)
|
||||
return i;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
function bss_reload_psk(bss, config, old_config)
|
||||
{
|
||||
if (is_equal(old_config.hash.wpa_psk_file, config.hash.wpa_psk_file))
|
||||
return;
|
||||
|
||||
old_config.hash.wpa_psk_file = config.hash.wpa_psk_file;
|
||||
if (!is_equal(old_config, config))
|
||||
return;
|
||||
|
||||
let ret = bss.ctrl("RELOAD_WPA_PSK");
|
||||
ret ??= "failed";
|
||||
|
||||
hostapd.printf(`Reload WPA PSK file for bss ${config.ifname}: ${ret}`);
|
||||
}
|
||||
|
||||
function remove_file_fields(config)
|
||||
{
|
||||
return filter(config, (line) => !hostapd.data.file_fields[split(line, "=")[0]]);
|
||||
}
|
||||
|
||||
function bss_remove_file_fields(config)
|
||||
{
|
||||
let new_cfg = {};
|
||||
|
||||
for (let key in config)
|
||||
new_cfg[key] = config[key];
|
||||
new_cfg.data = remove_file_fields(new_cfg.data);
|
||||
new_cfg.hash = {};
|
||||
for (let key in config.hash)
|
||||
new_cfg.hash[key] = config.hash[key];
|
||||
delete new_cfg.hash.wpa_psk_file;
|
||||
delete new_cfg.hash.vlan_file;
|
||||
|
||||
return new_cfg;
|
||||
}
|
||||
|
||||
function bss_config_hash(config)
|
||||
{
|
||||
return hostapd.sha1(remove_file_fields(config) + "");
|
||||
}
|
||||
|
||||
function bss_find_existing(config, prev_config, prev_hash)
|
||||
{
|
||||
let hash = bss_config_hash(config.data);
|
||||
|
||||
for (let i = 0; i < length(prev_config.bss); i++) {
|
||||
if (!prev_hash[i] || hash != prev_hash[i])
|
||||
continue;
|
||||
|
||||
prev_hash[i] = null;
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
function get_config_bss(config, idx)
|
||||
{
|
||||
if (!config.bss[idx]) {
|
||||
hostapd.printf(`Invalid bss index ${idx}`);
|
||||
return null;
|
||||
}
|
||||
|
||||
let ifname = config.bss[idx].ifname;
|
||||
if (!ifname)
|
||||
hostapd.printf(`Could not find bss ${config.bss[idx].ifname}`);
|
||||
|
||||
return hostapd.bss[ifname];
|
||||
}
|
||||
|
||||
function iface_reload_config(phydev, config, old_config)
|
||||
{
|
||||
let phy = phydev.name;
|
||||
|
||||
if (!old_config || !is_equal(old_config.radio, config.radio))
|
||||
return false;
|
||||
|
||||
if (is_equal(old_config.bss, config.bss))
|
||||
return true;
|
||||
|
||||
if (!old_config.bss || !old_config.bss[0])
|
||||
return false;
|
||||
|
||||
let iface = hostapd.interfaces[phy];
|
||||
if (!iface) {
|
||||
hostapd.printf(`Could not find previous interface ${iface_name}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
let iface_name = old_config.bss[0].ifname;
|
||||
let first_bss = hostapd.bss[iface_name];
|
||||
if (!first_bss) {
|
||||
hostapd.printf(`Could not find bss of previous interface ${iface_name}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
let macaddr_list = iface_config_macaddr_list(config);
|
||||
let bss_list = [];
|
||||
let bss_list_cfg = [];
|
||||
let prev_bss_hash = [];
|
||||
|
||||
for (let bss in old_config.bss) {
|
||||
let hash = bss_config_hash(bss.data);
|
||||
push(prev_bss_hash, bss_config_hash(bss.data));
|
||||
}
|
||||
|
||||
// Step 1: find (possibly renamed) interfaces with the same config
|
||||
// and store them in the new order (with gaps)
|
||||
for (let i = 0; i < length(config.bss); i++) {
|
||||
let prev;
|
||||
|
||||
// For fullmac devices, the first interface needs to be preserved,
|
||||
// since it's treated as the master
|
||||
if (!i && phy_is_fullmac(phy)) {
|
||||
prev = 0;
|
||||
prev_bss_hash[0] = null;
|
||||
} else {
|
||||
prev = bss_find_existing(config.bss[i], old_config, prev_bss_hash);
|
||||
}
|
||||
if (prev < 0)
|
||||
continue;
|
||||
|
||||
let cur_config = config.bss[i];
|
||||
let prev_config = old_config.bss[prev];
|
||||
|
||||
let prev_bss = get_config_bss(old_config, prev);
|
||||
if (!prev_bss)
|
||||
return false;
|
||||
|
||||
// try to preserve MAC address of this BSS by reassigning another
|
||||
// BSS if necessary
|
||||
if (cur_config.default_macaddr &&
|
||||
!macaddr_list[prev_config.bssid]) {
|
||||
macaddr_list[prev_config.bssid] = i;
|
||||
cur_config.bssid = prev_config.bssid;
|
||||
}
|
||||
|
||||
bss_list[i] = prev_bss;
|
||||
bss_list_cfg[i] = old_config.bss[prev];
|
||||
}
|
||||
|
||||
if (config.mbssid && !bss_list_cfg[0]) {
|
||||
hostapd.printf("First BSS changed with MBSSID enabled");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Step 2: if none were found, rename and preserve the first one
|
||||
if (length(bss_list) == 0) {
|
||||
// can't change the bssid of the first bss
|
||||
if (config.bss[0].bssid != old_config.bss[0].bssid) {
|
||||
if (!config.bss[0].default_macaddr) {
|
||||
hostapd.printf(`BSSID of first interface changed: ${lc(old_config.bss[0].bssid)} -> ${lc(config.bss[0].bssid)}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
config.bss[0].bssid = old_config.bss[0].bssid;
|
||||
}
|
||||
|
||||
let prev_bss = get_config_bss(old_config, 0);
|
||||
if (!prev_bss)
|
||||
return false;
|
||||
|
||||
macaddr_list[config.bss[0].bssid] = 0;
|
||||
bss_list[0] = prev_bss;
|
||||
bss_list_cfg[0] = old_config.bss[0];
|
||||
prev_bss_hash[0] = null;
|
||||
}
|
||||
|
||||
// Step 3: delete all unused old interfaces
|
||||
for (let i = 0; i < length(prev_bss_hash); i++) {
|
||||
if (!prev_bss_hash[i])
|
||||
continue;
|
||||
|
||||
let prev_bss = get_config_bss(old_config, i);
|
||||
if (!prev_bss)
|
||||
return false;
|
||||
|
||||
let ifname = old_config.bss[i].ifname;
|
||||
hostapd.printf(`Remove bss '${ifname}' on phy '${phy}'`);
|
||||
prev_bss.delete();
|
||||
wdev_remove(ifname);
|
||||
}
|
||||
|
||||
// Step 4: rename preserved interfaces, use temporary name on duplicates
|
||||
let rename_list = [];
|
||||
for (let i = 0; i < length(bss_list); i++) {
|
||||
if (!bss_list[i])
|
||||
continue;
|
||||
|
||||
let old_ifname = bss_list_cfg[i].ifname;
|
||||
let new_ifname = config.bss[i].ifname;
|
||||
if (old_ifname == new_ifname)
|
||||
continue;
|
||||
|
||||
if (hostapd.bss[new_ifname]) {
|
||||
new_ifname = "tmp_" + substr(hostapd.sha1(new_ifname), 0, 8);
|
||||
push(rename_list, i);
|
||||
}
|
||||
|
||||
hostapd.printf(`Rename bss ${old_ifname} to ${new_ifname}`);
|
||||
if (!bss_list[i].rename(new_ifname)) {
|
||||
hostapd.printf(`Failed to rename bss ${old_ifname} to ${new_ifname}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
bss_list_cfg[i].ifname = new_ifname;
|
||||
}
|
||||
|
||||
// Step 5: rename interfaces with temporary names
|
||||
for (let i in rename_list) {
|
||||
let new_ifname = config.bss[i].ifname;
|
||||
if (!bss_list[i].rename(new_ifname)) {
|
||||
hostapd.printf(`Failed to rename bss to ${new_ifname}`);
|
||||
return false;
|
||||
}
|
||||
bss_list_cfg[i].ifname = new_ifname;
|
||||
}
|
||||
|
||||
// Step 6: assign BSSID for newly created interfaces
|
||||
let macaddr_data = {
|
||||
num_global: config.num_global_macaddr ?? 1,
|
||||
mbssid: config.mbssid ?? 0,
|
||||
};
|
||||
macaddr_list = phydev.macaddr_init(macaddr_list, macaddr_data);
|
||||
for (let i = 0; i < length(config.bss); i++) {
|
||||
if (bss_list[i])
|
||||
continue;
|
||||
let bsscfg = config.bss[i];
|
||||
|
||||
let mac_idx = macaddr_list[bsscfg.bssid];
|
||||
if (mac_idx < 0)
|
||||
macaddr_list[bsscfg.bssid] = i;
|
||||
if (mac_idx == i)
|
||||
continue;
|
||||
|
||||
// statically assigned bssid of the new interface is in conflict
|
||||
// with the bssid of a reused interface. reassign the reused interface
|
||||
if (!bsscfg.default_macaddr) {
|
||||
// can't update bssid of the first BSS, need to restart
|
||||
if (!mac_idx < 0)
|
||||
return false;
|
||||
|
||||
bsscfg = config.bss[mac_idx];
|
||||
}
|
||||
|
||||
let addr = phydev.macaddr_next(i);
|
||||
if (!addr) {
|
||||
hostapd.printf(`Failed to generate mac address for phy ${phy}`);
|
||||
return false;
|
||||
}
|
||||
bsscfg.bssid = addr;
|
||||
}
|
||||
|
||||
let config_inline = iface_gen_config(phy, config);
|
||||
|
||||
// Step 7: fill in the gaps with new interfaces
|
||||
for (let i = 0; i < length(config.bss); i++) {
|
||||
let ifname = config.bss[i].ifname;
|
||||
let bss = bss_list[i];
|
||||
|
||||
if (bss)
|
||||
continue;
|
||||
|
||||
hostapd.printf(`Add bss ${ifname} on phy ${phy}`);
|
||||
bss_list[i] = iface.add_bss(config_inline, i);
|
||||
if (!bss_list[i]) {
|
||||
hostapd.printf(`Failed to add new bss ${ifname} on phy ${phy}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Step 8: update interface bss order
|
||||
if (!iface.set_bss_order(bss_list)) {
|
||||
hostapd.printf(`Failed to update BSS order on phy '${phy}'`);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Step 9: update config
|
||||
for (let i = 0; i < length(config.bss); i++) {
|
||||
if (!bss_list_cfg[i])
|
||||
continue;
|
||||
|
||||
let ifname = config.bss[i].ifname;
|
||||
let bss = bss_list[i];
|
||||
|
||||
if (is_equal(config.bss[i], bss_list_cfg[i]))
|
||||
continue;
|
||||
|
||||
if (is_equal(bss_remove_file_fields(config.bss[i]),
|
||||
bss_remove_file_fields(bss_list_cfg[i]))) {
|
||||
hostapd.printf(`Update config data files for bss ${ifname}`);
|
||||
if (bss.set_config(config_inline, i, true) < 0) {
|
||||
hostapd.printf(`Could not update config data files for bss ${ifname}`);
|
||||
return false;
|
||||
} else {
|
||||
bss.ctrl("RELOAD_WPA_PSK");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
bss_reload_psk(bss, config.bss[i], bss_list_cfg[i]);
|
||||
if (is_equal(config.bss[i], bss_list_cfg[i]))
|
||||
continue;
|
||||
|
||||
hostapd.printf(`Reload config for bss '${config.bss[0].ifname}' on phy '${phy}'`);
|
||||
if (bss.set_config(config_inline, i) < 0) {
|
||||
hostapd.printf(`Failed to set config for bss ${ifname}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function iface_set_config(phy, config)
|
||||
{
|
||||
let old_config = hostapd.data.config[phy];
|
||||
|
||||
hostapd.data.config[phy] = config;
|
||||
|
||||
if (!config) {
|
||||
hostapd.remove_iface(phy);
|
||||
return iface_remove(old_config);
|
||||
}
|
||||
|
||||
let phydev = phy_open(phy);
|
||||
if (!phydev) {
|
||||
hostapd.printf(`Failed to open phy ${phy}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
let ret = iface_reload_config(phydev, config, old_config);
|
||||
if (ret) {
|
||||
iface_update_supplicant_macaddr(phy, config);
|
||||
hostapd.printf(`Reloaded settings for phy ${phy}`);
|
||||
return 0;
|
||||
}
|
||||
} catch (e) {
|
||||
hostapd.printf(`Error reloading config: ${e}\n${e.stacktrace[0].context}`);
|
||||
}
|
||||
|
||||
hostapd.printf(`Restart interface for phy ${phy}`);
|
||||
let ret = iface_restart(phydev, config, old_config);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
function config_add_bss(config, name)
|
||||
{
|
||||
let bss = {
|
||||
ifname: name,
|
||||
data: [],
|
||||
hash: {}
|
||||
};
|
||||
|
||||
push(config.bss, bss);
|
||||
|
||||
return bss;
|
||||
}
|
||||
|
||||
function iface_load_config(filename)
|
||||
{
|
||||
let f = open(filename, "r");
|
||||
if (!f)
|
||||
return null;
|
||||
|
||||
let config = {
|
||||
radio: {
|
||||
data: []
|
||||
},
|
||||
bss: [],
|
||||
orig_file: filename,
|
||||
};
|
||||
|
||||
let bss;
|
||||
let line;
|
||||
while ((line = rtrim(f.read("line"), "\n")) != null) {
|
||||
let val = split(line, "=", 2);
|
||||
if (!val[0])
|
||||
continue;
|
||||
|
||||
if (val[0] == "interface") {
|
||||
bss = config_add_bss(config, val[1]);
|
||||
break;
|
||||
}
|
||||
|
||||
if (val[0] == "channel") {
|
||||
config.radio.channel = val[1];
|
||||
continue;
|
||||
}
|
||||
|
||||
if (val[0] == "#num_global_macaddr" ||
|
||||
val[0] == "mbssid")
|
||||
config[val[0]] = int(val[1]);
|
||||
|
||||
push(config.radio.data, line);
|
||||
}
|
||||
|
||||
while ((line = rtrim(f.read("line"), "\n")) != null) {
|
||||
if (line == "#default_macaddr")
|
||||
bss.default_macaddr = true;
|
||||
|
||||
let val = split(line, "=", 2);
|
||||
if (!val[0])
|
||||
continue;
|
||||
|
||||
if (val[0] == "bssid") {
|
||||
bss.bssid = lc(val[1]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (val[0] == "nas_identifier")
|
||||
bss.nasid = val[1];
|
||||
|
||||
if (val[0] == "bss") {
|
||||
bss = config_add_bss(config, val[1]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (hostapd.data.file_fields[val[0]])
|
||||
bss.hash[val[0]] = hostapd.sha1(readfile(val[1]));
|
||||
|
||||
push(bss.data, line);
|
||||
}
|
||||
f.close();
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
function ex_wrap(func) {
|
||||
return (req) => {
|
||||
try {
|
||||
let ret = func(req);
|
||||
return ret;
|
||||
} catch(e) {
|
||||
hostapd.printf(`Exception in ubus function: ${e}\n${e.stacktrace[0].context}`);
|
||||
}
|
||||
return libubus.STATUS_UNKNOWN_ERROR;
|
||||
};
|
||||
}
|
||||
|
||||
let main_obj = {
|
||||
reload: {
|
||||
args: {
|
||||
phy: "",
|
||||
},
|
||||
call: ex_wrap(function(req) {
|
||||
let phy_list = req.args.phy ? [ req.args.phy ] : keys(hostapd.data.config);
|
||||
for (let phy_name in phy_list) {
|
||||
let phy = hostapd.data.config[phy_name];
|
||||
let config = iface_load_config(phy.orig_file);
|
||||
iface_set_config(phy_name, config);
|
||||
}
|
||||
|
||||
return 0;
|
||||
})
|
||||
},
|
||||
apsta_state: {
|
||||
args: {
|
||||
phy: "",
|
||||
up: true,
|
||||
frequency: 0,
|
||||
sec_chan_offset: 0,
|
||||
csa: true,
|
||||
csa_count: 0,
|
||||
},
|
||||
call: ex_wrap(function(req) {
|
||||
if (req.args.up == null || !req.args.phy)
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
|
||||
let phy = req.args.phy;
|
||||
let config = hostapd.data.config[phy];
|
||||
if (!config || !config.bss || !config.bss[0] || !config.bss[0].ifname)
|
||||
return 0;
|
||||
|
||||
let iface = hostapd.interfaces[phy];
|
||||
if (!iface)
|
||||
return 0;
|
||||
|
||||
if (!req.args.up) {
|
||||
iface.stop();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!req.args.frequency)
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
|
||||
let freq_info = iface_freq_info(iface, config, req.args);
|
||||
if (!freq_info)
|
||||
return libubus.STATUS_UNKNOWN_ERROR;
|
||||
|
||||
let ret;
|
||||
if (req.args.csa) {
|
||||
freq_info.csa_count = req.args.csa_count ?? 10;
|
||||
ret = iface.switch_channel(freq_info);
|
||||
} else {
|
||||
ret = iface.start(freq_info);
|
||||
}
|
||||
if (!ret)
|
||||
return libubus.STATUS_UNKNOWN_ERROR;
|
||||
|
||||
return 0;
|
||||
})
|
||||
},
|
||||
config_get_macaddr_list: {
|
||||
args: {
|
||||
phy: ""
|
||||
},
|
||||
call: ex_wrap(function(req) {
|
||||
let phy = req.args.phy;
|
||||
if (!phy)
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
|
||||
let ret = {
|
||||
macaddr: [],
|
||||
};
|
||||
|
||||
let config = hostapd.data.config[phy];
|
||||
if (!config)
|
||||
return ret;
|
||||
|
||||
ret.macaddr = map(config.bss, (bss) => bss.bssid);
|
||||
return ret;
|
||||
})
|
||||
},
|
||||
config_set: {
|
||||
args: {
|
||||
phy: "",
|
||||
config: "",
|
||||
prev_config: "",
|
||||
},
|
||||
call: ex_wrap(function(req) {
|
||||
let phy = req.args.phy;
|
||||
let file = req.args.config;
|
||||
let prev_file = req.args.prev_config;
|
||||
|
||||
if (!phy)
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if (prev_file && !hostapd.data.config[phy]) {
|
||||
let config = iface_load_config(prev_file);
|
||||
if (config)
|
||||
config.radio.data = [];
|
||||
hostapd.data.config[phy] = config;
|
||||
}
|
||||
|
||||
let config = iface_load_config(file);
|
||||
|
||||
hostapd.printf(`Set new config for phy ${phy}: ${file}`);
|
||||
iface_set_config(phy, config);
|
||||
|
||||
return {
|
||||
pid: hostapd.getpid()
|
||||
};
|
||||
})
|
||||
},
|
||||
config_add: {
|
||||
args: {
|
||||
iface: "",
|
||||
config: "",
|
||||
},
|
||||
call: ex_wrap(function(req) {
|
||||
if (!req.args.iface || !req.args.config)
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if (hostapd.add_iface(`bss_config=${req.args.iface}:${req.args.config}`) < 0)
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
|
||||
return {
|
||||
pid: hostapd.getpid()
|
||||
};
|
||||
})
|
||||
},
|
||||
config_remove: {
|
||||
args: {
|
||||
iface: ""
|
||||
},
|
||||
call: ex_wrap(function(req) {
|
||||
if (!req.args.iface)
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
|
||||
hostapd.remove_iface(req.args.iface);
|
||||
return 0;
|
||||
})
|
||||
},
|
||||
};
|
||||
|
||||
hostapd.data.ubus = ubus;
|
||||
hostapd.data.obj = ubus.publish("hostapd", main_obj);
|
||||
|
||||
function bss_event(type, name, data) {
|
||||
let ubus = hostapd.data.ubus;
|
||||
|
||||
data ??= {};
|
||||
data.name = name;
|
||||
hostapd.data.obj.notify(`bss.${type}`, data, null, null, null, -1);
|
||||
ubus.call("service", "event", { type: `hostapd.${name}.${type}`, data: {} });
|
||||
}
|
||||
|
||||
return {
|
||||
shutdown: function() {
|
||||
for (let phy in hostapd.data.config)
|
||||
iface_set_config(phy, null);
|
||||
hostapd.ubus.disconnect();
|
||||
},
|
||||
bss_add: function(name, obj) {
|
||||
bss_event("add", name);
|
||||
},
|
||||
bss_reload: function(name, obj, reconf) {
|
||||
bss_event("reload", name, { reconf: reconf != 0 });
|
||||
},
|
||||
bss_remove: function(name, obj) {
|
||||
bss_event("remove", name);
|
||||
}
|
||||
};
|
||||
1
package/network/services/hostapd/files/radius.clients
Normal file
1
package/network/services/hostapd/files/radius.clients
Normal file
@@ -0,0 +1 @@
|
||||
0.0.0.0/0 radius
|
||||
9
package/network/services/hostapd/files/radius.config
Normal file
9
package/network/services/hostapd/files/radius.config
Normal file
@@ -0,0 +1,9 @@
|
||||
config radius
|
||||
option disabled '1'
|
||||
option ca_cert '/etc/radius/ca.pem'
|
||||
option cert '/etc/radius/cert.pem'
|
||||
option key '/etc/radius/key.pem'
|
||||
option users '/etc/radius/users'
|
||||
option clients '/etc/radius/clients'
|
||||
option auth_port '1812'
|
||||
option acct_port '1813'
|
||||
42
package/network/services/hostapd/files/radius.init
Normal file
42
package/network/services/hostapd/files/radius.init
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=30
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=radius
|
||||
|
||||
radius_start() {
|
||||
local cfg="$1"
|
||||
|
||||
config_get_bool disabled "$cfg" disabled 0
|
||||
|
||||
[ "$disabled" -gt 0 ] && return
|
||||
|
||||
config_get ca "$cfg" ca_cert
|
||||
config_get key "$cfg" key
|
||||
config_get cert "$cfg" cert
|
||||
config_get users "$cfg" users
|
||||
config_get clients "$cfg" clients
|
||||
config_get auth_port "$cfg" auth_port 1812
|
||||
config_get acct_port "$cfg" acct_port 1813
|
||||
config_get identity "$cfg" identity "$(cat /proc/sys/kernel/hostname)"
|
||||
|
||||
procd_open_instance $cfg
|
||||
procd_set_param command /usr/sbin/hostapd-radius \
|
||||
-C "$ca" \
|
||||
-c "$cert" -k "$key" \
|
||||
-s "$clients" -u "$users" \
|
||||
-p "$auth_port" -P "$acct_port" \
|
||||
-i "$identity"
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load radius
|
||||
config_foreach radius_start radius
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "radius"
|
||||
}
|
||||
14
package/network/services/hostapd/files/radius.users
Normal file
14
package/network/services/hostapd/files/radius.users
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"phase1": {
|
||||
"wildcard": [
|
||||
{
|
||||
"name": "*",
|
||||
"methods": [ "PEAP" ]
|
||||
}
|
||||
]
|
||||
},
|
||||
"phase2": {
|
||||
"users": {
|
||||
}
|
||||
}
|
||||
}
|
||||
185
package/network/services/hostapd/files/wdev.uc
Normal file
185
package/network/services/hostapd/files/wdev.uc
Normal file
@@ -0,0 +1,185 @@
|
||||
#!/usr/bin/env ucode
|
||||
'use strict';
|
||||
import { vlist_new, is_equal, wdev_create, wdev_set_mesh_params, wdev_remove, wdev_set_up, phy_open } from "/usr/share/hostap/common.uc";
|
||||
import { readfile, writefile, basename, readlink, glob } from "fs";
|
||||
let libubus = require("ubus");
|
||||
|
||||
let keep_devices = {};
|
||||
let phy = shift(ARGV);
|
||||
let command = shift(ARGV);
|
||||
let phydev;
|
||||
|
||||
function iface_stop(wdev)
|
||||
{
|
||||
if (keep_devices[wdev.ifname])
|
||||
return;
|
||||
|
||||
wdev_remove(wdev.ifname);
|
||||
}
|
||||
|
||||
function iface_start(wdev)
|
||||
{
|
||||
let ifname = wdev.ifname;
|
||||
|
||||
if (readfile(`/sys/class/net/${ifname}/ifindex`)) {
|
||||
wdev_set_up(ifname, false);
|
||||
wdev_remove(ifname);
|
||||
}
|
||||
let wdev_config = {};
|
||||
for (let key in wdev)
|
||||
wdev_config[key] = wdev[key];
|
||||
if (!wdev_config.macaddr && wdev.mode != "monitor")
|
||||
wdev_config.macaddr = phydev.macaddr_next();
|
||||
wdev_create(phy, ifname, wdev_config);
|
||||
wdev_set_up(ifname, true);
|
||||
if (wdev.freq)
|
||||
system(`iw dev ${ifname} set freq ${wdev.freq} ${wdev.htmode}`);
|
||||
if (wdev.mode == "adhoc") {
|
||||
let cmd = ["iw", "dev", ifname, "ibss", "join", wdev.ssid, wdev.freq, wdev.htmode, "fixed-freq" ];
|
||||
if (wdev.bssid)
|
||||
push(cmd, wdev.bssid);
|
||||
for (let key in [ "beacon-interval", "basic-rates", "mcast-rate", "keys" ])
|
||||
if (wdev[key])
|
||||
push(cmd, key, wdev[key]);
|
||||
system(cmd);
|
||||
} else if (wdev.mode == "mesh") {
|
||||
let cmd = [ "iw", "dev", ifname, "mesh", "join", wdev.ssid, "freq", wdev.freq, wdev.htmode ];
|
||||
for (let key in [ "mcast-rate", "beacon-interval" ])
|
||||
if (wdev[key])
|
||||
push(cmd, key, wdev[key]);
|
||||
system(cmd);
|
||||
|
||||
wdev_set_mesh_params(ifname, wdev);
|
||||
}
|
||||
}
|
||||
|
||||
function iface_cb(new_if, old_if)
|
||||
{
|
||||
if (old_if && new_if && is_equal(old_if, new_if))
|
||||
return;
|
||||
|
||||
if (old_if)
|
||||
iface_stop(old_if);
|
||||
if (new_if)
|
||||
iface_start(new_if);
|
||||
}
|
||||
|
||||
function drop_inactive(config)
|
||||
{
|
||||
for (let key in config) {
|
||||
if (!readfile(`/sys/class/net/${key}/ifindex`))
|
||||
delete config[key];
|
||||
}
|
||||
}
|
||||
|
||||
function add_ifname(config)
|
||||
{
|
||||
for (let key in config)
|
||||
config[key].ifname = key;
|
||||
}
|
||||
|
||||
function delete_ifname(config)
|
||||
{
|
||||
for (let key in config)
|
||||
delete config[key].ifname;
|
||||
}
|
||||
|
||||
function add_existing(phy, config)
|
||||
{
|
||||
let wdevs = glob(`/sys/class/ieee80211/${phy}/device/net/*`);
|
||||
wdevs = map(wdevs, (arg) => basename(arg));
|
||||
for (let wdev in wdevs) {
|
||||
if (config[wdev])
|
||||
continue;
|
||||
|
||||
if (basename(readlink(`/sys/class/net/${wdev}/phy80211`)) != phy)
|
||||
continue;
|
||||
|
||||
if (trim(readfile(`/sys/class/net/${wdev}/operstate`)) == "down")
|
||||
config[wdev] = {};
|
||||
}
|
||||
}
|
||||
|
||||
function usage()
|
||||
{
|
||||
warn(`Usage: ${basename(sourcepath())} <phy> <command> [<arguments>]
|
||||
|
||||
Commands:
|
||||
set_config <config> [<device]...] - set phy configuration
|
||||
get_macaddr <id> - get phy MAC address for vif index <id>
|
||||
`);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
const commands = {
|
||||
set_config: function(args) {
|
||||
let statefile = `/var/run/wdev-${phy}.json`;
|
||||
|
||||
let new_config = shift(args);
|
||||
for (let dev in ARGV)
|
||||
keep_devices[dev] = true;
|
||||
|
||||
if (!new_config)
|
||||
usage();
|
||||
|
||||
new_config = json(new_config);
|
||||
if (!new_config) {
|
||||
warn("Invalid configuration\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
let old_config = readfile(statefile);
|
||||
if (old_config)
|
||||
old_config = json(old_config);
|
||||
|
||||
let config = vlist_new(iface_cb);
|
||||
if (type(old_config) == "object")
|
||||
config.data = old_config;
|
||||
|
||||
add_existing(phy, config.data);
|
||||
add_ifname(config.data);
|
||||
drop_inactive(config.data);
|
||||
|
||||
let ubus = libubus.connect();
|
||||
let data = ubus.call("hostapd", "config_get_macaddr_list", { phy: phy });
|
||||
let macaddr_list = [];
|
||||
if (type(data) == "object" && data.macaddr)
|
||||
macaddr_list = data.macaddr;
|
||||
ubus.disconnect();
|
||||
phydev.macaddr_init(macaddr_list);
|
||||
|
||||
add_ifname(new_config);
|
||||
config.update(new_config);
|
||||
|
||||
drop_inactive(config.data);
|
||||
delete_ifname(config.data);
|
||||
writefile(statefile, sprintf("%J", config.data));
|
||||
},
|
||||
get_macaddr: function(args) {
|
||||
let data = {};
|
||||
|
||||
for (let arg in args) {
|
||||
arg = split(arg, "=", 2);
|
||||
data[arg[0]] = arg[1];
|
||||
}
|
||||
|
||||
let macaddr = phydev.macaddr_generate(data);
|
||||
if (!macaddr) {
|
||||
warn(`Could not get MAC address for phy ${phy}\n`);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
print(macaddr + "\n");
|
||||
},
|
||||
};
|
||||
|
||||
if (!phy || !command | !commands[command])
|
||||
usage();
|
||||
|
||||
phydev = phy_open(phy);
|
||||
if (!phydev) {
|
||||
warn(`PHY ${phy} does not exist\n`);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
commands[command](ARGV);
|
||||
@@ -26,7 +26,7 @@
|
||||
# replacement for WEXT and its use allows wpa_supplicant to properly control
|
||||
# the driver to improve existing functionality like roaming and to support new
|
||||
# functionality.
|
||||
CONFIG_DRIVER_WEXT=y
|
||||
#CONFIG_DRIVER_WEXT=y
|
||||
|
||||
# Driver interface for Linux drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
# replacement for WEXT and its use allows wpa_supplicant to properly control
|
||||
# the driver to improve existing functionality like roaming and to support new
|
||||
# functionality.
|
||||
CONFIG_DRIVER_WEXT=y
|
||||
#CONFIG_DRIVER_WEXT=y
|
||||
|
||||
# Driver interface for Linux drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
# replacement for WEXT and its use allows wpa_supplicant to properly control
|
||||
# the driver to improve existing functionality like roaming and to support new
|
||||
# functionality.
|
||||
CONFIG_DRIVER_WEXT=y
|
||||
#CONFIG_DRIVER_WEXT=y
|
||||
|
||||
# Driver interface for Linux drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
# replacement for WEXT and its use allows wpa_supplicant to properly control
|
||||
# the driver to improve existing functionality like roaming and to support new
|
||||
# functionality.
|
||||
CONFIG_DRIVER_WEXT=y
|
||||
#CONFIG_DRIVER_WEXT=y
|
||||
|
||||
# Driver interface for Linux drivers using the nl80211 kernel interface
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
|
||||
348
package/network/services/hostapd/files/wpa_supplicant.uc
Normal file
348
package/network/services/hostapd/files/wpa_supplicant.uc
Normal file
@@ -0,0 +1,348 @@
|
||||
let libubus = require("ubus");
|
||||
import { open, readfile } from "fs";
|
||||
import { wdev_create, wdev_set_mesh_params, wdev_remove, is_equal, wdev_set_up, vlist_new, phy_open } from "common";
|
||||
|
||||
let ubus = libubus.connect();
|
||||
|
||||
wpas.data.config = {};
|
||||
wpas.data.iface_phy = {};
|
||||
wpas.data.macaddr_list = {};
|
||||
|
||||
function iface_stop(iface)
|
||||
{
|
||||
let ifname = iface.config.iface;
|
||||
|
||||
if (!iface.running)
|
||||
return;
|
||||
|
||||
delete wpas.data.iface_phy[ifname];
|
||||
wpas.remove_iface(ifname);
|
||||
wdev_remove(ifname);
|
||||
iface.running = false;
|
||||
}
|
||||
|
||||
function iface_start(phydev, iface, macaddr_list)
|
||||
{
|
||||
let phy = phydev.name;
|
||||
|
||||
if (iface.running)
|
||||
return;
|
||||
|
||||
let ifname = iface.config.iface;
|
||||
let wdev_config = {};
|
||||
for (let field in iface.config)
|
||||
wdev_config[field] = iface.config[field];
|
||||
if (!wdev_config.macaddr)
|
||||
wdev_config.macaddr = phydev.macaddr_next();
|
||||
|
||||
wpas.data.iface_phy[ifname] = phy;
|
||||
wdev_remove(ifname);
|
||||
let ret = wdev_create(phy, ifname, wdev_config);
|
||||
if (ret)
|
||||
wpas.printf(`Failed to create device ${ifname}: ${ret}`);
|
||||
wdev_set_up(ifname, true);
|
||||
wpas.add_iface(iface.config);
|
||||
iface.running = true;
|
||||
}
|
||||
|
||||
function iface_cb(new_if, old_if)
|
||||
{
|
||||
if (old_if && new_if && is_equal(old_if.config, new_if.config)) {
|
||||
new_if.running = old_if.running;
|
||||
return;
|
||||
}
|
||||
|
||||
if (new_if && old_if)
|
||||
wpas.printf(`Update configuration for interface ${old_if.config.iface}`);
|
||||
else if (old_if)
|
||||
wpas.printf(`Remove interface ${old_if.config.iface}`);
|
||||
|
||||
if (old_if)
|
||||
iface_stop(old_if);
|
||||
}
|
||||
|
||||
function prepare_config(config)
|
||||
{
|
||||
config.config_data = readfile(config.config);
|
||||
|
||||
return { config: config };
|
||||
}
|
||||
|
||||
function set_config(phy_name, config_list)
|
||||
{
|
||||
let phy = wpas.data.config[phy_name];
|
||||
|
||||
if (!phy) {
|
||||
phy = vlist_new(iface_cb, false);
|
||||
wpas.data.config[phy_name] = phy;
|
||||
}
|
||||
|
||||
let values = [];
|
||||
for (let config in config_list)
|
||||
push(values, [ config.iface, prepare_config(config) ]);
|
||||
|
||||
phy.update(values);
|
||||
}
|
||||
|
||||
function start_pending(phy_name)
|
||||
{
|
||||
let phy = wpas.data.config[phy_name];
|
||||
let ubus = wpas.data.ubus;
|
||||
|
||||
if (!phy || !phy.data)
|
||||
return;
|
||||
|
||||
let phydev = phy_open(phy_name);
|
||||
if (!phydev) {
|
||||
wpas.printf(`Could not open phy ${phy_name}`);
|
||||
return;
|
||||
}
|
||||
|
||||
let macaddr_list = wpas.data.macaddr_list[phy_name];
|
||||
phydev.macaddr_init(macaddr_list);
|
||||
|
||||
for (let ifname in phy.data)
|
||||
iface_start(phydev, phy.data[ifname]);
|
||||
}
|
||||
|
||||
let main_obj = {
|
||||
phy_set_state: {
|
||||
args: {
|
||||
phy: "",
|
||||
stop: true,
|
||||
},
|
||||
call: function(req) {
|
||||
if (!req.args.phy || req.args.stop == null)
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
|
||||
let phy = wpas.data.config[req.args.phy];
|
||||
if (!phy)
|
||||
return libubus.STATUS_NOT_FOUND;
|
||||
|
||||
try {
|
||||
if (req.args.stop) {
|
||||
for (let ifname in phy.data)
|
||||
iface_stop(phy.data[ifname]);
|
||||
} else {
|
||||
start_pending(req.args.phy);
|
||||
}
|
||||
} catch (e) {
|
||||
wpas.printf(`Error chaging state: ${e}\n${e.stacktrace[0].context}`);
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
phy_set_macaddr_list: {
|
||||
args: {
|
||||
phy: "",
|
||||
macaddr: [],
|
||||
},
|
||||
call: function(req) {
|
||||
let phy = req.args.phy;
|
||||
if (!phy)
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
|
||||
wpas.data.macaddr_list[phy] = req.args.macaddr;
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
phy_status: {
|
||||
args: {
|
||||
phy: ""
|
||||
},
|
||||
call: function(req) {
|
||||
if (!req.args.phy)
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
|
||||
let phy = wpas.data.config[req.args.phy];
|
||||
if (!phy)
|
||||
return libubus.STATUS_NOT_FOUND;
|
||||
|
||||
for (let ifname in phy.data) {
|
||||
try {
|
||||
let iface = wpas.interfaces[ifname];
|
||||
if (!iface)
|
||||
continue;
|
||||
|
||||
let status = iface.status();
|
||||
if (!status)
|
||||
continue;
|
||||
|
||||
if (status.state == "INTERFACE_DISABLED")
|
||||
continue;
|
||||
|
||||
status.ifname = ifname;
|
||||
return status;
|
||||
} catch (e) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return libubus.STATUS_NOT_FOUND;
|
||||
}
|
||||
},
|
||||
config_set: {
|
||||
args: {
|
||||
phy: "",
|
||||
config: [],
|
||||
defer: true,
|
||||
},
|
||||
call: function(req) {
|
||||
if (!req.args.phy)
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
|
||||
wpas.printf(`Set new config for phy ${req.args.phy}`);
|
||||
try {
|
||||
if (req.args.config)
|
||||
set_config(req.args.phy, req.args.config);
|
||||
|
||||
if (!req.args.defer)
|
||||
start_pending(req.args.phy);
|
||||
} catch (e) {
|
||||
wpas.printf(`Error loading config: ${e}\n${e.stacktrace[0].context}`);
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
return {
|
||||
pid: wpas.getpid()
|
||||
};
|
||||
}
|
||||
},
|
||||
config_add: {
|
||||
args: {
|
||||
driver: "",
|
||||
iface: "",
|
||||
bridge: "",
|
||||
hostapd_ctrl: "",
|
||||
ctrl: "",
|
||||
config: "",
|
||||
},
|
||||
call: function(req) {
|
||||
if (!req.args.iface || !req.args.config)
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if (wpas.add_iface(req.args) < 0)
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
|
||||
return {
|
||||
pid: wpas.getpid()
|
||||
};
|
||||
}
|
||||
},
|
||||
config_remove: {
|
||||
args: {
|
||||
iface: ""
|
||||
},
|
||||
call: function(req) {
|
||||
if (!req.args.iface)
|
||||
return libubus.STATUS_INVALID_ARGUMENT;
|
||||
|
||||
wpas.remove_iface(req.args.iface);
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
wpas.data.ubus = ubus;
|
||||
wpas.data.obj = ubus.publish("wpa_supplicant", main_obj);
|
||||
|
||||
function iface_event(type, name, data) {
|
||||
let ubus = wpas.data.ubus;
|
||||
|
||||
data ??= {};
|
||||
data.name = name;
|
||||
wpas.data.obj.notify(`iface.${type}`, data, null, null, null, -1);
|
||||
ubus.call("service", "event", { type: `wpa_supplicant.${name}.${type}`, data: {} });
|
||||
}
|
||||
|
||||
function iface_hostapd_notify(phy, ifname, iface, state)
|
||||
{
|
||||
let ubus = wpas.data.ubus;
|
||||
let status = iface.status();
|
||||
let msg = { phy: phy };
|
||||
|
||||
switch (state) {
|
||||
case "DISCONNECTED":
|
||||
case "AUTHENTICATING":
|
||||
case "SCANNING":
|
||||
msg.up = false;
|
||||
break;
|
||||
case "INTERFACE_DISABLED":
|
||||
case "INACTIVE":
|
||||
msg.up = true;
|
||||
break;
|
||||
case "COMPLETED":
|
||||
msg.up = true;
|
||||
msg.frequency = status.frequency;
|
||||
msg.sec_chan_offset = status.sec_chan_offset;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
ubus.call("hostapd", "apsta_state", msg);
|
||||
}
|
||||
|
||||
function iface_channel_switch(phy, ifname, iface, info)
|
||||
{
|
||||
let msg = {
|
||||
phy: phy,
|
||||
up: true,
|
||||
csa: true,
|
||||
csa_count: info.csa_count ? info.csa_count - 1 : 0,
|
||||
frequency: info.frequency,
|
||||
sec_chan_offset: info.sec_chan_offset,
|
||||
};
|
||||
ubus.call("hostapd", "apsta_state", msg);
|
||||
}
|
||||
|
||||
return {
|
||||
shutdown: function() {
|
||||
for (let phy in wpas.data.config)
|
||||
set_config(phy, []);
|
||||
wpas.ubus.disconnect();
|
||||
},
|
||||
iface_add: function(name, obj) {
|
||||
iface_event("add", name);
|
||||
},
|
||||
iface_remove: function(name, obj) {
|
||||
iface_event("remove", name);
|
||||
},
|
||||
state: function(ifname, iface, state) {
|
||||
let phy = wpas.data.iface_phy[ifname];
|
||||
if (!phy) {
|
||||
wpas.printf(`no PHY for ifname ${ifname}`);
|
||||
return;
|
||||
}
|
||||
|
||||
iface_hostapd_notify(phy, ifname, iface, state);
|
||||
|
||||
if (state != "COMPLETED")
|
||||
return;
|
||||
|
||||
let phy_data = wpas.data.config[phy];
|
||||
if (!phy_data)
|
||||
return;
|
||||
|
||||
let iface_data = phy_data.data[ifname];
|
||||
if (!iface_data)
|
||||
return;
|
||||
|
||||
let wdev_config = iface_data.config;
|
||||
if (!wdev_config || wdev_config.mode != "mesh")
|
||||
return;
|
||||
|
||||
wdev_set_mesh_params(ifname, wdev_config);
|
||||
},
|
||||
event: function(ifname, iface, ev, info) {
|
||||
let phy = wpas.data.iface_phy[ifname];
|
||||
if (!phy) {
|
||||
wpas.printf(`no PHY for ifname ${ifname}`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ev == "CH_SWITCH_STARTED")
|
||||
iface_channel_switch(phy, ifname, iface, info);
|
||||
}
|
||||
};
|
||||
@@ -3,6 +3,12 @@
|
||||
"access": {
|
||||
"service": {
|
||||
"methods": [ "event" ]
|
||||
},
|
||||
"wpa_supplicant": {
|
||||
"methods": [ "phy_set_state", "phy_set_macaddr_list", "phy_status" ]
|
||||
},
|
||||
"hostapd": {
|
||||
"methods": [ "apsta_state" ]
|
||||
}
|
||||
},
|
||||
"publish": [ "hostapd", "hostapd.*", "wpa_supplicant", "wpa_supplicant.*" ],
|
||||
|
||||
@@ -29,7 +29,7 @@ Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
|
||||
|
||||
|
||||
enum dfs_channel_type {
|
||||
@@ -521,9 +522,14 @@ dfs_get_valid_channel(struct hostapd_ifa
|
||||
@@ -526,9 +527,14 @@ dfs_get_valid_channel(struct hostapd_ifa
|
||||
int num_available_chandefs;
|
||||
int chan_idx, chan_idx2;
|
||||
int sec_chan_idx_80p80 = -1;
|
||||
@@ -44,7 +44,7 @@ Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
|
||||
wpa_printf(MSG_DEBUG, "DFS: Selecting random channel");
|
||||
*secondary_channel = 0;
|
||||
*oper_centr_freq_seg0_idx = 0;
|
||||
@@ -543,8 +549,20 @@ dfs_get_valid_channel(struct hostapd_ifa
|
||||
@@ -548,8 +554,20 @@ dfs_get_valid_channel(struct hostapd_ifa
|
||||
if (num_available_chandefs == 0)
|
||||
return NULL;
|
||||
|
||||
@@ -68,7 +68,7 @@ Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
|
||||
if (!chan) {
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -10977,6 +10977,10 @@ static int nl80211_switch_channel(void *
|
||||
@@ -11017,6 +11017,10 @@ static int nl80211_switch_channel(void *
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -4601,6 +4601,13 @@ static int add_associated_sta(struct hos
|
||||
@@ -4621,6 +4621,13 @@ static int add_associated_sta(struct hos
|
||||
* drivers to accept the STA parameter configuration. Since this is
|
||||
* after a new FT-over-DS exchange, a new TK has been derived, so key
|
||||
* reinstallation is not a concern for this case.
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
wpa_printf(MSG_DEBUG, "Add associated STA " MACSTR
|
||||
" (added_unassoc=%d auth_alg=%u ft_over_ds=%u reassoc=%d authorized=%d ft_tk=%d fils_tk=%d)",
|
||||
@@ -4614,7 +4621,8 @@ static int add_associated_sta(struct hos
|
||||
@@ -4634,7 +4641,8 @@ static int add_associated_sta(struct hos
|
||||
(!(sta->flags & WLAN_STA_AUTHORIZED) ||
|
||||
(reassoc && sta->ft_over_ds && sta->auth_alg == WLAN_AUTH_FT) ||
|
||||
(!wpa_auth_sta_ft_tk_already_set(sta->wpa_sm) &&
|
||||
|
||||
@@ -92,7 +92,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
@@ -11843,13 +11840,14 @@ static int wpa_driver_br_add_ip_neigh(vo
|
||||
@@ -11883,13 +11880,14 @@ static int wpa_driver_br_add_ip_neigh(vo
|
||||
const u8 *ipaddr, int prefixlen,
|
||||
const u8 *addr)
|
||||
{
|
||||
@@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
int res;
|
||||
|
||||
if (!ipaddr || prefixlen == 0 || !addr)
|
||||
@@ -11868,85 +11866,66 @@ static int wpa_driver_br_add_ip_neigh(vo
|
||||
@@ -11908,85 +11906,66 @@ static int wpa_driver_br_add_ip_neigh(vo
|
||||
}
|
||||
|
||||
if (version == 4) {
|
||||
@@ -220,7 +220,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
addrsize = 16;
|
||||
} else {
|
||||
return -EINVAL;
|
||||
@@ -11964,41 +11943,30 @@ static int wpa_driver_br_delete_ip_neigh
|
||||
@@ -12004,41 +11983,30 @@ static int wpa_driver_br_delete_ip_neigh
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -3012,15 +3012,6 @@ static void handle_auth(struct hostapd_d
|
||||
@@ -3020,15 +3020,6 @@ static void handle_auth(struct hostapd_d
|
||||
seq_ctrl);
|
||||
return;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user