Merge branch 'openwrt:master' into master
This commit is contained in:
commit
2e39ffe94a
442 changed files with 12558 additions and 4706 deletions
4
.github/labeler.yml
vendored
4
.github/labeler.yml
vendored
|
@ -41,8 +41,8 @@
|
|||
- "target/linux/ipq40xx/**"
|
||||
"target/ipq806x":
|
||||
- "target/linux/ipq806x/**"
|
||||
"target/ipq807x":
|
||||
- "target/linux/ipq807x/**"
|
||||
"target/qualcommax":
|
||||
- "target/linux/qualcommax/**"
|
||||
"target/kirkwood":
|
||||
- "target/linux/kirkwood/**"
|
||||
- "package/boot/uboot-kirkwood/**"
|
||||
|
|
8
.github/workflows/Dockerfile.toolchain
vendored
8
.github/workflows/Dockerfile.toolchain
vendored
|
@ -1,8 +0,0 @@
|
|||
ARG OWNER_LC
|
||||
ARG CONTAINER_TAG
|
||||
|
||||
FROM ghcr.io/$OWNER_LC/tools:$CONTAINER_TAG
|
||||
|
||||
ARG TOOLCHAIN_NAME
|
||||
|
||||
ADD $TOOLCHAIN_NAME /external-toolchain/
|
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:v6
|
||||
|
||||
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:v6
|
||||
|
||||
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
|
575
.github/workflows/build.yml
vendored
575
.github/workflows/build.yml
vendored
|
@ -1,575 +0,0 @@
|
|||
name: Build sub target
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
secrets:
|
||||
coverity_api_token:
|
||||
inputs:
|
||||
container_name:
|
||||
type: string
|
||||
default: tools
|
||||
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
|
||||
build_external_toolchain:
|
||||
type: boolean
|
||||
upload_external_toolchain:
|
||||
type: boolean
|
||||
use_ccache_cache:
|
||||
type: boolean
|
||||
default: true
|
||||
ccache_type:
|
||||
type: string
|
||||
default: kernel
|
||||
upload_ccache_cache:
|
||||
type: boolean
|
||||
|
||||
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 }}
|
||||
container_tag: ${{ steps.determine_tools_container.outputs.container_tag }}
|
||||
container_name: ${{ steps.determine_tools_container.outputs.container_name }}
|
||||
|
||||
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
|
||||
|
||||
# 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_NAME=${{ inputs.container_name }}
|
||||
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
|
||||
|
||||
if [ "$CONTAINER_NAME" = "toolchain" ]; then
|
||||
GHCR_TOKEN=$(echo ${{ secrets.GITHUB_TOKEN }} | base64)
|
||||
GHCR_HEADER="Authorization: Bearer ${GHCR_TOKEN}"
|
||||
GHCR_MANIFEST_LINK=https://ghcr.io/v2/${{ steps.lower_owner.outputs.owner_lc }}/${{ inputs.container_name }}/manifests/${{ inputs.target }}-${{ inputs.subtarget }}-"$CONTAINER_TAG"
|
||||
# Check if container exist
|
||||
if [ $(curl -s -o /dev/null -w "%{http_code}" -H "$GHCR_HEADER" -I "$GHCR_MANIFEST_LINK") = 200 ]; then
|
||||
CONTAINER_TAG=${{ inputs.target }}-${{ inputs.subtarget }}-"$CONTAINER_TAG"
|
||||
else
|
||||
CONTAINER_NAME=tools
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Tools container to use $CONTAINER_NAME:$CONTAINER_TAG"
|
||||
echo "container_tag=$CONTAINER_TAG" >> $GITHUB_OUTPUT
|
||||
echo "container_name=$CONTAINER_NAME" >> $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 }}/${{ needs.setup_build.outputs.container_name }}:${{ needs.setup_build.outputs.container_tag }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
|
||||
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: |
|
||||
if [ -d /external-toolchain/ ]; then
|
||||
echo "toolchain-type=external_container" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
||||
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: Download and extract ccache cache from s3
|
||||
id: restore-ccache-cache-s3
|
||||
if: inputs.use_ccache_cache == true
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
ENDPOINT=https://storage.googleapis.com
|
||||
BUCKET=openwrt-ci-cache
|
||||
CCACHE_TAR=ccache-${{ inputs.ccache_type }}-${{ inputs.target }}-${{ inputs.subtarget }}.tar
|
||||
|
||||
if curl -o /dev/null -s --head --fail $ENDPOINT/$BUCKET/$CCACHE_TAR; then
|
||||
wget -O - $ENDPOINT/$BUCKET/$CCACHE_TAR | tar -xf -
|
||||
echo "cache-hit=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- 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: Restore ccache cache
|
||||
id: restore-ccache-cache
|
||||
if: inputs.use_ccache_cache == true && steps.restore-ccache-cache-s3.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/restore@v3
|
||||
with:
|
||||
path: openwrt/.ccache
|
||||
key: ccache-${{ inputs.ccache_type }}-${{ inputs.target }}/${{ inputs.subtarget }}-${{ hashFiles('openwrt/include/kernel-**') }}
|
||||
restore-keys: |
|
||||
ccache-${{ inputs.ccache_type }}-${{ inputs.target }}/${{ inputs.subtarget }}-
|
||||
|
||||
- name: Import GPG keys
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type != 'internal' && steps.parse-toolchain.outputs.toolchain-type != 'external_container'
|
||||
run: gpg --receive-keys 0xCD84BCED626471F1 0x1D53D1877742E911 0xCD54E82DADB3684D
|
||||
|
||||
- name: Download external toolchain/sdk
|
||||
if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type != 'internal' && steps.parse-toolchain.outputs.toolchain-type != 'external_container'
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
wget https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ inputs.target }}/${{ inputs.subtarget }}/${{ env.TOOLCHAIN_FILE }}.tar.xz
|
||||
wget https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ inputs.target }}/${{ inputs.subtarget }}/sha256sums.asc
|
||||
wget https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ inputs.target }}/${{ inputs.subtarget }}/sha256sums
|
||||
gpg --with-fingerprint --verify sha256sums.asc
|
||||
sha256sum --check --ignore-missing sha256sums
|
||||
tar --xz -xf ${{ env.TOOLCHAIN_FILE }}.tar.xz
|
||||
rm ${{ env.TOOLCHAIN_FILE }}.tar.xz sha256sums
|
||||
|
||||
- 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
|
||||
|
||||
# ccache for some reason have problem detecting compiler type
|
||||
# with external toolchain. This cause the complete malfunction
|
||||
# of ccache with the result of tons of unsupported compiler
|
||||
# option error.
|
||||
# To fix this force compiler type to gcc.
|
||||
- name: Configure ccache and apply fixes
|
||||
if: inputs.use_ccache_cache == true
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
env:
|
||||
SYSTEM_CCACHE_CONF: staging_dir/host/etc/ccache.conf
|
||||
run: |
|
||||
touch $SYSTEM_CCACHE_CONF
|
||||
|
||||
echo compiler_type=gcc >> $SYSTEM_CCACHE_CONF
|
||||
|
||||
echo CONFIG_CCACHE=y >> .config
|
||||
|
||||
- name: Configure external toolchain in container
|
||||
if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_container'
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
echo CONFIG_DEVEL=y >> .config
|
||||
echo CONFIG_AUTOREMOVE=y >> .config
|
||||
|
||||
./scripts/ext-toolchain.sh \
|
||||
--toolchain /external-toolchain/$(ls /external-toolchain/ | grep openwrt-toolchain)/toolchain-* \
|
||||
--overwrite-config \
|
||||
--config ${{ inputs.target }}/${{ inputs.subtarget }}
|
||||
|
||||
- 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
|
||||
|
||||
./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
|
||||
|
||||
./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_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: Build external toolchain
|
||||
if: inputs.build_external_toolchain == true
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: make target/toolchain/compile -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"
|
||||
|
||||
- name: Delete already present ccache cache
|
||||
if: steps.restore-ccache-cache.outputs.cache-hit == 'true' && inputs.use_ccache_cache == true &&
|
||||
github.event_name == 'push' && steps.restore-ccache-cache-s3.outputs.cache-hit != 'true'
|
||||
uses: octokit/request-action@v2.x
|
||||
with:
|
||||
route: DELETE /repos/{repository}/actions/caches?key={key}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
INPUT_REPOSITORY: ${{ github.repository }}
|
||||
INPUT_KEY: ${{ steps.restore-ccache-cache.outputs.cache-primary-key }}
|
||||
|
||||
- name: Save ccache cache
|
||||
if: inputs.use_ccache_cache == true && github.event_name == 'push' &&
|
||||
steps.restore-ccache-cache-s3.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v3
|
||||
with:
|
||||
path: openwrt/.ccache
|
||||
key: ${{ steps.restore-ccache-cache.outputs.cache-primary-key }}
|
||||
|
||||
- name: Archive ccache
|
||||
if: inputs.use_ccache_cache == true && github.event_name == 'push' &&
|
||||
inputs.upload_ccache_cache == true
|
||||
shell: su buildbot -c "sh -e {0}"
|
||||
working-directory: openwrt
|
||||
run: tar -cf ccache-${{ inputs.ccache_type }}-${{ inputs.target }}-${{ inputs.subtarget }}.tar .ccache
|
||||
|
||||
- name: Upload ccache cache
|
||||
if: inputs.use_ccache_cache == true && github.event_name == 'push' &&
|
||||
inputs.upload_ccache_cache == true
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.target }}-${{ inputs.subtarget }}-ccache-cache
|
||||
path: openwrt/ccache-${{ inputs.ccache_type }}-${{ inputs.target }}-${{ inputs.subtarget }}.tar
|
||||
retention-days: 1
|
||||
|
||||
- name: Find external toolchain name
|
||||
id: get-toolchain-name
|
||||
if: inputs.upload_external_toolchain == true
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
TOOLCHAIN_NAME=$(ls bin/targets/${{inputs.target }}/${{ inputs.subtarget }} | grep toolchain)
|
||||
echo "toolchain-name=$TOOLCHAIN_NAME" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Upload prebuilt toolchain
|
||||
if: inputs.upload_external_toolchain == true
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.target }}-${{ inputs.subtarget }}-external-toolchain
|
||||
path: openwrt/bin/targets/${{ inputs.target }}/${{ inputs.subtarget }}/${{ steps.get-toolchain-name.outputs.toolchain-name }}
|
||||
retention-days: 1
|
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
|
51
.github/workflows/coverity.yml
vendored
51
.github/workflows/coverity.yml
vendored
|
@ -16,53 +16,4 @@ jobs:
|
|||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
container_name: toolchain
|
||||
target: x86
|
||||
subtarget: 64
|
||||
build_full: true
|
||||
include_feeds: true
|
||||
use_ccache_cache: false
|
||||
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
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/coverity.yml@main
|
||||
|
|
121
.github/workflows/kernel.yml
vendored
121
.github/workflows/kernel.yml
vendored
|
@ -28,128 +28,13 @@ 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 we are testing pr
|
||||
if [ ${{ github.event_name }} != 'push' ]; then
|
||||
if echo "$CHANGED_FILES" | grep -v -q target/linux ||
|
||||
echo "$CHANGED_FILES" | grep -q target/linux/generic; then
|
||||
TARGETS_SUBTARGETS=$TARGETS
|
||||
fi
|
||||
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
|
||||
actions: write
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
include: ${{fromJson(needs.determine_targets.outputs.targets_subtargets)}}
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
container_name: toolchain
|
||||
target: ${{ matrix.target }}
|
||||
subtarget: ${{ matrix.subtarget }}
|
||||
build_kernel: true
|
||||
build_all_kmods: true
|
||||
upload_ccache_cache: ${{ github.repository_owner == 'openwrt' }}
|
||||
|
||||
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 }}
|
||||
|
||||
upload-ccache-cache-in-s3:
|
||||
if: github.event_name == 'push' && github.repository_owner == 'openwrt'
|
||||
name: Upload ccache cache to s3
|
||||
needs: [determine_targets, build]
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
include: ${{fromJson(needs.determine_targets.outputs.targets_subtargets)}}
|
||||
secrets:
|
||||
s3_access_key: ${{ secrets.GCS_S3_ACCESS_KEY }}
|
||||
s3_secret_key: ${{ secrets.GCS_S3_SECRET_KEY }}
|
||||
uses: ./.github/workflows/upload-file-s3.yml
|
||||
with:
|
||||
endpoint: https://storage.googleapis.com
|
||||
bucket: openwrt-ci-cache
|
||||
download_id: ${{ matrix.target }}-${{ matrix.subtarget }}-ccache-cache
|
||||
filename: ccache-kernel-${{ matrix.target }}-${{ matrix.subtarget }}.tar
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/kernel.yml@main
|
||||
|
|
119
.github/workflows/label-kernel.yml
vendored
119
.github/workflows/label-kernel.yml
vendored
|
@ -7,123 +7,10 @@ on:
|
|||
- labeled
|
||||
|
||||
jobs:
|
||||
set_target:
|
||||
if: startsWith(github.event.label.name, 'ci:kernel:')
|
||||
name: Set target
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
targets_subtargets: ${{ steps.set_target.outputs.targets_subtargets }}
|
||||
targets: ${{ steps.set_target.outputs.targets }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Parse label
|
||||
id: parse_label
|
||||
env:
|
||||
CI_EVENT_LABEL_NAME: ${{ github.event.label.name }}
|
||||
run: |
|
||||
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/ci:kernel:\([^:]*\):\([^:]*\):*\([^:]*\)$/target=\1/p' | tee --append $GITHUB_OUTPUT
|
||||
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/ci:kernel:\([^:]*\):\([^:]*\):*\([^:]*\)$/subtarget=\2/p' | tee --append $GITHUB_OUTPUT
|
||||
echo "$CI_EVENT_LABEL_NAME" | sed -n 's/ci:kernel:\([^:]*\):\([^:]*\):*\([^:]*\)$/testing=\3/p' | tee --append $GITHUB_OUTPUT
|
||||
|
||||
- name: Set targets
|
||||
id: set_target
|
||||
run: |
|
||||
ALL_TARGETS="$(perl ./scripts/dump-target-info.pl kernels 2>/dev/null)"
|
||||
|
||||
TARGETS_SUBTARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1)"
|
||||
TARGETS="$(echo "$ALL_TARGETS" | sort -u -t '/' -k1,1)"
|
||||
|
||||
[ "${{ steps.parse_label.outputs.subtarget }}" = "first" ] && TARGETS_SUBTARGETS=$TARGETS
|
||||
|
||||
JSON_TARGETS_SUBTARGETS='['
|
||||
FIRST=1
|
||||
while IFS= read -r line; do
|
||||
TARGET_SUBTARGET=$(echo $line | cut -d " " -f 1)
|
||||
TARGET=$(echo $TARGET_SUBTARGET | cut -d "/" -f 1)
|
||||
SUBTARGET=$(echo $TARGET_SUBTARGET | cut -d "/" -f 2)
|
||||
|
||||
[ "${{ steps.parse_label.outputs.target }}" != "all" ] && [ "${{ steps.parse_label.outputs.target }}" != "$TARGET" ] && continue
|
||||
[ "${{ steps.parse_label.outputs.subtarget }}" != "all" ] && [ "${{ steps.parse_label.outputs.subtarget }}" != "first" ] &&
|
||||
[ "${{ steps.parse_label.outputs.subtarget }}" != $SUBTARGET ] && continue
|
||||
if [ "${{ steps.parse_label.outputs.testing }}" = "testing" ]; then
|
||||
TESTING_KERNEL_VER=$(echo $line | cut -d " " -f 3)
|
||||
[ -z "$TESTING_KERNEL_VER" ] && continue
|
||||
fi
|
||||
|
||||
TUPLE='{"target":"'"$TARGET"'","subtarget":"'"$SUBTARGET"'","testing":"'"$TESTING_KERNEL_VER"'"}'
|
||||
[[ $FIRST -ne 1 ]] && JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS"','
|
||||
JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS""$TUPLE"
|
||||
FIRST=0
|
||||
done <<< "$TARGETS_SUBTARGETS"
|
||||
JSON_TARGETS_SUBTARGETS="$JSON_TARGETS_SUBTARGETS"']'
|
||||
|
||||
JSON_TARGETS='['
|
||||
FIRST=1
|
||||
while IFS= read -r line; do
|
||||
TARGET_SUBTARGET=$(echo $line | cut -d " " -f 1)
|
||||
TARGET=$(echo $TARGET_SUBTARGET | cut -d "/" -f 1)
|
||||
SUBTARGET=$(echo $TARGET_SUBTARGET | cut -d "/" -f 2)
|
||||
|
||||
[ "${{ steps.parse_label.outputs.target }}" != "all" ] && [ "${{ steps.parse_label.outputs.target }}" != $TARGET ] && continue
|
||||
if [ "${{ steps.parse_label.outputs.testing }}" = "testing" ]; then
|
||||
TESTING_KERNEL_VER=$(echo $line | cut -d " " -f 3)
|
||||
[ -z "$TESTING_KERNEL_VER" ] && continue
|
||||
fi
|
||||
|
||||
TUPLE='{"target":"'"$TARGET"'","subtarget":"'"$SUBTARGET"'","testing":"'"$TESTING_KERNEL_VER"'"}'
|
||||
[[ $FIRST -ne 1 ]] && JSON_TARGETS="$JSON_TARGETS"','
|
||||
JSON_TARGETS="$JSON_TARGETS""$TUPLE"
|
||||
FIRST=0
|
||||
done <<< "$TARGETS"
|
||||
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_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
|
||||
actions: write
|
||||
uses: ./.github/workflows/build.yml
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
include: ${{fromJson(needs.set_target.outputs.targets_subtargets)}}
|
||||
with:
|
||||
container_name: toolchain
|
||||
target: ${{ matrix.target }}
|
||||
subtarget: ${{ matrix.subtarget }}
|
||||
testing: ${{ matrix.testing != '' && true }}
|
||||
build_kernel: true
|
||||
build_all_kmods: true
|
||||
|
||||
check-kernel-patches:
|
||||
name: Check Kernel patches
|
||||
needs: set_target
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
include: ${{fromJson(needs.set_target.outputs.targets)}}
|
||||
uses: ./.github/workflows/check-kernel-patches.yml
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
subtarget: ${{ matrix.subtarget }}
|
||||
testing: ${{ matrix.testing != '' && true }}
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/label-kernel.yml@main
|
||||
|
|
32
.github/workflows/label-target.yml
vendored
32
.github/workflows/label-target.yml
vendored
|
@ -7,36 +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
|
||||
actions: write
|
||||
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
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/label-target.yml@main
|
||||
|
|
46
.github/workflows/packages.yml
vendored
46
.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,7 +11,6 @@ on:
|
|||
- 'toolchain/**'
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/build.yml'
|
||||
- '.github/workflows/packages.yml'
|
||||
- 'config/**'
|
||||
- 'include/**'
|
||||
|
@ -30,51 +28,13 @@ 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
|
||||
actions: write
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
include:
|
||||
- target: malta
|
||||
subtarget: be
|
||||
- target: x86
|
||||
subtarget: 64
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
container_name: toolchain
|
||||
target: ${{ matrix.target }}
|
||||
subtarget: ${{ matrix.subtarget }}
|
||||
build_kernel: true
|
||||
build_all_kmods: true
|
||||
build_all_modules: true
|
||||
build_full: true
|
||||
ccache_type: packages
|
||||
upload_ccache_cache: ${{ github.repository_owner == 'openwrt' }}
|
||||
|
||||
upload-ccache-cache-in-s3:
|
||||
if: github.event_name == 'push' && github.repository_owner == 'openwrt'
|
||||
name: Upload ccache cache to s3
|
||||
needs: build
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
include:
|
||||
- target: malta
|
||||
subtarget: be
|
||||
- target: x86
|
||||
subtarget: 64
|
||||
secrets:
|
||||
s3_access_key: ${{ secrets.GCS_S3_ACCESS_KEY }}
|
||||
s3_secret_key: ${{ secrets.GCS_S3_SECRET_KEY }}
|
||||
uses: ./.github/workflows/upload-file-s3.yml
|
||||
with:
|
||||
endpoint: https://storage.googleapis.com
|
||||
bucket: openwrt-ci-cache
|
||||
download_id: ${{ matrix.target }}-${{ matrix.subtarget }}-ccache-cache
|
||||
filename: ccache-packages-${{ matrix.target }}-${{ matrix.subtarget }}.tar
|
||||
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/packages.yml@main
|
||||
|
|
199
.github/workflows/push-containers.yml
vendored
199
.github/workflows/push-containers.yml
vendored
|
@ -5,13 +5,8 @@ on:
|
|||
paths:
|
||||
- 'include/version.mk'
|
||||
- 'tools/**'
|
||||
- '.github/workflows/build-tools.yml'
|
||||
- '.github/workflows/push-containers.yml'
|
||||
- '.github/workflows/Dockerfile.tools'
|
||||
- 'toolchain/**'
|
||||
- '.github/workflows/build.yml'
|
||||
- '.github/workflows/toolchain.yml'
|
||||
- '.github/workflows/Dockerfile.toolchain'
|
||||
branches-ignore:
|
||||
- master
|
||||
|
||||
|
@ -23,198 +18,10 @@ concurrency:
|
|||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
determine-container-info:
|
||||
name: Determine needed info to push containers
|
||||
if: ${{ github.repository_owner == 'openwrt' }}
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
owner-lc: ${{ steps.generate-owner-lc.outputs.owner-lc }}
|
||||
container-tag: ${{ steps.determine-container-tag.outputs.container-tag }}
|
||||
|
||||
steps:
|
||||
- name: Set lower case owner name
|
||||
id: generate-owner-lc
|
||||
env:
|
||||
OWNER: ${{ github.repository_owner }}
|
||||
run: |
|
||||
echo "owner-lc=${OWNER,,}" >> "$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
|
||||
# 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
|
||||
id: determine-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 "Container tag to push for tools and toolchain is $CONTAINER_TAG"
|
||||
echo "container-tag=$CONTAINER_TAG" >> "$GITHUB_OUTPUT"
|
||||
|
||||
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: [ determine-container-info, build-linux-buildbot ]
|
||||
if: ${{ github.repository_owner == 'openwrt' }}
|
||||
name: Push prebuilt tools container
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
build-push-containers:
|
||||
name: Build and Push all prebuilt containers
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- 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/${{ needs.determine-container-info.outputs.owner-lc }}/tools:${{ needs.determine-container-info.outputs.container-tag }}
|
||||
file: openwrt/.github/workflows/Dockerfile.tools
|
||||
|
||||
determine-targets:
|
||||
name: Set targets
|
||||
if: ${{ github.repository_owner == 'openwrt' }}
|
||||
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 \
|
||||
| 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
|
||||
if: ${{ github.repository_owner == 'openwrt' }}
|
||||
needs: [ determine-targets, push-tools-container ]
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
actions: write
|
||||
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
|
||||
build_external_toolchain: true
|
||||
upload_external_toolchain: true
|
||||
|
||||
push-toolchain-container:
|
||||
name: Push Target Toolchain container
|
||||
if: ${{ github.repository_owner == 'openwrt' }}
|
||||
needs: [ determine-container-info, determine-targets, build ]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: False
|
||||
matrix:
|
||||
include: ${{fromJson(needs.determine-targets.outputs.target)}}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: 'openwrt'
|
||||
|
||||
- name: Download external toolchain from build job
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.target }}-${{ matrix.subtarget }}-external-toolchain
|
||||
path: openwrt
|
||||
|
||||
- name: Find external toolchain name
|
||||
id: get-toolchain-name
|
||||
working-directory: openwrt
|
||||
run: |
|
||||
TOOLCHAIN_NAME=$(ls | grep toolchain-${{ matrix.target }}-${{ matrix.subtarget }})
|
||||
echo "toolchain-name=$TOOLCHAIN_NAME" >> $GITHUB_OUTPUT
|
||||
|
||||
- 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/${{ needs.determine-container-info.outputs.owner-lc }}/toolchain:${{ matrix.target }}-${{ matrix.subtarget }}-${{ needs.determine-container-info.outputs.container-tag }}
|
||||
file: openwrt/.github/workflows/Dockerfile.toolchain
|
||||
build-args: |
|
||||
OWNER_LC=${{ needs.determine-container-info.outputs.owner-lc }}
|
||||
CONTAINER_TAG=${{ needs.determine-container-info.outputs.container-tag }}
|
||||
TOOLCHAIN_NAME=${{ steps.get-toolchain-name.outputs.toolchain-name }}
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/push-containers.yml@main
|
||||
|
|
50
.github/workflows/toolchain.yml
vendored
50
.github/workflows/toolchain.yml
vendored
|
@ -3,12 +3,10 @@ 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:
|
||||
|
@ -22,52 +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
|
||||
actions: write
|
||||
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
|
||||
uses: openwrt/actions-shared-workflows/.github/workflows/toolchain.yml@main
|
||||
|
|
74
.github/workflows/tools.yml
vendored
74
.github/workflows/tools.yml
vendored
|
@ -5,13 +5,11 @@ 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
|
||||
|
@ -24,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
|
||||
|
|
46
.github/workflows/upload-file-s3.yml
vendored
46
.github/workflows/upload-file-s3.yml
vendored
|
@ -1,46 +0,0 @@
|
|||
name: Upload File to S3
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
secrets:
|
||||
s3_access_key:
|
||||
s3_secret_key:
|
||||
inputs:
|
||||
endpoint:
|
||||
required: true
|
||||
type: string
|
||||
bucket:
|
||||
required: true
|
||||
type: string
|
||||
download_id:
|
||||
required: true
|
||||
type: string
|
||||
filename:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
upload-file-in-s3:
|
||||
name: Upload file in S3
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Install minio
|
||||
run: |
|
||||
curl https://dl.min.io/client/mc/release/linux-amd64/mc \
|
||||
--create-dirs \
|
||||
-o $GITHUB_WORKSPACE/minio-binaries/mc
|
||||
|
||||
chmod +x $GITHUB_WORKSPACE/minio-binaries/mc
|
||||
echo $GITHUB_WORKSPACE/minio-binaries/ >> $GITHUB_PATH
|
||||
|
||||
- name: Setup minio
|
||||
run: mc alias set s3 ${{ inputs.endpoint }} ${{ secrets.s3_access_key }} ${{ secrets.s3_secret_key }}
|
||||
|
||||
- name: Download file
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.download_id }}
|
||||
|
||||
- name: Upload file to s3
|
||||
run: mc cp ${{ inputs.filename }} s3/${{ inputs.bucket }}/
|
|
@ -17,7 +17,7 @@ menu "Target Images"
|
|||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_lantiq
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_mpc85xx
|
||||
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ramips
|
||||
default TARGET_INITRAMFS_COMPRESSION_ZSTD if TARGET_ipq807x
|
||||
default TARGET_INITRAMFS_COMPRESSION_ZSTD if TARGET_qualcommax
|
||||
default TARGET_INITRAMFS_COMPRESSION_XZ if USES_SEPARATE_INITRAMFS
|
||||
default TARGET_INITRAMFS_COMPRESSION_NONE
|
||||
depends on TARGET_ROOTFS_INITRAMFS
|
||||
|
|
|
@ -1343,3 +1343,19 @@ config KERNEL_UBIFS_FS_SECURITY
|
|||
|
||||
config KERNEL_JFFS2_FS_SECURITY
|
||||
bool "JFFS2 Security Labels"
|
||||
|
||||
config KERNEL_WERROR
|
||||
bool "Compile the kernel with warnings as errors"
|
||||
default BUILDBOT
|
||||
default y if GCC_USE_VERSION_12
|
||||
help
|
||||
A kernel build should not cause any compiler warnings, and this
|
||||
enables the '-Werror' (for C) and '-Dwarnings' (for Rust) flags
|
||||
to enforce that rule by default. Certain warnings from other tools
|
||||
such as the linker may be upgraded to errors with this option as
|
||||
well.
|
||||
|
||||
However, if you have a new (or very old) compiler or linker with odd
|
||||
and unusual warnings, or you have some architecture with problems,
|
||||
you may need to disable this config option in order to
|
||||
successfully build the kernel.
|
||||
|
|
|
@ -399,6 +399,15 @@ define Build/lzma-no-dict
|
|||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
define Build/moxa-encode-fw
|
||||
$(TOPDIR)/scripts/moxa-encode-fw.py \
|
||||
--input $@ \
|
||||
--output $@ \
|
||||
--magic $(MOXA_MAGIC) \
|
||||
--hwid $(MOXA_HWID) \
|
||||
--buildid 00000000
|
||||
endef
|
||||
|
||||
define Build/netgear-chk
|
||||
$(STAGING_DIR_HOST)/bin/mkchkimg \
|
||||
-o $@.new \
|
||||
|
@ -423,6 +432,8 @@ define Build/netgear-encrypted-factory
|
|||
--output-file $@ \
|
||||
--model $(NETGEAR_ENC_MODEL) \
|
||||
--region $(NETGEAR_ENC_REGION) \
|
||||
$(if $(NETGEAR_ENC_HW_ID_LIST),--hw-id-list "$(NETGEAR_ENC_HW_ID_LIST)") \
|
||||
$(if $(NETGEAR_ENC_MODEL_LIST),--model-list "$(NETGEAR_ENC_MODEL_LIST)") \
|
||||
--version V1.0.0.0.$(shell cat $(VERSION_DIST)| sed -e 's/[[:space:]]/-/g').$(firstword $(subst -, ,$(REVISION))) \
|
||||
--encryption-block-size 0x20000 \
|
||||
--openssl-bin "$(STAGING_DIR_HOST)/bin/openssl" \
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
LINUX_VERSION-5.15 = .116
|
||||
LINUX_KERNEL_HASH-5.15.116 = f617c9d1bb5326cc93495938f43eb8cb9aea9d2f451e5a99bce2893f296e179a
|
||||
LINUX_VERSION-5.15 = .119
|
||||
LINUX_KERNEL_HASH-5.15.119 = 7aa5a0fd3520947e5599e811d28acdc30e36446c016c7dcee3793e6d1cbecfcf
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
LINUX_VERSION-6.1 = .33
|
||||
LINUX_KERNEL_HASH-6.1.33 = b87d6ba8ea7328e8007a7ea9171d1aa0d540d95eacfcab09578e0a3b623dd2cd
|
||||
LINUX_VERSION-6.1 = .35
|
||||
LINUX_KERNEL_HASH-6.1.35 = be368143bc5d0dc73dd3e8c6191630c1620520379baf6f47c16116b2c0bc26ac
|
|
@ -236,7 +236,7 @@ $(call KernelPackage/$(1)/config)
|
|||
$(call KernelPackage/depends)
|
||||
$(call KernelPackage/hooks)
|
||||
|
||||
ifneq ($(if $(filter-out %=y %=n %=m,$(KCONFIG)),$(filter m y,$(foreach c,$(filter-out %=y %=n %=m,$(KCONFIG)),$($(c)))),.),)
|
||||
ifneq ($(if $(filter-out %=y %=n %=m,$(KCONFIG)),$(filter m y,$(foreach c,$(call version_filter,$(filter-out %=y %=n %=m,$(KCONFIG))),$($(c)))),.),)
|
||||
define Package/kmod-$(1)/install
|
||||
@for mod in $$(call version_filter,$$(FILES)); do \
|
||||
if grep -q "$$$$$$$${mod##$(LINUX_DIR)/}" "$(LINUX_DIR)/modules.builtin"; then \
|
||||
|
|
|
@ -7,43 +7,66 @@
|
|||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=arm-trusted-firmware-rockchip
|
||||
PKG_VERSION:=2.3
|
||||
PKG_VERSION:=2.9
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=atf-v$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/atf-builds/atf/releases/download/v$(PKG_VERSION)/atf-v$(PKG_VERSION).tar.gz?
|
||||
PKG_HASH:=bf352298743aed594cf2958dd588e06ab6713fc514bb6f809bf55a85a87134c1
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=license.md
|
||||
PKG_HASH:=76a66a1de0c01aeb83dfc7b72b51173fe62c6e51d6fca17cc562393117bed08b
|
||||
|
||||
PKG_MAINTAINER:=Tobias Maedel <openwrt@tbspace.de>
|
||||
|
||||
MAKE_PATH:=$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/trusted-firmware-a.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/arm-trusted-firmware-rockchip
|
||||
SECTION:=boot
|
||||
CATEGORY:=Boot Loaders
|
||||
TITLE:=ARM Trusted Firmware for Rockchip
|
||||
DEPENDS:=@TARGET_rockchip_armv8
|
||||
define Trusted-Firmware-A/Default
|
||||
NAME:=Rockchip $(1) SoCs
|
||||
BUILD_TARGET:=rockchip
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(TAR) -C $(PKG_BUILD_DIR) -xf $(DL_DIR)/$(PKG_SOURCE)
|
||||
define Trusted-Firmware-A/rk3328
|
||||
BUILD_SUBTARGET:=armv8
|
||||
PLAT=rk3328
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
define Trusted-Firmware-A/rk3399
|
||||
BUILD_SUBTARGET:=armv8
|
||||
PLAT:=rk3399
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) -p $(STAGING_DIR_IMAGE)
|
||||
$(CP) $(PKG_BUILD_DIR)/rk*.elf $(STAGING_DIR_IMAGE)/
|
||||
TFA_TARGETS:= \
|
||||
rk3328 \
|
||||
rk3399
|
||||
|
||||
ifeq ($(BUILD_VARIANT),rk3399)
|
||||
M0_GCC_NAME:=gcc-arm
|
||||
M0_GCC_RELEASE:=11.2-2022.02
|
||||
M0_GCC_VERSION:=$(HOST_ARCH)-arm-none-eabi
|
||||
M0_GCC_SOURCE:=$(M0_GCC_NAME)-$(M0_GCC_RELEASE)-$(M0_GCC_VERSION).tar.xz
|
||||
|
||||
define Download/m0-gcc
|
||||
FILE:=$(M0_GCC_SOURCE)
|
||||
URL:=https://developer.arm.com/-/media/Files/downloads/gnu/$(M0_GCC_RELEASE)/binrel
|
||||
ifeq ($(HOST_ARCH),aarch64)
|
||||
HASH:=ef1d82e5894e3908cb7ed49c5485b5b95deefa32872f79c2b5f6f5447cabf55f
|
||||
else
|
||||
HASH:=8c5acd5ae567c0100245b0556941c237369f210bceb196edfe5a2e7532c60326
|
||||
endif
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(eval $(call Download,m0-gcc))
|
||||
$(call Build/Prepare/Default)
|
||||
|
||||
xzcat $(DL_DIR)/$(M0_GCC_SOURCE) | $(HOST_TAR) -C $(PKG_BUILD_DIR)/ $(TAR_OPTIONS)
|
||||
endef
|
||||
|
||||
TFA_MAKE_FLAGS+= \
|
||||
M0_CROSS_COMPILE=$(PKG_BUILD_DIR)/$(M0_GCC_NAME)-$(M0_GCC_RELEASE)-$(M0_GCC_VERSION)/bin/arm-none-eabi-
|
||||
endif
|
||||
|
||||
define Package/trusted-firmware-a/install
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/build/$(PLAT)/release/bl31/bl31.elf $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)_bl31.elf
|
||||
endef
|
||||
|
||||
define Package/arm-trusted-firmware-rockchip/install
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,arm-trusted-firmware-rockchip))
|
||||
$(eval $(call BuildPackage/Trusted-Firmware-A))
|
||||
|
|
|
@ -47,6 +47,7 @@ etactica,eg200|\
|
|||
glinet,gl-ar750s-nor|\
|
||||
glinet,gl-ar750s-nor-nand|\
|
||||
librerouter,librerouter-v1|\
|
||||
moxa,awk-1137c|\
|
||||
netgear,ex7300|\
|
||||
netgear,ex7300-v2|\
|
||||
netgear,wndr4300-v2|\
|
||||
|
@ -93,6 +94,7 @@ zyxel,nbg6616)
|
|||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
aruba,ap-105|\
|
||||
aruba,ap-115|\
|
||||
aruba,ap-175|\
|
||||
dongwon,dw02-412h-64m|\
|
||||
dongwon,dw02-412h-128m|\
|
||||
|
|
|
@ -12,9 +12,8 @@ touch /etc/config/ubootenv
|
|||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
traverse,ls1043v|\
|
||||
traverse,ls1043s)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x40000" "0x2000" "0x20000"
|
||||
traverse,ten64)
|
||||
ubootenv_add_uci_config "/dev/mtd3" "0x0000" "0x80000" "0x80000"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
|
@ -40,10 +40,18 @@ bananapi,bpi-r3)
|
|||
glinet,gl-mt3000)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000"
|
||||
;;
|
||||
mercusys,mr90x-v1)
|
||||
local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
|
||||
ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1"
|
||||
;;
|
||||
netgear,wax220)
|
||||
ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
xiaomi,redmi-router-ax6000-stock)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
|
||||
ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000"
|
||||
;;
|
||||
h3c,magic-nx30-pro|\
|
||||
qihoo,360t7|\
|
||||
tplink,tl-xdr4288|\
|
||||
tplink,tl-xdr6086|\
|
||||
|
|
|
@ -12,7 +12,8 @@ touch /etc/config/ubootenv
|
|||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
iptime,a6004mx)
|
||||
iptime,a6004mx|\
|
||||
netgear,ex6250-v2)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000"
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -24,7 +24,8 @@ sitecom,wlr-4100-v1-002|\
|
|||
zyxel,keenetic-lite-iii-a)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
|
||||
;;
|
||||
arcadyan,we420223-99)
|
||||
arcadyan,we420223-99|\
|
||||
dlink,dir-806a-b1)
|
||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x1000" "0x1000"
|
||||
;;
|
||||
allnet,all0256n-4m|\
|
||||
|
@ -44,6 +45,13 @@ etisalat,s3|\
|
|||
rostelecom,rt-sf-1)
|
||||
ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000"
|
||||
;;
|
||||
beeline,smartbox-pro|\
|
||||
tplink,ec330-g5u-v1|\
|
||||
wifire,s1500-nbn)
|
||||
idx="$(find_mtd_index u-boot-env)"
|
||||
[ -n "$idx" ] && \
|
||||
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x20000"
|
||||
;;
|
||||
buffalo,wsr-1166dhp|\
|
||||
buffalo,wsr-600dhp|\
|
||||
kroks,kndrt31r16|\
|
||||
|
@ -64,6 +72,7 @@ h3c,tx1801-plus|\
|
|||
h3c,tx1806|\
|
||||
jcg,q20|\
|
||||
linksys,e7350|\
|
||||
netgear,eax12|\
|
||||
netgear,wax202|\
|
||||
zyxel,wsm20)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
|
||||
|
@ -96,11 +105,6 @@ snr,cpe-w4n-mt)
|
|||
[ -n "$idx" ] && \
|
||||
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x1000"
|
||||
;;
|
||||
tplink,ec330-g5u-v1)
|
||||
idx="$(find_mtd_index u-boot-env)"
|
||||
[ -n "$idx" ] && \
|
||||
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x20000"
|
||||
;;
|
||||
xiaomi,mi-router-3g-v2|\
|
||||
xiaomi,mi-router-4a-gigabit|\
|
||||
xiaomi,miwifi-3c)
|
||||
|
|
|
@ -176,6 +176,18 @@ define U-Boot/mt7629_rfb
|
|||
UBOOT_CONFIG:=mt7629_rfb
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_h3c_magic-nx30-pro
|
||||
NAME:=H3C Magic NX30 Pro
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=h3c_magic-nx30-pro
|
||||
UBOOT_CONFIG:=mt7981_h3c_magic-nx30-pro
|
||||
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_qihoo_360t7
|
||||
NAME:=Qihoo 360T7
|
||||
BUILD_SUBTARGET:=filogic
|
||||
|
@ -313,6 +325,7 @@ UBOOT_TARGETS := \
|
|||
mt7628_rfb \
|
||||
ravpower_rp-wd009 \
|
||||
mt7629_rfb \
|
||||
mt7981_h3c_magic-nx30-pro \
|
||||
mt7981_qihoo_360t7 \
|
||||
mt7986_bananapi_bpi-r3-emmc \
|
||||
mt7986_bananapi_bpi-r3-sdmmc \
|
||||
|
|
|
@ -0,0 +1,440 @@
|
|||
--- /dev/null
|
||||
+++ b/configs/mt7981_h3c_magic-nx30-pro_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_h3c_magic-nx30-pro"
|
||||
+CONFIG_DEFAULT_ENV_FILE="h3c_magic-nx30-pro_env"
|
||||
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981_h3c_magic-nx30-pro.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_h3c_magic-nx30-pro.dts
|
||||
@@ -0,0 +1,200 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/*
|
||||
+ * 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 = "H3C Magic NX30 Pro";
|
||||
+ compatible = "mediatek,mt7981", "mediatek,mt7981-rfb";
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = &uart0;
|
||||
+ tick-timer = &timer0;
|
||||
+ };
|
||||
+
|
||||
+ keys {
|
||||
+ compatible = "gpio-keys";
|
||||
+
|
||||
+ factory {
|
||||
+ label = "reset";
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
+ gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ wps {
|
||||
+ label = "wps";
|
||||
+ linux,code = <KEY_WPS_BUTTON>;
|
||||
+ gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ status_red {
|
||||
+ label = "red:status";
|
||||
+ gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ status_green {
|
||||
+ label = "green:status";
|
||||
+ gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ mediatek,force-highspeed;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&uart1 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart1_pins>;
|
||||
+ status = "disabled";
|
||||
+};
|
||||
+
|
||||
+ð {
|
||||
+ status = "okay";
|
||||
+ mediatek,gmac-id = <0>;
|
||||
+ phy-mode = "sgmii";
|
||||
+ mediatek,switch = "mt7531";
|
||||
+ reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
|
||||
+
|
||||
+ fixed-link {
|
||||
+ speed = <1000>;
|
||||
+ full-duplex;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ spi_flash_pins: spi0-pins-func-1 {
|
||||
+ mux {
|
||||
+ function = "flash";
|
||||
+ groups = "spi0", "spi0_wp_hold";
|
||||
+ };
|
||||
+
|
||||
+ conf-pu {
|
||||
+ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
|
||||
+ };
|
||||
+
|
||||
+ conf-pd {
|
||||
+ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ spic_pins: spi1-pins-func-1 {
|
||||
+ mux {
|
||||
+ function = "spi";
|
||||
+ groups = "spi1_1";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ uart1_pins: spi1-pins-func-3 {
|
||||
+ mux {
|
||||
+ function = "uart";
|
||||
+ groups = "uart1_2";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ pwm_pins: pwm0-pins-func-1 {
|
||||
+ mux {
|
||||
+ function = "pwm";
|
||||
+ groups = "pwm0_1", "pwm1_0";
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pwm {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&pwm_pins>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&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 = <0x0000000 0x0100000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@100000 {
|
||||
+ label = "orig-env";
|
||||
+ reg = <0x0100000 0x0080000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@180000 {
|
||||
+ label = "factory";
|
||||
+ reg = <0x0180000 0x0200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@380000 {
|
||||
+ label = "fip";
|
||||
+ reg = <0x0380000 0x0200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@580000 {
|
||||
+ label = "ubi";
|
||||
+ reg = <0x0580000 0x4000000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@4580000 {
|
||||
+ label = "pdt_data";
|
||||
+ reg = <0x4580000 0x0600000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@4b80000 {
|
||||
+ label = "pdt_data_1";
|
||||
+ reg = <0x4b80000 0x0600000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@5180000 {
|
||||
+ label = "exp";
|
||||
+ reg = <0x5180000 0x0100000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@5280000 {
|
||||
+ label = "plugin";
|
||||
+ reg = <0x5280000 0x2580000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&watchdog {
|
||||
+ status = "disabled";
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/h3c_magic-nx30-pro_env
|
||||
@@ -0,0 +1,56 @@
|
||||
+ipaddr=192.168.1.1
|
||||
+serverip=192.168.1.254
|
||||
+loadaddr=0x46000000
|
||||
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
|
||||
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
|
||||
+bootconf=config-1
|
||||
+bootdelay=0
|
||||
+bootfile=openwrt-mediatek-filogic-h3c_magic-nx30-pro-initramfs-recovery.itb
|
||||
+bootfile_bl2=openwrt-mediatek-filogic-h3c_magic-nx30-pro-preloader.bin
|
||||
+bootfile_fip=openwrt-mediatek-filogic-h3c_magic-nx30-pro-bl31-uboot.fip
|
||||
+bootfile_upg=openwrt-mediatek-filogic-h3c_magic-nx30-pro-squashfs-sysupgrade.itb
|
||||
+bootled_pwr=green:status
|
||||
+bootled_rec=red:status
|
||||
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
|
||||
+bootmenu_default=0
|
||||
+bootmenu_delay=0
|
||||
+bootmenu_title= [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) )
|
||||
+bootmenu_0=Initialize environment.=run _firstboot
|
||||
+bootmenu_0d=Run default boot command.=run boot_default
|
||||
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
|
||||
+bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
|
||||
+bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
|
||||
+bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to NAND.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
|
||||
+bootmenu_7=[31mLoad BL2 preloader via TFTP then write to NAND.[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
|
||||
+bootmenu_8=Reboot.=reset
|
||||
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
|
||||
+boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
|
||||
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
|
||||
+boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
|
||||
+boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off
|
||||
+boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever
|
||||
+boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
|
||||
+boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
|
||||
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory
|
||||
+boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2
|
||||
+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"
|
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_VERSION:=2020.04
|
||||
PKG_RELEASE:=5
|
||||
PKG_RELEASE:=6
|
||||
|
||||
PKG_HASH:=fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372
|
||||
|
||||
|
@ -27,10 +27,12 @@ endef
|
|||
|
||||
define U-Boot/mx23_olinuxino
|
||||
NAME:=Olinuxino i.MX233
|
||||
BUILD_DEVICES:=olinuxino_maxi olinuxino_micro
|
||||
endef
|
||||
|
||||
define U-Boot/duckbill
|
||||
NAME:=I2SE Duckbill
|
||||
BUILD_DEVICES:=i2se_duckbill
|
||||
endef
|
||||
|
||||
UBOOT_TARGETS := \
|
||||
|
@ -40,8 +42,12 @@ UBOOT_TARGETS := \
|
|||
UBOOT_MAKE_FLAGS += $(UBOOT_IMAGE)
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE)
|
||||
$(foreach device,$(BUILD_DEVICES), \
|
||||
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)/$(device)
|
||||
)
|
||||
$(foreach device,$(BUILD_DEVICES), \
|
||||
$(CP) $(patsubst %,$(PKG_BUILD_DIR)/%,$(UBOOT_IMAGE)) $(STAGING_DIR_IMAGE)/$(device)/
|
||||
)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage/U-Boot))
|
||||
|
|
|
@ -26,7 +26,7 @@ endef
|
|||
|
||||
define U-Boot/rk3328/Default
|
||||
BUILD_SUBTARGET:=armv8
|
||||
DEPENDS:=+PACKAGE_u-boot-$(1):arm-trusted-firmware-rockchip
|
||||
DEPENDS:=+PACKAGE_u-boot-$(1):trusted-firmware-a-rk3328
|
||||
ATF:=rk3328_bl31.elf
|
||||
OF_PLATDATA:=$(1)
|
||||
endef
|
||||
|
@ -70,7 +70,7 @@ endef
|
|||
|
||||
define U-Boot/rk3399/Default
|
||||
BUILD_SUBTARGET:=armv8
|
||||
DEPENDS:=+PACKAGE_u-boot-$(1):arm-trusted-firmware-rockchip
|
||||
DEPENDS:=+PACKAGE_u-boot-$(1):trusted-firmware-a-rk3399
|
||||
ATF:=rk3399_bl31.elf
|
||||
endef
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ ALLWIFIBOARDS:= \
|
|||
wallys_dr40x9 \
|
||||
xiaomi_ax3600 \
|
||||
xiaomi_ax9000 \
|
||||
zte_mf287plus \
|
||||
zyxel_nbg7815
|
||||
|
||||
ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
|
||||
|
@ -48,7 +49,7 @@ define Package/ipq-wifi-default
|
|||
SUBMENU:=ath10k Board-Specific Overrides
|
||||
SECTION:=firmware
|
||||
CATEGORY:=Firmware
|
||||
DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x||TARGET_ipq807x)
|
||||
DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x||TARGET_qualcommax)
|
||||
TITLE:=Custom Board
|
||||
endef
|
||||
|
||||
|
@ -126,6 +127,7 @@ $(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6))
|
|||
$(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_mf287plus,ZTE MF287Plus))
|
||||
$(eval $(call generate-ipq-wifi-package,zyxel_nbg7815,Zyxel NBG7815))
|
||||
|
||||
$(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE))))
|
||||
|
|
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=linux-firmware
|
||||
PKG_VERSION:=20230515
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
|
|
|
@ -3,6 +3,8 @@ define Package/ibt-firmware/install
|
|||
$(INSTALL_DIR) $(1)/lib/firmware/intel
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/intel/*.bseq \
|
||||
$(PKG_BUILD_DIR)/intel/ibt*.sfi \
|
||||
$(PKG_BUILD_DIR)/intel/ibt*.ddc \
|
||||
$(1)/lib/firmware/intel
|
||||
endef
|
||||
$(eval $(call BuildPackage,ibt-firmware))
|
||||
|
|
|
@ -197,7 +197,7 @@ $(eval $(call KernelPackage,nf-flow))
|
|||
define KernelPackage/nf-socket
|
||||
SUBMENU:=$(NF_MENU)
|
||||
TITLE:=Netfilter socket lookup support
|
||||
KCONFIG:= $(KCOFNIG_NF_SOCKET)
|
||||
KCONFIG:= $(KCONFIG_NF_SOCKET)
|
||||
FILES:=$(foreach mod,$(NF_SOCKET-m),$(LINUX_DIR)/net/$(mod).ko)
|
||||
AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_SOCKET-m)))
|
||||
endef
|
||||
|
@ -208,7 +208,7 @@ $(eval $(call KernelPackage,nf-socket))
|
|||
define KernelPackage/nf-tproxy
|
||||
SUBMENU:=$(NF_MENU)
|
||||
TITLE:=Netfilter tproxy support
|
||||
KCONFIG:= $(KCOFNIG_NF_TPROXY)
|
||||
KCONFIG:= $(KCONFIG_NF_TPROXY)
|
||||
FILES:=$(foreach mod,$(NF_TPROXY-m),$(LINUX_DIR)/net/$(mod).ko)
|
||||
AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_TPROXY-m)))
|
||||
endef
|
||||
|
|
|
@ -1511,7 +1511,7 @@ $(eval $(call KernelPackage,qrtr-tun))
|
|||
define KernelPackage/qrtr-smd
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
TITLE:=SMD IPC Router channels
|
||||
DEPENDS:=+kmod-qrtr @TARGET_ipq807x
|
||||
DEPENDS:=+kmod-qrtr @TARGET_qualcommax
|
||||
KCONFIG:=CONFIG_QRTR_SMD
|
||||
FILES:= $(LINUX_DIR)/net/qrtr/qrtr-smd.ko
|
||||
AUTOLOAD:=$(call AutoProbe,qrtr-smd)
|
||||
|
|
|
@ -483,7 +483,7 @@ $(eval $(call KernelPackage,usb-dwc3))
|
|||
|
||||
define KernelPackage/usb-dwc3-qcom
|
||||
TITLE:=DWC3 Qualcomm USB driver
|
||||
DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x||TARGET_ipq807x) +kmod-usb-dwc3
|
||||
DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x||TARGET_qualcommax) +kmod-usb-dwc3
|
||||
KCONFIG:= CONFIG_USB_DWC3_QCOM
|
||||
FILES:= $(LINUX_DIR)/drivers/usb/dwc3/dwc3-qcom.ko
|
||||
AUTOLOAD:=$(call AutoLoad,53,dwc3-qcom,1)
|
||||
|
|
|
@ -317,7 +317,7 @@ define KernelPackage/ath11k/config
|
|||
config ATH11K_THERMAL
|
||||
bool "Enable thermal sensors and throttling support"
|
||||
depends on PACKAGE_kmod-ath11k
|
||||
default y if TARGET_ipq807x
|
||||
default y if TARGET_qualcommax
|
||||
|
||||
endef
|
||||
|
||||
|
@ -325,7 +325,7 @@ define KernelPackage/ath11k-ahb
|
|||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Qualcomm 802.11ax AHB wireless chipset support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath11k
|
||||
DEPENDS+= @TARGET_ipq807x +kmod-ath11k +kmod-qrtr-smd
|
||||
DEPENDS+= @TARGET_qualcommax +kmod-ath11k +kmod-qrtr-smd
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath11k/ath11k_ahb.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath11k_ahb)
|
||||
endef
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Thu, 22 Jun 2023 18:02:25 +0200
|
||||
Subject: [PATCH] mac80211: fix sband iftype data lookup for AP_VLAN
|
||||
|
||||
AP_VLAN interfaces are virtual, so doesn't really exist as a type for
|
||||
capabilities. When passed in as a type, AP is the one that's really intended.
|
||||
|
||||
Fixes: c4cbaf7973a7 ("cfg80211: Add support for HE")
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/include/net/cfg80211.h
|
||||
+++ b/include/net/cfg80211.h
|
||||
@@ -567,6 +567,9 @@ ieee80211_get_sband_iftype_data(const st
|
||||
if (WARN_ON(iftype >= NL80211_IFTYPE_MAX))
|
||||
return NULL;
|
||||
|
||||
+ if (iftype == NL80211_IFTYPE_AP_VLAN)
|
||||
+ iftype = NL80211_IFTYPE_AP;
|
||||
+
|
||||
for (i = 0; i < sband->n_iftype_data; i++) {
|
||||
const struct ieee80211_sband_iftype_data *data =
|
||||
&sband->iftype_data[i];
|
|
@ -0,0 +1,219 @@
|
|||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Fri, 30 Jun 2023 13:11:51 +0200
|
||||
Subject: [PATCH] mac80211: split mesh fast tx cache into
|
||||
local/proxied/forwarded
|
||||
|
||||
Depending on the origin of the packets (and their SA), 802.11 + mesh headers
|
||||
could be filled in differently. In order to properly deal with that, add a
|
||||
new field to the lookup key, indicating the type (local, proxied or
|
||||
forwarded). This can fix spurious packet drop issues that depend on the order
|
||||
in which nodes/hosts communicate with each other.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/mesh.c
|
||||
+++ b/net/mac80211/mesh.c
|
||||
@@ -703,6 +703,9 @@ bool ieee80211_mesh_xmit_fast(struct iee
|
||||
struct sk_buff *skb, u32 ctrl_flags)
|
||||
{
|
||||
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
|
||||
+ struct ieee80211_mesh_fast_tx_key key = {
|
||||
+ .type = MESH_FAST_TX_TYPE_LOCAL
|
||||
+ };
|
||||
struct ieee80211_mesh_fast_tx *entry;
|
||||
struct ieee80211s_hdr *meshhdr;
|
||||
u8 sa[ETH_ALEN] __aligned(2);
|
||||
@@ -738,7 +741,10 @@ bool ieee80211_mesh_xmit_fast(struct iee
|
||||
return false;
|
||||
}
|
||||
|
||||
- entry = mesh_fast_tx_get(sdata, skb->data);
|
||||
+ ether_addr_copy(key.addr, skb->data);
|
||||
+ if (!ether_addr_equal(skb->data + ETH_ALEN, sdata->vif.addr))
|
||||
+ key.type = MESH_FAST_TX_TYPE_PROXIED;
|
||||
+ entry = mesh_fast_tx_get(sdata, &key);
|
||||
if (!entry)
|
||||
return false;
|
||||
|
||||
--- a/net/mac80211/mesh.h
|
||||
+++ b/net/mac80211/mesh.h
|
||||
@@ -133,9 +133,33 @@ struct mesh_path {
|
||||
#define MESH_FAST_TX_CACHE_TIMEOUT 8000 /* msecs */
|
||||
|
||||
/**
|
||||
+ * enum ieee80211_mesh_fast_tx_type - cached mesh fast tx entry type
|
||||
+ *
|
||||
+ * @MESH_FAST_TX_TYPE_LOCAL: tx from the local vif address as SA
|
||||
+ * @MESH_FAST_TX_TYPE_PROXIED: local tx with a different SA (e.g. bridged)
|
||||
+ * @MESH_FAST_TX_TYPE_FORWARDED: forwarded from a different mesh point
|
||||
+ */
|
||||
+enum ieee80211_mesh_fast_tx_type {
|
||||
+ MESH_FAST_TX_TYPE_LOCAL,
|
||||
+ MESH_FAST_TX_TYPE_PROXIED,
|
||||
+ MESH_FAST_TX_TYPE_FORWARDED,
|
||||
+};
|
||||
+
|
||||
+/**
|
||||
+ * struct ieee80211_mesh_fast_tx_key - cached mesh fast tx entry key
|
||||
+ *
|
||||
+ * @addr: The Ethernet DA for this entry
|
||||
+ * @type: cache entry type
|
||||
+ */
|
||||
+struct ieee80211_mesh_fast_tx_key {
|
||||
+ u8 addr[ETH_ALEN] __aligned(2);
|
||||
+ enum ieee80211_mesh_fast_tx_type type;
|
||||
+};
|
||||
+
|
||||
+/**
|
||||
* struct ieee80211_mesh_fast_tx - cached mesh fast tx entry
|
||||
* @rhash: rhashtable pointer
|
||||
- * @addr_key: The Ethernet DA which is the key for this entry
|
||||
+ * @key: the lookup key for this cache entry
|
||||
* @fast_tx: base fast_tx data
|
||||
* @hdr: cached mesh and rfc1042 headers
|
||||
* @hdrlen: length of mesh + rfc1042
|
||||
@@ -146,7 +170,7 @@ struct mesh_path {
|
||||
*/
|
||||
struct ieee80211_mesh_fast_tx {
|
||||
struct rhash_head rhash;
|
||||
- u8 addr_key[ETH_ALEN] __aligned(2);
|
||||
+ struct ieee80211_mesh_fast_tx_key key;
|
||||
|
||||
struct ieee80211_fast_tx fast_tx;
|
||||
u8 hdr[sizeof(struct ieee80211s_hdr) + sizeof(rfc1042_header)];
|
||||
@@ -329,7 +353,8 @@ void mesh_path_tx_root_frame(struct ieee
|
||||
|
||||
bool mesh_action_is_path_sel(struct ieee80211_mgmt *mgmt);
|
||||
struct ieee80211_mesh_fast_tx *
|
||||
-mesh_fast_tx_get(struct ieee80211_sub_if_data *sdata, const u8 *addr);
|
||||
+mesh_fast_tx_get(struct ieee80211_sub_if_data *sdata,
|
||||
+ struct ieee80211_mesh_fast_tx_key *key);
|
||||
bool ieee80211_mesh_xmit_fast(struct ieee80211_sub_if_data *sdata,
|
||||
struct sk_buff *skb, u32 ctrl_flags);
|
||||
void mesh_fast_tx_cache(struct ieee80211_sub_if_data *sdata,
|
||||
--- a/net/mac80211/mesh_pathtbl.c
|
||||
+++ b/net/mac80211/mesh_pathtbl.c
|
||||
@@ -36,8 +36,8 @@ static const struct rhashtable_params me
|
||||
static const struct rhashtable_params fast_tx_rht_params = {
|
||||
.nelem_hint = 10,
|
||||
.automatic_shrinking = true,
|
||||
- .key_len = ETH_ALEN,
|
||||
- .key_offset = offsetof(struct ieee80211_mesh_fast_tx, addr_key),
|
||||
+ .key_len = sizeof(struct ieee80211_mesh_fast_tx_key),
|
||||
+ .key_offset = offsetof(struct ieee80211_mesh_fast_tx, key),
|
||||
.head_offset = offsetof(struct ieee80211_mesh_fast_tx, rhash),
|
||||
.hashfn = mesh_table_hash,
|
||||
};
|
||||
@@ -426,20 +426,21 @@ static void mesh_fast_tx_entry_free(stru
|
||||
}
|
||||
|
||||
struct ieee80211_mesh_fast_tx *
|
||||
-mesh_fast_tx_get(struct ieee80211_sub_if_data *sdata, const u8 *addr)
|
||||
+mesh_fast_tx_get(struct ieee80211_sub_if_data *sdata,
|
||||
+ struct ieee80211_mesh_fast_tx_key *key)
|
||||
{
|
||||
struct ieee80211_mesh_fast_tx *entry;
|
||||
struct mesh_tx_cache *cache;
|
||||
|
||||
cache = &sdata->u.mesh.tx_cache;
|
||||
- entry = rhashtable_lookup(&cache->rht, addr, fast_tx_rht_params);
|
||||
+ entry = rhashtable_lookup(&cache->rht, key, fast_tx_rht_params);
|
||||
if (!entry)
|
||||
return NULL;
|
||||
|
||||
if (!(entry->mpath->flags & MESH_PATH_ACTIVE) ||
|
||||
mpath_expired(entry->mpath)) {
|
||||
spin_lock_bh(&cache->walk_lock);
|
||||
- entry = rhashtable_lookup(&cache->rht, addr, fast_tx_rht_params);
|
||||
+ entry = rhashtable_lookup(&cache->rht, key, fast_tx_rht_params);
|
||||
if (entry)
|
||||
mesh_fast_tx_entry_free(cache, entry);
|
||||
spin_unlock_bh(&cache->walk_lock);
|
||||
@@ -484,18 +485,24 @@ void mesh_fast_tx_cache(struct ieee80211
|
||||
if (!sta)
|
||||
return;
|
||||
|
||||
+ build.key.type = MESH_FAST_TX_TYPE_LOCAL;
|
||||
if ((meshhdr->flags & MESH_FLAGS_AE) == MESH_FLAGS_AE_A5_A6) {
|
||||
/* This is required to keep the mppath alive */
|
||||
mppath = mpp_path_lookup(sdata, meshhdr->eaddr1);
|
||||
if (!mppath)
|
||||
return;
|
||||
build.mppath = mppath;
|
||||
+ if (!ether_addr_equal(meshhdr->eaddr2, sdata->vif.addr))
|
||||
+ build.key.type = MESH_FAST_TX_TYPE_PROXIED;
|
||||
} else if (ieee80211_has_a4(hdr->frame_control)) {
|
||||
mppath = mpath;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (!ether_addr_equal(hdr->addr4, sdata->vif.addr))
|
||||
+ build.key.type = MESH_FAST_TX_TYPE_FORWARDED;
|
||||
+
|
||||
/* rate limit, in case fast xmit can't be enabled */
|
||||
if (mppath->fast_tx_check == jiffies)
|
||||
return;
|
||||
@@ -542,7 +549,7 @@ void mesh_fast_tx_cache(struct ieee80211
|
||||
}
|
||||
}
|
||||
|
||||
- memcpy(build.addr_key, mppath->dst, ETH_ALEN);
|
||||
+ memcpy(build.key.addr, mppath->dst, ETH_ALEN);
|
||||
build.timestamp = jiffies;
|
||||
build.fast_tx.band = info->band;
|
||||
build.fast_tx.da_offs = offsetof(struct ieee80211_hdr, addr3);
|
||||
@@ -644,13 +651,19 @@ void mesh_fast_tx_flush_addr(struct ieee
|
||||
const u8 *addr)
|
||||
{
|
||||
struct mesh_tx_cache *cache = &sdata->u.mesh.tx_cache;
|
||||
+ struct ieee80211_mesh_fast_tx_key key = {};
|
||||
struct ieee80211_mesh_fast_tx *entry;
|
||||
+ int i;
|
||||
|
||||
+ ether_addr_copy(key.addr, addr);
|
||||
cache = &sdata->u.mesh.tx_cache;
|
||||
spin_lock_bh(&cache->walk_lock);
|
||||
- entry = rhashtable_lookup(&cache->rht, addr, fast_tx_rht_params);
|
||||
- if (entry)
|
||||
- mesh_fast_tx_entry_free(cache, entry);
|
||||
+ for (i = MESH_FAST_TX_TYPE_LOCAL; i < MESH_FAST_TX_TYPE_FORWARDED; i++) {
|
||||
+ key.type = i;
|
||||
+ entry = rhashtable_lookup(&cache->rht, &key, fast_tx_rht_params);
|
||||
+ if (entry)
|
||||
+ mesh_fast_tx_entry_free(cache, entry);
|
||||
+ }
|
||||
spin_unlock_bh(&cache->walk_lock);
|
||||
}
|
||||
|
||||
--- a/net/mac80211/rx.c
|
||||
+++ b/net/mac80211/rx.c
|
||||
@@ -2726,7 +2726,10 @@ ieee80211_rx_mesh_fast_forward(struct ie
|
||||
struct sk_buff *skb, int hdrlen)
|
||||
{
|
||||
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
|
||||
- struct ieee80211_mesh_fast_tx *entry = NULL;
|
||||
+ struct ieee80211_mesh_fast_tx_key key = {
|
||||
+ .type = MESH_FAST_TX_TYPE_FORWARDED
|
||||
+ };
|
||||
+ struct ieee80211_mesh_fast_tx *entry;
|
||||
struct ieee80211s_hdr *mesh_hdr;
|
||||
struct tid_ampdu_tx *tid_tx;
|
||||
struct sta_info *sta;
|
||||
@@ -2735,9 +2738,13 @@ ieee80211_rx_mesh_fast_forward(struct ie
|
||||
|
||||
mesh_hdr = (struct ieee80211s_hdr *)(skb->data + sizeof(eth));
|
||||
if ((mesh_hdr->flags & MESH_FLAGS_AE) == MESH_FLAGS_AE_A5_A6)
|
||||
- entry = mesh_fast_tx_get(sdata, mesh_hdr->eaddr1);
|
||||
+ ether_addr_copy(key.addr, mesh_hdr->eaddr1);
|
||||
else if (!(mesh_hdr->flags & MESH_FLAGS_AE))
|
||||
- entry = mesh_fast_tx_get(sdata, skb->data);
|
||||
+ ether_addr_copy(key.addr, skb->data);
|
||||
+ else
|
||||
+ return false;
|
||||
+
|
||||
+ entry = mesh_fast_tx_get(sdata, &key);
|
||||
if (!entry)
|
||||
return false;
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
From cdf461888f900c3a149b10a04d72b4a590ecdec3 Mon Sep 17 00:00:00 2001
|
||||
From: David Bauer <mail@david-bauer.net>
|
||||
Date: Tue, 16 May 2023 23:11:32 +0200
|
||||
Subject: [PATCH] mac80211: always use mac80211 loss detection
|
||||
|
||||
ath10k does not report excessive loss in case of broken block-ack
|
||||
sessions. The loss is communicated to the host-os, but ath10k does not
|
||||
trigger a low-ack events by itself.
|
||||
|
||||
The mac80211 framework for loss detection however detects this
|
||||
circumstance well in case of ath10k. So use it regardless of ath10k's
|
||||
own loss detection mechanism.
|
||||
|
||||
Patching this in mac80211 does allow this hack to be used with any
|
||||
flavor of ath10k/ath11k.
|
||||
|
||||
Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
---
|
||||
net/mac80211/status.c | 6 ------
|
||||
1 file changed, 6 deletions(-)
|
||||
|
||||
--- a/net/mac80211/status.c
|
||||
+++ b/net/mac80211/status.c
|
||||
@@ -794,12 +794,6 @@ static void ieee80211_lost_packet(struct
|
||||
unsigned long pkt_time = STA_LOST_PKT_TIME;
|
||||
unsigned int pkt_thr = STA_LOST_PKT_THRESHOLD;
|
||||
|
||||
- /* If driver relies on its own algorithm for station kickout, skip
|
||||
- * mac80211 packet loss mechanism.
|
||||
- */
|
||||
- if (ieee80211_hw_check(&sta->local->hw, REPORTS_LOW_ACK))
|
||||
- return;
|
||||
-
|
||||
/* This packet was aggregated but doesn't carry status info */
|
||||
if ((info->flags & IEEE80211_TX_CTL_AMPDU) &&
|
||||
!(info->flags & IEEE80211_TX_STAT_AMPDU))
|
|
@ -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-05-13
|
||||
PKG_SOURCE_VERSION:=969b7b5ebd129068ca56e4b0d831593a2f92382f
|
||||
PKG_MIRROR_HASH:=d28869591d1cb9a967b72f5cd8215c7b2c3388b7b31147b7b18c797018ab8ffb
|
||||
PKG_SOURCE_DATE:=2023-07-04
|
||||
PKG_SOURCE_VERSION:=f704e4f83c6fd21fb39046fa328efb51bee6383b
|
||||
PKG_MIRROR_HASH:=651d2963a0d624943601dcad971e4942401274af81d39913c6d3d91be2f8d8b1
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_USE_NINJA:=0
|
||||
|
@ -266,7 +266,7 @@ define KernelPackage/mt7921-common
|
|||
$(KernelPackage/mt76-default)
|
||||
TITLE:=MediaTek MT7615 wireless driver common code
|
||||
HIDDEN:=1
|
||||
DEPENDS+=+kmod-mt76-connac +kmod-mt7921-firmware +@DRIVER_11AX_SUPPORT
|
||||
DEPENDS+=+kmod-mt76-connac +kmod-mt7921-firmware +@DRIVER_11AX_SUPPORT +kmod-hwmon-core
|
||||
FILES:= $(PKG_BUILD_DIR)/mt7921/mt7921-common.ko
|
||||
endef
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=qca-nss-dp
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/nss-dp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2022-04-30
|
||||
PKG_SOURCE_VERSION:=72e9ec4187414461cbcf6ccff100e8b5ebe5f40b
|
||||
PKG_MIRROR_HASH:=805f16e59c75511132922f97740ebf6bf953845b0bbfd2089c4615456893bb37
|
||||
PKG_SOURCE_DATE:=2023-06-06
|
||||
PKG_SOURCE_VERSION:=fa67464466f69f00967cc373d1bdd6025f57eb89
|
||||
PKG_MIRROR_HASH:=51bf524382a5cb542c2c80d12a91f87b9736de3ac3c1d4a351c97b3502d68574
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_FLAGS:=nonshared
|
||||
|
@ -19,7 +19,7 @@ define KernelPackage/qca-nss-dp
|
|||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=@TARGET_ipq807x +kmod-qca-ssdk
|
||||
DEPENDS:=@TARGET_qualcommax +kmod-qca-ssdk
|
||||
TITLE:=Qualcom NSS dataplane ethernet driver
|
||||
FILES:=$(PKG_BUILD_DIR)/qca-nss-dp.ko
|
||||
AUTOLOAD:=$(call AutoLoad,31,qca-nss-dp,1)
|
||||
|
@ -39,18 +39,15 @@ EXTRA_CFLAGS+= \
|
|||
|
||||
NSS_DP_HAL_DIR:=$(PKG_BUILD_DIR)/hal
|
||||
define Build/Configure
|
||||
$(LN) $(NSS_DP_HAL_DIR)/soc_ops/$(CONFIG_TARGET_BOARD)/nss_$(CONFIG_TARGET_BOARD).h \
|
||||
$(LN) $(NSS_DP_HAL_DIR)/soc_ops/$(CONFIG_TARGET_SUBTARGET)/nss_$(CONFIG_TARGET_SUBTARGET).h \
|
||||
$(PKG_BUILD_DIR)/exports/nss_dp_arch.h
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) -C "$(LINUX_DIR)" \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
+$(KERNEL_MAKE) $(PKG_JOBS) \
|
||||
-C "$(LINUX_DIR)" \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" SoC="$(CONFIG_TARGET_BOARD)" \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
$(PKG_JOBS) \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" SoC="$(CONFIG_TARGET_SUBTARGET)" \
|
||||
modules
|
||||
endef
|
||||
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
From 946381fd6fdabedf2b5a1d8647a49e3da8f1894e Mon Sep 17 00:00:00 2001
|
||||
From: Baruch Siach <baruch@tkos.co.il>
|
||||
Date: Fri, 23 Jun 2023 11:28:02 +0200
|
||||
Subject: [PATCH 1/8] nss-dp: Drop _nocache variants of ioremap()
|
||||
|
||||
ioremap_nocache was made equivelant to ioremap and was dropped.
|
||||
|
||||
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 2 +-
|
||||
hal/gmac_ops/syn/gmac/syn_if.c | 2 +-
|
||||
hal/soc_ops/ipq50xx/nss_ipq50xx.c | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
@@ -279,7 +279,7 @@ int edma_init(void)
|
||||
/*
|
||||
* Remap register resource
|
||||
*/
|
||||
- edma_hw.reg_base = ioremap_nocache((edma_hw.reg_resource)->start,
|
||||
+ edma_hw.reg_base = ioremap((edma_hw.reg_resource)->start,
|
||||
resource_size(edma_hw.reg_resource));
|
||||
if (!edma_hw.reg_base) {
|
||||
pr_warn("Unable to remap EDMA register memory.\n");
|
||||
--- a/hal/gmac_ops/syn/gmac/syn_if.c
|
||||
+++ b/hal/gmac_ops/syn/gmac/syn_if.c
|
||||
@@ -806,7 +806,7 @@ static void *syn_init(struct nss_gmac_ha
|
||||
* Populate the mac base addresses
|
||||
*/
|
||||
shd->nghd.mac_base =
|
||||
- devm_ioremap_nocache(&dp_priv->pdev->dev, res->start,
|
||||
+ devm_ioremap(&dp_priv->pdev->dev, res->start,
|
||||
resource_size(res));
|
||||
if (!shd->nghd.mac_base) {
|
||||
netdev_dbg(ndev, "ioremap fail.\n");
|
||||
--- a/hal/soc_ops/ipq50xx/nss_ipq50xx.c
|
||||
+++ b/hal/soc_ops/ipq50xx/nss_ipq50xx.c
|
||||
@@ -89,7 +89,7 @@ static void nss_dp_hal_tcsr_set(void)
|
||||
pr_err("%s: SCM TCSR write error: %d\n", __func__, err);
|
||||
}
|
||||
} else {
|
||||
- tcsr_addr = ioremap_nocache((tcsr_base + TCSR_GMAC_AXI_CACHE_OVERRIDE_OFFSET),
|
||||
+ tcsr_addr = ioremap((tcsr_base + TCSR_GMAC_AXI_CACHE_OVERRIDE_OFFSET),
|
||||
TCSR_GMAC_AXI_CACHE_OVERRIDE_REG_SIZE);
|
||||
if (!tcsr_addr) {
|
||||
pr_err("%s: ioremap failed\n", __func__);
|
|
@ -1,9 +1,12 @@
|
|||
From 40979666b4371012405715ffa61ab5760fcdc6b3 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <40979666b4371012405715ffa61ab5760fcdc6b3.1620066716.git.baruch@tkos.co.il>
|
||||
From 3357c64b3fc63fe003d5ef02ba7f6abca64d80bf Mon Sep 17 00:00:00 2001
|
||||
From: Baruch Siach <baruch@tkos.co.il>
|
||||
Date: Mon, 3 May 2021 20:07:36 +0300
|
||||
Subject: [PATCH 1/3] edma_tx_rx: support newer kernels time stamping API
|
||||
Subject: [PATCH 2/8] edma_tx_rx: support newer kernels time stamping API
|
||||
|
||||
Timestamping API has changed in kernel 5.6, so update the implementation
|
||||
for newer kernels.
|
||||
|
||||
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_tx_rx.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
|
@ -1,48 +0,0 @@
|
|||
From cef7873a2d77df13ee702d902ed4e06b2248904b Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <cef7873a2d77df13ee702d902ed4e06b2248904b.1620066716.git.baruch@tkos.co.il>
|
||||
In-Reply-To: <40979666b4371012405715ffa61ab5760fcdc6b3.1620066716.git.baruch@tkos.co.il>
|
||||
References: <40979666b4371012405715ffa61ab5760fcdc6b3.1620066716.git.baruch@tkos.co.il>
|
||||
From: Baruch Siach <baruch@tkos.co.il>
|
||||
Date: Mon, 3 May 2021 20:17:22 +0300
|
||||
Subject: [PATCH 2/3] nss_dp_main: make phy mode code compatible with newer
|
||||
kernels
|
||||
|
||||
---
|
||||
include/nss_dp_dev.h | 4 ++--
|
||||
nss_dp_main.c | 4 ++++
|
||||
2 files changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/include/nss_dp_dev.h
|
||||
+++ b/include/nss_dp_dev.h
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/platform_device.h>
|
||||
-#include <linux/switch.h>
|
||||
+#include <linux/phy.h>
|
||||
#include <linux/version.h>
|
||||
|
||||
#include "nss_dp_api_if.h"
|
||||
@@ -99,7 +99,7 @@ struct nss_dp_dev {
|
||||
/* Phy related stuff */
|
||||
struct phy_device *phydev; /* Phy device */
|
||||
struct mii_bus *miibus; /* MII bus */
|
||||
- uint32_t phy_mii_type; /* RGMII/SGMII/QSGMII */
|
||||
+ phy_interface_t phy_mii_type; /* RGMII/SGMII/QSGMII */
|
||||
uint32_t phy_mdio_addr; /* Mdio address */
|
||||
bool link_poll; /* Link polling enable? */
|
||||
uint32_t forced_speed; /* Forced speed? */
|
||||
--- a/nss_dp_main.c
|
||||
+++ b/nss_dp_main.c
|
||||
@@ -584,7 +584,11 @@ static int32_t nss_dp_of_get_pdata(struc
|
||||
hal_pdata->netdev = netdev;
|
||||
hal_pdata->macid = dp_priv->macid;
|
||||
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0))
|
||||
dp_priv->phy_mii_type = of_get_phy_mode(np);
|
||||
+#else
|
||||
+ of_get_phy_mode(np, &dp_priv->phy_mii_type);
|
||||
+#endif
|
||||
dp_priv->link_poll = of_property_read_bool(np, "qcom,link-poll");
|
||||
if (of_property_read_u32(np, "qcom,phy-mdio-addr",
|
||||
&dp_priv->phy_mdio_addr) && dp_priv->link_poll) {
|
|
@ -1,48 +0,0 @@
|
|||
From c8c52512ff48bee578901c381a42f027e79eadf9 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <c8c52512ff48bee578901c381a42f027e79eadf9.1620066716.git.baruch@tkos.co.il>
|
||||
In-Reply-To: <40979666b4371012405715ffa61ab5760fcdc6b3.1620066716.git.baruch@tkos.co.il>
|
||||
References: <40979666b4371012405715ffa61ab5760fcdc6b3.1620066716.git.baruch@tkos.co.il>
|
||||
From: Baruch Siach <baruch@tkos.co.il>
|
||||
Date: Mon, 3 May 2021 20:20:29 +0300
|
||||
Subject: [PATCH 3/3] Drop _nocache variants of ioremap()
|
||||
|
||||
Recent kernels removed them.
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 2 +-
|
||||
hal/gmac_ops/qcom/qcom_if.c | 2 +-
|
||||
hal/gmac_ops/syn/xgmac/syn_if.c | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
@@ -279,7 +279,7 @@ int edma_init(void)
|
||||
/*
|
||||
* Remap register resource
|
||||
*/
|
||||
- edma_hw.reg_base = ioremap_nocache((edma_hw.reg_resource)->start,
|
||||
+ edma_hw.reg_base = ioremap((edma_hw.reg_resource)->start,
|
||||
resource_size(edma_hw.reg_resource));
|
||||
if (!edma_hw.reg_base) {
|
||||
pr_warn("Unable to remap EDMA register memory.\n");
|
||||
--- a/hal/gmac_ops/qcom/qcom_if.c
|
||||
+++ b/hal/gmac_ops/qcom/qcom_if.c
|
||||
@@ -418,7 +418,7 @@ static void *qcom_init(struct nss_gmac_h
|
||||
qhd->nghd.mac_id = gmacpdata->macid;
|
||||
|
||||
/* Populate the mac base addresses */
|
||||
- qhd->nghd.mac_base = devm_ioremap_nocache(&dp_priv->pdev->dev,
|
||||
+ qhd->nghd.mac_base = devm_ioremap(&dp_priv->pdev->dev,
|
||||
res->start, resource_size(res));
|
||||
if (!qhd->nghd.mac_base) {
|
||||
netdev_dbg(ndev, "ioremap fail.\n");
|
||||
--- a/hal/gmac_ops/syn/xgmac/syn_if.c
|
||||
+++ b/hal/gmac_ops/syn/xgmac/syn_if.c
|
||||
@@ -432,7 +432,7 @@ static void *syn_init(struct nss_gmac_ha
|
||||
|
||||
/* Populate the mac base addresses */
|
||||
shd->nghd.mac_base =
|
||||
- devm_ioremap_nocache(&dp_priv->pdev->dev, res->start,
|
||||
+ devm_ioremap(&dp_priv->pdev->dev, res->start,
|
||||
resource_size(res));
|
||||
if (!shd->nghd.mac_base) {
|
||||
netdev_dbg(ndev, "ioremap fail.\n");
|
|
@ -1,7 +1,7 @@
|
|||
From d74920e2a7c413ef40eed72f9cf287cf6fbd5fb8 Mon Sep 17 00:00:00 2001
|
||||
From c36420c219bf0e03842a11f69193c802eb42030a Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Thu, 20 May 2021 14:56:46 +0200
|
||||
Subject: [PATCH 1/2] EDMA: Fix NAPI packet counting
|
||||
Subject: [PATCH 3/8] EDMA: Fix NAPI packet counting
|
||||
|
||||
There is a bug in the NAPI packet counting that will
|
||||
cause NAPI over budget warnings.
|
|
@ -1,7 +1,7 @@
|
|||
From 44a30d94abcbb10aacc21db29be212518a6b1bf7 Mon Sep 17 00:00:00 2001
|
||||
From 158032d3d4e5089afa2aa38c27c6e222ac427820 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Thu, 20 May 2021 14:57:46 +0200
|
||||
Subject: [PATCH] EDMA: Use NAPI_POLL_WEIGHT as NAPI weight
|
||||
Subject: [PATCH 4/8] EDMA: Use NAPI_POLL_WEIGHT as NAPI weight
|
||||
|
||||
Currently a weight of 100 is used by the EDMA, according
|
||||
to upstream max of 64 should be used and that is used for
|
||||
|
@ -20,7 +20,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
|||
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
@@ -837,7 +837,7 @@ static int edma_register_netdevice(struc
|
||||
@@ -845,7 +845,7 @@ static int edma_register_netdevice(struc
|
||||
*/
|
||||
if (!edma_hw.napi_added) {
|
||||
netif_napi_add(netdev, &edma_hw.napi, edma_napi,
|
|
@ -0,0 +1,46 @@
|
|||
From e46c4d526d77916c00fff4fff3237b9c9d0d774d Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Fri, 23 Jun 2023 12:04:11 +0200
|
||||
Subject: [PATCH 5/8] nss-dp: adapt to netif_napi_add() changes
|
||||
|
||||
netif_napi_add() removed the weight argument and just uses the default
|
||||
NAPI_POLL_WEIGHT in background, so for those requiring custom weight use
|
||||
netif_napi_add_weight() instead.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 4 ++++
|
||||
hal/dp_ops/syn_gmac_dp/syn_dp.c | 5 +++++
|
||||
2 files changed, 9 insertions(+)
|
||||
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
@@ -844,8 +844,12 @@ static int edma_register_netdevice(struc
|
||||
* NAPI add
|
||||
*/
|
||||
if (!edma_hw.napi_added) {
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0))
|
||||
netif_napi_add(netdev, &edma_hw.napi, edma_napi,
|
||||
NAPI_POLL_WEIGHT);
|
||||
+#else
|
||||
+ netif_napi_add(netdev, &edma_hw.napi, edma_napi);
|
||||
+#endif
|
||||
/*
|
||||
* Register the interrupt handlers and enable interrupts
|
||||
*/
|
||||
--- a/hal/dp_ops/syn_gmac_dp/syn_dp.c
|
||||
+++ b/hal/dp_ops/syn_gmac_dp/syn_dp.c
|
||||
@@ -189,8 +189,13 @@ static int syn_dp_if_init(struct nss_dp_
|
||||
}
|
||||
|
||||
if (!dev_info->napi_added) {
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0))
|
||||
netif_napi_add(netdev, &rx_info->napi_rx, syn_dp_napi_poll_rx, SYN_DP_NAPI_BUDGET_RX);
|
||||
netif_napi_add(netdev, &tx_info->napi_tx, syn_dp_napi_poll_tx, SYN_DP_NAPI_BUDGET_TX);
|
||||
+#else
|
||||
+ netif_napi_add_weight(netdev, &rx_info->napi_rx, syn_dp_napi_poll_rx, SYN_DP_NAPI_BUDGET_RX);
|
||||
+ netif_napi_add_weight(netdev, &tx_info->napi_tx, syn_dp_napi_poll_tx, SYN_DP_NAPI_BUDGET_TX);
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Requesting irq. Set IRQ_DISABLE_UNLAZY flag, this flag
|
|
@ -1,46 +0,0 @@
|
|||
From cadeb62a42296563141d6954eec58e34ef86778d Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Fri, 13 Aug 2021 20:12:08 +0200
|
||||
Subject: [PATCH] NSS-DP: fix of_get_mac_address()
|
||||
|
||||
Recently OpenWrt backported the updated of_get_mac_address()
|
||||
function which returns and error code instead.
|
||||
|
||||
So, patch the SSDK to use it and fix the compilation error.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
nss_dp_main.c | 13 ++++---------
|
||||
1 file changed, 4 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/nss_dp_main.c
|
||||
+++ b/nss_dp_main.c
|
||||
@@ -555,9 +555,10 @@ static int32_t nss_dp_of_get_pdata(struc
|
||||
struct net_device *netdev,
|
||||
struct nss_gmac_hal_platform_data *hal_pdata)
|
||||
{
|
||||
- uint8_t *maddr;
|
||||
+ u8 maddr[ETH_ALEN];
|
||||
struct nss_dp_dev *dp_priv;
|
||||
struct resource memres_devtree = {0};
|
||||
+ int ret;
|
||||
|
||||
dp_priv = netdev_priv(netdev);
|
||||
|
||||
@@ -600,14 +601,8 @@ static int32_t nss_dp_of_get_pdata(struc
|
||||
of_property_read_u32(np, "qcom,forced-speed", &dp_priv->forced_speed);
|
||||
of_property_read_u32(np, "qcom,forced-duplex", &dp_priv->forced_duplex);
|
||||
|
||||
- maddr = (uint8_t *)of_get_mac_address(np);
|
||||
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(5, 4, 0))
|
||||
- if (IS_ERR((void *)maddr)) {
|
||||
- maddr = NULL;
|
||||
- }
|
||||
-#endif
|
||||
-
|
||||
- if (maddr && is_valid_ether_addr(maddr)) {
|
||||
+ ret = of_get_mac_address(np, maddr);
|
||||
+ if (!ret && is_valid_ether_addr(maddr)) {
|
||||
ether_addr_copy(netdev->dev_addr, maddr);
|
||||
} else {
|
||||
random_ether_addr(netdev->dev_addr);
|
|
@ -1,8 +1,8 @@
|
|||
From 8293a26ca56ee2e9a88e4efb5dcc7f647803cd8c Mon Sep 17 00:00:00 2001
|
||||
From 5b05b1d7a2d2001d9711856608f61abaf7b9a9a5 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
||||
Date: Sun, 5 Jun 2022 21:45:09 -0500
|
||||
Subject: [PATCH] nss_dp_main: Use a 'phy-handle' property to connect to the
|
||||
PHY
|
||||
Date: Fri, 23 Jun 2023 13:34:56 +0200
|
||||
Subject: [PATCH 6/8] nss_dp_main: Use a 'phy-handle' property to connect to
|
||||
the PHY
|
||||
|
||||
The original method of connecting a PHY to the ethernet controller
|
||||
requires the "qcom,link-poll", and "qcom,phy-mdio-addr" devicetree
|
||||
|
@ -18,21 +18,22 @@ as they are no longer used:
|
|||
* "qcom,forced-duplex"
|
||||
|
||||
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
include/nss_dp_dev.h | 5 +--
|
||||
nss_dp_main.c | 91 +++++---------------------------------------
|
||||
2 files changed, 10 insertions(+), 86 deletions(-)
|
||||
nss_dp_main.c | 91 +++++++-------------------------------------
|
||||
2 files changed, 14 insertions(+), 82 deletions(-)
|
||||
|
||||
--- a/include/nss_dp_dev.h
|
||||
+++ b/include/nss_dp_dev.h
|
||||
@@ -100,13 +100,10 @@ struct nss_dp_dev {
|
||||
@@ -202,13 +202,10 @@ struct nss_dp_dev {
|
||||
unsigned long drv_flags; /* Driver specific feature flags */
|
||||
|
||||
/* Phy related stuff */
|
||||
+ struct device_node *phy_node;
|
||||
+ struct device_node *phy_node; /* Phy device OF node */
|
||||
struct phy_device *phydev; /* Phy device */
|
||||
struct mii_bus *miibus; /* MII bus */
|
||||
phy_interface_t phy_mii_type; /* RGMII/SGMII/QSGMII */
|
||||
uint32_t phy_mii_type; /* RGMII/SGMII/QSGMII */
|
||||
- uint32_t phy_mdio_addr; /* Mdio address */
|
||||
- bool link_poll; /* Link polling enable? */
|
||||
- uint32_t forced_speed; /* Forced speed? */
|
||||
|
@ -42,7 +43,7 @@ Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
|||
|
||||
--- a/nss_dp_main.c
|
||||
+++ b/nss_dp_main.c
|
||||
@@ -399,7 +399,7 @@ static int nss_dp_open(struct net_device
|
||||
@@ -418,7 +418,7 @@ static int nss_dp_open(struct net_device
|
||||
|
||||
netif_start_queue(netdev);
|
||||
|
||||
|
@ -51,19 +52,23 @@ Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
|||
/* Notify data plane link is up */
|
||||
if (dp_priv->data_plane_ops->link_state(dp_priv->dpc, 1)) {
|
||||
netdev_dbg(netdev, "Data plane set link failed\n");
|
||||
@@ -576,6 +576,8 @@ static int32_t nss_dp_of_get_pdata(struc
|
||||
@@ -615,6 +615,12 @@ static int32_t nss_dp_of_get_pdata(struc
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
+ dp_priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
|
||||
+ if (!dp_priv->phy_node) {
|
||||
+ pr_err("%s: error parsing phy-handle\n", np->name);
|
||||
+ return -EFAULT;
|
||||
+ }
|
||||
+
|
||||
if (of_property_read_u32(np, "qcom,mactype", &hal_pdata->mactype)) {
|
||||
pr_err("%s: error reading mactype\n", np->name);
|
||||
return -EFAULT;
|
||||
@@ -594,16 +596,6 @@ static int32_t nss_dp_of_get_pdata(struc
|
||||
#else
|
||||
of_get_phy_mode(np, &dp_priv->phy_mii_type);
|
||||
@@ -635,18 +641,6 @@ static int32_t nss_dp_of_get_pdata(struc
|
||||
return -EFAULT;
|
||||
#endif
|
||||
|
||||
- dp_priv->link_poll = of_property_read_bool(np, "qcom,link-poll");
|
||||
- if (of_property_read_u32(np, "qcom,phy-mdio-addr",
|
||||
- &dp_priv->phy_mdio_addr) && dp_priv->link_poll) {
|
||||
|
@ -74,10 +79,12 @@ Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
|||
-
|
||||
- of_property_read_u32(np, "qcom,forced-speed", &dp_priv->forced_speed);
|
||||
- of_property_read_u32(np, "qcom,forced-duplex", &dp_priv->forced_duplex);
|
||||
|
||||
ret = of_get_mac_address(np, maddr);
|
||||
if (!ret && is_valid_ether_addr(maddr)) {
|
||||
@@ -636,50 +628,6 @@ static int32_t nss_dp_of_get_pdata(struc
|
||||
-
|
||||
-
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0))
|
||||
maddr = (uint8_t *)of_get_mac_address(np);
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(5, 4, 0))
|
||||
@@ -695,56 +689,6 @@ static int32_t nss_dp_of_get_pdata(struc
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -88,7 +95,9 @@ Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
|||
-{
|
||||
- struct device_node *mdio_node;
|
||||
- struct platform_device *mdio_plat;
|
||||
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0))
|
||||
- struct ipq40xx_mdio_data *mdio_data;
|
||||
-#endif
|
||||
-
|
||||
- /*
|
||||
- * Find mii_bus using "mdio-bus" handle.
|
||||
|
@ -115,6 +124,9 @@ Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
|||
- return NULL;
|
||||
- }
|
||||
-
|
||||
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0))
|
||||
- return dev_get_drvdata(&mdio_plat->dev);
|
||||
-#else
|
||||
- mdio_data = dev_get_drvdata(&mdio_plat->dev);
|
||||
- if (!mdio_data) {
|
||||
- dev_err(&pdev->dev, "cannot get mii bus reference from device data\n");
|
||||
|
@ -123,12 +135,13 @@ Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
|||
- }
|
||||
-
|
||||
- return mdio_data->mii_bus;
|
||||
-#endif
|
||||
-}
|
||||
-
|
||||
#ifdef CONFIG_NET_SWITCHDEV
|
||||
/*
|
||||
* nss_dp_is_phy_dev()
|
||||
@@ -738,7 +686,6 @@ static int32_t nss_dp_probe(struct platf
|
||||
@@ -803,7 +747,6 @@ static int32_t nss_dp_probe(struct platf
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
struct nss_gmac_hal_platform_data gmac_hal_pdata;
|
||||
int32_t ret = 0;
|
||||
|
@ -136,7 +149,7 @@ Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
|||
#if defined(NSS_DP_PPE_SUPPORT)
|
||||
uint32_t vsi_id;
|
||||
fal_port_t port_id;
|
||||
@@ -813,37 +760,17 @@ static int32_t nss_dp_probe(struct platf
|
||||
@@ -880,22 +823,14 @@ static int32_t nss_dp_probe(struct platf
|
||||
|
||||
dp_priv->drv_flags |= NSS_DP_PRIV_FLAG(INIT_DONE);
|
||||
|
||||
|
@ -151,33 +164,17 @@ Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
|||
-
|
||||
+ if (dp_priv->phy_node) {
|
||||
SET_NETDEV_DEV(netdev, &pdev->dev);
|
||||
-
|
||||
|
||||
- dp_priv->phydev = phy_connect(netdev, phy_id,
|
||||
- &nss_dp_adjust_link,
|
||||
- dp_priv->phy_mii_type);
|
||||
- if (IS_ERR(dp_priv->phydev)) {
|
||||
- netdev_dbg(netdev, "failed to connect to phy device\n");
|
||||
+ dp_priv->phydev = of_phy_connect(netdev, dp_priv->phy_node,
|
||||
+ &nss_dp_adjust_link, 0,
|
||||
+ dp_priv->phy_mii_type);
|
||||
+ &nss_dp_adjust_link, 0,
|
||||
+ dp_priv->phy_mii_type);
|
||||
+ if (!(dp_priv->phydev)) {
|
||||
+ dev_err(&pdev->dev, "Could not attach to PHY\n");
|
||||
+ netdev_err(netdev, "failed to connect to phy device\n");
|
||||
goto phy_setup_fail;
|
||||
}
|
||||
|
||||
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0))
|
||||
- dp_priv->phydev->advertising |=
|
||||
- (ADVERTISED_Pause | ADVERTISED_Asym_Pause);
|
||||
- dp_priv->phydev->supported |=
|
||||
- (SUPPORTED_Pause | SUPPORTED_Asym_Pause);
|
||||
-#else
|
||||
- linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, dp_priv->phydev->advertising);
|
||||
- linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, dp_priv->phydev->advertising);
|
||||
-
|
||||
- linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, dp_priv->phydev->supported);
|
||||
- linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, dp_priv->phydev->supported);
|
||||
-#endif
|
||||
+ phy_attached_info(dp_priv->phydev);
|
||||
}
|
||||
|
||||
#if defined(NSS_DP_PPE_SUPPORT)
|
|
@ -1,29 +0,0 @@
|
|||
From 5da62ba19f554bf437752a44360fb5ae9f1a7f5e Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Tue, 8 Mar 2022 10:48:32 +0100
|
||||
Subject: [PATCH] NSS-DP: implement ethernet IOCTL-s
|
||||
|
||||
Since kernel 5.15 ethernet/PHY related IOCTL-s have been split from the
|
||||
generic IOCTL netdev op.
|
||||
So, implement the new op instead of the generic one which is considered
|
||||
for private IOCTL-s only now for 5.15+.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
nss_dp_main.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
--- a/nss_dp_main.c
|
||||
+++ b/nss_dp_main.c
|
||||
@@ -532,7 +532,11 @@ static const struct net_device_ops nss_d
|
||||
.ndo_set_mac_address = nss_dp_set_mac_address,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
.ndo_change_mtu = nss_dp_change_mtu,
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
|
||||
.ndo_do_ioctl = nss_dp_do_ioctl,
|
||||
+#else
|
||||
+ .ndo_eth_ioctl = nss_dp_do_ioctl,
|
||||
+#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0))
|
||||
.ndo_bridge_setlink = switchdev_port_bridge_setlink,
|
|
@ -1,7 +1,7 @@
|
|||
From ae4fe8fb79b68f4cf4a887434ab6a8a9a1c65bfc Mon Sep 17 00:00:00 2001
|
||||
From c2df713569fe3bb671d1444c7bf758681081053c Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Thu, 23 Jun 2022 14:18:50 +0200
|
||||
Subject: [PATCH] nss-dp: edma-v1: use NAPI GRO by default
|
||||
Subject: [PATCH 7/8] nss-dp: edma-v1: use NAPI GRO by default
|
||||
|
||||
Utilize napi_gro_receive instead of plain netif_receive_skb on EDMA v1.
|
||||
|
||||
|
@ -20,7 +20,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
|||
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
@@ -589,10 +589,12 @@ drop:
|
||||
@@ -597,10 +597,12 @@ drop:
|
||||
*/
|
||||
static void edma_if_set_features(struct nss_dp_data_plane_ctx *dpc)
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
From 358b93e40d0c6b6d381fe0e9d2a63c45a10321b3 Mon Sep 17 00:00:00 2001
|
||||
From 53b044f7a21d5cd65ada90a228910e6efbad00fa Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Sun, 4 Dec 2022 18:41:36 +0100
|
||||
Subject: [PATCH] nss-dp: allow setting netdev name from DTS
|
||||
Subject: [PATCH 8/8] nss-dp: allow setting netdev name from DTS
|
||||
|
||||
Allow reading the desired netdev name from DTS like DSA allows and then
|
||||
set it as the netdev name during registration.
|
||||
|
@ -15,7 +15,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
|||
|
||||
--- a/nss_dp_main.c
|
||||
+++ b/nss_dp_main.c
|
||||
@@ -685,18 +685,29 @@ static int32_t nss_dp_probe(struct platf
|
||||
@@ -746,18 +746,29 @@ static int32_t nss_dp_probe(struct platf
|
||||
struct nss_dp_dev *dp_priv;
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
struct nss_gmac_hal_platform_data gmac_hal_pdata;
|
|
@ -1,48 +0,0 @@
|
|||
From c9afdcdd2642485a6476906be9da2e811090fc7a Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Fri, 18 Mar 2022 18:06:03 +0100
|
||||
Subject: [PATCH] switchdev: remove the transaction structure
|
||||
|
||||
Since 5.12 there is no transaction structure anymore, so drop it for
|
||||
5.12 and newer.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
nss_dp_switchdev.c | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
--- a/nss_dp_switchdev.c
|
||||
+++ b/nss_dp_switchdev.c
|
||||
@@ -279,13 +279,19 @@ void nss_dp_switchdev_setup(struct net_d
|
||||
* Sets attributes
|
||||
*/
|
||||
static int nss_dp_port_attr_set(struct net_device *dev,
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0))
|
||||
const struct switchdev_attr *attr,
|
||||
struct switchdev_trans *trans)
|
||||
+#else
|
||||
+ const struct switchdev_attr *attr)
|
||||
+#endif
|
||||
{
|
||||
struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(dev);
|
||||
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0))
|
||||
if (switchdev_trans_ph_prepare(trans))
|
||||
return 0;
|
||||
+#endif
|
||||
|
||||
switch (attr->id) {
|
||||
case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS:
|
||||
@@ -309,8 +315,12 @@ static int nss_dp_switchdev_port_attr_se
|
||||
{
|
||||
int err;
|
||||
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0))
|
||||
err = nss_dp_port_attr_set(netdev, port_attr_info->attr,
|
||||
port_attr_info->trans);
|
||||
+#else
|
||||
+ err = nss_dp_port_attr_set(netdev, port_attr_info->attr);
|
||||
+#endif
|
||||
|
||||
port_attr_info->handled = true;
|
||||
return notifier_from_errno(err);
|
|
@ -1,7 +1,7 @@
|
|||
From d16102cad769f430144ca8094d928762b445e9b0 Mon Sep 17 00:00:00 2001
|
||||
From 25ca3308edb67aa0c6c70b83edf0e22b8ae7533f Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Fri, 18 Mar 2022 22:02:01 +0100
|
||||
Subject: [PATCH] switchdev: fix FDB roaming
|
||||
Date: Thu, 29 Jun 2023 13:52:58 +0200
|
||||
Subject: [PATCH] nss-dp: switchdev: fix FDB roaming
|
||||
|
||||
Try and solve the roaming issue by trying to replicate what NSS bridge
|
||||
module is doing, but by utilizing switchdev FDB notifiers instead of
|
||||
|
@ -17,12 +17,12 @@ notification provided MAC adress existing FDB entry gets removed.
|
|||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
nss_dp_switchdev.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 61 insertions(+)
|
||||
nss_dp_switchdev.c | 73 +++++++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 72 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/nss_dp_switchdev.c
|
||||
+++ b/nss_dp_switchdev.c
|
||||
@@ -24,6 +24,8 @@
|
||||
@@ -29,6 +29,8 @@
|
||||
#include "nss_dp_dev.h"
|
||||
#include "fal/fal_stp.h"
|
||||
#include "fal/fal_ctrlpkt.h"
|
||||
|
@ -31,10 +31,18 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
|||
|
||||
#define NSS_DP_SWITCH_ID 0
|
||||
#define NSS_DP_SW_ETHTYPE_PID 0 /* PPE ethtype profile ID for slow protocols */
|
||||
@@ -348,10 +350,64 @@ static int nss_dp_switchdev_event(struct
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
@@ -521,7 +523,76 @@ static struct notifier_block *nss_dp_sw_
|
||||
|
||||
#else
|
||||
|
||||
-static struct notifier_block *nss_dp_sw_ev_nb;
|
||||
+/*
|
||||
+ * nss_dp_switchdev_fdb_del_event
|
||||
+ *
|
||||
+ * Used for EDMA v1 to remove old MAC in order to preventing having
|
||||
+ * duplicate MAC entries in FDB thus and avoid roaming issues.
|
||||
+ */
|
||||
+
|
||||
+static int nss_dp_switchdev_fdb_del_event(struct net_device *netdev,
|
||||
+ struct switchdev_notifier_fdb_info *fdb_info)
|
||||
+{
|
||||
|
@ -65,8 +73,14 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
|||
+ return notifier_from_errno(rv);
|
||||
+}
|
||||
+
|
||||
+static int nss_dp_fdb_switchdev_event(struct notifier_block *nb,
|
||||
+ unsigned long event, void *ptr)
|
||||
+/*
|
||||
+ * nss_dp_switchdev_event_nb
|
||||
+ *
|
||||
+ * Non blocking switchdev event for netdevice.
|
||||
+ * Used for EDMA v1 to remove old MAC and avoid roaming issues.
|
||||
+ */
|
||||
+static int nss_dp_switchdev_event_nb(struct notifier_block *unused,
|
||||
+ unsigned long event, void *ptr)
|
||||
+{
|
||||
+ struct net_device *dev = switchdev_notifier_info_to_dev(ptr);
|
||||
+
|
||||
|
@ -80,31 +94,18 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
|||
+ switch (event) {
|
||||
+ case SWITCHDEV_FDB_DEL_TO_DEVICE:
|
||||
+ return nss_dp_switchdev_fdb_del_event(dev, ptr);
|
||||
+ default:
|
||||
+ netdev_dbg(dev, "Switchdev event %lu is not supported\n", event);
|
||||
+ }
|
||||
+
|
||||
+ return NOTIFY_DONE;
|
||||
+}
|
||||
+
|
||||
static struct notifier_block nss_dp_switchdev_notifier = {
|
||||
.notifier_call = nss_dp_switchdev_event,
|
||||
};
|
||||
|
||||
+static struct notifier_block nss_dp_switchdev_fdb_notifier = {
|
||||
+ .notifier_call = nss_dp_fdb_switchdev_event,
|
||||
+static struct notifier_block nss_dp_switchdev_notifier_nb = {
|
||||
+ .notifier_call = nss_dp_switchdev_event_nb,
|
||||
+};
|
||||
+
|
||||
static bool switch_init_done;
|
||||
+static struct notifier_block *nss_dp_sw_ev_nb = &nss_dp_switchdev_notifier_nb;
|
||||
|
||||
/*
|
||||
@@ -366,6 +422,11 @@ void nss_dp_switchdev_setup(struct net_d
|
||||
return;
|
||||
}
|
||||
|
||||
+ err = register_switchdev_notifier(&nss_dp_switchdev_fdb_notifier);
|
||||
+ if (err) {
|
||||
+ netdev_dbg(dev, "%px:Failed to register switchdev FDB notifier\n", dev);
|
||||
+ }
|
||||
+
|
||||
err = register_switchdev_blocking_notifier(&nss_dp_switchdev_notifier);
|
||||
if (err) {
|
||||
netdev_dbg(dev, "%px:Failed to register switchdev notifier\n", dev);
|
||||
* nss_dp_bridge_attr_set()
|
|
@ -1,51 +0,0 @@
|
|||
From f95868d54301c0f54e968ec9d978c9caa02ee425 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Fri, 18 Mar 2022 18:24:18 +0100
|
||||
Subject: [PATCH] switchdev: use new switchdev flags
|
||||
|
||||
Since kernel 5.12 switched utilizes a new way of setting the flags by
|
||||
using a dedicated structure with flags and mask.
|
||||
|
||||
So fix using kernels 5.12 and later.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
include/nss_dp_dev.h | 7 +++++++
|
||||
nss_dp_switchdev.c | 2 +-
|
||||
2 files changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/include/nss_dp_dev.h
|
||||
+++ b/include/nss_dp_dev.h
|
||||
@@ -24,6 +24,9 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/phy.h>
|
||||
#include <linux/version.h>
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0))
|
||||
+#include <net/switchdev.h>
|
||||
+#endif
|
||||
|
||||
#include "nss_dp_api_if.h"
|
||||
#include "nss_dp_hal_if.h"
|
||||
@@ -126,7 +129,11 @@ struct nss_dp_dev {
|
||||
/* switchdev related attributes */
|
||||
#ifdef CONFIG_NET_SWITCHDEV
|
||||
u8 stp_state; /* STP state of this physical port */
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0))
|
||||
unsigned long brport_flags; /* bridge port flags */
|
||||
+#else
|
||||
+ struct switchdev_brport_flags brport_flags; /* bridge port flags */
|
||||
+#endif
|
||||
#endif
|
||||
uint32_t rx_page_mode; /* page mode for Rx processing */
|
||||
uint32_t rx_jumbo_mru; /* Jumbo mru value for Rx processing */
|
||||
--- a/nss_dp_switchdev.c
|
||||
+++ b/nss_dp_switchdev.c
|
||||
@@ -296,7 +296,7 @@ static int nss_dp_port_attr_set(struct n
|
||||
switch (attr->id) {
|
||||
case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS:
|
||||
dp_priv->brport_flags = attr->u.brport_flags;
|
||||
- netdev_dbg(dev, "set brport_flags %lu\n", attr->u.brport_flags);
|
||||
+ netdev_dbg(dev, "set brport_flags %lu\n", attr->u.brport_flags.val);
|
||||
return 0;
|
||||
case SWITCHDEV_ATTR_ID_PORT_STP_STATE:
|
||||
return nss_dp_stp_state_set(dp_priv, attr->u.stp_state);
|
|
@ -1,41 +0,0 @@
|
|||
From 7e4ae2d6285095794d73d2f2ce61404f61d4e633 Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Tue, 17 May 2022 15:55:36 +0200
|
||||
Subject: [PATCH 11/11] treewide: fix confusing printing of registered netdev
|
||||
|
||||
Net core implementation changed and now printing the netdev name cause
|
||||
confusing printing if done before register_netdev. Move the old printing
|
||||
to dbg and add an additional info log right after register_netdev to
|
||||
give the user some info on correct nss-dp probe.
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 4 ++--
|
||||
nss_dp_main.c | 3 +++
|
||||
2 files changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
@@ -822,8 +822,8 @@ static int edma_register_netdevice(struc
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- netdev_info(netdev, "nss_dp_edma: Registering netdev %s(qcom-id:%d) with EDMA\n",
|
||||
- netdev->name, macid);
|
||||
+ netdev_dbg(netdev, "nss_dp_edma: Registering netdev %s(qcom-id:%d) with EDMA\n",
|
||||
+ netdev->name, macid);
|
||||
|
||||
/*
|
||||
* We expect 'macid' to correspond to ports numbers on
|
||||
--- a/nss_dp_main.c
|
||||
+++ b/nss_dp_main.c
|
||||
@@ -875,6 +875,9 @@ static int32_t nss_dp_probe(struct platf
|
||||
goto phy_setup_fail;
|
||||
}
|
||||
|
||||
+ netdev_info(netdev, "Registered netdev %s(qcom-id:%d)\n",
|
||||
+ netdev->name, port_id);
|
||||
+
|
||||
dp_global_ctx.nss_dp[dp_priv->macid - 1] = dp_priv;
|
||||
dp_global_ctx.slowproto_acl_bm = 0;
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
From fee52ef165e9fab2fca15492677082fd8e9e891f Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Thu, 19 May 2022 23:40:24 +0200
|
||||
Subject: [PATCH 12/12] gmac: syn: xgmac: silence debug log on probe
|
||||
|
||||
Silence debug log set as info in xgmac port probe.
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
hal/gmac_ops/syn/xgmac/syn_if.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/hal/gmac_ops/syn/xgmac/syn_if.c
|
||||
+++ b/hal/gmac_ops/syn/xgmac/syn_if.c
|
||||
@@ -445,7 +445,7 @@ static void *syn_init(struct nss_gmac_ha
|
||||
|
||||
spin_lock_init(&shd->nghd.slock);
|
||||
|
||||
- netdev_info(ndev, "ioremap OK.Size 0x%x Ndev base 0x%lx macbase 0x%px\n",
|
||||
+ netdev_dbg(ndev, "ioremap OK.Size 0x%x Ndev base 0x%lx macbase 0x%px\n",
|
||||
gmacpdata->reg_len,
|
||||
ndev->base_addr,
|
||||
shd->nghd.mac_base);
|
|
@ -1,57 +0,0 @@
|
|||
From ff9284e3a59982c78a0132e6f2c5e3f04ba11472 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Thu, 29 Sep 2022 20:37:46 +0200
|
||||
Subject: [PATCH 15/16] nss-dp: netdev mac_addr is const
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
exports/nss_dp_api_if.h | 2 +-
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 2 +-
|
||||
hal/dp_ops/edma_dp/edma_v2/edma_dp.c | 2 +-
|
||||
hal/dp_ops/syn_gmac_dp/syn_dp.c | 2 +-
|
||||
4 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/exports/nss_dp_api_if.h
|
||||
+++ b/exports/nss_dp_api_if.h
|
||||
@@ -83,7 +83,7 @@ struct nss_dp_data_plane_ops {
|
||||
int (*close)(struct nss_dp_data_plane_ctx *dpc);
|
||||
int (*link_state)(struct nss_dp_data_plane_ctx *dpc,
|
||||
uint32_t link_state);
|
||||
- int (*mac_addr)(struct nss_dp_data_plane_ctx *dpc, uint8_t *addr);
|
||||
+ int (*mac_addr)(struct nss_dp_data_plane_ctx *dpc, const uint8_t *addr);
|
||||
int (*change_mtu)(struct nss_dp_data_plane_ctx *dpc, uint32_t mtu);
|
||||
netdev_tx_t (*xmit)(struct nss_dp_data_plane_ctx *dpc, struct sk_buff *os_buf);
|
||||
void (*set_features)(struct nss_dp_data_plane_ctx *dpc);
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
@@ -494,7 +494,7 @@ static int edma_if_link_state(struct nss
|
||||
/*
|
||||
* edma_if_mac_addr()
|
||||
*/
|
||||
-static int edma_if_mac_addr(struct nss_dp_data_plane_ctx *dpc, uint8_t *addr)
|
||||
+static int edma_if_mac_addr(struct nss_dp_data_plane_ctx *dpc, const uint8_t *addr)
|
||||
{
|
||||
return NSS_DP_SUCCESS;
|
||||
}
|
||||
--- a/hal/dp_ops/edma_dp/edma_v2/edma_dp.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v2/edma_dp.c
|
||||
@@ -99,7 +99,7 @@ static int edma_dp_link_state(struct nss
|
||||
* edma_dp_mac_addr()
|
||||
* EDMA data plane MAC address change API
|
||||
*/
|
||||
-static int edma_dp_mac_addr(struct nss_dp_data_plane_ctx *dpc, uint8_t *addr)
|
||||
+static int edma_dp_mac_addr(struct nss_dp_data_plane_ctx *dpc, const uint8_t *addr)
|
||||
{
|
||||
return NSS_DP_SUCCESS;
|
||||
}
|
||||
--- a/hal/dp_ops/syn_gmac_dp/syn_dp.c
|
||||
+++ b/hal/dp_ops/syn_gmac_dp/syn_dp.c
|
||||
@@ -289,7 +289,7 @@ static int syn_dp_if_link_state(struct n
|
||||
/*
|
||||
* syn_dp_if_mac_addr()
|
||||
*/
|
||||
-static int syn_dp_if_mac_addr(struct nss_dp_data_plane_ctx *dpc, uint8_t *addr)
|
||||
+static int syn_dp_if_mac_addr(struct nss_dp_data_plane_ctx *dpc, const uint8_t *addr)
|
||||
{
|
||||
return NSS_DP_SUCCESS;
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
From 704706969301076961c15423dedce9e2e6f1026e Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Thu, 29 Sep 2022 20:39:07 +0200
|
||||
Subject: [PATCH 16/16] nss-dp: use proper netdev MAC helpers
|
||||
|
||||
mac_addr is const, so utilize proper helpers for setting random and
|
||||
desired MAC addres as old ones were dropped in newer kernels.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
nss_dp_main.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/nss_dp_main.c
|
||||
+++ b/nss_dp_main.c
|
||||
@@ -599,9 +599,9 @@ static int32_t nss_dp_of_get_pdata(struc
|
||||
|
||||
ret = of_get_mac_address(np, maddr);
|
||||
if (!ret && is_valid_ether_addr(maddr)) {
|
||||
- ether_addr_copy(netdev->dev_addr, maddr);
|
||||
+ eth_hw_addr_set(netdev, maddr);
|
||||
} else {
|
||||
- random_ether_addr(netdev->dev_addr);
|
||||
+ eth_hw_addr_random(netdev);
|
||||
pr_info("GMAC%d(%px) Invalid MAC@ - using %pM\n", dp_priv->macid,
|
||||
dp_priv, netdev->dev_addr);
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
From ba748ab91a62db57f9bdf69dd306e6557315db85 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Mon, 3 Oct 2022 23:05:14 +0200
|
||||
Subject: [PATCH] nss-dp: adapt to netif_napi_add() changes
|
||||
|
||||
netif_napi_add() removed the weight argument and just uses the default
|
||||
NAPI_POLL_WEIGHT in background, so for those requiring custom weight use
|
||||
netif_napi_add_weight() instead.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 6 +++++-
|
||||
hal/dp_ops/edma_dp/edma_v2/edma_cfg_rx.c | 8 +++++++-
|
||||
hal/dp_ops/edma_dp/edma_v2/edma_cfg_tx.c | 7 ++++++-
|
||||
hal/dp_ops/syn_gmac_dp/syn_dp.c | 5 +++++
|
||||
4 files changed, 23 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
|
||||
@@ -838,8 +838,12 @@ static int edma_register_netdevice(struc
|
||||
* NAPI add
|
||||
*/
|
||||
if (!edma_hw.napi_added) {
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
|
||||
netif_napi_add(netdev, &edma_hw.napi, edma_napi,
|
||||
- NAPI_POLL_WEIGHT);
|
||||
+ NAPI_POLL_WEIGHT);
|
||||
+#else
|
||||
+ netif_napi_add(netdev, &edma_hw.napi, edma_napi);
|
||||
+#endif
|
||||
/*
|
||||
* Register the interrupt handlers and enable interrupts
|
||||
*/
|
||||
--- a/hal/dp_ops/edma_dp/edma_v2/edma_cfg_rx.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v2/edma_cfg_rx.c
|
||||
@@ -1097,8 +1097,14 @@ void edma_cfg_rx_napi_add(struct edma_gb
|
||||
|
||||
for (i = 0; i < egc->num_rxdesc_rings; i++) {
|
||||
struct edma_rxdesc_ring *rxdesc_ring = &egc->rxdesc_rings[i];
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
|
||||
netif_napi_add(netdev, &rxdesc_ring->napi,
|
||||
- edma_rx_napi_poll, nss_dp_rx_napi_budget);
|
||||
+ edma_rx_napi_poll, nss_dp_rx_napi_budget);
|
||||
+
|
||||
+#else
|
||||
+ netif_napi_add_weight(netdev, &rxdesc_ring->napi,
|
||||
+ edma_rx_napi_poll, nss_dp_rx_napi_budget);
|
||||
+#endif
|
||||
rxdesc_ring->napi_added = true;
|
||||
}
|
||||
edma_info("%s: Rx NAPI budget: %d\n", netdev->name, nss_dp_rx_napi_budget);
|
||||
--- a/hal/dp_ops/edma_dp/edma_v2/edma_cfg_tx.c
|
||||
+++ b/hal/dp_ops/edma_dp/edma_v2/edma_cfg_tx.c
|
||||
@@ -672,8 +672,13 @@ void edma_cfg_tx_napi_add(struct edma_gb
|
||||
for (i = 0; i < egc->num_txcmpl_rings; i++) {
|
||||
struct edma_txcmpl_ring *txcmpl_ring = &egc->txcmpl_rings[i];
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
|
||||
netif_napi_add(netdev, &txcmpl_ring->napi,
|
||||
- edma_tx_napi_poll, nss_dp_tx_napi_budget);
|
||||
+ edma_tx_napi_poll, nss_dp_tx_napi_budget);
|
||||
+#else
|
||||
+ netif_napi_add_weight(netdev, &txcmpl_ring->napi,
|
||||
+ edma_tx_napi_poll, nss_dp_tx_napi_budget);
|
||||
+#endif
|
||||
txcmpl_ring->napi_added = true;
|
||||
}
|
||||
edma_info("Tx NAPI budget: %d\n", nss_dp_tx_napi_budget);
|
||||
--- a/hal/dp_ops/syn_gmac_dp/syn_dp.c
|
||||
+++ b/hal/dp_ops/syn_gmac_dp/syn_dp.c
|
||||
@@ -189,8 +189,13 @@ static int syn_dp_if_init(struct nss_dp_
|
||||
}
|
||||
|
||||
if (!dev_info->napi_added) {
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
|
||||
netif_napi_add(netdev, &rx_info->napi_rx, syn_dp_napi_poll_rx, SYN_DP_NAPI_BUDGET_RX);
|
||||
netif_napi_add(netdev, &tx_info->napi_tx, syn_dp_napi_poll_tx, SYN_DP_NAPI_BUDGET_TX);
|
||||
+#else
|
||||
+ netif_napi_add_weight(netdev, &rx_info->napi_rx, syn_dp_napi_poll_rx, SYN_DP_NAPI_BUDGET_RX);
|
||||
+ netif_napi_add_weight(netdev, &tx_info->napi_tx, syn_dp_napi_poll_tx, SYN_DP_NAPI_BUDGET_TX);
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Requesting irq. Set IRQ_DISABLE_UNLAZY flag, this flag
|
|
@ -1,13 +1,13 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=qca-ssdk
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-ssdk.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2022-09-12
|
||||
PKG_SOURCE_VERSION:=628b22bc3d5ee81414b75ab3de6a255c82754dec
|
||||
PKG_MIRROR_HASH:=859344f79504b9953639dc5aa27042249f68e3a9a269e66d7f7a25e1ab38c110
|
||||
PKG_SOURCE_DATE:=2023-06-06
|
||||
PKG_SOURCE_VERSION:=74caf88aa3b6793c300f676e4fb1c62da7507be9
|
||||
PKG_MIRROR_HASH:=6bdb90919b773f5fb432c8b374c9419feac32ba6583ad82dfec5e41628a32dd9
|
||||
|
||||
PKG_FLAGS:=nonshared
|
||||
PKG_BUILD_FLAGS:=no-lto
|
||||
|
@ -20,7 +20,7 @@ define KernelPackage/qca-ssdk
|
|||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Qualcom SSDK switch driver
|
||||
DEPENDS:=@(TARGET_ipq807x)
|
||||
DEPENDS:=@(TARGET_qualcommax)
|
||||
FILES:=$(PKG_BUILD_DIR)/build/bin/qca-ssdk.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,qca-ssdk)
|
||||
endef
|
||||
|
@ -51,7 +51,7 @@ MAKE_FLAGS+= \
|
|||
EXTRA_CFLAGS=-fno-stack-protector -I$(STAGING_DIR)/usr/include \
|
||||
$(LNX_CONFIG_OPTS)
|
||||
|
||||
ifeq ($(CONFIG_TARGET_BOARD), "ipq807x")
|
||||
ifeq ($(CONFIG_TARGET_SUBTARGET), "ipq807x")
|
||||
MAKE_FLAGS+= CHIP_TYPE=HPPE PTP_FEATURE=disable SWCONFIG_FEATURE=disable
|
||||
endif
|
||||
|
||||
|
@ -75,6 +75,9 @@ define Build/InstallDev
|
|||
if [ -f $(PKG_BUILD_DIR)/include/init/ssdk_init.h ]; then \
|
||||
$(CP) -rf $(PKG_BUILD_DIR)/include/init/ssdk_init.h $(1)/usr/include/qca-ssdk/init/; \
|
||||
fi
|
||||
if [ -f $(PKG_BUILD_DIR)/include/init/ssdk_netlink.h ]; then \
|
||||
$(CP) -rf $(PKG_BUILD_DIR)/include/init/ssdk_netlink.h $(1)/usr/include/qca-ssdk/init/; \
|
||||
fi
|
||||
$(CP) -rf $(PKG_BUILD_DIR)/include/fal $(1)/usr/include/qca-ssdk
|
||||
$(CP) -rf $(PKG_BUILD_DIR)/include/common/*.h $(1)/usr/include/qca-ssdk
|
||||
$(CP) -rf $(PKG_BUILD_DIR)/include/sal/os/linux/*.h $(1)/usr/include/qca-ssdk
|
||||
|
|
|
@ -1,102 +0,0 @@
|
|||
From 1e46d596701fedb751a669666a74677344fb8724 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Wed, 12 May 2021 13:45:45 +0200
|
||||
Subject: [PATCH 01/14] SSDK: replace ioremap_nocache with ioremap
|
||||
|
||||
ioremap_nocache was dropped upstream, simply use the
|
||||
generic variety.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
src/init/ssdk_clk.c | 10 +++++-----
|
||||
src/init/ssdk_init.c | 2 +-
|
||||
src/init/ssdk_plat.c | 6 +++---
|
||||
3 files changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/src/init/ssdk_clk.c
|
||||
+++ b/src/init/ssdk_clk.c
|
||||
@@ -721,7 +721,7 @@ ssdk_mp_tcsr_get(a_uint32_t tcsr_offset,
|
||||
{
|
||||
void __iomem *tcsr_base = NULL;
|
||||
|
||||
- tcsr_base = ioremap_nocache(TCSR_ETH_ADDR, TCSR_ETH_SIZE);
|
||||
+ tcsr_base = ioremap(TCSR_ETH_ADDR, TCSR_ETH_SIZE);
|
||||
if (!tcsr_base)
|
||||
{
|
||||
SSDK_ERROR("Failed to map tcsr eth address!\n");
|
||||
@@ -738,7 +738,7 @@ ssdk_mp_tcsr_set(a_uint32_t tcsr_offset,
|
||||
{
|
||||
void __iomem *tcsr_base = NULL;
|
||||
|
||||
- tcsr_base = ioremap_nocache(TCSR_ETH_ADDR, TCSR_ETH_SIZE);
|
||||
+ tcsr_base = ioremap(TCSR_ETH_ADDR, TCSR_ETH_SIZE);
|
||||
if (!tcsr_base)
|
||||
{
|
||||
SSDK_ERROR("Failed to map tcsr eth address!\n");
|
||||
@@ -786,7 +786,7 @@ ssdk_mp_cmnblk_stable_check(void)
|
||||
a_uint32_t reg_val;
|
||||
int i, loops = 20;
|
||||
|
||||
- pll_lock = ioremap_nocache(CMN_PLL_LOCKED_ADDR, CMN_PLL_LOCKED_SIZE);
|
||||
+ pll_lock = ioremap(CMN_PLL_LOCKED_ADDR, CMN_PLL_LOCKED_SIZE);
|
||||
if (!pll_lock) {
|
||||
SSDK_ERROR("Failed to map CMN PLL LOCK register!\n");
|
||||
return A_FALSE;
|
||||
@@ -843,7 +843,7 @@ static void ssdk_cmnblk_pll_src_set(enum
|
||||
void __iomem *cmn_pll_src_base = NULL;
|
||||
a_uint32_t reg_val;
|
||||
|
||||
- cmn_pll_src_base = ioremap_nocache(CMN_BLK_PLL_SRC_ADDR, CMN_BLK_SIZE);
|
||||
+ cmn_pll_src_base = ioremap(CMN_BLK_PLL_SRC_ADDR, CMN_BLK_SIZE);
|
||||
if (!cmn_pll_src_base) {
|
||||
SSDK_ERROR("Failed to map cmn pll source address!\n");
|
||||
return;
|
||||
@@ -869,7 +869,7 @@ static void ssdk_cmnblk_init(enum cmnblk
|
||||
return;
|
||||
}
|
||||
|
||||
- gcc_pll_base = ioremap_nocache(CMN_BLK_ADDR, CMN_BLK_SIZE);
|
||||
+ gcc_pll_base = ioremap(CMN_BLK_ADDR, CMN_BLK_SIZE);
|
||||
if (!gcc_pll_base) {
|
||||
SSDK_ERROR("Failed to map gcc pll address!\n");
|
||||
return;
|
||||
--- a/src/init/ssdk_init.c
|
||||
+++ b/src/init/ssdk_init.c
|
||||
@@ -3134,7 +3134,7 @@ static int ssdk_dess_mac_mode_init(a_uin
|
||||
(a_uint8_t *)®_value, 4);
|
||||
mdelay(10);
|
||||
/*softreset psgmii, fixme*/
|
||||
- gcc_addr = ioremap_nocache(0x1812000, 0x200);
|
||||
+ gcc_addr = ioremap(0x1812000, 0x200);
|
||||
if (!gcc_addr) {
|
||||
SSDK_ERROR("gcc map fail!\n");
|
||||
return 0;
|
||||
--- a/src/init/ssdk_plat.c
|
||||
+++ b/src/init/ssdk_plat.c
|
||||
@@ -1708,7 +1708,7 @@ ssdk_plat_init(ssdk_init_cfg *cfg, a_uin
|
||||
reg_mode = ssdk_uniphy_reg_access_mode_get(dev_id);
|
||||
if(reg_mode == HSL_REG_LOCAL_BUS) {
|
||||
ssdk_uniphy_reg_map_info_get(dev_id, &map);
|
||||
- qca_phy_priv_global[dev_id]->uniphy_hw_addr = ioremap_nocache(map.base_addr,
|
||||
+ qca_phy_priv_global[dev_id]->uniphy_hw_addr = ioremap(map.base_addr,
|
||||
map.size);
|
||||
if (!qca_phy_priv_global[dev_id]->uniphy_hw_addr) {
|
||||
SSDK_ERROR("%s ioremap fail.", __func__);
|
||||
@@ -1723,7 +1723,7 @@ ssdk_plat_init(ssdk_init_cfg *cfg, a_uin
|
||||
reg_mode = ssdk_switch_reg_access_mode_get(dev_id);
|
||||
if (reg_mode == HSL_REG_LOCAL_BUS) {
|
||||
ssdk_switch_reg_map_info_get(dev_id, &map);
|
||||
- qca_phy_priv_global[dev_id]->hw_addr = ioremap_nocache(map.base_addr,
|
||||
+ qca_phy_priv_global[dev_id]->hw_addr = ioremap(map.base_addr,
|
||||
map.size);
|
||||
if (!qca_phy_priv_global[dev_id]->hw_addr) {
|
||||
SSDK_ERROR("%s ioremap fail.", __func__);
|
||||
@@ -1764,7 +1764,7 @@ ssdk_plat_init(ssdk_init_cfg *cfg, a_uin
|
||||
return -1;
|
||||
}
|
||||
|
||||
- qca_phy_priv_global[dev_id]->psgmii_hw_addr = ioremap_nocache(map.base_addr,
|
||||
+ qca_phy_priv_global[dev_id]->psgmii_hw_addr = ioremap(map.base_addr,
|
||||
map.size);
|
||||
if (!qca_phy_priv_global[dev_id]->psgmii_hw_addr) {
|
||||
SSDK_ERROR("%s ioremap fail.", __func__);
|
|
@ -1,7 +1,7 @@
|
|||
From 37255b97a9170f6dd1604931f0d7a8f847be5b5d Mon Sep 17 00:00:00 2001
|
||||
From cdcafa28c857e4d04c9210feb54dc84e427061fe Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Tue, 11 Jan 2022 00:28:42 +0100
|
||||
Subject: [PATCH 05/14] qca807x: add a LED quirk for Xiaomi AX9000
|
||||
Subject: [PATCH 1/2] qca807x: add a LED quirk for Xiaomi AX9000
|
||||
|
||||
Xiaomi AX9000 has a single LED for each of 4 gigabit ethernet ports that
|
||||
are connected to QCA8075, and that LED is connected to the 100M LED pin.
|
||||
|
@ -49,7 +49,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
|||
#include "sw.h"
|
||||
#include "fal_port_ctrl.h"
|
||||
#include "hsl_api.h"
|
||||
@@ -2708,6 +2710,15 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_
|
||||
@@ -2716,6 +2718,15 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_
|
||||
led_status |= MALIBU_LED_1000_CTRL1_100_10_MASK;
|
||||
malibu_phy_mmd_write(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM,
|
||||
MALIBU_PHY_MMD7_LED_1000_CTRL1, led_status);
|
|
@ -1,40 +0,0 @@
|
|||
From 60d2b72cacd43796def9b4bd69a9e0e84be9d2e1 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Wed, 12 May 2021 17:15:46 +0200
|
||||
Subject: [PATCH 02/14] SSDK: platform: use of_mdio_find_bus() to get MDIO bus
|
||||
|
||||
Kernel has a generic of_mdio_find_bus() which can get the appropriate
|
||||
MDIO bus based on the DT node.
|
||||
So, drop the getting MDIO from platform data, which no longer works
|
||||
in 5.4 and later and use of_mdio_find_bus().
|
||||
|
||||
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
src/init/ssdk_plat.c | 8 +-------
|
||||
1 file changed, 1 insertion(+), 7 deletions(-)
|
||||
|
||||
--- a/src/init/ssdk_plat.c
|
||||
+++ b/src/init/ssdk_plat.c
|
||||
@@ -753,7 +753,6 @@ static int miibus_get(a_uint32_t dev_id)
|
||||
struct device_node *mdio_node = NULL;
|
||||
struct device_node *switch_node = NULL;
|
||||
struct platform_device *mdio_plat = NULL;
|
||||
- struct qca_mdio_data *mdio_data = NULL;
|
||||
struct qca_phy_priv *priv;
|
||||
hsl_reg_mode reg_mode = HSL_REG_LOCAL_BUS;
|
||||
priv = qca_phy_priv_global[dev_id];
|
||||
@@ -788,12 +787,7 @@ static int miibus_get(a_uint32_t dev_id)
|
||||
|
||||
if(reg_mode == HSL_REG_LOCAL_BUS)
|
||||
{
|
||||
- mdio_data = dev_get_drvdata(&mdio_plat->dev);
|
||||
- if (!mdio_data) {
|
||||
- SSDK_ERROR("cannot get mdio_data reference from device data\n");
|
||||
- return 1;
|
||||
- }
|
||||
- priv->miibus = mdio_data->mii_bus;
|
||||
+ priv->miibus = of_mdio_find_bus(mdio_node);
|
||||
}
|
||||
else
|
||||
priv->miibus = dev_get_drvdata(&mdio_plat->dev);
|
|
@ -1,7 +1,7 @@
|
|||
From 1eaed6c8d72cb07e221a94d05615ae45b60ffd82 Mon Sep 17 00:00:00 2001
|
||||
From a750e569aeb4f7b454dbde18cd6d0f2bb1875dfa Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Wed, 26 Jan 2022 14:47:33 +0100
|
||||
Subject: [PATCH 06/14] qca807x: add a LED quirk for Xiaomi AX3600
|
||||
Subject: [PATCH 2/2] qca807x: add a LED quirk for Xiaomi AX3600
|
||||
|
||||
AX3600 requires the same LED quirk so that PHY LED-s will blink even
|
||||
once Linux resets the PHY.
|
||||
|
@ -15,7 +15,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
|||
|
||||
--- a/src/hsl/phy/malibu_phy.c
|
||||
+++ b/src/hsl/phy/malibu_phy.c
|
||||
@@ -2710,8 +2710,9 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_
|
||||
@@ -2718,8 +2718,9 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_
|
||||
led_status |= MALIBU_LED_1000_CTRL1_100_10_MASK;
|
||||
malibu_phy_mmd_write(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM,
|
||||
MALIBU_PHY_MMD7_LED_1000_CTRL1, led_status);
|
|
@ -1,42 +0,0 @@
|
|||
From c1b6fa42a160763b574dd52aa4845718e4cd0ea6 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Fri, 13 Aug 2021 20:03:21 +0200
|
||||
Subject: [PATCH 03/14] SSDK: dts: fix of_get_mac_address()
|
||||
|
||||
Recently OpenWrt backported the updated of_get_mac_address()
|
||||
function which returns and error code instead.
|
||||
|
||||
So, patch the SSDK to use it and fix the compilation error.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
src/init/ssdk_dts.c | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/src/init/ssdk_dts.c
|
||||
+++ b/src/init/ssdk_dts.c
|
||||
@@ -921,8 +921,9 @@ static void ssdk_dt_parse_intf_mac(void)
|
||||
{
|
||||
struct device_node *dp_node = NULL;
|
||||
a_uint32_t dp = 0;
|
||||
- a_uint8_t *maddr = NULL;
|
||||
+ u8 maddr[ETH_ALEN];
|
||||
char dp_name[8] = {0};
|
||||
+ int ret;
|
||||
|
||||
for (dp = 1; dp <= SSDK_MAX_NR_ETH; dp++) {
|
||||
snprintf(dp_name, sizeof(dp_name), "dp%d", dp);
|
||||
@@ -930,11 +931,11 @@ static void ssdk_dt_parse_intf_mac(void)
|
||||
if (!dp_node) {
|
||||
continue;
|
||||
}
|
||||
- maddr = (a_uint8_t *)of_get_mac_address(dp_node);
|
||||
+ ret = of_get_mac_address(dp_node, maddr);
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0))
|
||||
if (maddr && is_valid_ether_addr(maddr)) {
|
||||
#else
|
||||
- if (!IS_ERR(maddr) && is_valid_ether_addr(maddr)) {
|
||||
+ if (!ret && is_valid_ether_addr(maddr)) {
|
||||
#endif
|
||||
ssdk_dt_global.num_intf_mac++;
|
||||
ether_addr_copy(ssdk_dt_global.intf_mac[dp-1].uc, maddr);
|
|
@ -1,83 +0,0 @@
|
|||
From aaac91b5e8756dce1c0242d58074a0b5d4607b57 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Fri, 24 Dec 2021 20:02:32 +0100
|
||||
Subject: [PATCH 04/14] qca8081: convert to 5.11 IRQ model
|
||||
|
||||
Kernel 5.11 introduced new IRQ handling model for PHY-s,
|
||||
so provide those if 5.11 or later is used.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
src/hsl/phy/qca808x.c | 46 +++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 46 insertions(+)
|
||||
|
||||
--- a/src/hsl/phy/qca808x.c
|
||||
+++ b/src/hsl/phy/qca808x.c
|
||||
@@ -247,6 +247,7 @@ static int qca808x_config_intr(struct ph
|
||||
return err;
|
||||
}
|
||||
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0))
|
||||
static int qca808x_ack_interrupt(struct phy_device *phydev)
|
||||
{
|
||||
int err;
|
||||
@@ -266,6 +267,47 @@ static int qca808x_ack_interrupt(struct
|
||||
|
||||
return (err < 0) ? err : 0;
|
||||
}
|
||||
+#endif
|
||||
+
|
||||
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(5, 11, 0))
|
||||
+static irqreturn_t qca808x_handle_interrupt(struct phy_device *phydev)
|
||||
+{
|
||||
+ a_uint16_t irq_status, int_enabled;
|
||||
+ a_uint32_t dev_id = 0, phy_id = 0;
|
||||
+ qca808x_priv *priv = phydev->priv;
|
||||
+ const struct qca808x_phy_info *pdata = priv->phy_info;
|
||||
+
|
||||
+ if (!pdata) {
|
||||
+ return SW_FAIL;
|
||||
+ }
|
||||
+
|
||||
+ dev_id = pdata->dev_id;
|
||||
+ phy_id = pdata->phy_addr;
|
||||
+
|
||||
+ irq_status = qca808x_phy_reg_read(dev_id, phy_id,
|
||||
+ QCA808X_PHY_INTR_STATUS);
|
||||
+ if (irq_status < 0) {
|
||||
+ phy_error(phydev);
|
||||
+ return IRQ_NONE;
|
||||
+ }
|
||||
+
|
||||
+ /* Read the current enabled interrupts */
|
||||
+ int_enabled = qca808x_phy_reg_read(dev_id, phy_id,
|
||||
+ QCA808X_PHY_INTR_MASK);
|
||||
+ if (int_enabled < 0) {
|
||||
+ phy_error(phydev);
|
||||
+ return IRQ_NONE;
|
||||
+ }
|
||||
+
|
||||
+ /* See if this was one of our enabled interrupts */
|
||||
+ if (!(irq_status & int_enabled))
|
||||
+ return IRQ_NONE;
|
||||
+
|
||||
+ phy_trigger_machine(phydev);
|
||||
+
|
||||
+ return IRQ_HANDLED;
|
||||
+}
|
||||
+#endif
|
||||
|
||||
/* switch linux negtiation capability to fal avariable */
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0))
|
||||
@@ -638,7 +680,11 @@ struct phy_driver qca808x_phy_driver = {
|
||||
.config_intr = qca808x_config_intr,
|
||||
.config_aneg = qca808x_config_aneg,
|
||||
.aneg_done = qca808x_aneg_done,
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0))
|
||||
.ack_interrupt = qca808x_ack_interrupt,
|
||||
+#else
|
||||
+ .handle_interrupt = qca808x_handle_interrupt,
|
||||
+#endif
|
||||
.read_status = qca808x_read_status,
|
||||
.suspend = qca808x_suspend,
|
||||
.resume = qca808x_resume,
|
|
@ -1,22 +0,0 @@
|
|||
From adc75660a50c5b7a16032921a30a0eaedc8b826f Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Sat, 7 May 2022 19:03:55 +0200
|
||||
Subject: [PATCH 07/14] include: fix compilation error for parse_uci_option
|
||||
|
||||
Fix missing include for parse_uci_option
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
include/ref/ref_uci.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/include/ref/ref_uci.h
|
||||
+++ b/include/ref/ref_uci.h
|
||||
@@ -22,6 +22,7 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
+#include <linux/switch.h>
|
||||
|
||||
#if defined(IN_SWCONFIG)
|
||||
int
|
|
@ -1,30 +0,0 @@
|
|||
From d70d013ac1090565ebb71875f5bdc70840807428 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
||||
Date: Fri, 23 Sep 2022 08:21:13 -0500
|
||||
Subject: [PATCH 08/14] QSDK: config: Avoid -Werror heroics
|
||||
|
||||
Trying to compile the QSDK with warnings as errors is a very brave
|
||||
endeavor. It's also stupid as it doesn't work on ipq60xx:
|
||||
|
||||
isisc_acl_prv.h:99: error: "FIELD_GET" redefined [-Werror]
|
||||
99 | #define FIELD_GET(reg, field, val) \
|
||||
|
|
||||
|
||||
Instead of dealing with the braindead code, just disable Werror.
|
||||
|
||||
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
||||
---
|
||||
config | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/config
|
||||
+++ b/config
|
||||
@@ -133,7 +133,7 @@ endif
|
||||
|
||||
ifeq ($(ARCH), arm64)
|
||||
ifeq ($(KVER),$(filter 4.1% 4.4% 4.9% 5.4%,$(KVER)))
|
||||
- CPU_CFLAG= -DMODULE -Os -pipe -march=armv8-a -mcpu=cortex-a53+crypto -fno-caller-saves -fno-strict-aliasing -Werror -fno-common -Wno-format-security -Wno-pointer-sign -Wno-unused-but-set-variable -Wno-error=unused-result -mcmodel=large
|
||||
+ CPU_CFLAG= -DMODULE -Os -pipe -march=armv8-a -mcpu=cortex-a53+crypto -fno-caller-saves -fno-strict-aliasing -fno-common -Wno-format-security -Wno-pointer-sign -Wno-unused-but-set-variable -Wno-error=unused-result -mcmodel=large
|
||||
endif
|
||||
endif
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
From 0582c76ce9c35ce8d49cba598e0e17073dd875b5 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
||||
Date: Fri, 23 Sep 2022 08:30:03 -0500
|
||||
Subject: [PATCH 09/14] Revert "qca-ssdk: remove bridge fdb entry for the
|
||||
authentication failed mac"
|
||||
|
||||
This change causes an undefined reference to "br_fdb_delete_by_netdev".
|
||||
This reverts commit 144f02b982c8c707aaf84b57d8c277d03d877236.
|
||||
|
||||
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
||||
---
|
||||
src/ref/ref_acl.c | 11 -----------
|
||||
1 file changed, 11 deletions(-)
|
||||
|
||||
--- a/src/ref/ref_acl.c
|
||||
+++ b/src/ref/ref_acl.c
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "ssdk_init.h"
|
||||
#include "ssdk_plat.h"
|
||||
#include <linux/etherdevice.h>
|
||||
-#include <linux/if_bridge.h>
|
||||
|
||||
/* entry 0-1 is for global deny all and accept eapol rule
|
||||
entry 2-9 is for phy port1 specific mac accept rule
|
||||
@@ -128,7 +127,6 @@ _ref_acl_mac_entry_create_rule(a_uint32_
|
||||
{
|
||||
sw_error_t rv = SW_OK;
|
||||
fal_acl_rule_t rule = {0};
|
||||
- struct net_device *eth_dev = NULL;
|
||||
a_uint32_t port_id = ssdk_ifname_to_port(dev_id, entry->ifname);
|
||||
SSDK_DEBUG("port_id %d entry_idx %d\n", port_id, entry_idx);
|
||||
|
||||
@@ -224,15 +222,6 @@ _ref_acl_mac_entry_create_rule(a_uint32_
|
||||
ref_acl_mac_entry[dev_id][entry_idx].port_map = BIT(port_id);
|
||||
ref_acl_mac_entry[dev_id][entry_idx].acl_policy = 1;
|
||||
}
|
||||
- else if (!is_deny_all_mac(entry->src_mac.uc) && !entry->acl_policy)
|
||||
- {
|
||||
- eth_dev = dev_get_by_name(&init_net, entry->ifname);
|
||||
- if (eth_dev)
|
||||
- {
|
||||
- br_fdb_delete_by_netdev(eth_dev, entry->src_mac.uc, 0);
|
||||
- dev_put(eth_dev);
|
||||
- }
|
||||
- }
|
||||
return rv;
|
||||
}
|
||||
|
|
@ -1,281 +0,0 @@
|
|||
From 2276a0b93751f015ef719dedf9a0d4b55ae684d5 Mon Sep 17 00:00:00 2001
|
||||
From: crao <quic_crao@quicinc.com>
|
||||
Date: Tue, 15 Nov 2022 18:50:01 +0800
|
||||
Subject: [PATCH 10/14] Support Linux-Style Makefile for SSDK
|
||||
|
||||
Change-Id: I8c4399433b6422ef6192f70bf08b0d3023cc94b6
|
||||
Signed-off-by: crao <quic_crao@quicinc.com>
|
||||
---
|
||||
Makefile | 15 +++++++++++++
|
||||
Makefile.modules | 16 ++++++++++++++
|
||||
make/defs.mk | 1 +
|
||||
make/linux_opt.mk | 54 ++++++++++++++++++++++++++++-------------------
|
||||
make/target.mk | 12 +++++++++++
|
||||
src/api/Makefile | 2 +-
|
||||
6 files changed, 77 insertions(+), 23 deletions(-)
|
||||
create mode 100644 Makefile.modules
|
||||
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -12,6 +12,9 @@ include ./make/$(OS)_opt.mk
|
||||
SUB_DIR=$(patsubst %/, %, $(dir $(wildcard src/*/Makefile)))
|
||||
SUB_LIB=$(subst src/, , $(SUB_DIR))
|
||||
|
||||
+####################################################################
|
||||
+# SSDK-Style Makefile
|
||||
+####################################################################
|
||||
all: $(BIN_DIR) kslib
|
||||
mkdir -p ./temp/;cd ./temp;cp ../build/bin/ssdk_ks_km.a ./;ar -x ssdk_ks_km.a; cp ../ko_Makefile ./Makefile;
|
||||
make -C $(SYS_PATH) M=$(PRJ_PATH)/temp/ CROSS_COMPILE=$(TOOLPREFIX) modules
|
||||
@@ -20,6 +23,18 @@ all: $(BIN_DIR) kslib
|
||||
rm -Rf ./temp/*.o ./temp/*.ko ./temp/*.a
|
||||
@echo "---Build [SSDK-$(VERSION)] at $(BUILD_DATE) finished."
|
||||
|
||||
+####################################################################
|
||||
+# LNX Modules-Style Makefile
|
||||
+####################################################################
|
||||
+modules: $(BIN_DIR) kslib_c
|
||||
+ cp Makefile.modules ./Makefile;
|
||||
+ make -C $(SYS_PATH) M=$(PRJ_PATH)/ $(LNX_MAKEOPTS) modules
|
||||
+ cp *.ko build/bin;
|
||||
+ @echo "---Build [SSDK-$(VERSION)] at $(BUILD_DATE) finished."
|
||||
+
|
||||
+kslib_c:
|
||||
+ $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=KSLIB -C src/$i src_list_loop || exit 1;)
|
||||
+
|
||||
kslib:kslib_o
|
||||
$(AR) -r $(BIN_DIR)/$(KS_MOD)_$(RUNMODE).a $(wildcard $(BLD_DIR)/KSLIB/*.o)
|
||||
|
||||
--- /dev/null
|
||||
+++ b/Makefile.modules
|
||||
@@ -0,0 +1,16 @@
|
||||
+####################################################################
|
||||
+# Add All Local Flags
|
||||
+####################################################################
|
||||
+ccflags-y += $(LNX_LOCAL_CFLAGS) -Wno-error
|
||||
+
|
||||
+####################################################################
|
||||
+# Build Object List
|
||||
+####################################################################
|
||||
+SRC_LIST := $(shell cat $(PRJ_PATH)/src_list.dep)
|
||||
+OBJ_LIST := $(patsubst %.c,%.o,$(SRC_LIST))
|
||||
+
|
||||
+####################################################################
|
||||
+# Linux Kernel Module
|
||||
+####################################################################
|
||||
+obj-m := qca-ssdk.o
|
||||
+qca-ssdk-objs := $(OBJ_LIST)
|
||||
--- a/make/defs.mk
|
||||
+++ b/make/defs.mk
|
||||
@@ -7,6 +7,7 @@ ifeq (,$(findstring $(LIB), $(COMPONENTS
|
||||
endif
|
||||
|
||||
SRC_FILE=$(addprefix $(PRJ_PATH)/$(LOC_DIR)/, $(SRC_LIST))
|
||||
+LOC_SRC_FILE=$(addprefix $(LOC_DIR)/, $(SRC_LIST))
|
||||
|
||||
OBJ_LIST=$(SRC_LIST:.c=.o)
|
||||
OBJ_FILE=$(addprefix $(DST_DIR)/, $(OBJ_LIST))
|
||||
--- a/make/linux_opt.mk
|
||||
+++ b/make/linux_opt.mk
|
||||
@@ -295,7 +295,7 @@ ifeq (TRUE, $(DEBUG_ON))
|
||||
MODULE_CFLAG += -g
|
||||
endif
|
||||
|
||||
-MODULE_CFLAG += $(OPT_FLAG) -Wall -DVERSION=\"$(VERSION)\" -DBUILD_DATE=\"$(BUILD_DATE)\" -DOS=\"$(OS)\" -D"KBUILD_STR(s)=\#s" -D"KBUILD_MODNAME=KBUILD_STR(qca-ssdk)"
|
||||
+MODULE_CFLAG += $(OPT_FLAG) -Wall -DVERSION=\"$(VERSION)\" -DBUILD_DATE=\"$(BUILD_DATE)\" -DOS=\"$(OS)\" -D"KBUILD_STR(s)=\#s"
|
||||
|
||||
MODULE_INC += -I$(PRJ_PATH)/include \
|
||||
-I$(PRJ_PATH)/include/common \
|
||||
@@ -450,7 +450,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
MODULE_CFLAG += -DKVER34
|
||||
MODULE_CFLAG += -DKVER32
|
||||
MODULE_CFLAG += -DLNX26_22
|
||||
- MODULE_INC += -I$(SYS_PATH) \
|
||||
+ SYS_INC += -I$(SYS_PATH) \
|
||||
-I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/$(GCC_VERSION)/include/ \
|
||||
-I$(SYS_PATH)/include \
|
||||
-I$(SYS_PATH)/source/include \
|
||||
@@ -473,7 +473,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
MODULE_CFLAG += -DKVER32
|
||||
MODULE_CFLAG += -DLNX26_22
|
||||
ifeq ($(ARCH), arm64)
|
||||
- MODULE_INC += -I$(SYS_PATH) \
|
||||
+ SYS_INC += -I$(SYS_PATH) \
|
||||
-I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/$(GCC_VERSION)/include/ \
|
||||
-I$(SYS_PATH)/include \
|
||||
-I$(SYS_PATH)/source \
|
||||
@@ -492,13 +492,13 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
-I$(SYS_PATH)/source/include/uapi
|
||||
|
||||
ifneq ($(wildcard $(SYS_PATH)/include/linux/kconfig.h),)
|
||||
- MODULE_INC += -include $(SYS_PATH)/include/linux/kconfig.h
|
||||
+ SYS_INC += -include $(SYS_PATH)/include/linux/kconfig.h
|
||||
else
|
||||
- MODULE_INC += -include $(KERNEL_SRC)/include/linux/kconfig.h
|
||||
+ SYS_INC += -include $(KERNEL_SRC)/include/linux/kconfig.h
|
||||
endif
|
||||
|
||||
else ifeq ($(ARCH), arm)
|
||||
- MODULE_INC += -I$(SYS_PATH) \
|
||||
+ SYS_INC += -I$(SYS_PATH) \
|
||||
-I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/$(GCC_VERSION)/include/ \
|
||||
-I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/7.5.0/include/ \
|
||||
-I$(TOOL_PATH)/../../lib/armv7a-vfp-neon-rdk-linux-gnueabi/gcc/arm-rdk-linux-gnueabi/4.8.4/include/ \
|
||||
@@ -522,13 +522,13 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
-I$(TOOL_PATH)/../../lib/arm-rdk-linux-gnueabi/gcc/arm-rdk-linux-gnueabi/9.3.0/include/
|
||||
|
||||
ifneq ($(wildcard $(SYS_PATH)/include/linux/kconfig.h),)
|
||||
- MODULE_INC += -include $(SYS_PATH)/include/linux/kconfig.h
|
||||
+ SYS_INC += -include $(SYS_PATH)/include/linux/kconfig.h
|
||||
else
|
||||
- MODULE_INC += -include $(KERNEL_SRC)/include/linux/kconfig.h
|
||||
+ SYS_INC += -include $(KERNEL_SRC)/include/linux/kconfig.h
|
||||
endif
|
||||
|
||||
else
|
||||
- MODULE_INC += -I$(SYS_PATH) \
|
||||
+ SYS_INC += -I$(SYS_PATH) \
|
||||
-I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/$(GCC_VERSION)/include/ \
|
||||
-I$(SYS_PATH)/include \
|
||||
-I$(SYS_PATH)/source \
|
||||
@@ -564,7 +564,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
MODULE_CFLAG += -DLNX26_22
|
||||
ifeq ($(ARCH), arm64)
|
||||
KCONF_FILE = $(SYS_PATH)/source/include/linux/kconfig.h
|
||||
- MODULE_INC += -I$(SYS_PATH) \
|
||||
+ SYS_INC += -I$(SYS_PATH) \
|
||||
-I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/$(GCC_VERSION)/include/ \
|
||||
-I$(SYS_PATH)/include \
|
||||
-I$(SYS_PATH)/source/include \
|
||||
@@ -581,7 +581,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
-I$(SYS_PATH)/source/arch/arm64/include/asm/mach \
|
||||
-include $(KCONF_FILE)
|
||||
else ifeq ($(ARCH), arm)
|
||||
- MODULE_INC += -I$(SYS_PATH) \
|
||||
+ SYS_INC += -I$(SYS_PATH) \
|
||||
-I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/$(GCC_VERSION)/include/ \
|
||||
-I$(TOOL_PATH)/../../lib/armv7a-vfp-neon-rdk-linux-gnueabi/gcc/arm-rdk-linux-gnueabi/4.8.4/include/ \
|
||||
-I$(SYS_PATH)/include \
|
||||
@@ -604,7 +604,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
MODULE_CFLAG += -DKVER34
|
||||
MODULE_CFLAG += -DKVER32
|
||||
MODULE_CFLAG += -DLNX26_22
|
||||
- MODULE_INC += -I$(SYS_PATH) \
|
||||
+ SYS_INC += -I$(SYS_PATH) \
|
||||
-I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/$(GCC_VERSION)/include/ \
|
||||
-I$(TOOL_PATH)/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.3.0/include/ \
|
||||
-I$(TOOL_PATH)/../../lib/armv7a-vfp-neon-rdk-linux-gnueabi/gcc/arm-rdk-linux-gnueabi/4.8.4/include/ \
|
||||
@@ -627,10 +627,10 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
-I$(EXT_PATH) \
|
||||
-I$(SYS_PATH)/source/arch/arm/include/asm/mach
|
||||
ifneq ($(wildcard $(SYS_PATH)/include/linux/kconfig.h),)
|
||||
- MODULE_INC += \
|
||||
+ SYS_INC += \
|
||||
-include $(SYS_PATH)/include/linux/kconfig.h
|
||||
else
|
||||
- MODULE_INC += \
|
||||
+ SYS_INC += \
|
||||
-include $(SYS_PATH)/source/include/linux/kconfig.h
|
||||
endif
|
||||
|
||||
@@ -641,7 +641,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
MODULE_CFLAG += -DKVER32
|
||||
MODULE_CFLAG += -DLNX26_22
|
||||
MODULE_CFLAG += -Werror
|
||||
- MODULE_INC += -I$(SYS_PATH) \
|
||||
+ SYS_INC += -I$(SYS_PATH) \
|
||||
-I$(SYS_PATH)/include \
|
||||
-I$(SYS_PATH)/source/include \
|
||||
-I$(SYS_PATH)/source/arch/arm/mach-msm/include \
|
||||
@@ -657,7 +657,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
MODULE_CFLAG += -DKVER32
|
||||
MODULE_CFLAG += -DLNX26_22
|
||||
ifeq (mips, $(CPU))
|
||||
- MODULE_INC += -I$(SYS_PATH) \
|
||||
+ SYS_INC += -I$(SYS_PATH) \
|
||||
-I$(SYS_PATH)/include \
|
||||
-I$(SYS_PATH)/arch/mips/include \
|
||||
-I$(SYS_PATH)/arch/mips/include/asm/mach-ar7240 \
|
||||
@@ -678,7 +678,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
-O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB
|
||||
endif
|
||||
else
|
||||
- MODULE_INC += -I$(SYS_PATH) \
|
||||
+ SYS_INC += -I$(SYS_PATH) \
|
||||
-I$(SYS_PATH)/include \
|
||||
-I$(SYS_PATH)/arch/arm/include \
|
||||
-I$(SYS_PATH)/arch/arm/include/asm \
|
||||
@@ -695,7 +695,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
MODULE_CFLAG += -DKVER26
|
||||
MODULE_CFLAG += -DLNX26_22
|
||||
ifeq (mips, $(CPU))
|
||||
- MODULE_INC += -I$(SYS_PATH) \
|
||||
+ SYS_INC += -I$(SYS_PATH) \
|
||||
-I$(SYS_PATH)/include \
|
||||
-I$(SYS_PATH)/arch/mips/include \
|
||||
-I$(SYS_PATH)/arch/mips/include/asm/mach-ar7240 \
|
||||
@@ -708,7 +708,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
-O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB
|
||||
endif
|
||||
else
|
||||
- MODULE_INC += -I$(SYS_PATH) \
|
||||
+ SYS_INC += -I$(SYS_PATH) \
|
||||
-I$(SYS_PATH)/include \
|
||||
-I$(SYS_PATH)/arch/arm/include \
|
||||
-I$(SYS_PATH)/arch/arm/include/asm \
|
||||
@@ -721,8 +721,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
|
||||
endif
|
||||
|
||||
- MODULE_CFLAG += -D__KERNEL__ -DKERNEL_MODULE $(CPU_CFLAG)
|
||||
-
|
||||
+ MODULE_CFLAG += -D__KERNEL__ -DKERNEL_MODULE
|
||||
|
||||
endif
|
||||
|
||||
@@ -748,4 +747,15 @@ ifneq (TRUE, $(KERNEL_MODE))
|
||||
endif
|
||||
endif
|
||||
|
||||
-LOCAL_CFLAGS += $(MODULE_INC) $(MODULE_CFLAG) $(EXTRA_CFLAGS)
|
||||
+LOCAL_CFLAGS += $(MODULE_INC) $(SYS_INC) $(MODULE_CFLAG) $(EXTRA_CFLAGS)
|
||||
+
|
||||
+####################################################################
|
||||
+# cflags for SSDK-Style Makefile
|
||||
+####################################################################
|
||||
+LOCAL_CFLAGS += $(CPU_CFLAG) -D"KBUILD_MODNAME=KBUILD_STR(qca-ssdk)"
|
||||
+
|
||||
+####################################################################
|
||||
+# cflags for LNX Modules-Style Makefile
|
||||
+####################################################################
|
||||
+LNX_LOCAL_CFLAGS += $(MODULE_INC) $(MODULE_CFLAG) ${EXTRA_INC}
|
||||
+export LNX_LOCAL_CFLAGS
|
||||
--- a/make/target.mk
|
||||
+++ b/make/target.mk
|
||||
@@ -3,6 +3,18 @@ include $(PRJ_PATH)/make/$(OS)_opt.mk
|
||||
|
||||
include $(PRJ_PATH)/make/tools.mk
|
||||
|
||||
+####################################################################
|
||||
+# LNX Modules-Style Makefile
|
||||
+####################################################################
|
||||
+src_list_loop: src_list
|
||||
+ $(foreach i, $(SUB_DIR), $(MAKE) -C $(i) src_list_loop || exit 1;)
|
||||
+
|
||||
+src_list:
|
||||
+ echo -n "$(LOC_SRC_FILE) " >> $(PRJ_PATH)/src_list.dep
|
||||
+
|
||||
+####################################################################
|
||||
+# SSDK-Style Makefile
|
||||
+####################################################################
|
||||
obj: $(OBJ_LIST)
|
||||
$(OBJ_LOOP)
|
||||
|
||||
--- a/src/api/Makefile
|
||||
+++ b/src/api/Makefile
|
||||
@@ -1,4 +1,4 @@
|
||||
-LOC_DIR=src/sal
|
||||
+LOC_DIR=src/api
|
||||
LIB=API
|
||||
|
||||
include $(PRJ_PATH)/make/config.mk
|
|
@ -1,26 +0,0 @@
|
|||
From 46a5dd73195081b5d78582f2a13f83e49f36e917 Mon Sep 17 00:00:00 2001
|
||||
From: crao <quic_crao@quicinc.com>
|
||||
Date: Tue, 7 Mar 2023 17:15:07 +0800
|
||||
Subject: [PATCH 11/14] fix compilation issue in Linux-Style Makefile
|
||||
|
||||
Change-Id: If38251fc0a2bf4abc666d30f4812c0d9507310dc
|
||||
Signed-off-by: crao <quic_crao@quicinc.com>
|
||||
---
|
||||
Makefile | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -27,9 +27,9 @@ all: $(BIN_DIR) kslib
|
||||
# LNX Modules-Style Makefile
|
||||
####################################################################
|
||||
modules: $(BIN_DIR) kslib_c
|
||||
- cp Makefile.modules ./Makefile;
|
||||
- make -C $(SYS_PATH) M=$(PRJ_PATH)/ $(LNX_MAKEOPTS) modules
|
||||
- cp *.ko build/bin;
|
||||
+ mkdir -p ./temp/;cp * ./temp -a;cd ./temp;cp ../Makefile.modules ./Makefile;
|
||||
+ make -C $(SYS_PATH) M=$(PRJ_PATH)/temp $(LNX_MAKEOPTS) modules
|
||||
+ cp temp/*.ko build/bin;
|
||||
@echo "---Build [SSDK-$(VERSION)] at $(BUILD_DATE) finished."
|
||||
|
||||
kslib_c:
|
|
@ -1,23 +0,0 @@
|
|||
From 0060aa1b0d2530672e64708d8062b3f33d007ed3 Mon Sep 17 00:00:00 2001
|
||||
From: crao <quic_crao@quicinc.com>
|
||||
Date: Wed, 15 Mar 2023 11:19:39 +0800
|
||||
Subject: [PATCH 12/14] fix compilation issue in Miami yocto
|
||||
|
||||
Change-Id: I8526b9e43667d72ae9afa4ef8a13167088d194ba
|
||||
Signed-off-by: crao <quic_crao@quicinc.com>
|
||||
---
|
||||
Makefile | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -29,7 +29,9 @@ all: $(BIN_DIR) kslib
|
||||
modules: $(BIN_DIR) kslib_c
|
||||
mkdir -p ./temp/;cp * ./temp -a;cd ./temp;cp ../Makefile.modules ./Makefile;
|
||||
make -C $(SYS_PATH) M=$(PRJ_PATH)/temp $(LNX_MAKEOPTS) modules
|
||||
+ cp $(PRJ_PATH)/temp/Module.symvers $(PRJ_PATH)/Module.symvers;
|
||||
cp temp/*.ko build/bin;
|
||||
+ rm -Rf ./temp/*.o ./temp/*.ko ./temp/*.a
|
||||
@echo "---Build [SSDK-$(VERSION)] at $(BUILD_DATE) finished."
|
||||
|
||||
kslib_c:
|
|
@ -1,55 +0,0 @@
|
|||
From 05aba6d6dfd49fe10b33cf221b7e81250a67033c Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Thu, 29 Sep 2022 09:59:20 +0200
|
||||
Subject: [PATCH 13/14] SSDK: config: add kernel 6.1
|
||||
|
||||
Allow kernel 6.1 to be recognized and compiled under it.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
config | 6 +++++-
|
||||
make/linux_opt.mk | 4 ++--
|
||||
2 files changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/config
|
||||
+++ b/config
|
||||
@@ -24,6 +24,10 @@ ifeq ($(KVER),$(filter 5.4%,$(KVER)))
|
||||
OS_VER=5_4
|
||||
endif
|
||||
|
||||
+ifeq ($(KVER),$(filter 6.1%,$(KVER)))
|
||||
+ OS_VER=6_1
|
||||
+endif
|
||||
+
|
||||
ifeq ($(KVER), 3.4.0)
|
||||
OS_VER=3_4
|
||||
endif
|
||||
@@ -132,7 +136,7 @@ ifeq ($(ARCH), arm)
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH), arm64)
|
||||
- ifeq ($(KVER),$(filter 4.1% 4.4% 4.9% 5.4%,$(KVER)))
|
||||
+ ifeq ($(KVER),$(filter 4.1% 4.4% 4.9% 5.4% 6.1%,$(KVER)))
|
||||
CPU_CFLAG= -DMODULE -Os -pipe -march=armv8-a -mcpu=cortex-a53+crypto -fno-caller-saves -fno-strict-aliasing -fno-common -Wno-format-security -Wno-pointer-sign -Wno-unused-but-set-variable -Wno-error=unused-result -mcmodel=large
|
||||
endif
|
||||
endif
|
||||
--- a/make/linux_opt.mk
|
||||
+++ b/make/linux_opt.mk
|
||||
@@ -437,7 +437,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
KASAN_SHADOW_SCALE_SHIFT := 3
|
||||
endif
|
||||
|
||||
- ifeq (5_4, $(OS_VER))
|
||||
+ ifeq (5_4 6_1, $(OS_VER))
|
||||
ifeq ($(ARCH), arm64)
|
||||
KASAN_OPTION += -DKASAN_SHADOW_SCALE_SHIFT=$(KASAN_SHADOW_SCALE_SHIFT)
|
||||
endif
|
||||
@@ -468,7 +468,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
|
||||
endif
|
||||
|
||||
- ifeq ($(OS_VER),$(filter 4_4 5_4, $(OS_VER)))
|
||||
+ ifeq ($(OS_VER),$(filter 4_4 5_4 6_1, $(OS_VER)))
|
||||
MODULE_CFLAG += -DKVER34
|
||||
MODULE_CFLAG += -DKVER32
|
||||
MODULE_CFLAG += -DLNX26_22
|
|
@ -1,27 +0,0 @@
|
|||
From 6a49dd6bb2e40ce49351adb6100599f176d80494 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Fri, 21 Oct 2022 13:40:15 +0200
|
||||
Subject: [PATCH 14/14] SSDK: qca808x: use get_random_u32
|
||||
|
||||
prandom has been removed from the kernel in 6.1-rc1, so use get_random_u32
|
||||
instead as its the drop-in replacement.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
src/hsl/phy/qca808x_phy.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
--- a/src/hsl/phy/qca808x_phy.c
|
||||
+++ b/src/hsl/phy/qca808x_phy.c
|
||||
@@ -299,7 +299,11 @@ qca808x_phy_ms_random_seed_set(a_uint32_
|
||||
phy_data = qca808x_phy_debug_read(dev_id, phy_id,
|
||||
QCA808X_DEBUG_LOCAL_SEED);
|
||||
phy_data &= ~(QCA808X_MASTER_SLAVE_SEED_CFG);
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
|
||||
phy_data |= (prandom_u32()%QCA808X_MASTER_SLAVE_SEED_RANGE) << 2;
|
||||
+#else
|
||||
+ phy_data |= (get_random_u32()%QCA808X_MASTER_SLAVE_SEED_RANGE) << 2;
|
||||
+#endif
|
||||
SSDK_DEBUG("QCA808X_DEBUG_LOCAL_SEED:%x\n", phy_data);
|
||||
rv = qca808x_phy_debug_write(dev_id, phy_id,
|
||||
QCA808X_DEBUG_LOCAL_SEED, phy_data);
|
|
@ -12,9 +12,9 @@ PKG_RELEASE:=1
|
|||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/libnl-tiny.git
|
||||
PKG_SOURCE_DATE:=2023-04-02
|
||||
PKG_SOURCE_VERSION:=11b7c5f0745af2637b48131287f28689bb80ed3e
|
||||
PKG_MIRROR_HASH:=9bcae026ad1fde81865ea113d24bbc70c2bd1945655d51cd00181c41b70570d2
|
||||
PKG_SOURCE_DATE:=2023-07-01
|
||||
PKG_SOURCE_VERSION:=d433990c00e804593f253cc709b8fe901492b530
|
||||
PKG_MIRROR_HASH:=fffb2782c7ed2ebabc7d57e5513f52ac53d1828014bc9a8ea131f50eab093086
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
PKG_LICENSE:=LGPL-2.1
|
||||
|
|
|
@ -5,9 +5,9 @@ PKG_RELEASE:=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-07-03
|
||||
PKG_SOURCE_VERSION:=e94f7a81a03992805aa443156b73721228e6e2d1
|
||||
PKG_MIRROR_HASH:=4cf3199c2ebb96bcee183a2c9a750541afca16a16942008e865b4313c14a01bd
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
|
|
@ -121,6 +121,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 +134,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 +236,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
|
||||
|
|
|
@ -12,9 +12,9 @@ PKG_RELEASE:=1
|
|||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
|
||||
PKG_MIRROR_HASH:=c2851b577d1ee632c902eca1864444fa22cad98956bfa852019e6d621c0f8d2a
|
||||
PKG_SOURCE_DATE:=2023-04-05
|
||||
PKG_SOURCE_VERSION:=40ab806bf4c8698ac925d094ce11ce1d57ae2e46
|
||||
PKG_MIRROR_HASH:=e2e00e2bb6b7bacda5dcb713e4f9a4b1e316d75b140a4aa77145471bf6fe5c17
|
||||
PKG_SOURCE_DATE:=2023-06-24
|
||||
PKG_SOURCE_VERSION:=52112643308bb02a3b4fa2894dd7d4340ba4a237
|
||||
|
||||
PKG_MAINTAINER:=Hans Dedecker <dedeckeh@gmail.com>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
|
|
@ -12,9 +12,9 @@ PKG_RELEASE:=1
|
|||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git
|
||||
PKG_SOURCE_DATE:=2023-01-28
|
||||
PKG_SOURCE_VERSION:=47561aa13574068403d48f13ea310f8511057b2b
|
||||
PKG_MIRROR_HASH:=84500cf0c8224fe80b5717c9b6bad8ac13f44f286e3a88e8b12adfcf02e22c7c
|
||||
PKG_SOURCE_DATE:=2023-06-25
|
||||
PKG_SOURCE_VERSION:=34a8a74dbdec3c0de38abc1b08f6a73c51263792
|
||||
PKG_MIRROR_HASH:=8206885eebed5d1827763bcc5bcf9ca3510ae22b0ad1f6432114f1136c32dde2
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=ISC
|
||||
|
||||
|
|
|
@ -11,13 +11,13 @@ PKG_RELEASE:=1
|
|||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git
|
||||
PKG_SOURCE_DATE:=2023-05-17
|
||||
PKG_SOURCE_VERSION:=c9f5c3f7b50d146f18be1458ab5591defc0af6da
|
||||
PKG_MIRROR_HASH:=0d9263cbbe79d62966398af66b3b3ce7b58991da6b266f8f4ec2ec4be3d4ad97
|
||||
PKG_SOURCE_DATE:=2023-07-01
|
||||
PKG_SOURCE_VERSION:=ca79f64154b107f192ec3c1ba631816cb8b07922
|
||||
PKG_MIRROR_HASH:=5eddf584a1c3ed5637162d6bfc573ed1ce3691fcb38bdd55bf9f1e11e82ccc46
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
IWINFO_ABI_VERSION:=20230121
|
||||
IWINFO_ABI_VERSION:=20230701
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@ PKG_RELEASE:=1
|
|||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
|
||||
PKG_MIRROR_HASH:=75a92c01ef85f41dc7e0b77ac35f464fbe45942af02ca6847516c4ebf574c4a4
|
||||
PKG_SOURCE_DATE:=2023-01-16
|
||||
PKG_SOURCE_VERSION:=190f13a75e67e0bdb662188da79b8be31e0aae01
|
||||
PKG_MIRROR_HASH:=a7e42525ae65eb1342e593a714e88bc59e46467cbb5a7fd7d7aca4a9815b7c0d
|
||||
PKG_SOURCE_DATE:=2023-06-25
|
||||
PKG_SOURCE_VERSION:=2db836553e8fc318143b38dbc6e12b8625cf5c33
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
|
|
@ -12,9 +12,9 @@ PKG_RELEASE:=1
|
|||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git
|
||||
PKG_MIRROR_HASH:=d636b6e08a69578d615b2a294d6ca2c7ef73791de2a8314f1afb741655d8a143
|
||||
PKG_SOURCE_DATE:=2023-03-14
|
||||
PKG_SOURCE_VERSION:=d97883005ffb5be251872c3e4abe04f71732f9bd
|
||||
PKG_MIRROR_HASH:=76467ff072b50190f93d071b7792ade7c717674397a2547e995a8f819a48954e
|
||||
PKG_SOURCE_DATE:=2023-07-01
|
||||
PKG_SOURCE_VERSION:=c07ab2f91061ad64209e9aaa1fb1b77061a1af25
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
PKG_LICENSE:=ISC
|
||||
|
|
|
@ -12,9 +12,9 @@ PKG_RELEASE:=1
|
|||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=https://github.com/jow-/ucode.git
|
||||
PKG_SOURCE_DATE:=2023-04-03
|
||||
PKG_SOURCE_VERSION:=5163867269fc04fa01ec5e9f8df3384c933339f2
|
||||
PKG_MIRROR_HASH:=e82922ff59d6f899d9434bf79f2e6e4add0b7b0466355755fc83d4b5a0aeebfb
|
||||
PKG_SOURCE_DATE:=2023-06-06
|
||||
PKG_SOURCE_VERSION:=c7d84aae09691a99ae3db427c0b2463732ef84f4
|
||||
PKG_MIRROR_HASH:=38826ae70d886d1d7ada3fc6591ac807169aa28107f60f7f2e617520083525fb
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
PKG_LICENSE:=ISC
|
||||
|
||||
|
|
109
scripts/moxa-encode-fw.py
Executable file
109
scripts/moxa-encode-fw.py
Executable file
|
@ -0,0 +1,109 @@
|
|||
#! /usr/bin/env python3
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
import argparse
|
||||
import struct
|
||||
|
||||
from binascii import crc32
|
||||
from dataclasses import dataclass
|
||||
from itertools import cycle
|
||||
from typing import List
|
||||
|
||||
|
||||
def xor(data: bytes) -> bytes:
|
||||
passphrase = "Seek AGREEMENT for the date of completion.\0"
|
||||
pw = cycle(bytearray(passphrase.encode('ascii')))
|
||||
return bytearray(b ^ next(pw) for b in data)
|
||||
|
||||
|
||||
def add_fw_header(data: bytes, magic: int, hwid: int, build_id: int,
|
||||
offsets: List[int]) -> bytes:
|
||||
unknown_1 = 0x01
|
||||
unknown_2 = 0x0000
|
||||
unknown_3 = 0x00000000
|
||||
unknown_4 = 0x01000000
|
||||
file_crc = crc(data, 0)
|
||||
|
||||
header_struct = struct.Struct('>QIBBHIIIIII' + 'I' * len(offsets))
|
||||
header_size = header_struct.size
|
||||
file_size = header_size + len(data)
|
||||
|
||||
header_offsets = map(lambda x: x + header_size, offsets)
|
||||
|
||||
header_data = header_struct.pack(magic, file_size, unknown_1, len(offsets),
|
||||
unknown_2, hwid, build_id, unknown_3,
|
||||
build_id, unknown_4, *header_offsets,
|
||||
file_crc)
|
||||
return header_data + data
|
||||
|
||||
|
||||
def add_file_header(data: bytes, filename: str, build_id: int) -> bytes:
|
||||
unknown1 = 0x01000000
|
||||
unknown2 = 0x00000000
|
||||
file_crc = crc(data, 0)
|
||||
|
||||
header_struct = struct.Struct(">16sIIIII")
|
||||
file_size = header_struct.size + len(data)
|
||||
|
||||
header_data = header_struct.pack(filename.encode('ascii'), file_size,
|
||||
unknown1, build_id, unknown2, file_crc)
|
||||
return header_data + data
|
||||
|
||||
|
||||
def crc(data: bytes, init_val: int) -> int:
|
||||
return 0xffffffff ^ (crc32(data, 0xffffffff ^ init_val))
|
||||
|
||||
|
||||
@dataclass
|
||||
class Partition:
|
||||
name: str
|
||||
size: int
|
||||
|
||||
|
||||
def main():
|
||||
partitions = [
|
||||
Partition(name='kernel', size=2048 * 1024),
|
||||
Partition(name='root', size=9216 * 1024),
|
||||
Partition(name='userdisk', size=3076 * 1024),
|
||||
]
|
||||
|
||||
parser = argparse.ArgumentParser(prog='moxa-encode-fw',
|
||||
description='MOXA IW firmware encoder')
|
||||
parser.add_argument('-i', '--input', required=True, type=str, help='Firmware file')
|
||||
parser.add_argument('-o', '--output', required=True, type=str, help="Output path for encoded firmware file")
|
||||
parser.add_argument('-m', '--magic', required=True, type=lambda x: int(x,0), help="Magic for firmware header")
|
||||
parser.add_argument('-d', '--hwid', required=True, type=lambda x: int(x,0), help="Hardware id of device")
|
||||
parser.add_argument('-b', '--buildid', required=True, type=lambda x: int(x,0), help="Build id of firmware")
|
||||
args = parser.parse_args()
|
||||
|
||||
with open(args.input, 'rb') as input_file:
|
||||
firmware = bytearray(input_file.read())
|
||||
|
||||
offsets = []
|
||||
pos_input = 0
|
||||
pos_output = 0
|
||||
firmware_seg = bytearray()
|
||||
|
||||
for partition in partitions:
|
||||
part_data = firmware[pos_input:pos_input + partition.size]
|
||||
|
||||
# just to make sure that no partition is empty
|
||||
if len(part_data) == 0:
|
||||
part_data = bytearray([0x00])
|
||||
|
||||
header = add_file_header(part_data, partition.name, args.buildid)
|
||||
firmware_seg += header
|
||||
|
||||
offsets.append(pos_output)
|
||||
pos_input += partition.size
|
||||
pos_output += len(header)
|
||||
|
||||
moxa_firmware = add_fw_header(firmware_seg, args.magic, args.hwid, args.buildid, offsets)
|
||||
|
||||
encrypted = xor(moxa_firmware)
|
||||
with open(args.output, 'wb') as output_file:
|
||||
output_file.write(encrypted)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
|
@ -14,6 +14,8 @@ def main():
|
|||
parser.add_argument('--model', type=str, required=True)
|
||||
parser.add_argument('--region', type=str, required=True)
|
||||
parser.add_argument('--version', type=str, required=True)
|
||||
parser.add_argument('--hw-id-list', type=str)
|
||||
parser.add_argument('--model-list', type=str)
|
||||
parser.add_argument('--encryption-block-size', type=str, required=True)
|
||||
parser.add_argument('--openssl-bin', type=str, required=True)
|
||||
parser.add_argument('--key', type=str, required=True)
|
||||
|
@ -26,6 +28,10 @@ def main():
|
|||
assert (encryption_block_size > 0 and encryption_block_size % 16 ==
|
||||
0), 'Encryption block size must be a multiple of the AES block size (16)'
|
||||
|
||||
hw_id_list = args.hw_id_list.split(';') if args.hw_id_list else []
|
||||
model_list = args.model_list.split(';') if args.model_list else []
|
||||
hw_info = ';'.join(hw_id_list + model_list)
|
||||
|
||||
image = open(args.input_file, 'rb').read()
|
||||
image_enc = []
|
||||
for i in range(0, len(image), encryption_block_size):
|
||||
|
@ -45,13 +51,18 @@ def main():
|
|||
image_enc = b''.join(image_enc)
|
||||
|
||||
image_with_header = struct.pack(
|
||||
'>32s32s64s64s64s256s12sII',
|
||||
'>32s32s64s64sIBBB13s200s100s12sII',
|
||||
args.model.encode('ascii'),
|
||||
args.region.encode('ascii'),
|
||||
args.version.encode('ascii'),
|
||||
b'Thu Jan 1 00:00:00 1970', # static date for reproducibility
|
||||
0, # product hw model
|
||||
0, # model index
|
||||
len(hw_id_list),
|
||||
len(model_list),
|
||||
b'', # reserved
|
||||
hw_info.encode('ascii'),
|
||||
b'', # reserved
|
||||
b'', # RSA signature - omitted for now
|
||||
b'encrpted_img',
|
||||
len(image_enc),
|
||||
encryption_block_size,
|
||||
|
|
|
@ -10,7 +10,6 @@ CONFIG_APM821xx=y
|
|||
# CONFIG_ARCHES is not set
|
||||
CONFIG_ARCH_32BIT_OFF_T=y
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_FORCE_MAX_ORDER=11
|
||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
|
||||
|
|
|
@ -168,7 +168,6 @@ CONFIG_FB_CMDLINE=y
|
|||
CONFIG_FB_MODE_HELPERS=y
|
||||
# CONFIG_FB_XILINX is not set
|
||||
CONFIG_FRAME_POINTER=y
|
||||
CONFIG_FRAME_WARN=2048
|
||||
# CONFIG_FSL_DPAA is not set
|
||||
# CONFIG_FSL_DPAA2_QDMA is not set
|
||||
CONFIG_FSL_ERRATUM_A008585=y
|
||||
|
|
|
@ -39,7 +39,6 @@ CONFIG_ACPI_THERMAL=y
|
|||
# CONFIG_ACPI_TINY_POWER_BUTTON is not set
|
||||
# CONFIG_ALIBABA_UNCORE_DRW_PMU is not set
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_FORCE_MAX_ORDER=11
|
||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
|
||||
|
|
|
@ -202,7 +202,7 @@
|
|||
+subsys_initcall(ar5312_gpio_init);
|
||||
--- a/arch/mips/Kconfig
|
||||
+++ b/arch/mips/Kconfig
|
||||
@@ -230,6 +230,7 @@ config ATH25
|
||||
@@ -231,6 +231,7 @@ config ATH25
|
||||
select CEVT_R4K
|
||||
select CSRC_R4K
|
||||
select DMA_NONCOHERENT
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "ar9344_mikrotik_routerboard-951x-2hnd.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "mikrotik,routerboard-951g-2hnd", "qca,ar9344";
|
||||
model = "Mikrotik RouterBOARD 951G-2HnD";
|
||||
|
||||
/delete-node/ aliases;
|
||||
/delete-node/ leds;
|
||||
|
||||
gpio-export {
|
||||
compatible = "gpio-export";
|
||||
|
||||
gpio_usb_power {
|
||||
gpio-export,name = "rb951g-2hnd:power:usb";
|
||||
gpio-export,output = <1>;
|
||||
gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
buzzer {
|
||||
gpio-export,name = "buzzer";
|
||||
gpio-export,output = <1>;
|
||||
gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&ref {
|
||||
clock-frequency = <25000000>;
|
||||
};
|
||||
|
||||
&mdio0 {
|
||||
status = "okay";
|
||||
|
||||
phy0: ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
|
||||
qca,ar8327-initvals = <
|
||||
0x04 0x07600000 /* PAD0_MODE */
|
||||
0x7c 0x0000007e /* PORT0_STATUS */
|
||||
>;
|
||||
};
|
||||
};
|
||||
|
||||
ð0 {
|
||||
status = "okay";
|
||||
|
||||
pll-data = <0x6f000000 0x00000101 0x00001616>;
|
||||
|
||||
phy-mode = "rgmii";
|
||||
phy-handle = <&phy0>;
|
||||
|
||||
gmac-config {
|
||||
device = <&gmac>;
|
||||
rgmii-gmac0 = <1>;
|
||||
rxd-delay = <1>;
|
||||
switch-only-mode = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
ð1 {
|
||||
status = "disabled";
|
||||
};
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "ar9344_mikrotik_routerboard.dtsi"
|
||||
#include "ar9344_mikrotik_routerboard-951x-2hnd.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "mikrotik,routerboard-951ui-2hnd", "qca,ar9344";
|
||||
|
@ -59,77 +59,6 @@
|
|||
};
|
||||
};
|
||||
|
||||
&gpio {
|
||||
nand_power {
|
||||
gpio-hog;
|
||||
gpios = <14 GPIO_ACTIVE_LOW>;
|
||||
output-high;
|
||||
};
|
||||
};
|
||||
|
||||
&nand {
|
||||
status = "okay";
|
||||
|
||||
nand-ecc-mode = "soft";
|
||||
qca,nand-swap-dma;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "booter";
|
||||
reg = <0x0000000 0x0040000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@40000 {
|
||||
label = "kernel";
|
||||
reg = <0x0040000 0x03c0000>;
|
||||
};
|
||||
|
||||
partition@400000 {
|
||||
label = "ubi";
|
||||
reg = <0x0400000 0x7c00000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <25000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "mikrotik,routerboot-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "routerboot";
|
||||
reg = <0x0 0x0>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
hard_config: hard_config {
|
||||
read-only;
|
||||
};
|
||||
|
||||
bios {
|
||||
size = <0x1000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
soft_config {
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ð0 {
|
||||
phy-handle = <&swphy4>;
|
||||
|
||||
|
@ -143,11 +72,3 @@
|
|||
&wmac {
|
||||
qca,led-pin = /bits/ 8 <11>;
|
||||
};
|
||||
|
||||
&usb {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_phy {
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -0,0 +1,82 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "ar9344_mikrotik_routerboard.dtsi"
|
||||
|
||||
&gpio {
|
||||
nand_power {
|
||||
gpio-hog;
|
||||
gpios = <14 GPIO_ACTIVE_LOW>;
|
||||
output-high;
|
||||
};
|
||||
};
|
||||
|
||||
&nand {
|
||||
status = "okay";
|
||||
|
||||
nand-ecc-mode = "soft";
|
||||
qca,nand-swap-dma;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "booter";
|
||||
reg = <0x0000000 0x0040000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@40000 {
|
||||
label = "kernel";
|
||||
reg = <0x0040000 0x03c0000>;
|
||||
};
|
||||
|
||||
partition@400000 {
|
||||
label = "ubi";
|
||||
reg = <0x0400000 0x7c00000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <25000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "mikrotik,routerboot-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "routerboot";
|
||||
reg = <0x0 0x0>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
hard_config: hard_config {
|
||||
read-only;
|
||||
};
|
||||
|
||||
bios {
|
||||
size = <0x1000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
soft_config {
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&usb {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_phy {
|
||||
status = "okay";
|
||||
};
|
184
target/linux/ath79/dts/ar9344_moxa_awk-1137c.dts
Normal file
184
target/linux/ath79/dts/ar9344_moxa_awk-1137c.dts
Normal file
|
@ -0,0 +1,184 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
|
||||
#include "ar9344.dtsi"
|
||||
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/leds/common.h>
|
||||
|
||||
/ {
|
||||
compatible = "moxa,awk-1137c", "qca,ar9344";
|
||||
model = "MOXA AWK-1137C";
|
||||
|
||||
aliases {
|
||||
led-boot = &led_status_red;
|
||||
led-failsafe = &led_status_red;
|
||||
led-running = &led_status_green;
|
||||
led-upgrade = &led_status_red;
|
||||
label-mac-device = ð1;
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
pinctrl-names = "default";
|
||||
|
||||
led_status_green: led-0 {
|
||||
label = "green:status";
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
function-enumerator = <0>;
|
||||
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_status_red: led-1 {
|
||||
label = "red:status";
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
function = LED_FUNCTION_STATUS;
|
||||
function-enumerator = <1>;
|
||||
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led-2 {
|
||||
label = "green:wifi";
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WLAN;
|
||||
function-enumerator = <0>;
|
||||
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
|
||||
led-3 {
|
||||
label = "green:lan1";
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WAN;
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led-4 {
|
||||
label = "green:lan2";
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led-5 {
|
||||
label = "yellow:wifi";
|
||||
color = <LED_COLOR_ID_YELLOW>;
|
||||
function = LED_FUNCTION_WLAN;
|
||||
function-enumerator = <1>;
|
||||
gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "phy0assoc";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&ref {
|
||||
clock-frequency = <40000000>;
|
||||
};
|
||||
|
||||
&spi {
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <40000000>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "u-boot";
|
||||
reg = <0x000000 0x040000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@40000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x040000 0x010000>;
|
||||
};
|
||||
|
||||
partition@50000 {
|
||||
label = "firmware";
|
||||
reg = <0x050000 0xe00000>;
|
||||
compatible = "denx,uimage";
|
||||
};
|
||||
|
||||
partition@e50000 {
|
||||
label = "log1";
|
||||
reg = <0xe50000 0x020000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@e70000 {
|
||||
label = "log2";
|
||||
reg = <0xe70000 0x020000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@e90000 {
|
||||
label = "version";
|
||||
reg = <0xe90000 0x020000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@eb0000 {
|
||||
label = "config1";
|
||||
reg = <0xeb0000 0x020000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@ed0000 {
|
||||
label = "config2";
|
||||
reg = <0xed0000 0x020000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@ef0000 {
|
||||
label = "config-data";
|
||||
reg = <0xef0000 0x0c0000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@fb0000 {
|
||||
label = "mib0";
|
||||
reg = <0xfb0000 0x030000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
art: partition@fe0000 {
|
||||
label = "art";
|
||||
reg = <0xfe0000 0x010000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@ff0000 {
|
||||
label = "fis";
|
||||
reg = <0xff0000 0x010000>;
|
||||
read-only;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ð1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&wmac {
|
||||
status = "okay";
|
||||
qca,no-eeprom;
|
||||
};
|
|
@ -59,6 +59,14 @@
|
|||
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
watchdog {
|
||||
compatible = "linux,wdt-gpio";
|
||||
gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
|
||||
hw_algo = "toggle";
|
||||
hw_margin_ms = <30000>;
|
||||
always-running;
|
||||
};
|
||||
};
|
||||
|
||||
&wdt {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue